occam-verify-cli 1.0.388 → 1.0.404
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/lib/action/verify.js +3 -3
- package/lib/assignment/equality.js +2 -2
- package/lib/context/file.js +11 -11
- package/lib/context/local.js +38 -61
- package/lib/context/partial.js +10 -10
- package/lib/context/temporary.js +755 -0
- package/lib/mixins/statement/verify.js +38 -16
- package/lib/mixins/step/unify.js +7 -8
- package/lib/node/argument.js +4 -4
- package/lib/node/assertion/contained.js +6 -6
- package/lib/node/assertion/defined.js +6 -6
- package/lib/node/assertion/property.js +6 -6
- package/lib/node/assertion/satisfies.js +6 -6
- package/lib/node/assertion/subproof.js +6 -6
- package/lib/node/assertion/type.js +6 -6
- package/lib/node/assertion.js +107 -0
- package/lib/node/assumption.js +134 -0
- package/lib/node/axiom.js +6 -6
- package/lib/node/{topLevelAssertion.js → axiomLemmaTheoremConjecture.js} +12 -12
- package/lib/node/body.js +4 -5
- package/lib/node/combinator.js +4 -4
- package/lib/node/conclusion.js +4 -4
- package/lib/node/conjecture.js +6 -6
- package/lib/node/constructor.js +4 -4
- package/lib/node/declaration/combinator.js +6 -6
- package/lib/node/declaration/complexType.js +6 -6
- package/lib/node/declaration/constructor.js +6 -6
- package/lib/node/declaration/metavariable.js +6 -6
- package/lib/node/declaration/property.js +6 -6
- package/lib/node/declaration/simpleType.js +6 -6
- package/lib/node/declaration/typePrefix.js +6 -6
- package/lib/node/declaration/variable.js +6 -6
- package/lib/node/declaration.js +6 -22
- package/lib/node/deduction.js +4 -4
- package/lib/node/derivation.js +4 -4
- package/lib/node/document.js +107 -0
- package/lib/node/equality.js +4 -4
- package/lib/node/error.js +4 -4
- package/lib/node/frame.js +25 -14
- package/lib/node/header.js +4 -4
- package/lib/node/hypothesis.js +4 -4
- package/lib/node/judgement.js +8 -8
- package/lib/node/label.js +4 -4
- package/lib/node/labels.js +4 -4
- package/lib/node/lemma.js +6 -6
- package/lib/node/metaArgument.js +4 -4
- package/lib/node/metaLemma.js +6 -6
- package/lib/node/{topLevelMetaAssertion.js → metaLemmaMetaTheorem.js} +12 -12
- package/lib/node/metaType.js +4 -4
- package/lib/node/metatheorem.js +6 -6
- package/lib/node/metavariable.js +4 -4
- package/lib/node/nonsense.js +4 -4
- package/lib/node/parameter.js +4 -4
- package/lib/node/parenthesisedLabel.js +4 -4
- package/lib/node/parenthesisedLabels.js +4 -4
- package/lib/node/placeholder.js +107 -0
- package/lib/node/premise.js +4 -4
- package/lib/node/procedureCall.js +4 -4
- package/lib/node/procedureReference.js +4 -4
- package/lib/node/proof.js +4 -4
- package/lib/node/property.js +4 -4
- package/lib/node/propertyRelation.js +4 -4
- package/lib/node/qualification.js +4 -4
- package/lib/node/reference.js +4 -4
- package/lib/node/rule.js +4 -4
- package/lib/node/section.js +4 -4
- package/lib/node/signature.js +4 -4
- package/lib/node/statement.js +15 -4
- package/lib/node/step.js +4 -4
- package/lib/node/subDerivation.js +4 -4
- package/lib/node/subproof.js +4 -4
- package/lib/node/substitution/frame.js +28 -6
- package/lib/node/substitution/statement.js +6 -6
- package/lib/node/substitution/term.js +28 -6
- package/lib/node/substitution.js +107 -0
- package/lib/node/supposition.js +4 -4
- package/lib/node/term.js +27 -4
- package/lib/node/theorem.js +6 -6
- package/lib/node/type.js +4 -4
- package/lib/node/typePrefix.js +4 -4
- package/lib/node/types.js +4 -4
- package/lib/node/variable.js +4 -4
- package/lib/nominal/parser.js +3 -3
- package/lib/nonTerminalNode.js +222 -0
- package/lib/nonTerminalNodeMap.js +5 -3
- package/lib/ontology/assertion/contained.js +80 -39
- package/lib/ontology/assertion/defined.js +80 -39
- package/lib/ontology/assertion/property.js +71 -29
- package/lib/ontology/assertion/satisfies.js +73 -25
- package/lib/ontology/assertion/subproof.js +95 -41
- package/lib/ontology/assertion/type.js +74 -18
- package/lib/ontology/assertion.js +66 -0
- package/lib/ontology/assumption.js +379 -0
- package/lib/ontology/axiom.js +8 -11
- package/lib/ontology/combinator/bracketed.js +17 -3
- package/lib/ontology/combinator.js +17 -3
- package/lib/ontology/conclusion.js +38 -9
- package/lib/ontology/constructor/bracketed.js +17 -3
- package/lib/ontology/constructor.js +17 -3
- package/lib/ontology/declaration/combinator.js +75 -33
- package/lib/ontology/declaration/complexType.js +110 -63
- package/lib/ontology/declaration/constructor.js +81 -38
- package/lib/ontology/declaration/metavariable.js +87 -39
- package/lib/ontology/declaration/simpleType.js +95 -48
- package/lib/ontology/declaration/typePrefix.js +87 -40
- package/lib/ontology/declaration/variable.js +87 -39
- package/lib/ontology/declaration.js +13 -313
- package/lib/ontology/deduction.js +38 -9
- package/lib/ontology/equivalence.js +295 -0
- package/lib/ontology/equivalences.js +264 -0
- package/lib/ontology/frame.js +83 -51
- package/lib/ontology/hypothesis.js +11 -11
- package/lib/ontology/judgement.js +8 -8
- package/lib/ontology/label.js +5 -6
- package/lib/ontology/metavariable.js +14 -15
- package/lib/ontology/premise.js +60 -21
- package/lib/ontology/procedureCall.js +15 -15
- package/lib/ontology/procedureReference.js +1 -1
- package/lib/ontology/proof.js +2 -2
- package/lib/ontology/reference.js +6 -13
- package/lib/ontology/rule.js +69 -71
- package/lib/ontology/section.js +2 -2
- package/lib/ontology/signature.js +2 -2
- package/lib/ontology/statement.js +36 -24
- package/lib/ontology/step.js +38 -26
- package/lib/ontology/subproof.js +12 -13
- package/lib/ontology/substitution/frame.js +69 -21
- package/lib/ontology/substitution/reference.js +24 -9
- package/lib/ontology/substitution/statement.js +137 -76
- package/lib/ontology/substitution/term.js +75 -35
- package/lib/ontology/substitution.js +50 -44
- package/lib/ontology/substitutions.js +425 -0
- package/lib/ontology/supposition.js +69 -29
- package/lib/ontology/term.js +35 -37
- package/lib/ontology/topLevelAssertion.js +16 -17
- package/lib/ontology/topLevelMetaAssertion.js +3 -4
- package/lib/ontology/variable.js +9 -14
- package/lib/preamble.js +7 -4
- package/lib/ruleNames.js +20 -12
- package/lib/unifier/intrinsicLevel.js +4 -5
- package/lib/unifier/metaLevel.js +24 -24
- package/lib/utilities/brackets.js +4 -21
- package/lib/utilities/context.js +6 -6
- package/lib/utilities/frame.js +18 -0
- package/lib/utilities/json.js +24 -1
- package/lib/utilities/metavariable.js +18 -0
- package/lib/utilities/statement.js +18 -0
- package/lib/utilities/substitutions.js +43 -30
- package/lib/utilities/unification.js +10 -16
- package/lib/utilities/variable.js +18 -0
- package/package.json +10 -10
- package/src/action/verify.js +2 -2
- package/src/assignment/equality.js +1 -1
- package/src/context/file.js +13 -11
- package/src/context/local.js +40 -65
- package/src/context/partial.js +9 -14
- package/src/context/temporary.js +463 -0
- package/src/mixins/statement/verify.js +60 -23
- package/src/mixins/step/unify.js +6 -6
- package/src/node/argument.js +1 -1
- package/src/node/assertion/contained.js +3 -3
- package/src/node/assertion/defined.js +3 -3
- package/src/node/assertion/property.js +3 -3
- package/src/node/assertion/satisfies.js +3 -3
- package/src/node/assertion/subproof.js +3 -3
- package/src/node/assertion/type.js +3 -3
- package/src/node/assertion.js +7 -0
- package/src/node/assumption.js +35 -0
- package/src/node/axiom.js +3 -3
- package/src/node/{topLevelAssertion.js → axiomLemmaTheoremConjecture.js} +2 -2
- package/src/node/body.js +1 -3
- package/src/node/combinator.js +1 -1
- package/src/node/conclusion.js +1 -1
- package/src/node/conjecture.js +3 -3
- package/src/node/constructor.js +1 -1
- package/src/node/declaration/combinator.js +3 -3
- package/src/node/declaration/complexType.js +3 -3
- package/src/node/declaration/constructor.js +3 -3
- package/src/node/declaration/metavariable.js +3 -3
- package/src/node/declaration/property.js +3 -3
- package/src/node/declaration/simpleType.js +3 -3
- package/src/node/declaration/typePrefix.js +3 -3
- package/src/node/declaration/variable.js +3 -3
- package/src/node/declaration.js +2 -18
- package/src/node/deduction.js +1 -1
- package/src/node/derivation.js +1 -1
- package/src/node/document.js +7 -0
- package/src/node/equality.js +1 -1
- package/src/node/error.js +1 -1
- package/src/node/frame.js +23 -11
- package/src/node/header.js +1 -1
- package/src/node/hypothesis.js +1 -1
- package/src/node/judgement.js +6 -6
- package/src/node/label.js +1 -1
- package/src/node/labels.js +1 -1
- package/src/node/lemma.js +3 -3
- package/src/node/metaArgument.js +1 -1
- package/src/node/metaLemma.js +3 -3
- package/src/node/{topLevelMetaAssertion.js → metaLemmaMetaTheorem.js} +2 -2
- package/src/node/metaType.js +1 -1
- package/src/node/metatheorem.js +3 -3
- package/src/node/metavariable.js +1 -1
- package/src/node/nonsense.js +1 -1
- package/src/node/parameter.js +1 -1
- package/src/node/parenthesisedLabel.js +1 -1
- package/src/node/parenthesisedLabels.js +1 -1
- package/src/node/placeholder.js +7 -0
- package/src/node/premise.js +1 -1
- package/src/node/procedureCall.js +1 -1
- package/src/node/procedureReference.js +1 -1
- package/src/node/proof.js +1 -1
- package/src/node/property.js +1 -1
- package/src/node/propertyRelation.js +1 -1
- package/src/node/qualification.js +1 -1
- package/src/node/reference.js +1 -1
- package/src/node/rule.js +2 -2
- package/src/node/section.js +1 -1
- package/src/node/signature.js +1 -1
- package/src/node/statement.js +13 -1
- package/src/node/step.js +1 -1
- package/src/node/subDerivation.js +1 -1
- package/src/node/subproof.js +1 -1
- package/src/node/substitution/frame.js +29 -3
- package/src/node/substitution/statement.js +3 -3
- package/src/node/substitution/term.js +29 -3
- package/src/node/substitution.js +7 -0
- package/src/node/supposition.js +1 -1
- package/src/node/term.js +27 -1
- package/src/node/theorem.js +3 -3
- package/src/node/type.js +1 -1
- package/src/node/typePrefix.js +1 -1
- package/src/node/types.js +1 -1
- package/src/node/variable.js +1 -1
- package/src/nominal/parser.js +2 -2
- package/src/{node/nonTerminal.js → nonTerminalNode.js} +31 -25
- package/src/nonTerminalNodeMap.js +10 -5
- package/src/ontology/assertion/contained.js +21 -32
- package/src/ontology/assertion/defined.js +20 -31
- package/src/ontology/assertion/property.js +7 -20
- package/src/ontology/assertion/satisfies.js +8 -16
- package/src/ontology/assertion/subproof.js +36 -42
- package/src/ontology/assertion/type.js +10 -11
- package/src/ontology/assertion.js +23 -0
- package/src/ontology/assumption.js +385 -0
- package/src/ontology/axiom.js +7 -16
- package/src/ontology/combinator/bracketed.js +2 -0
- package/src/ontology/combinator.js +2 -0
- package/src/ontology/conclusion.js +51 -10
- package/src/ontology/constructor/bracketed.js +2 -0
- package/src/ontology/constructor.js +2 -0
- package/src/ontology/declaration/combinator.js +15 -24
- package/src/ontology/declaration/complexType.js +57 -53
- package/src/ontology/declaration/constructor.js +25 -31
- package/src/ontology/declaration/metavariable.js +25 -30
- package/src/ontology/declaration/simpleType.js +34 -38
- package/src/ontology/declaration/typePrefix.js +23 -31
- package/src/ontology/declaration/variable.js +26 -31
- package/src/ontology/declaration.js +8 -339
- package/src/ontology/deduction.js +51 -10
- package/src/{equivalence.js → ontology/equivalence.js} +4 -3
- package/src/{equivalences.js → ontology/equivalences.js} +14 -12
- package/src/ontology/frame.js +93 -66
- package/src/ontology/hypothesis.js +8 -8
- package/src/ontology/judgement.js +8 -8
- package/src/ontology/label.js +2 -7
- package/src/ontology/metavariable.js +14 -17
- package/src/ontology/premise.js +82 -25
- package/src/ontology/procedureCall.js +14 -14
- package/src/ontology/procedureReference.js +2 -2
- package/src/ontology/proof.js +1 -1
- package/src/ontology/reference.js +5 -9
- package/src/ontology/rule.js +79 -82
- package/src/ontology/section.js +1 -1
- package/src/ontology/signature.js +1 -1
- package/src/ontology/statement.js +37 -27
- package/src/ontology/step.js +45 -28
- package/src/ontology/subproof.js +10 -10
- package/src/ontology/substitution/frame.js +72 -26
- package/src/ontology/substitution/reference.js +8 -6
- package/src/ontology/substitution/statement.js +95 -76
- package/src/ontology/substitution/term.js +81 -41
- package/src/ontology/substitution.js +35 -34
- package/src/{substitutions.js → ontology/substitutions.js} +29 -28
- package/src/ontology/supposition.js +88 -28
- package/src/ontology/term.js +31 -43
- package/src/ontology/topLevelAssertion.js +16 -18
- package/src/ontology/topLevelMetaAssertion.js +3 -3
- package/src/ontology/variable.js +10 -17
- package/src/preamble.js +6 -3
- package/src/ruleNames.js +10 -8
- package/src/unifier/intrinsicLevel.js +5 -6
- package/src/unifier/metaLevel.js +32 -29
- package/src/utilities/brackets.js +3 -29
- package/src/utilities/context.js +5 -5
- package/src/utilities/frame.js +13 -0
- package/src/utilities/json.js +28 -0
- package/src/utilities/metavariable.js +13 -0
- package/src/utilities/statement.js +13 -0
- package/src/utilities/substitutions.js +59 -33
- package/src/utilities/unification.js +8 -24
- package/src/utilities/variable.js +13 -0
- package/lib/equivalence.js +0 -294
- package/lib/equivalences.js +0 -263
- package/lib/node/nonTerminal.js +0 -218
- package/lib/substitutions.js +0 -424
package/src/ontology/variable.js
CHANGED
|
@@ -127,13 +127,12 @@ export default define(class Variable {
|
|
|
127
127
|
|
|
128
128
|
variable = this; ///
|
|
129
129
|
|
|
130
|
-
const
|
|
130
|
+
const substitution = substitutions.findSubstitutionByVariable(variable);
|
|
131
131
|
|
|
132
|
-
if (
|
|
132
|
+
if (substitution !== null) {
|
|
133
133
|
context = specificContext; ///
|
|
134
134
|
|
|
135
|
-
const
|
|
136
|
-
substitutionTermEqualToTerm = substitution.isTermEqualTo(term, context);
|
|
135
|
+
const substitutionTermEqualToTerm = substitution.isTermEqualToTerm(term, context);
|
|
137
136
|
|
|
138
137
|
if (substitutionTermEqualToTerm) {
|
|
139
138
|
termUnifies = true;
|
|
@@ -147,26 +146,20 @@ export default define(class Variable {
|
|
|
147
146
|
|
|
148
147
|
context = specificContext; ///
|
|
149
148
|
|
|
150
|
-
const
|
|
151
|
-
let verifiesAhead = false;
|
|
149
|
+
const termNode = term.getNode();
|
|
152
150
|
|
|
153
|
-
|
|
154
|
-
variableType = variable.getType(),
|
|
155
|
-
termTypeEqualToOrSubTypeOfVariableType = termType.isEqualToOrSubTypeOf(variableType);
|
|
151
|
+
term = context.findTermByTermNode(termNode);
|
|
156
152
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
153
|
+
const termType = term.getType(),
|
|
154
|
+
variableType = variable.getType(),
|
|
155
|
+
termTypeEqualToOrSubTypeOfVariableType = termType.isEqualToOrSubTypeOf(variableType);
|
|
160
156
|
|
|
161
|
-
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
if (termVerifies) {
|
|
157
|
+
if (termTypeEqualToOrSubTypeOfVariableType) {
|
|
165
158
|
const { TermSubstitution } = ontology,
|
|
166
159
|
termSubstitution = TermSubstitution.fromTernAndVariable(term, variable, context),
|
|
167
160
|
substitution = termSubstitution; ///
|
|
168
161
|
|
|
169
|
-
substitutions.addSubstitution(substitution,
|
|
162
|
+
substitutions.addSubstitution(substitution, context);
|
|
170
163
|
|
|
171
164
|
termUnifies = true;
|
|
172
165
|
}
|
package/src/preamble.js
CHANGED
|
@@ -31,23 +31,26 @@ import Conclusion from "./ontology/conclusion";
|
|
|
31
31
|
import Derivation from "./ontology/derivation";
|
|
32
32
|
import Combinator from "./ontology/combinator";
|
|
33
33
|
import Hypothesis from "./ontology/hypothesis";
|
|
34
|
+
import Assumption from "./ontology/assumption";
|
|
34
35
|
import Constructor from "./ontology/constructor";
|
|
35
|
-
import Declaration from "./ontology/declaration";
|
|
36
36
|
import Supposition from "./ontology/supposition";
|
|
37
37
|
import Metatheorem from "./ontology/metatheorem";
|
|
38
|
+
import Equivalence from "./ontology/equivalence";
|
|
39
|
+
import Equivalences from "./ontology/equivalences";
|
|
38
40
|
import Metavariable from "./ontology/metavariable";
|
|
41
|
+
import Substitutions from "./ontology/substitutions";
|
|
39
42
|
import ProcedureCall from "./ontology/procedureCall";
|
|
40
43
|
import SubDerivation from "./ontology/subDerivation";
|
|
41
44
|
import TypeAssertion from "./ontology/assertion/type";
|
|
42
|
-
import DefinedAssertion from "./ontology/assertion/defined";
|
|
43
45
|
import PropertyRelation from "./ontology/propertyRelation";
|
|
46
|
+
import DefinedAssertion from "./ontology/assertion/defined";
|
|
44
47
|
import TermSubstitution from "./ontology/substitution/term";
|
|
45
48
|
import FrameSubstitution from "./ontology/substitution/frame";
|
|
46
49
|
import SubproofAssertion from "./ontology/assertion/subproof";
|
|
47
50
|
import PropertyAssertion from "./ontology/assertion/property";
|
|
51
|
+
import ProcedureReference from "./ontology/procedureReference";
|
|
48
52
|
import ContainedAssertion from "./ontology/assertion/contained";
|
|
49
53
|
import SatisfiesAssertion from "./ontology/assertion/satisfies";
|
|
50
|
-
import ProcedureReference from "./ontology/procedureReference";
|
|
51
54
|
import VariableDeclaration from "./ontology/declaration/variable";
|
|
52
55
|
import BracketedCombinator from "./ontology/combinator/bracketed";
|
|
53
56
|
import BracketedConstructor from "./ontology/constructor/bracketed";
|
package/src/ruleNames.js
CHANGED
|
@@ -21,28 +21,30 @@ export const EQUALITY_RULE_NAME = "equality";
|
|
|
21
21
|
export const VARIABLE_RULE_NAME = "variable";
|
|
22
22
|
export const SUBPROOF_RULE_NAME = "subproof";
|
|
23
23
|
export const NONSENSE_RULE_NAME = "nonsense";
|
|
24
|
-
export const
|
|
24
|
+
export const DOCUMENT_RULE_NAME = "document";
|
|
25
|
+
export const RULE_BODY_RULE_NAME = "ruleBody";
|
|
25
26
|
export const META_TYPE_RULE_NAME = "metaType";
|
|
27
|
+
export const SIGNATURE_RULE_NAME = "signature";
|
|
26
28
|
export const PARAMETER_RULE_NAME = "parameter";
|
|
27
29
|
export const DEDUCTION_RULE_NAME = "deduction";
|
|
28
30
|
export const JUDGEMENT_RULE_NAME = "judgement";
|
|
29
31
|
export const REFERENCE_RULE_NAME = "reference";
|
|
30
32
|
export const STATEMENT_RULE_NAME = "statement";
|
|
31
|
-
export const RULE_BODY_RULE_NAME = "ruleBody";
|
|
32
33
|
export const META_LEMMA_RULE_NAME = "metaLemma";
|
|
34
|
+
export const AXIOM_BODY_RULE_NAME = "axiomBody";
|
|
35
|
+
export const LEMMA_BODY_RULE_NAME = "lemmaBody";
|
|
33
36
|
export const COMBINATOR_RULE_NAME = "combinator";
|
|
34
37
|
export const CONCLUSION_RULE_NAME = "conclusion";
|
|
35
38
|
export const CONJECTURE_RULE_NAME = "conjecture";
|
|
36
39
|
export const DERIVATION_RULE_NAME = "derivation";
|
|
37
40
|
export const HYPOTHESIS_RULE_NAME = "hypothesis";
|
|
38
|
-
export const
|
|
39
|
-
export const
|
|
41
|
+
export const ASSUMPTION_RULE_NAME = "assumption";
|
|
42
|
+
export const PLACEHOLDER_RULE_NAME = "_"; ///
|
|
43
|
+
export const RULE_HEADER_RULE_NAME = "ruleHeader";
|
|
40
44
|
export const TYPE_PREFIX_RULE_NAME = "typePrefix";
|
|
41
45
|
export const SUPPOSITION_RULE_NAME = "supposition";
|
|
42
46
|
export const CONSTRUCTOR_RULE_NAME = "constructor";
|
|
43
|
-
export const DECLARATION_RULE_NAME = "declaration";
|
|
44
47
|
export const METATHEOREM_RULE_NAME = "metatheorem";
|
|
45
|
-
export const RULE_HEADER_RULE_NAME = "ruleHeader";
|
|
46
48
|
export const AXIOM_HEADER_RULE_NAME = "axiomHeader";
|
|
47
49
|
export const LEMMA_HEADER_RULE_NAME = "lemmaHeader";
|
|
48
50
|
export const THEOREM_BODY_RULE_NAME = "theoremBody";
|
|
@@ -57,18 +59,18 @@ export const META_LEMMA_BODY_RULE_NAME = "metaLemmaBody";
|
|
|
57
59
|
export const CONJECTURE_BODY_RULE_NAME = "conjectureBody";
|
|
58
60
|
export const METATHEOREM_BODY_RULE_NAME = "metatheoremBody";
|
|
59
61
|
export const META_LEMMA_HEADER_RULE_NAME = "metaLemmaHeader";
|
|
62
|
+
export const CONJECTURE_HEADER_RULE_NAME = "conjectureHeader";
|
|
60
63
|
export const PROPERTY_RELATION_RULE_NAME = "propertyRelation";
|
|
61
64
|
export const DEFINED_ASSERTION_RULE_NAME = "definedAssertion";
|
|
62
65
|
export const TERM_SUBSTITUTION_RULE_NAME = "termSubstitution";
|
|
63
|
-
export const CONJECTURE_HEADER_RULE_NAME = "conjectureHeader";
|
|
64
66
|
export const METATHEOREM_HEADER_RULE_NAME = "metatheoremHeader";
|
|
65
67
|
export const PROPERTY_ASSERTION_RULE_NAME = "propertyAssertion";
|
|
66
68
|
export const SUBPROOF_ASSERTION_RULE_NAME = "subproofAssertion";
|
|
67
69
|
export const FRAME_SUBSTITUTION_RULE_NAME = "frameSubstitution";
|
|
70
|
+
export const PARENTHESISED_LABEL_RULE_NAME = "parenthesisedLabel";
|
|
68
71
|
export const PROCEDURE_REFERENCE_RULE_NAME = "procedureReference";
|
|
69
72
|
export const CONTAINED_ASSERTION_RULE_NAME = "containedAssertion";
|
|
70
73
|
export const SATISFIES_ASSERTION_RULE_NAME = "satisfiesAssertion";
|
|
71
|
-
export const PARENTHESISED_LABEL_RULE_NAME = "parenthesisedLabel";
|
|
72
74
|
export const PARENTHESISED_LABELS_RULE_NAME = "parenthesisedLabels";
|
|
73
75
|
export const PROPERTY_DECLARATION_RULE_NAME = "propertyDeclaration";
|
|
74
76
|
export const VARIABLE_DECLARATION_RULE_NAME = "variableDeclaration";
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../ontology";
|
|
4
3
|
import Unifier from "../unifier";
|
|
5
4
|
|
|
6
5
|
import { nodeQuery } from "../utilities/query";
|
|
@@ -26,19 +25,19 @@ class IntrinsicLevelUnifier extends Unifier {
|
|
|
26
25
|
unify: (generalTermVariableNode, specificTermNode, substitutions, generalContext, specificContext) => {
|
|
27
26
|
let termUnifies;
|
|
28
27
|
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const termNode = specificTermNode, ///
|
|
29
|
+
variableNode = generalTermVariableNode, ///
|
|
30
|
+
variableIdentifier = variableNode.getVariableIdentifier();
|
|
32
31
|
|
|
33
32
|
let context;
|
|
34
33
|
|
|
35
34
|
context = generalContext; ///
|
|
36
35
|
|
|
37
|
-
const variable =
|
|
36
|
+
const variable = context.findVariableByVariableIdentifier(variableIdentifier);
|
|
38
37
|
|
|
39
38
|
context = specificContext; ///
|
|
40
39
|
|
|
41
|
-
const term =
|
|
40
|
+
const term = context.findTermByTermNode(termNode);
|
|
42
41
|
|
|
43
42
|
termUnifies = variable.unifyTerm(term, substitutions, generalContext, specificContext);
|
|
44
43
|
|
package/src/unifier/metaLevel.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../ontology";
|
|
4
3
|
import Unifier from "../unifier";
|
|
4
|
+
import ontology from "../ontology";
|
|
5
5
|
|
|
6
6
|
import { nodeQuery } from "../utilities/query";
|
|
7
|
-
import
|
|
7
|
+
import { metavariableNameFromMetavariableNode } from "../utilities/metavariable";
|
|
8
8
|
|
|
9
9
|
const termNodeQuery = nodeQuery("/term"),
|
|
10
10
|
frameNodeQuery = nodeQuery("/frame"),
|
|
11
11
|
statementNodeQuery = nodeQuery("/statement"),
|
|
12
12
|
termVariableNodeQuery = nodeQuery("/term/variable!"),
|
|
13
13
|
statementMetavariableNodeQuery = nodeQuery("/statement/metavariable!"),
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
assumptionMetavariableNodeQuery = nodeQuery("/assumption/metavariable!"),
|
|
15
|
+
frameAssumptionMetavariableNodeQuery = nodeQuery("/frame/assumption!/metavariable!");
|
|
16
16
|
|
|
17
17
|
class MetaLevelUnifier extends Unifier {
|
|
18
18
|
unify(generalNonTerminalNode, specificNonTerminalNode, substitutions, generalContext, specificContext) {
|
|
@@ -32,30 +32,32 @@ class MetaLevelUnifier extends Unifier {
|
|
|
32
32
|
unify: (generalStatementMetavariableNode, specificStatementNode, substitutions, generalContext, specificContext) => {
|
|
33
33
|
let statementUnifies;
|
|
34
34
|
|
|
35
|
-
const { Metavariable, Statement } = ontology; ///
|
|
36
|
-
|
|
37
35
|
let context,
|
|
36
|
+
statement,
|
|
38
37
|
statementNode;
|
|
39
38
|
|
|
40
39
|
context = generalContext; ///
|
|
41
40
|
|
|
42
41
|
const metavariableNode = generalStatementMetavariableNode, ///
|
|
43
|
-
|
|
42
|
+
metavariableName = metavariableNameFromMetavariableNode(metavariableNode),
|
|
43
|
+
metavariable = context.findMetavariableByMetavariableName(metavariableName);
|
|
44
44
|
|
|
45
45
|
const metavariableNodeParentNode = metavariableNode.getParentNode();
|
|
46
46
|
|
|
47
47
|
statementNode = metavariableNodeParentNode; ///
|
|
48
48
|
|
|
49
|
+
statement = context.findStatementByStatementNode(statementNode);
|
|
50
|
+
|
|
49
51
|
const { TermSubstitution, FrameSubstitution } = ontology,
|
|
50
|
-
frameSubstitution = FrameSubstitution.
|
|
51
|
-
termSubstitution = TermSubstitution.
|
|
52
|
+
frameSubstitution = FrameSubstitution.fromStatement(statement, context),
|
|
53
|
+
termSubstitution = TermSubstitution.fromStatement(statement, context),
|
|
52
54
|
substitution = (frameSubstitution || termSubstitution);
|
|
53
55
|
|
|
54
56
|
context = specificContext; ///
|
|
55
57
|
|
|
56
58
|
statementNode = specificStatementNode; ///
|
|
57
59
|
|
|
58
|
-
|
|
60
|
+
statement = context.findStatementByStatementNode(statementNode);
|
|
59
61
|
|
|
60
62
|
statementUnifies = metavariable.unifyStatement(statement, substitution, substitutions, generalContext, specificContext);
|
|
61
63
|
|
|
@@ -63,24 +65,24 @@ class MetaLevelUnifier extends Unifier {
|
|
|
63
65
|
}
|
|
64
66
|
},
|
|
65
67
|
{
|
|
66
|
-
generalNodeQuery:
|
|
68
|
+
generalNodeQuery: frameAssumptionMetavariableNodeQuery,
|
|
67
69
|
specificNodeQuery: frameNodeQuery,
|
|
68
|
-
unify: (
|
|
70
|
+
unify: (generalFrameAssumptionMetavariableNode, specificFrameNode, substitutions, generalContext, specificContext) => {
|
|
69
71
|
let frameUnifies;
|
|
70
72
|
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
const frameNode = specificFrameNode, ///
|
|
74
|
+
metavariableNode = generalFrameAssumptionMetavariableNode, ///
|
|
75
|
+
metavariableName = metavariableNameFromMetavariableNode(metavariableNode);
|
|
74
76
|
|
|
75
77
|
let context;
|
|
76
78
|
|
|
77
79
|
context = generalContext; ///
|
|
78
80
|
|
|
79
|
-
const metavariable =
|
|
81
|
+
const metavariable = context.findMetavariableByMetavariableName(metavariableName);
|
|
80
82
|
|
|
81
83
|
context = specificContext; ///
|
|
82
84
|
|
|
83
|
-
const frame =
|
|
85
|
+
const frame = context.findFrameByFrameNode(frameNode);
|
|
84
86
|
|
|
85
87
|
frameUnifies = metavariable.unifyFrame(frame, substitutions, generalContext, specificContext);
|
|
86
88
|
|
|
@@ -93,19 +95,19 @@ class MetaLevelUnifier extends Unifier {
|
|
|
93
95
|
unify: (generalTermVariableNode, specificTermNode, substitutions, generalContext, specificContext) => {
|
|
94
96
|
let termUnifies;
|
|
95
97
|
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
const termNode = specificTermNode, ///
|
|
99
|
+
variableNode = generalTermVariableNode, ///
|
|
100
|
+
variableIdentifier = variableNode.getVariableIdentifier();
|
|
99
101
|
|
|
100
102
|
let context;
|
|
101
103
|
|
|
102
104
|
context = generalContext; ///
|
|
103
105
|
|
|
104
|
-
const variable =
|
|
106
|
+
const variable = context.findVariableByVariableIdentifier(variableIdentifier);
|
|
105
107
|
|
|
106
108
|
context = specificContext; ///
|
|
107
109
|
|
|
108
|
-
const term =
|
|
110
|
+
const term = context.findTermByTermNode(termNode);
|
|
109
111
|
|
|
110
112
|
termUnifies = variable.unifyTerm(term, substitutions, generalContext, specificContext);
|
|
111
113
|
|
|
@@ -113,25 +115,26 @@ class MetaLevelUnifier extends Unifier {
|
|
|
113
115
|
}
|
|
114
116
|
},
|
|
115
117
|
{
|
|
116
|
-
generalNodeQuery:
|
|
117
|
-
specificNodeQuery:
|
|
118
|
-
unify: (
|
|
118
|
+
generalNodeQuery: assumptionMetavariableNodeQuery,
|
|
119
|
+
specificNodeQuery: assumptionMetavariableNodeQuery,
|
|
120
|
+
unify: (generalAssumptionMetavariableNode, specificAssumptionMetavariableNode, substitutions, generalContext, specificContext) => {
|
|
119
121
|
let referenceUnifies;
|
|
120
122
|
|
|
121
|
-
const {
|
|
123
|
+
const { Reference } = ontology;
|
|
122
124
|
|
|
123
125
|
let context,
|
|
124
126
|
metavariableNode;
|
|
125
127
|
|
|
126
128
|
context = generalContext; ///
|
|
127
129
|
|
|
128
|
-
metavariableNode =
|
|
130
|
+
metavariableNode = generalAssumptionMetavariableNode; ///
|
|
129
131
|
|
|
130
|
-
const
|
|
132
|
+
const metavariableName = metavariableNameFromMetavariableNode(metavariableNode),
|
|
133
|
+
metavariable = context.findMetavariableByMetavariableName(metavariableName);
|
|
131
134
|
|
|
132
135
|
context = specificContext; ///
|
|
133
136
|
|
|
134
|
-
metavariableNode =
|
|
137
|
+
metavariableNode = specificAssumptionMetavariableNode; ///
|
|
135
138
|
|
|
136
139
|
const reference = Reference.fromMetavariableNode(metavariableNode, context);
|
|
137
140
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import ontology from "../ontology";
|
|
4
|
-
import
|
|
4
|
+
import TemporaryContext from "../context/temporary";
|
|
5
5
|
import combinatorBracketedContext from "../context/bracketed/combinator";
|
|
6
6
|
import constructorBracketedContext from "../context/bracketed/constructor";
|
|
7
7
|
|
|
@@ -21,22 +21,6 @@ export function stripBracketsFromTerm(term, context) {
|
|
|
21
21
|
return term;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export function stripBracketsFromReference(reference, context) {
|
|
25
|
-
const referenceNode = reference.getNode(),
|
|
26
|
-
bracketedReferenceChildNode = bracketedReferenceChildNodeFromReferenceNode(referenceNode);
|
|
27
|
-
|
|
28
|
-
if (bracketedReferenceChildNode !== null) {
|
|
29
|
-
context = contextFromReference(reference, context); ///
|
|
30
|
-
|
|
31
|
-
const { Reference } = ontology,
|
|
32
|
-
referenceNode = bracketedReferenceChildNode; ///
|
|
33
|
-
|
|
34
|
-
reference = Reference.fromReferenceNode(referenceNode, context);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return reference;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
24
|
export function stripBracketsFromStatement(statement, context) {
|
|
41
25
|
const statementNode = statement.getNode(),
|
|
42
26
|
bracketedStatementChildNode = bracketedStatementChildNodeFromStatementNode(statementNode);
|
|
@@ -105,22 +89,12 @@ export function bracketedStatementChildNodeFromStatementNode(statementNode) {
|
|
|
105
89
|
return bracketedStatementChildNode;
|
|
106
90
|
}
|
|
107
91
|
|
|
108
|
-
function contextFromReference(reference, context) {
|
|
109
|
-
const referenceTokens = reference.getTokens(),
|
|
110
|
-
tokens = referenceTokens, ///
|
|
111
|
-
localContext = LocalContext.fromContextAndTokens(context, tokens);
|
|
112
|
-
|
|
113
|
-
context = localContext; ///
|
|
114
|
-
|
|
115
|
-
return context;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
92
|
function contextFromStatement(statement, context) {
|
|
119
93
|
const statementTokens = statement.getTokens(),
|
|
120
94
|
tokens = statementTokens, ///
|
|
121
|
-
|
|
95
|
+
temporaryContext = TemporaryContext.fromContextAndTokens(context, tokens);
|
|
122
96
|
|
|
123
|
-
context =
|
|
97
|
+
context = temporaryContext; ///
|
|
124
98
|
|
|
125
99
|
return context;
|
|
126
100
|
}
|
package/src/utilities/context.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import ontology from "../ontology";
|
|
4
|
-
import
|
|
4
|
+
import TemporaryContext from "../context/temporary";
|
|
5
5
|
|
|
6
6
|
export function metavariableFromFrame(frame, context) {
|
|
7
7
|
context = contextFromFrame(frame, context); ///
|
|
@@ -106,9 +106,9 @@ export function satisfiesAssertionFromStatement(statement, context) {
|
|
|
106
106
|
function contextFromFrame(frame, context) {
|
|
107
107
|
const frameTokens = frame.getTokens(),
|
|
108
108
|
tokens = frameTokens, ///
|
|
109
|
-
|
|
109
|
+
temporaryContext = TemporaryContext.fromContextAndTokens(context, tokens);
|
|
110
110
|
|
|
111
|
-
context =
|
|
111
|
+
context = temporaryContext; ///
|
|
112
112
|
|
|
113
113
|
return context;
|
|
114
114
|
}
|
|
@@ -116,9 +116,9 @@ function contextFromFrame(frame, context) {
|
|
|
116
116
|
function contextFromStatement(statement, context) {
|
|
117
117
|
const statementTokens = statement.getTokens(),
|
|
118
118
|
tokens = statementTokens, ///
|
|
119
|
-
|
|
119
|
+
temporaryContext = TemporaryContext.fromContextAndTokens(context, tokens);
|
|
120
120
|
|
|
121
|
-
context =
|
|
121
|
+
context = temporaryContext; ///
|
|
122
122
|
|
|
123
123
|
return context;
|
|
124
124
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { nodeQuery } from "../utilities/query";
|
|
4
|
+
|
|
5
|
+
const frameMetavariableNameNodeQuery = nodeQuery("/frame/assumption!/metavariable!/@name!");
|
|
6
|
+
|
|
7
|
+
export function frameMetavariableNameFromFrameNode(frmaeNode) {
|
|
8
|
+
const frameMetavariableNameTerminalNode = frameMetavariableNameNodeQuery(frmaeNode),
|
|
9
|
+
frameMetavariableNameTerminalNodeContent = frameMetavariableNameTerminalNode.getContent(),
|
|
10
|
+
frameMetavariableName = frameMetavariableNameTerminalNodeContent; ///
|
|
11
|
+
|
|
12
|
+
return frameMetavariableName;
|
|
13
|
+
}
|
package/src/utilities/json.js
CHANGED
|
@@ -203,6 +203,22 @@ export function labelFromJSON(json, context) {
|
|
|
203
203
|
return label;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
export function framesFromJSON(json, context) {
|
|
207
|
+
let { frames } = json;
|
|
208
|
+
|
|
209
|
+
const { Frame } = ontology,
|
|
210
|
+
framesJSON = frames; ///
|
|
211
|
+
|
|
212
|
+
frames = framesJSON.map((frameJSON) => {
|
|
213
|
+
const json = frameJSON, ///
|
|
214
|
+
frame = Frame.fromJSON(json, context);
|
|
215
|
+
|
|
216
|
+
return frame;
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
return frames;
|
|
220
|
+
}
|
|
221
|
+
|
|
206
222
|
export function labelsFromJSON(json, context) {
|
|
207
223
|
let { labels } = json;
|
|
208
224
|
|
|
@@ -600,6 +616,18 @@ export function rulesToRulesJSON(rules) {
|
|
|
600
616
|
return rulesJSON;
|
|
601
617
|
}
|
|
602
618
|
|
|
619
|
+
export function framesToFramesJSON(frames) {
|
|
620
|
+
const framesJSON = frames.map((frame) => {
|
|
621
|
+
const frameJSON = frame.toJSON();
|
|
622
|
+
|
|
623
|
+
frame = frameJSON; ///
|
|
624
|
+
|
|
625
|
+
return frame;
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
return framesJSON;
|
|
629
|
+
}
|
|
630
|
+
|
|
603
631
|
export function labelsToLabelsJSON(labels) {
|
|
604
632
|
const labelsJSON = labels.map((label) => {
|
|
605
633
|
const labelJSON = label.toJSON();
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { nodeQuery } from "../utilities/query";
|
|
4
|
+
|
|
5
|
+
const metavariableNameNodeQuery = nodeQuery("/metavariable/@name!");
|
|
6
|
+
|
|
7
|
+
export function metavariableNameFromMetavariableNode(metavariableNode) {
|
|
8
|
+
const metavariableNameTerminalNode = metavariableNameNodeQuery(metavariableNode),
|
|
9
|
+
metavariableNameTerminalNodeContent = metavariableNameTerminalNode.getContent(),
|
|
10
|
+
metavariableName = metavariableNameTerminalNodeContent; ///
|
|
11
|
+
|
|
12
|
+
return metavariableName;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { nodeQuery } from "../utilities/query";
|
|
4
|
+
|
|
5
|
+
const statementMetavariableNameNodeQuery = nodeQuery("/statement/metavariable!/@name!");
|
|
6
|
+
|
|
7
|
+
export function statementMetavariableNameFromFrameNode(frmaeNode) {
|
|
8
|
+
const statementMetavariableNameTerminalNode = statementMetavariableNameNodeQuery(frmaeNode),
|
|
9
|
+
statementMetavariableNameTerminalNodeContent = statementMetavariableNameTerminalNode.getContent(),
|
|
10
|
+
statementMetavariableName = statementMetavariableNameTerminalNodeContent; ///
|
|
11
|
+
|
|
12
|
+
return statementMetavariableName;
|
|
13
|
+
}
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { nodeQuery } from "../utilities/query";
|
|
4
|
+
import { frameMetavariableNameFromFrameNode } from "../utilities/frame";
|
|
5
|
+
import { termVariableIdentifierFromTermNode } from "../utilities/variable";
|
|
6
|
+
import { statementMetavariableNameFromFrameNode } from "../utilities/statement";
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
const substitutionNodeQuery = nodeQuery("/statement/termSubstitution|frameSubstitution!");
|
|
9
|
+
|
|
10
|
+
export function termFromTermAndSubstitutions(term, substitutions, generalContext, specificContext) {
|
|
6
11
|
if (term !== null) {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
variable = Variable.fromTermNode(termNode, context);
|
|
12
|
+
const termNode = term.getNode(),
|
|
13
|
+
termSimple = term.isSimple();
|
|
10
14
|
|
|
11
15
|
term = null; ///
|
|
12
16
|
|
|
13
|
-
if (
|
|
14
|
-
const
|
|
17
|
+
if (termSimple) {
|
|
18
|
+
const termVariableIdentifier = termVariableIdentifierFromTermNode(termNode),
|
|
19
|
+
variableIdentifier = termVariableIdentifier, ///
|
|
20
|
+
variable = generalContext.findVariableByVariableIdentifier(variableIdentifier);
|
|
21
|
+
|
|
22
|
+
if (variable !== null) {
|
|
23
|
+
const substitution = substitutions.findSubstitutionByVariable(variable);
|
|
24
|
+
|
|
25
|
+
if (substitution !== null) {
|
|
26
|
+
const termSubstitution = substitution; ///
|
|
15
27
|
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
term = termSubstitution.getTerm();
|
|
29
|
+
}
|
|
18
30
|
}
|
|
19
31
|
}
|
|
20
32
|
}
|
|
@@ -22,21 +34,28 @@ export function termFromTermAndSubstitutions(term, substitutions, context) {
|
|
|
22
34
|
return term;
|
|
23
35
|
}
|
|
24
36
|
|
|
25
|
-
export function frameFromFrameAndSubstitutions(frame, substitutions,
|
|
37
|
+
export function frameFromFrameAndSubstitutions(frame, substitutions, generalContext, specificContext) {
|
|
26
38
|
if (frame !== null) {
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
metavariable = Metavariable.fromFrameNode(frameNode, context);
|
|
39
|
+
const frameNode = frame.getNode(),
|
|
40
|
+
frameSimple = frame.isSimple();
|
|
30
41
|
|
|
31
|
-
frame = null;
|
|
42
|
+
frame = null; ///
|
|
32
43
|
|
|
33
|
-
if (
|
|
34
|
-
|
|
44
|
+
if (frameSimple) {
|
|
45
|
+
const frameMetavariableName = frameMetavariableNameFromFrameNode(frameNode),
|
|
46
|
+
metavariableName = frameMetavariableName, ///
|
|
47
|
+
metavariable = generalContext.findMetavariableByMetavariableName(metavariableName);
|
|
48
|
+
|
|
49
|
+
if (metavariable !== null) {
|
|
50
|
+
let substitution = null;
|
|
35
51
|
|
|
36
|
-
|
|
52
|
+
substitution = substitutions.findSubstitutionByMetavariableAndSubstitution(metavariable, substitution);
|
|
37
53
|
|
|
38
|
-
|
|
39
|
-
|
|
54
|
+
if (substitution !== null) {
|
|
55
|
+
const frameSubstitution = substitution; ///
|
|
56
|
+
|
|
57
|
+
frame = frameSubstitution.getFrame();
|
|
58
|
+
}
|
|
40
59
|
}
|
|
41
60
|
}
|
|
42
61
|
}
|
|
@@ -44,27 +63,34 @@ export function frameFromFrameAndSubstitutions(frame, substitutions, context) {
|
|
|
44
63
|
return frame;
|
|
45
64
|
}
|
|
46
65
|
|
|
47
|
-
export function statementFromStatementAndSubstitutions(statement, substitutions,
|
|
66
|
+
export function statementFromStatementAndSubstitutions(statement, substitutions, generalContext, specificContext) {
|
|
48
67
|
if (statement !== null) {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
68
|
+
const statementNode = statement.getNode(),
|
|
69
|
+
statementSimple = statement.isSimple();
|
|
70
|
+
|
|
71
|
+
if (statementSimple) {
|
|
72
|
+
statement = null;
|
|
52
73
|
|
|
53
|
-
|
|
74
|
+
let substitution = null;
|
|
54
75
|
|
|
55
|
-
|
|
56
|
-
|
|
76
|
+
const substitutionNode = substitutionNodeQuery(statementNode);
|
|
77
|
+
|
|
78
|
+
if (substitutionNode !== null) {
|
|
79
|
+
substitution = generalContext.findSubstitutionBySubstitutionNode(substitutionNode);
|
|
80
|
+
}
|
|
57
81
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
82
|
+
const statementMetavariableName = statementMetavariableNameFromFrameNode(statementNode),
|
|
83
|
+
metavariableName = statementMetavariableName, ///
|
|
84
|
+
metavariable = generalContext.findMetavariableByMetavariableName(metavariableName);
|
|
61
85
|
|
|
62
|
-
|
|
86
|
+
if (metavariable !== null) {
|
|
87
|
+
substitution = substitutions.findSubstitutionByMetavariableAndSubstitution(metavariable, substitution);
|
|
63
88
|
|
|
64
|
-
|
|
89
|
+
if (substitution !== null) {
|
|
90
|
+
const statementSubstitution = substitution; ///
|
|
65
91
|
|
|
66
|
-
|
|
67
|
-
|
|
92
|
+
statement = statementSubstitution.getStatement();
|
|
93
|
+
}
|
|
68
94
|
}
|
|
69
95
|
}
|
|
70
96
|
}
|