proposit-core
    Preparing search index...

    Interface TArgumentExpressionQueries<TExpr>

    Cross-premise expression lookups and analysis.

    interface TArgumentExpressionQueries<
        TExpr extends
            TCorePropositionalExpression = TCorePropositionalExpression,
    > {
        collectReferencedVariables(): {
            byId: Record<string, { premiseIds: string[]; symbol: string }>;
            bySymbol: Record<string, { premiseIds: string[]; variableIds: string[] }>;
            variableIds: string[];
        };
        getAllExpressions(): TExpr[];
        getExpression(expressionId: string): TExpr | undefined;
        getExpressionPremiseId(expressionId: string): string | undefined;
        getExpressionsByVariableId(variableId: string): TExpr[];
        hasExpression(expressionId: string): boolean;
        listRootExpressions(): TExpr[];
    }

    Type Parameters

    Implemented by

    Index

    Methods

    • Collects all variables referenced by expressions across all premises, indexed both by variable ID and by symbol.

      Returns {
          byId: Record<string, { premiseIds: string[]; symbol: string }>;
          bySymbol: Record<string, { premiseIds: string[]; variableIds: string[] }>;
          variableIds: string[];
      }

      An object with variableIds, byId, and bySymbol indexes.

    • Returns the premise ID that contains the given expression, or undefined.

      Parameters

      • expressionId: string

        The expression ID to look up.

      Returns string | undefined

      The owning premise ID, or undefined.

    • Returns true if an expression with the given ID exists in any premise.

      Parameters

      • expressionId: string

        The expression ID to check.

      Returns boolean

      Whether the expression exists.