@proposit/proposit-core 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1032 -0
- package/dist/cli/commands/analysis.d.ts +3 -0
- package/dist/cli/commands/analysis.d.ts.map +1 -0
- package/dist/cli/commands/analysis.js +504 -0
- package/dist/cli/commands/analysis.js.map +1 -0
- package/dist/cli/commands/arguments.d.ts +3 -0
- package/dist/cli/commands/arguments.d.ts.map +1 -0
- package/dist/cli/commands/arguments.js +187 -0
- package/dist/cli/commands/arguments.js.map +1 -0
- package/dist/cli/commands/claims.d.ts +3 -0
- package/dist/cli/commands/claims.d.ts.map +1 -0
- package/dist/cli/commands/claims.js +120 -0
- package/dist/cli/commands/claims.js.map +1 -0
- package/dist/cli/commands/diff.d.ts +3 -0
- package/dist/cli/commands/diff.d.ts.map +1 -0
- package/dist/cli/commands/diff.js +61 -0
- package/dist/cli/commands/diff.js.map +1 -0
- package/dist/cli/commands/expressions.d.ts +3 -0
- package/dist/cli/commands/expressions.d.ts.map +1 -0
- package/dist/cli/commands/expressions.js +344 -0
- package/dist/cli/commands/expressions.js.map +1 -0
- package/dist/cli/commands/graph.d.ts +13 -0
- package/dist/cli/commands/graph.d.ts.map +1 -0
- package/dist/cli/commands/graph.js +382 -0
- package/dist/cli/commands/graph.js.map +1 -0
- package/dist/cli/commands/meta.d.ts +3 -0
- package/dist/cli/commands/meta.d.ts.map +1 -0
- package/dist/cli/commands/meta.js +14 -0
- package/dist/cli/commands/meta.js.map +1 -0
- package/dist/cli/commands/parse.d.ts +3 -0
- package/dist/cli/commands/parse.d.ts.map +1 -0
- package/dist/cli/commands/parse.js +171 -0
- package/dist/cli/commands/parse.js.map +1 -0
- package/dist/cli/commands/premises.d.ts +3 -0
- package/dist/cli/commands/premises.d.ts.map +1 -0
- package/dist/cli/commands/premises.js +261 -0
- package/dist/cli/commands/premises.js.map +1 -0
- package/dist/cli/commands/render.d.ts +3 -0
- package/dist/cli/commands/render.d.ts.map +1 -0
- package/dist/cli/commands/render.js +109 -0
- package/dist/cli/commands/render.js.map +1 -0
- package/dist/cli/commands/repair.d.ts +3 -0
- package/dist/cli/commands/repair.d.ts.map +1 -0
- package/dist/cli/commands/repair.js +53 -0
- package/dist/cli/commands/repair.js.map +1 -0
- package/dist/cli/commands/roles.d.ts +3 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +64 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/sources.d.ts +3 -0
- package/dist/cli/commands/sources.d.ts.map +1 -0
- package/dist/cli/commands/sources.js +103 -0
- package/dist/cli/commands/sources.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +3 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +27 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/commands/variables.d.ts +3 -0
- package/dist/cli/commands/variables.d.ts.map +1 -0
- package/dist/cli/commands/variables.js +206 -0
- package/dist/cli/commands/variables.js.map +1 -0
- package/dist/cli/commands/version-show.d.ts +3 -0
- package/dist/cli/commands/version-show.d.ts.map +1 -0
- package/dist/cli/commands/version-show.js +31 -0
- package/dist/cli/commands/version-show.js.map +1 -0
- package/dist/cli/config.d.ts +8 -0
- package/dist/cli/config.d.ts.map +1 -0
- package/dist/cli/config.js +24 -0
- package/dist/cli/config.js.map +1 -0
- package/dist/cli/engine.d.ts +19 -0
- package/dist/cli/engine.d.ts.map +1 -0
- package/dist/cli/engine.js +173 -0
- package/dist/cli/engine.js.map +1 -0
- package/dist/cli/import.d.ts +22 -0
- package/dist/cli/import.d.ts.map +1 -0
- package/dist/cli/import.js +242 -0
- package/dist/cli/import.js.map +1 -0
- package/dist/cli/llm/index.d.ts +6 -0
- package/dist/cli/llm/index.d.ts.map +1 -0
- package/dist/cli/llm/index.js +26 -0
- package/dist/cli/llm/index.js.map +1 -0
- package/dist/cli/llm/openai.d.ts +4 -0
- package/dist/cli/llm/openai.d.ts.map +1 -0
- package/dist/cli/llm/openai.js +44 -0
- package/dist/cli/llm/openai.js.map +1 -0
- package/dist/cli/llm/types.d.ts +14 -0
- package/dist/cli/llm/types.d.ts.map +1 -0
- package/dist/cli/llm/types.js +2 -0
- package/dist/cli/llm/types.js.map +1 -0
- package/dist/cli/logging.d.ts +8 -0
- package/dist/cli/logging.d.ts.map +1 -0
- package/dist/cli/logging.js +23 -0
- package/dist/cli/logging.js.map +1 -0
- package/dist/cli/output/diff-renderer.d.ts +4 -0
- package/dist/cli/output/diff-renderer.d.ts.map +1 -0
- package/dist/cli/output/diff-renderer.js +89 -0
- package/dist/cli/output/diff-renderer.js.map +1 -0
- package/dist/cli/output.d.ts +6 -0
- package/dist/cli/output.d.ts.map +1 -0
- package/dist/cli/output.js +41 -0
- package/dist/cli/output.js.map +1 -0
- package/dist/cli/router.d.ts +14 -0
- package/dist/cli/router.d.ts.map +1 -0
- package/dist/cli/router.js +59 -0
- package/dist/cli/router.js.map +1 -0
- package/dist/cli/schemata.d.ts +74 -0
- package/dist/cli/schemata.d.ts.map +1 -0
- package/dist/cli/schemata.js +89 -0
- package/dist/cli/schemata.js.map +1 -0
- package/dist/cli/storage/analysis.d.ts +9 -0
- package/dist/cli/storage/analysis.d.ts.map +1 -0
- package/dist/cli/storage/analysis.js +108 -0
- package/dist/cli/storage/analysis.js.map +1 -0
- package/dist/cli/storage/arguments.d.ts +12 -0
- package/dist/cli/storage/arguments.d.ts.map +1 -0
- package/dist/cli/storage/arguments.js +80 -0
- package/dist/cli/storage/arguments.js.map +1 -0
- package/dist/cli/storage/libraries.d.ts +14 -0
- package/dist/cli/storage/libraries.d.ts.map +1 -0
- package/dist/cli/storage/libraries.js +80 -0
- package/dist/cli/storage/libraries.js.map +1 -0
- package/dist/cli/storage/premises.d.ts +9 -0
- package/dist/cli/storage/premises.d.ts.map +1 -0
- package/dist/cli/storage/premises.js +67 -0
- package/dist/cli/storage/premises.js.map +1 -0
- package/dist/cli/storage/roles.d.ts +4 -0
- package/dist/cli/storage/roles.d.ts.map +1 -0
- package/dist/cli/storage/roles.js +26 -0
- package/dist/cli/storage/roles.js.map +1 -0
- package/dist/cli/storage/variables.d.ts +4 -0
- package/dist/cli/storage/variables.d.ts.map +1 -0
- package/dist/cli/storage/variables.js +36 -0
- package/dist/cli/storage/variables.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +65 -0
- package/dist/cli.js.map +1 -0
- package/dist/extensions/basics/argument-parser.d.ts +12 -0
- package/dist/extensions/basics/argument-parser.d.ts.map +1 -0
- package/dist/extensions/basics/argument-parser.js +27 -0
- package/dist/extensions/basics/argument-parser.js.map +1 -0
- package/dist/extensions/basics/index.d.ts +4 -0
- package/dist/extensions/basics/index.d.ts.map +1 -0
- package/dist/extensions/basics/index.js +3 -0
- package/dist/extensions/basics/index.js.map +1 -0
- package/dist/extensions/basics/schemata.d.ts +35 -0
- package/dist/extensions/basics/schemata.d.ts.map +1 -0
- package/dist/extensions/basics/schemata.js +55 -0
- package/dist/extensions/basics/schemata.js.map +1 -0
- package/dist/extensions/ieee/formatting.d.ts +18 -0
- package/dist/extensions/ieee/formatting.d.ts.map +1 -0
- package/dist/extensions/ieee/formatting.js +57 -0
- package/dist/extensions/ieee/formatting.js.map +1 -0
- package/dist/extensions/ieee/index.d.ts +6 -0
- package/dist/extensions/ieee/index.d.ts.map +1 -0
- package/dist/extensions/ieee/index.js +6 -0
- package/dist/extensions/ieee/index.js.map +1 -0
- package/dist/extensions/ieee/references.d.ts +1379 -0
- package/dist/extensions/ieee/references.d.ts.map +1 -0
- package/dist/extensions/ieee/references.js +929 -0
- package/dist/extensions/ieee/references.js.map +1 -0
- package/dist/extensions/ieee/relaxed.d.ts +1371 -0
- package/dist/extensions/ieee/relaxed.d.ts.map +1 -0
- package/dist/extensions/ieee/relaxed.js +160 -0
- package/dist/extensions/ieee/relaxed.js.map +1 -0
- package/dist/extensions/ieee/segment-builder.d.ts +9 -0
- package/dist/extensions/ieee/segment-builder.d.ts.map +1 -0
- package/dist/extensions/ieee/segment-builder.js +98 -0
- package/dist/extensions/ieee/segment-builder.js.map +1 -0
- package/dist/extensions/ieee/segment-templates.d.ts +58 -0
- package/dist/extensions/ieee/segment-templates.d.ts.map +1 -0
- package/dist/extensions/ieee/segment-templates.js +1618 -0
- package/dist/extensions/ieee/segment-templates.js.map +1 -0
- package/dist/extensions/ieee/source.d.ts +434 -0
- package/dist/extensions/ieee/source.d.ts.map +1 -0
- package/dist/extensions/ieee/source.js +12 -0
- package/dist/extensions/ieee/source.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/consts.d.ts +21 -0
- package/dist/lib/consts.d.ts.map +1 -0
- package/dist/lib/consts.js +117 -0
- package/dist/lib/consts.js.map +1 -0
- package/dist/lib/core/argument-engine.d.ts +181 -0
- package/dist/lib/core/argument-engine.d.ts.map +1 -0
- package/dist/lib/core/argument-engine.js +1294 -0
- package/dist/lib/core/argument-engine.js.map +1 -0
- package/dist/lib/core/argument-library.d.ts +84 -0
- package/dist/lib/core/argument-library.d.ts.map +1 -0
- package/dist/lib/core/argument-library.js +122 -0
- package/dist/lib/core/argument-library.js.map +1 -0
- package/dist/lib/core/argument-validation.d.ts +74 -0
- package/dist/lib/core/argument-validation.d.ts.map +1 -0
- package/dist/lib/core/argument-validation.js +315 -0
- package/dist/lib/core/argument-validation.js.map +1 -0
- package/dist/lib/core/change-collector.d.ts +24 -0
- package/dist/lib/core/change-collector.d.ts.map +1 -0
- package/dist/lib/core/change-collector.js +63 -0
- package/dist/lib/core/change-collector.js.map +1 -0
- package/dist/lib/core/checksum.d.ts +15 -0
- package/dist/lib/core/checksum.d.ts.map +1 -0
- package/dist/lib/core/checksum.js +43 -0
- package/dist/lib/core/checksum.js.map +1 -0
- package/dist/lib/core/claim-library.d.ts +23 -0
- package/dist/lib/core/claim-library.d.ts.map +1 -0
- package/dist/lib/core/claim-library.js +21 -0
- package/dist/lib/core/claim-library.js.map +1 -0
- package/dist/lib/core/claim-source-library.d.ts +32 -0
- package/dist/lib/core/claim-source-library.d.ts.map +1 -0
- package/dist/lib/core/claim-source-library.js +193 -0
- package/dist/lib/core/claim-source-library.js.map +1 -0
- package/dist/lib/core/diff.d.ts +20 -0
- package/dist/lib/core/diff.d.ts.map +1 -0
- package/dist/lib/core/diff.js +260 -0
- package/dist/lib/core/diff.js.map +1 -0
- package/dist/lib/core/evaluation/argument-evaluation.d.ts +53 -0
- package/dist/lib/core/evaluation/argument-evaluation.d.ts.map +1 -0
- package/dist/lib/core/evaluation/argument-evaluation.js +535 -0
- package/dist/lib/core/evaluation/argument-evaluation.js.map +1 -0
- package/dist/lib/core/evaluation/grading.d.ts +28 -0
- package/dist/lib/core/evaluation/grading.d.ts.map +1 -0
- package/dist/lib/core/evaluation/grading.js +44 -0
- package/dist/lib/core/evaluation/grading.js.map +1 -0
- package/dist/lib/core/evaluation/kleene.d.ts +12 -0
- package/dist/lib/core/evaluation/kleene.d.ts.map +1 -0
- package/dist/lib/core/evaluation/kleene.js +29 -0
- package/dist/lib/core/evaluation/kleene.js.map +1 -0
- package/dist/lib/core/evaluation/validation.d.ts +10 -0
- package/dist/lib/core/evaluation/validation.d.ts.map +1 -0
- package/dist/lib/core/evaluation/validation.js +28 -0
- package/dist/lib/core/evaluation/validation.js.map +1 -0
- package/dist/lib/core/expression-manager.d.ts +278 -0
- package/dist/lib/core/expression-manager.d.ts.map +1 -0
- package/dist/lib/core/expression-manager.js +1622 -0
- package/dist/lib/core/expression-manager.js.map +1 -0
- package/dist/lib/core/fork-library.d.ts +26 -0
- package/dist/lib/core/fork-library.d.ts.map +1 -0
- package/dist/lib/core/fork-library.js +71 -0
- package/dist/lib/core/fork-library.js.map +1 -0
- package/dist/lib/core/fork-namespace.d.ts +32 -0
- package/dist/lib/core/fork-namespace.d.ts.map +1 -0
- package/dist/lib/core/fork-namespace.js +99 -0
- package/dist/lib/core/fork-namespace.js.map +1 -0
- package/dist/lib/core/fork.d.ts +30 -0
- package/dist/lib/core/fork.d.ts.map +1 -0
- package/dist/lib/core/fork.js +125 -0
- package/dist/lib/core/fork.js.map +1 -0
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts +366 -0
- package/dist/lib/core/interfaces/argument-engine.interfaces.d.ts.map +1 -0
- package/dist/lib/core/interfaces/argument-engine.interfaces.js +2 -0
- package/dist/lib/core/interfaces/argument-engine.interfaces.js.map +1 -0
- package/dist/lib/core/interfaces/index.d.ts +5 -0
- package/dist/lib/core/interfaces/index.d.ts.map +1 -0
- package/dist/lib/core/interfaces/index.js +2 -0
- package/dist/lib/core/interfaces/index.js.map +1 -0
- package/dist/lib/core/interfaces/library.interfaces.d.ts +347 -0
- package/dist/lib/core/interfaces/library.interfaces.d.ts.map +1 -0
- package/dist/lib/core/interfaces/library.interfaces.js +2 -0
- package/dist/lib/core/interfaces/library.interfaces.js.map +1 -0
- package/dist/lib/core/interfaces/premise-engine.interfaces.d.ts +401 -0
- package/dist/lib/core/interfaces/premise-engine.interfaces.d.ts.map +1 -0
- package/dist/lib/core/interfaces/premise-engine.interfaces.js +2 -0
- package/dist/lib/core/interfaces/premise-engine.interfaces.js.map +1 -0
- package/dist/lib/core/interfaces/shared.interfaces.d.ts +28 -0
- package/dist/lib/core/interfaces/shared.interfaces.d.ts.map +1 -0
- package/dist/lib/core/interfaces/shared.interfaces.js +2 -0
- package/dist/lib/core/interfaces/shared.interfaces.js.map +1 -0
- package/dist/lib/core/invariant-violation-error.d.ts +10 -0
- package/dist/lib/core/invariant-violation-error.d.ts.map +1 -0
- package/dist/lib/core/invariant-violation-error.js +16 -0
- package/dist/lib/core/invariant-violation-error.js.map +1 -0
- package/dist/lib/core/parser/formula-gen.js +923 -0
- package/dist/lib/core/parser/formula.d.ts +24 -0
- package/dist/lib/core/parser/formula.d.ts.map +1 -0
- package/dist/lib/core/parser/formula.js +8 -0
- package/dist/lib/core/parser/formula.js.map +1 -0
- package/dist/lib/core/premise-engine.d.ts +122 -0
- package/dist/lib/core/premise-engine.d.ts.map +1 -0
- package/dist/lib/core/premise-engine.js +1362 -0
- package/dist/lib/core/premise-engine.js.map +1 -0
- package/dist/lib/core/proposit-core.d.ts +111 -0
- package/dist/lib/core/proposit-core.d.ts.map +1 -0
- package/dist/lib/core/proposit-core.js +365 -0
- package/dist/lib/core/proposit-core.js.map +1 -0
- package/dist/lib/core/relationships.d.ts +15 -0
- package/dist/lib/core/relationships.d.ts.map +1 -0
- package/dist/lib/core/relationships.js +319 -0
- package/dist/lib/core/relationships.js.map +1 -0
- package/dist/lib/core/source-library.d.ts +23 -0
- package/dist/lib/core/source-library.d.ts.map +1 -0
- package/dist/lib/core/source-library.js +21 -0
- package/dist/lib/core/source-library.js.map +1 -0
- package/dist/lib/core/variable-manager.d.ts +68 -0
- package/dist/lib/core/variable-manager.d.ts.map +1 -0
- package/dist/lib/core/variable-manager.js +200 -0
- package/dist/lib/core/variable-manager.js.map +1 -0
- package/dist/lib/core/versioned-library.d.ts +52 -0
- package/dist/lib/core/versioned-library.d.ts.map +1 -0
- package/dist/lib/core/versioned-library.js +192 -0
- package/dist/lib/core/versioned-library.js.map +1 -0
- package/dist/lib/index.d.ts +54 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +39 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/parsing/argument-parser.d.ts +49 -0
- package/dist/lib/parsing/argument-parser.d.ts.map +1 -0
- package/dist/lib/parsing/argument-parser.js +403 -0
- package/dist/lib/parsing/argument-parser.js.map +1 -0
- package/dist/lib/parsing/clamp-max-lengths.d.ts +11 -0
- package/dist/lib/parsing/clamp-max-lengths.d.ts.map +1 -0
- package/dist/lib/parsing/clamp-max-lengths.js +56 -0
- package/dist/lib/parsing/clamp-max-lengths.js.map +1 -0
- package/dist/lib/parsing/index.d.ts +7 -0
- package/dist/lib/parsing/index.d.ts.map +1 -0
- package/dist/lib/parsing/index.js +4 -0
- package/dist/lib/parsing/index.js.map +1 -0
- package/dist/lib/parsing/prompt-builder.d.ts +11 -0
- package/dist/lib/parsing/prompt-builder.d.ts.map +1 -0
- package/dist/lib/parsing/prompt-builder.js +229 -0
- package/dist/lib/parsing/prompt-builder.js.map +1 -0
- package/dist/lib/parsing/schemata.d.ts +79 -0
- package/dist/lib/parsing/schemata.d.ts.map +1 -0
- package/dist/lib/parsing/schemata.js +92 -0
- package/dist/lib/parsing/schemata.js.map +1 -0
- package/dist/lib/parsing/types.d.ts +24 -0
- package/dist/lib/parsing/types.d.ts.map +1 -0
- package/dist/lib/parsing/types.js +2 -0
- package/dist/lib/parsing/types.js.map +1 -0
- package/dist/lib/schemata/analysis.d.ts +9 -0
- package/dist/lib/schemata/analysis.d.ts.map +1 -0
- package/dist/lib/schemata/analysis.js +13 -0
- package/dist/lib/schemata/analysis.js.map +1 -0
- package/dist/lib/schemata/argument.d.ts +14 -0
- package/dist/lib/schemata/argument.d.ts.map +1 -0
- package/dist/lib/schemata/argument.js +24 -0
- package/dist/lib/schemata/argument.js.map +1 -0
- package/dist/lib/schemata/claim.d.ts +9 -0
- package/dist/lib/schemata/claim.d.ts.map +1 -0
- package/dist/lib/schemata/claim.js +18 -0
- package/dist/lib/schemata/claim.js.map +1 -0
- package/dist/lib/schemata/fork.d.ts +76 -0
- package/dist/lib/schemata/fork.d.ts.map +1 -0
- package/dist/lib/schemata/fork.js +55 -0
- package/dist/lib/schemata/fork.js.map +1 -0
- package/dist/lib/schemata/import.d.ts +33 -0
- package/dist/lib/schemata/import.d.ts.map +1 -0
- package/dist/lib/schemata/import.js +18 -0
- package/dist/lib/schemata/import.js.map +1 -0
- package/dist/lib/schemata/index.d.ts +8 -0
- package/dist/lib/schemata/index.d.ts.map +1 -0
- package/dist/lib/schemata/index.js +8 -0
- package/dist/lib/schemata/index.js.map +1 -0
- package/dist/lib/schemata/propositional.d.ts +142 -0
- package/dist/lib/schemata/propositional.d.ts.map +1 -0
- package/dist/lib/schemata/propositional.js +120 -0
- package/dist/lib/schemata/propositional.js.map +1 -0
- package/dist/lib/schemata/shared.d.ts +41 -0
- package/dist/lib/schemata/shared.d.ts.map +1 -0
- package/dist/lib/schemata/shared.js +66 -0
- package/dist/lib/schemata/shared.js.map +1 -0
- package/dist/lib/schemata/source.d.ts +18 -0
- package/dist/lib/schemata/source.d.ts.map +1 -0
- package/dist/lib/schemata/source.js +35 -0
- package/dist/lib/schemata/source.js.map +1 -0
- package/dist/lib/types/checksum.d.ts +20 -0
- package/dist/lib/types/checksum.d.ts.map +1 -0
- package/dist/lib/types/checksum.js +2 -0
- package/dist/lib/types/checksum.js.map +1 -0
- package/dist/lib/types/diff.d.ts +60 -0
- package/dist/lib/types/diff.d.ts.map +1 -0
- package/dist/lib/types/diff.js +2 -0
- package/dist/lib/types/diff.js.map +1 -0
- package/dist/lib/types/evaluation.d.ts +164 -0
- package/dist/lib/types/evaluation.d.ts.map +1 -0
- package/dist/lib/types/evaluation.js +2 -0
- package/dist/lib/types/evaluation.js.map +1 -0
- package/dist/lib/types/fork.d.ts +25 -0
- package/dist/lib/types/fork.d.ts.map +1 -0
- package/dist/lib/types/fork.js +2 -0
- package/dist/lib/types/fork.js.map +1 -0
- package/dist/lib/types/grammar.d.ts +38 -0
- package/dist/lib/types/grammar.d.ts.map +1 -0
- package/dist/lib/types/grammar.js +11 -0
- package/dist/lib/types/grammar.js.map +1 -0
- package/dist/lib/types/mutation.d.ts +31 -0
- package/dist/lib/types/mutation.d.ts.map +1 -0
- package/dist/lib/types/mutation.js +2 -0
- package/dist/lib/types/mutation.js.map +1 -0
- package/dist/lib/types/reactive.d.ts +14 -0
- package/dist/lib/types/reactive.d.ts.map +1 -0
- package/dist/lib/types/reactive.js +2 -0
- package/dist/lib/types/reactive.js.map +1 -0
- package/dist/lib/types/relationships.d.ts +36 -0
- package/dist/lib/types/relationships.d.ts.map +1 -0
- package/dist/lib/types/relationships.js +2 -0
- package/dist/lib/types/relationships.js.map +1 -0
- package/dist/lib/types/validation.d.ts +47 -0
- package/dist/lib/types/validation.d.ts.map +1 -0
- package/dist/lib/types/validation.js +43 -0
- package/dist/lib/types/validation.js.map +1 -0
- package/dist/lib/utils/changeset.d.ts +124 -0
- package/dist/lib/utils/changeset.d.ts.map +1 -0
- package/dist/lib/utils/changeset.js +221 -0
- package/dist/lib/utils/changeset.js.map +1 -0
- package/dist/lib/utils/collections.d.ts +12 -0
- package/dist/lib/utils/collections.d.ts.map +1 -0
- package/dist/lib/utils/collections.js +24 -0
- package/dist/lib/utils/collections.js.map +1 -0
- package/dist/lib/utils/default-map.d.ts +17 -0
- package/dist/lib/utils/default-map.d.ts.map +1 -0
- package/dist/lib/utils/default-map.js +33 -0
- package/dist/lib/utils/default-map.js.map +1 -0
- package/dist/lib/utils/lookup.d.ts +47 -0
- package/dist/lib/utils/lookup.d.ts.map +1 -0
- package/dist/lib/utils/lookup.js +62 -0
- package/dist/lib/utils/lookup.js.map +1 -0
- package/dist/lib/utils/position.d.ts +12 -0
- package/dist/lib/utils/position.d.ts.map +1 -0
- package/dist/lib/utils/position.js +13 -0
- package/dist/lib/utils/position.js.map +1 -0
- package/package.json +82 -0
- package/skills/proposit-core/SKILL.md +35 -0
- package/skills/proposit-core/docs/api-usage.md +442 -0
- package/skills/proposit-core/docs/architecture.md +256 -0
- package/skills/proposit-core/docs/cli.md +304 -0
- package/skills/proposit-core/docs/testing.md +281 -0
- package/skills/proposit-core/docs/types-schemas.md +648 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** Kleene three-valued NOT: null propagates. */
|
|
2
|
+
export function kleeneNot(a) {
|
|
3
|
+
return a === null ? null : !a;
|
|
4
|
+
}
|
|
5
|
+
/** Kleene three-valued AND: false dominates, null propagates. */
|
|
6
|
+
export function kleeneAnd(a, b) {
|
|
7
|
+
if (a === false || b === false)
|
|
8
|
+
return false;
|
|
9
|
+
if (a === null || b === null)
|
|
10
|
+
return null;
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
/** Kleene three-valued OR: true dominates, null propagates. */
|
|
14
|
+
export function kleeneOr(a, b) {
|
|
15
|
+
if (a === true || b === true)
|
|
16
|
+
return true;
|
|
17
|
+
if (a === null || b === null)
|
|
18
|
+
return null;
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
/** Kleene three-valued material implication: NOT a OR b. */
|
|
22
|
+
export function kleeneImplies(a, b) {
|
|
23
|
+
return kleeneOr(kleeneNot(a), b);
|
|
24
|
+
}
|
|
25
|
+
/** Kleene three-valued biconditional: (a -> b) AND (b -> a). */
|
|
26
|
+
export function kleeneIff(a, b) {
|
|
27
|
+
return kleeneAnd(kleeneImplies(a, b), kleeneImplies(b, a));
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=kleene.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kleene.js","sourceRoot":"","sources":["../../../../src/lib/core/evaluation/kleene.ts"],"names":[],"mappings":"AAEA,gDAAgD;AAChD,MAAM,UAAU,SAAS,CAAC,CAAsB;IAC5C,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AACjC,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,SAAS,CACrB,CAAsB,EACtB,CAAsB;IAEtB,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IAC5C,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACzC,OAAO,IAAI,CAAA;AACf,CAAC;AAED,+DAA+D;AAC/D,MAAM,UAAU,QAAQ,CACpB,CAAsB,EACtB,CAAsB;IAEtB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACzC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAA;IACzC,OAAO,KAAK,CAAA;AAChB,CAAC;AAED,4DAA4D;AAC5D,MAAM,UAAU,aAAa,CACzB,CAAsB,EACtB,CAAsB;IAEtB,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACpC,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,SAAS,CACrB,CAAsB,EACtB,CAAsB;IAEtB,OAAO,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAC9D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TCoreDirectionalVacuity, TCoreTrivalentValue, TCoreValidationIssue, TCoreValidationResult } from "../../types/evaluation.js";
|
|
2
|
+
/** Creates a validation result, setting `ok` based on whether any error-severity issues exist. */
|
|
3
|
+
export declare function makeValidationResult(issues: TCoreValidationIssue[]): TCoreValidationResult;
|
|
4
|
+
/** Creates a validation issue with `severity: "error"`. */
|
|
5
|
+
export declare function makeErrorIssue(issue: Omit<TCoreValidationIssue, "severity">): TCoreValidationIssue;
|
|
6
|
+
/** Computes Kleene three-valued material implication: `!antecedent || consequent`. */
|
|
7
|
+
export declare function implicationValue(antecedent: TCoreTrivalentValue, consequent: TCoreTrivalentValue): TCoreTrivalentValue;
|
|
8
|
+
/** Builds a directional vacuity diagnostic for one direction of an implication. */
|
|
9
|
+
export declare function buildDirectionalVacuity(antecedentTrue: TCoreTrivalentValue, consequentTrue: TCoreTrivalentValue): TCoreDirectionalVacuity;
|
|
10
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/evaluation/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACxB,MAAM,2BAA2B,CAAA;AAGlC,kGAAkG;AAClG,wBAAgB,oBAAoB,CAChC,MAAM,EAAE,oBAAoB,EAAE,GAC/B,qBAAqB,CAKvB;AAED,2DAA2D;AAC3D,wBAAgB,cAAc,CAC1B,KAAK,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GAC9C,oBAAoB,CAEtB;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAC5B,UAAU,EAAE,mBAAmB,EAC/B,UAAU,EAAE,mBAAmB,GAChC,mBAAmB,CAErB;AAED,mFAAmF;AACnF,wBAAgB,uBAAuB,CACnC,cAAc,EAAE,mBAAmB,EACnC,cAAc,EAAE,mBAAmB,GACpC,uBAAuB,CASzB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { kleeneAnd, kleeneImplies, kleeneNot } from "./kleene.js";
|
|
2
|
+
/** Creates a validation result, setting `ok` based on whether any error-severity issues exist. */
|
|
3
|
+
export function makeValidationResult(issues) {
|
|
4
|
+
return {
|
|
5
|
+
ok: issues.every((issue) => issue.severity !== "error"),
|
|
6
|
+
issues,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
/** Creates a validation issue with `severity: "error"`. */
|
|
10
|
+
export function makeErrorIssue(issue) {
|
|
11
|
+
return { severity: "error", ...issue };
|
|
12
|
+
}
|
|
13
|
+
/** Computes Kleene three-valued material implication: `!antecedent || consequent`. */
|
|
14
|
+
export function implicationValue(antecedent, consequent) {
|
|
15
|
+
return kleeneImplies(antecedent, consequent);
|
|
16
|
+
}
|
|
17
|
+
/** Builds a directional vacuity diagnostic for one direction of an implication. */
|
|
18
|
+
export function buildDirectionalVacuity(antecedentTrue, consequentTrue) {
|
|
19
|
+
const implication = implicationValue(antecedentTrue, consequentTrue);
|
|
20
|
+
return {
|
|
21
|
+
antecedentTrue,
|
|
22
|
+
consequentTrue,
|
|
23
|
+
implicationValue: implication,
|
|
24
|
+
isVacuouslyTrue: kleeneAnd(implication, kleeneNot(antecedentTrue)),
|
|
25
|
+
fired: antecedentTrue,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../src/lib/core/evaluation/validation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEjE,kGAAkG;AAClG,MAAM,UAAU,oBAAoB,CAChC,MAA8B;IAE9B,OAAO;QACH,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,OAAO,CAAC;QACvD,MAAM;KACT,CAAA;AACL,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,cAAc,CAC1B,KAA6C;IAE7C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,EAAE,CAAA;AAC1C,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,gBAAgB,CAC5B,UAA+B,EAC/B,UAA+B;IAE/B,OAAO,aAAa,CAAC,UAAU,EAAE,UAAU,CAAC,CAAA;AAChD,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,uBAAuB,CACnC,cAAmC,EACnC,cAAmC;IAEnC,MAAM,WAAW,GAAG,gBAAgB,CAAC,cAAc,EAAE,cAAc,CAAC,CAAA;IACpE,OAAO;QACH,cAAc;QACd,cAAc;QACd,gBAAgB,EAAE,WAAW;QAC7B,eAAe,EAAE,SAAS,CAAC,WAAW,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;QAClE,KAAK,EAAE,cAAc;KACxB,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import type { TCoreLogicalOperatorType, TCorePropositionalExpression } from "../schemata/index.js";
|
|
2
|
+
import type { ChangeCollector } from "./change-collector.js";
|
|
3
|
+
import type { TLogicEngineOptions } from "./argument-engine.js";
|
|
4
|
+
import { type TGrammarConfig } from "../types/grammar.js";
|
|
5
|
+
import type { TInvariantValidationResult } from "../types/validation.js";
|
|
6
|
+
export type TExpressionInput<TExpr extends TCorePropositionalExpression = TCorePropositionalExpression> = TExpr extends infer U ? U extends TCorePropositionalExpression ? Omit<U, "checksum" | "descendantChecksum" | "combinedChecksum"> : never : never;
|
|
7
|
+
export type TExpressionWithoutPosition<TExpr extends TCorePropositionalExpression = TCorePropositionalExpression> = TExpr extends infer U ? U extends TCorePropositionalExpression ? Omit<U, "position" | "checksum" | "descendantChecksum" | "combinedChecksum"> : never : never;
|
|
8
|
+
export type TExpressionManagerSnapshot<TExpr extends TCorePropositionalExpression = TCorePropositionalExpression> = {
|
|
9
|
+
expressions: TExpr[];
|
|
10
|
+
config?: TLogicEngineOptions;
|
|
11
|
+
};
|
|
12
|
+
/** Fields that may be updated on an existing expression. */
|
|
13
|
+
export type TExpressionUpdate = {
|
|
14
|
+
position?: number;
|
|
15
|
+
variableId?: string;
|
|
16
|
+
operator?: TCoreLogicalOperatorType;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Low-level manager for a flat-stored expression tree.
|
|
20
|
+
*
|
|
21
|
+
* Expressions are immutable value objects stored in three maps: the main
|
|
22
|
+
* expression store, a parent-to-children ID index, and a parent-to-positions
|
|
23
|
+
* index. Structural invariants (child limits, root-only operators, position
|
|
24
|
+
* uniqueness) are enforced on every mutation.
|
|
25
|
+
*
|
|
26
|
+
* This class is an internal building block used by {@link PremiseEngine}
|
|
27
|
+
* and is not part of the public API.
|
|
28
|
+
*/
|
|
29
|
+
export declare class ExpressionManager<TExpr extends TCorePropositionalExpression = TCorePropositionalExpression> {
|
|
30
|
+
private expressions;
|
|
31
|
+
private childExpressionIdsByParentId;
|
|
32
|
+
private childPositionsByParentId;
|
|
33
|
+
private positionConfig;
|
|
34
|
+
private config?;
|
|
35
|
+
private generateId;
|
|
36
|
+
private collector;
|
|
37
|
+
private dirtyExpressionIds;
|
|
38
|
+
setCollector(collector: ChangeCollector | null): void;
|
|
39
|
+
constructor(config?: TLogicEngineOptions);
|
|
40
|
+
private get grammarConfig();
|
|
41
|
+
private attachChecksum;
|
|
42
|
+
/**
|
|
43
|
+
* Creates and registers a formula-buffer expression in the three internal
|
|
44
|
+
* maps (`expressions`, `childExpressionIdsByParentId`,
|
|
45
|
+
* `childPositionsByParentId`) and notifies the change collector.
|
|
46
|
+
*
|
|
47
|
+
* Used by `addExpression`, `insertExpression`, and `wrapExpression` to
|
|
48
|
+
* auto-insert formula nodes between operators when
|
|
49
|
+
* `grammarConfig.autoNormalize` is enabled.
|
|
50
|
+
*
|
|
51
|
+
* @returns The generated formula expression ID.
|
|
52
|
+
*/
|
|
53
|
+
private registerFormulaBuffer;
|
|
54
|
+
/**
|
|
55
|
+
* Removes an expression from the three internal maps: deletes it from
|
|
56
|
+
* the main `expressions` store, removes it from its parent's child-id
|
|
57
|
+
* and position indexes, and deletes its own child-id and position
|
|
58
|
+
* indexes.
|
|
59
|
+
*
|
|
60
|
+
* Callers remain responsible for collector notification, dirty-set
|
|
61
|
+
* cleanup, and parent dirtying — timing for those varies by call site.
|
|
62
|
+
*/
|
|
63
|
+
private detachExpression;
|
|
64
|
+
/**
|
|
65
|
+
* Marks an expression and all its ancestors as dirty for hierarchical
|
|
66
|
+
* checksum recomputation. Stops early when it reaches an expression
|
|
67
|
+
* already in the dirty set (since its ancestors are already marked).
|
|
68
|
+
*/
|
|
69
|
+
markExpressionDirty(exprId: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Recomputes `descendantChecksum` and `combinedChecksum` for all dirty
|
|
72
|
+
* expressions, processing bottom-up (deepest first) so that children
|
|
73
|
+
* are up-to-date before their parents are computed.
|
|
74
|
+
*/
|
|
75
|
+
flushExpressionChecksums(): void;
|
|
76
|
+
/**
|
|
77
|
+
* Removes deleted expression IDs from the dirty set so that flush
|
|
78
|
+
* doesn't attempt to process expressions that no longer exist.
|
|
79
|
+
*/
|
|
80
|
+
pruneDeletedFromDirtySet(deletedIds: Set<string>): void;
|
|
81
|
+
/** Returns all expressions sorted by ID for deterministic output. */
|
|
82
|
+
toArray(): TExpr[];
|
|
83
|
+
/**
|
|
84
|
+
* Adds an expression to the tree.
|
|
85
|
+
*
|
|
86
|
+
* @throws If the expression ID already exists.
|
|
87
|
+
* @throws If the expression references itself as parent.
|
|
88
|
+
* @throws If `implies`/`iff` operators have a non-null parentId (they must be roots).
|
|
89
|
+
* @throws If the parent does not exist or is not an operator/formula.
|
|
90
|
+
* @throws If the parent's child limit would be exceeded.
|
|
91
|
+
* @throws If the position is already occupied under the parent.
|
|
92
|
+
*/
|
|
93
|
+
addExpression(input: TExpressionInput<TExpr>): void;
|
|
94
|
+
/**
|
|
95
|
+
* Adds an expression as the last child of the given parent.
|
|
96
|
+
*
|
|
97
|
+
* If the parent has no children, the expression gets `POSITION_INITIAL`.
|
|
98
|
+
* Otherwise it gets a midpoint between the last child's position and
|
|
99
|
+
* `POSITION_MAX`.
|
|
100
|
+
*/
|
|
101
|
+
appendExpression(parentId: string | null, expression: TExpressionWithoutPosition<TExpr>): void;
|
|
102
|
+
/**
|
|
103
|
+
* Adds an expression immediately before or after an existing sibling.
|
|
104
|
+
*
|
|
105
|
+
* @throws If the sibling does not exist.
|
|
106
|
+
*/
|
|
107
|
+
addExpressionRelative(siblingId: string, relativePosition: "before" | "after", expression: TExpressionWithoutPosition<TExpr>): void;
|
|
108
|
+
/**
|
|
109
|
+
* Updates mutable fields of an existing expression in-place.
|
|
110
|
+
*
|
|
111
|
+
* Only `position`, `variableId`, and `operator` may be updated. Structural
|
|
112
|
+
* fields (`id`, `parentId`, `type`, `argumentId`, `argumentVersion`,
|
|
113
|
+
* `checksum`) are forbidden.
|
|
114
|
+
*
|
|
115
|
+
* Operator changes are restricted to permitted swaps: `and`/`or` and
|
|
116
|
+
* `implies`/`iff`. Variable ID changes require the expression to be of
|
|
117
|
+
* type `"variable"`.
|
|
118
|
+
*
|
|
119
|
+
* @throws If the expression does not exist.
|
|
120
|
+
* @throws If a forbidden field is present in `updates`.
|
|
121
|
+
* @throws If an operator change is not permitted.
|
|
122
|
+
* @throws If `variableId` is set on a non-variable expression.
|
|
123
|
+
* @throws If the new position collides with a sibling.
|
|
124
|
+
*/
|
|
125
|
+
updateExpression(expressionId: string, updates: TExpressionUpdate): TExpr;
|
|
126
|
+
/**
|
|
127
|
+
* Removes an expression from the tree.
|
|
128
|
+
*
|
|
129
|
+
* When `deleteSubtree` is `true`, the expression and its entire descendant
|
|
130
|
+
* subtree are removed, then {@link collapseIfNeeded} runs on the parent.
|
|
131
|
+
*
|
|
132
|
+
* When `deleteSubtree` is `false`, the expression is removed but its single
|
|
133
|
+
* child (if any) is promoted into the removed expression's slot. If the
|
|
134
|
+
* expression has more than one child, an error is thrown. Leaf removal
|
|
135
|
+
* (0 children) still triggers {@link collapseIfNeeded} on the parent.
|
|
136
|
+
* Promotion does **not** trigger collapse.
|
|
137
|
+
*
|
|
138
|
+
* @throws If `deleteSubtree` is `false` and the expression has multiple children.
|
|
139
|
+
* @throws If `deleteSubtree` is `false` and the single child is a root-only
|
|
140
|
+
* operator (`implies`/`iff`) that would be placed in a non-root position.
|
|
141
|
+
* @returns The removed expression, or `undefined` if not found.
|
|
142
|
+
*/
|
|
143
|
+
removeExpression(expressionId: string, deleteSubtree: boolean): TExpr | undefined;
|
|
144
|
+
private removeSubtree;
|
|
145
|
+
private removeAndPromote;
|
|
146
|
+
/**
|
|
147
|
+
* Promotes `child` into the slot occupied by `parent` and removes `parent`.
|
|
148
|
+
* Used by `collapseIfNeeded` and `normalize()`.
|
|
149
|
+
*/
|
|
150
|
+
private promoteChild;
|
|
151
|
+
private collapseIfNeeded;
|
|
152
|
+
/**
|
|
153
|
+
* Checks whether the subtree rooted at `expressionId` contains a binary
|
|
154
|
+
* operator (`and` or `or`). Traversal stops at formula boundaries — a
|
|
155
|
+
* nested formula owns its own subtree and is not inspected.
|
|
156
|
+
*/
|
|
157
|
+
private hasBinaryOperatorInBoundedSubtree;
|
|
158
|
+
/**
|
|
159
|
+
* Performs a full normalization sweep on the expression tree:
|
|
160
|
+
* 1. Collapses operators with 0 or 1 children.
|
|
161
|
+
* 2. Collapses formulas whose bounded subtree has no binary operator.
|
|
162
|
+
* 3. Inserts formula buffers where `enforceFormulaBetweenOperators` requires them.
|
|
163
|
+
* 4. Repeats until stable.
|
|
164
|
+
*
|
|
165
|
+
* Works regardless of the current `autoNormalize` setting — this is an
|
|
166
|
+
* explicit on-demand normalization.
|
|
167
|
+
*/
|
|
168
|
+
normalize(): void;
|
|
169
|
+
/** Returns `true` if any expression in the tree references the given variable ID. */
|
|
170
|
+
hasVariableReference(variableId: string): boolean;
|
|
171
|
+
/** Returns the expression with the given ID, or `undefined` if not found. */
|
|
172
|
+
getExpression(expressionId: string): TExpr | undefined;
|
|
173
|
+
/** Returns the children of the given parent, sorted by position. */
|
|
174
|
+
getChildExpressions(parentId: string | null): TExpr[];
|
|
175
|
+
private loadInitialExpressions;
|
|
176
|
+
/**
|
|
177
|
+
* Simulates the collapse chain that would result from removing an expression.
|
|
178
|
+
* Throws if any promotion would violate nesting or root-only rules.
|
|
179
|
+
*/
|
|
180
|
+
private assertRemovalSafe;
|
|
181
|
+
/**
|
|
182
|
+
* Checks whether promoting `child` into a slot with the given `newParentId`
|
|
183
|
+
* would violate the nesting rule or root-only rule.
|
|
184
|
+
*/
|
|
185
|
+
private assertPromotionSafe;
|
|
186
|
+
/**
|
|
187
|
+
* Walks the collapse chain starting from `operatorId` after `removedChildId`
|
|
188
|
+
* is removed. At each level: if 0 remaining children, operator/formula is deleted
|
|
189
|
+
* and chain continues up. If 1 remaining child, check promotion safety.
|
|
190
|
+
*/
|
|
191
|
+
private simulateCollapseChain;
|
|
192
|
+
/**
|
|
193
|
+
* After an operator promotion places `promotedChild` into `parentId`'s child set,
|
|
194
|
+
* check whether the parent (if a formula) would itself collapse. Formula collapse
|
|
195
|
+
* promotion is always safe (the child can't be a binary operator or root-only operator),
|
|
196
|
+
* but we need to continue the simulation chain.
|
|
197
|
+
*/
|
|
198
|
+
private simulatePostPromotionCollapse;
|
|
199
|
+
private assertChildLimit;
|
|
200
|
+
private reparent;
|
|
201
|
+
/**
|
|
202
|
+
* Inserts a new expression between existing nodes in the tree.
|
|
203
|
+
*
|
|
204
|
+
* The new expression inherits the tree slot of the anchor node
|
|
205
|
+
* (`leftNodeId ?? rightNodeId`). The anchor and optional second node
|
|
206
|
+
* become children of the new expression at positions 0 and 1.
|
|
207
|
+
*
|
|
208
|
+
* Right node is reparented before left node to handle the case where
|
|
209
|
+
* the right node is a descendant of the left node's subtree.
|
|
210
|
+
*
|
|
211
|
+
* @throws If neither leftNodeId nor rightNodeId is provided.
|
|
212
|
+
* @throws If the expression ID already exists.
|
|
213
|
+
* @throws If leftNodeId and rightNodeId are the same.
|
|
214
|
+
* @throws If either referenced node does not exist.
|
|
215
|
+
* @throws If a unary operator/formula is given two children.
|
|
216
|
+
* @throws If either child is an `implies`/`iff` operator (cannot be subordinated).
|
|
217
|
+
* @throws If an `implies`/`iff` expression would be inserted at a non-root position.
|
|
218
|
+
*/
|
|
219
|
+
insertExpression(expression: TExpressionInput<TExpr>, leftNodeId?: string, rightNodeId?: string): void;
|
|
220
|
+
/**
|
|
221
|
+
* Wraps an existing expression with a new operator and a new sibling.
|
|
222
|
+
*
|
|
223
|
+
* The operator takes the existing node's slot in the tree. Both the
|
|
224
|
+
* existing node and the new sibling become children of the operator.
|
|
225
|
+
*
|
|
226
|
+
* Exactly one of `leftNodeId` / `rightNodeId` must be provided — it
|
|
227
|
+
* identifies the existing node and which child slot (position 0 or 1)
|
|
228
|
+
* it occupies. The new sibling fills the other slot.
|
|
229
|
+
*
|
|
230
|
+
* @throws If neither or both of leftNodeId/rightNodeId are provided.
|
|
231
|
+
* @throws If the operator or sibling expression ID already exists.
|
|
232
|
+
* @throws If operator and sibling IDs are the same.
|
|
233
|
+
* @throws If the existing node does not exist.
|
|
234
|
+
* @throws If the operator is not of type `"operator"`.
|
|
235
|
+
* @throws If the operator is unary (`not`).
|
|
236
|
+
* @throws If the operator is `implies`/`iff` and the existing node is not at root.
|
|
237
|
+
* @throws If the existing node is an `implies`/`iff` operator (cannot be subordinated).
|
|
238
|
+
* @throws If the new sibling is an `implies`/`iff` operator (cannot be subordinated).
|
|
239
|
+
*/
|
|
240
|
+
wrapExpression(operator: TExpressionWithoutPosition<TExpr>, newSibling: TExpressionWithoutPosition<TExpr>, leftNodeId?: string, rightNodeId?: string): void;
|
|
241
|
+
/**
|
|
242
|
+
* Reparents an expression to a new parent at a given position.
|
|
243
|
+
*/
|
|
244
|
+
reparentExpression(expressionId: string, newParentId: string | null, newPosition: number): void;
|
|
245
|
+
/**
|
|
246
|
+
* Deletes a single expression that has no children.
|
|
247
|
+
* Does NOT trigger operator collapse. Caller must ensure children
|
|
248
|
+
* have been reparented away first.
|
|
249
|
+
*/
|
|
250
|
+
deleteExpression(expressionId: string): TExpr | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* Changes the operator type of an operator expression without the swap
|
|
253
|
+
* restriction enforced by {@link updateExpression}. Only validates that
|
|
254
|
+
* the target expression is an operator, the new operator is not `"not"`,
|
|
255
|
+
* and root-only constraints are satisfied.
|
|
256
|
+
*/
|
|
257
|
+
changeOperatorType(expressionId: string, newOperator: TCoreLogicalOperatorType): TExpr;
|
|
258
|
+
/**
|
|
259
|
+
* Loads expressions in BFS order, respecting the current grammar config.
|
|
260
|
+
* Used by restoration paths (fromData, rollback) that load existing data.
|
|
261
|
+
*/
|
|
262
|
+
loadExpressions(expressions: TExpressionInput<TExpr>[]): void;
|
|
263
|
+
/**
|
|
264
|
+
* Performs a comprehensive validation sweep on all managed expressions.
|
|
265
|
+
*
|
|
266
|
+
* Collects ALL violations rather than failing on the first one. Checks:
|
|
267
|
+
* schema validity, duplicate IDs, self-referential parents, parent
|
|
268
|
+
* existence, parent container type, root-only operators, formula-between-
|
|
269
|
+
* operators (when enabled), child limits, position uniqueness, and
|
|
270
|
+
* checksum integrity.
|
|
271
|
+
*/
|
|
272
|
+
validate(): TInvariantValidationResult;
|
|
273
|
+
/** Returns a serializable snapshot of the current state. */
|
|
274
|
+
snapshot(): TExpressionManagerSnapshot<TExpr>;
|
|
275
|
+
/** Creates a new ExpressionManager from a previously captured snapshot. */
|
|
276
|
+
static fromSnapshot<TExpr extends TCorePropositionalExpression = TCorePropositionalExpression>(snapshot: TExpressionManagerSnapshot<TExpr>, grammarConfig?: TGrammarConfig, generateId?: () => string): ExpressionManager<TExpr>;
|
|
277
|
+
}
|
|
278
|
+
//# sourceMappingURL=expression-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expression-manager.d.ts","sourceRoot":"","sources":["../../../src/lib/core/expression-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,wBAAwB,EACxB,4BAA4B,EAC/B,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAQ5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAO/D,OAAO,EAEH,KAAK,cAAc,EACtB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,EAER,0BAA0B,EAC7B,MAAM,wBAAwB,CAAA;AAe/B,MAAM,MAAM,gBAAgB,CACxB,KAAK,SAAS,4BAA4B,GAAG,4BAA4B,IACzE,KAAK,SAAS,MAAM,CAAC,GACnB,CAAC,SAAS,4BAA4B,GAClC,IAAI,CAAC,CAAC,EAAE,UAAU,GAAG,oBAAoB,GAAG,kBAAkB,CAAC,GAC/D,KAAK,GACT,KAAK,CAAA;AAEX,MAAM,MAAM,0BAA0B,CAClC,KAAK,SAAS,4BAA4B,GAAG,4BAA4B,IACzE,KAAK,SAAS,MAAM,CAAC,GACnB,CAAC,SAAS,4BAA4B,GAClC,IAAI,CAC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