proposit-core
    Preparing search index...

    Interface TPremiseLifecycle<TPremise, TExpr>

    Premise snapshot and mutation callback lifecycle. Static fromSnapshot factory is class-level only.

    interface TPremiseLifecycle<
        TPremise extends TCorePremise = TCorePremise,
        TExpr extends TCorePropositionalExpression = TCorePropositionalExpression,
    > {
        markDirty(): void;
        setArgumentValidateCallback(
            callback: (() => TInvariantValidationResult) | undefined,
        ): void;
        setCircularityCheck(
            check: ((variableId: string, premiseId: string) => boolean) | undefined,
        ): void;
        setEmptyBoundPremiseCheck(
            check: ((variableId: string) => boolean) | undefined,
        ): void;
        setOnMutate(callback: (() => void) | undefined): void;
        setVariableIdsCallback(callback: (() => Set<string>) | undefined): void;
        snapshot(): TPremiseEngineSnapshot<TPremise, TExpr>;
        validate(): TInvariantValidationResult;
    }

    Type Parameters

    Implemented by

    Index

    Methods

    • Sets a callback that checks whether adding a variable-expression to a premise would create a circular binding. Injected by ArgumentEngine to enable cross-premise cycle detection. If not set, only the direct check (within the premise itself) runs.

      Parameters

      • check: ((variableId: string, premiseId: string) => boolean) | undefined

        A function that returns true if adding the variable to the premise would create a cycle, or undefined to clear.

      Returns void

    • Sets a callback that checks whether a premise-bound variable's target premise has an empty expression tree. Injected by ArgumentEngine to enable cross-premise validation. Used during validateEvaluability.

      Parameters

      • check: ((variableId: string) => boolean) | undefined

        A function that returns true if the variable's bound premise has no root expression, or undefined to clear.

      Returns void

    • Sets a callback invoked after every mutation, or undefined to clear.

      Parameters

      • callback: (() => void) | undefined

        The mutation callback, or undefined to remove.

      Returns void

    • Sets a callback that returns the full set of variable IDs registered in the argument. Injected by ArgumentEngine.

      Parameters

      • callback: (() => Set<string>) | undefined

        A function returning the set of registered variable IDs, or undefined to clear.

      Returns void