occam-verify-cli 1.0.564 → 1.0.570
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/context/file/nominal.js +1 -13
- package/lib/context/liminal.js +84 -6
- package/lib/element/assertion/satisfies.js +4 -46
- package/lib/element/assumption.js +49 -69
- package/lib/element/conclusion.js +3 -3
- package/lib/element/frame.js +56 -42
- package/lib/element/judgement.js +2 -2
- package/lib/element/metavariable.js +26 -35
- package/lib/element/proofAssertion/premise.js +26 -29
- package/lib/element/proofAssertion/step.js +4 -44
- package/lib/element/proofAssertion/supposition.js +161 -32
- package/lib/element/proofAssertion.js +5 -5
- package/lib/element/reference.js +9 -2
- package/lib/element/rule.js +21 -55
- package/lib/element/statement.js +5 -5
- package/lib/element/subproof.js +2 -2
- package/lib/element/substitution/frame.js +1 -2
- package/lib/element/substitution/reference.js +1 -2
- package/lib/element/substitution/statement.js +3 -46
- package/lib/element/substitution/term.js +1 -2
- package/lib/element/substitution.js +8 -1
- package/lib/element/substitutions.js +1 -53
- package/lib/element/term.js +3 -3
- package/lib/element/topLevelAssertion/axiom.js +25 -15
- package/lib/element/topLevelAssertion/conjecture.js +22 -12
- package/lib/element/topLevelAssertion/lemma.js +27 -12
- package/lib/element/topLevelAssertion/theorem.js +22 -12
- package/lib/element/topLevelAssertion.js +331 -58
- package/lib/element/topLevelMetaAssertion/metaLemma.js +4 -2
- package/lib/element/topLevelMetaAssertion/metatheorem.js +4 -2
- package/lib/element/variable.js +6 -7
- package/lib/node/assumption.js +1 -12
- package/lib/node/frame.js +8 -34
- package/lib/process/assign.js +9 -9
- package/lib/process/instantiate.js +2 -14
- package/lib/process/unify.js +14 -14
- package/lib/process/validate.js +1 -1
- package/lib/utilities/context.js +169 -1
- package/lib/utilities/element.js +18 -7
- package/lib/utilities/unification.js +3 -5
- package/package.json +4 -4
- package/src/context/file/nominal.js +0 -13
- package/src/context/liminal.js +90 -7
- package/src/element/assertion/satisfies.js +2 -5
- package/src/element/assumption.js +62 -86
- package/src/element/conclusion.js +2 -2
- package/src/element/frame.js +72 -45
- package/src/element/judgement.js +2 -1
- package/src/element/metavariable.js +31 -39
- package/src/element/proofAssertion/premise.js +30 -35
- package/src/element/proofAssertion/step.js +4 -4
- package/src/element/proofAssertion/supposition.js +3 -1
- package/src/element/proofAssertion.js +4 -4
- package/src/element/reference.js +13 -3
- package/src/element/rule.js +25 -17
- package/src/element/statement.js +10 -7
- package/src/element/subproof.js +2 -3
- package/src/element/substitution/frame.js +0 -2
- package/src/element/substitution/reference.js +0 -2
- package/src/element/substitution/statement.js +1 -7
- package/src/element/substitution/term.js +0 -2
- package/src/element/substitution.js +11 -0
- package/src/element/substitutions.js +0 -53
- package/src/element/term.js +8 -5
- package/src/element/topLevelAssertion/axiom.js +5 -2
- package/src/element/topLevelAssertion/conjecture.js +5 -2
- package/src/element/topLevelAssertion/lemma.js +6 -3
- package/src/element/topLevelAssertion/theorem.js +5 -2
- package/src/element/topLevelAssertion.js +40 -38
- package/src/element/topLevelMetaAssertion/metaLemma.js +5 -2
- package/src/element/topLevelMetaAssertion/metatheorem.js +5 -2
- package/src/element/variable.js +8 -6
- package/src/node/assumption.js +0 -12
- package/src/node/frame.js +6 -34
- package/src/process/assign.js +16 -16
- package/src/process/instantiate.js +2 -10
- package/src/process/unify.js +14 -14
- package/src/process/validate.js +2 -2
- package/src/utilities/context.js +17 -0
- package/src/utilities/element.js +23 -10
- package/src/utilities/unification.js +3 -7
package/src/node/assumption.js
CHANGED
|
@@ -5,18 +5,6 @@ import { NonTerminalNode } from "occam-languages";
|
|
|
5
5
|
import { STATEMENT_RULE_NAME, METAVARIABLE_RULE_NAME } from "../ruleNames";
|
|
6
6
|
|
|
7
7
|
export default class AssumptionpNode extends NonTerminalNode {
|
|
8
|
-
isSingular() {
|
|
9
|
-
let singular = false;
|
|
10
|
-
|
|
11
|
-
const statementNode = this.getStatementNode();
|
|
12
|
-
|
|
13
|
-
if (statementNode === null) {
|
|
14
|
-
singular = true;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
return singular;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
8
|
getStatementNode() {
|
|
21
9
|
const ruleName = STATEMENT_RULE_NAME,
|
|
22
10
|
statementNode = this.getNodeByRuleName(ruleName);
|
package/src/node/frame.js
CHANGED
|
@@ -8,10 +8,10 @@ export default class FrameNode extends NonTerminalNode {
|
|
|
8
8
|
isSingular() {
|
|
9
9
|
let singular = false;
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const metavariableNode = this.getMetavariableNode();
|
|
12
12
|
|
|
13
|
-
if (
|
|
14
|
-
singular =
|
|
13
|
+
if (metavariableNode !== null) {
|
|
14
|
+
singular = true;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
return singular;
|
|
@@ -29,27 +29,6 @@ export default class FrameNode extends NonTerminalNode {
|
|
|
29
29
|
return metavariableName;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
getMetavariableNode() {
|
|
33
|
-
const singularMetavariableNode = this.getSingularMetavariableNode(),
|
|
34
|
-
metavariableNode = singularMetavariableNode; ///
|
|
35
|
-
|
|
36
|
-
return metavariableNode;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
getSingularMetavariableNode() {
|
|
40
|
-
let singularMetavariableNode = null;
|
|
41
|
-
|
|
42
|
-
const singularAssumptionNode = this.getSingularAssumptionNode();
|
|
43
|
-
|
|
44
|
-
if (singularAssumptionNode !== null) {
|
|
45
|
-
const metavariableNode = singularAssumptionNode.getMetavariableNode();
|
|
46
|
-
|
|
47
|
-
singularMetavariableNode = metavariableNode; ///
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return singularMetavariableNode;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
32
|
getAssumptionNodes() {
|
|
54
33
|
const ruleName = ASSUMPTION_RULE_NAME,
|
|
55
34
|
declarationNodes = this.getNodesByRuleName(ruleName);
|
|
@@ -57,18 +36,11 @@ export default class FrameNode extends NonTerminalNode {
|
|
|
57
36
|
return declarationNodes;
|
|
58
37
|
}
|
|
59
38
|
|
|
60
|
-
|
|
39
|
+
getMetavariableNode() {
|
|
61
40
|
const ruleName = METAVARIABLE_RULE_NAME,
|
|
62
|
-
|
|
41
|
+
metavariableNode = this.getNodeByRuleName(ruleName);
|
|
63
42
|
|
|
64
|
-
return
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
getSingularAssumptionNode() {
|
|
68
|
-
const ruleName = ASSUMPTION_RULE_NAME,
|
|
69
|
-
singularAssumptionNode = this.getSingularNodeByRuleName(ruleName);
|
|
70
|
-
|
|
71
|
-
return singularAssumptionNode;
|
|
43
|
+
return metavariableNode;
|
|
72
44
|
}
|
|
73
45
|
|
|
74
46
|
static fromRuleNameChildNodesOpacityAndPrecedence(ruleName, childNodes, opacity, precedence) { return NonTerminalNode.fromRuleNameChildNodesOpacityAndPrecedence(FrameNode, ruleName, childNodes, opacity, precedence); }
|
package/src/process/assign.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export function
|
|
3
|
+
export function variableAssignmentFromVariable(variable) {
|
|
4
4
|
return function (context) {
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const nested = false;
|
|
6
|
+
|
|
7
|
+
context.addVariable(variable, nested);
|
|
8
|
+
|
|
9
|
+
const variableTypeString = variable.getTypeString(),
|
|
10
|
+
variableString = variable.getString(),
|
|
11
|
+
assigned = true;
|
|
8
12
|
|
|
9
13
|
assigned ?
|
|
10
|
-
context.trace(`Assigned the '${
|
|
11
|
-
context.debug(`Unable to assign the '${
|
|
14
|
+
context.trace(`Assigned the '${variableString}' variable with type '${variableTypeString}'.`) :
|
|
15
|
+
context.debug(`Unable to assign the '${variableString}' variable with type '${variableTypeString}'.`);
|
|
12
16
|
|
|
13
17
|
return assigned;
|
|
14
18
|
};
|
|
@@ -28,19 +32,15 @@ export function equalityAssignmentFromEquality(equality) {
|
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
34
|
|
|
31
|
-
export function
|
|
35
|
+
export function judgementAssignmentFromJudgement(judgement) {
|
|
32
36
|
return function (context) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const variableTypeString = variable.getTypeString(),
|
|
38
|
-
variableString = variable.getString(),
|
|
39
|
-
assigned = true;
|
|
37
|
+
const judgementString = judgement.getString(),
|
|
38
|
+
judgementAdded = context.addJudgement(judgement),
|
|
39
|
+
assigned = judgementAdded; ///
|
|
40
40
|
|
|
41
41
|
assigned ?
|
|
42
|
-
context.trace(`Assigned the '${
|
|
43
|
-
context.debug(`Unable to assign the '${
|
|
42
|
+
context.trace(`Assigned the '${judgementString}' judgement.`) :
|
|
43
|
+
context.debug(`Unable to assign the '${judgementString}' judgement.`);
|
|
44
44
|
|
|
45
45
|
return assigned;
|
|
46
46
|
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { ruleFromRuleName } from "../utilities/bnf";
|
|
4
|
-
import {
|
|
5
|
-
REFERENCE_RULE_NAME,
|
|
6
|
-
STATEMENT_RULE_NAME,
|
|
4
|
+
import { REFERENCE_RULE_NAME,
|
|
7
5
|
COMBINATOR_RULE_NAME,
|
|
8
6
|
CONSTRUCTOR_RULE_NAME,
|
|
9
7
|
EQUIVALENCE_RULE_NAME,
|
|
@@ -12,9 +10,7 @@ import { TERM_RULE_NAME,
|
|
|
12
10
|
STATEMENT_SUBSTITUTION_RULE_NAME,
|
|
13
11
|
REFERENCE_SUBSTITUTION_RULE_NAME } from "../ruleNames";
|
|
14
12
|
|
|
15
|
-
const
|
|
16
|
-
referencePlaceholderRule = ruleFromRuleName(REFERENCE_RULE_NAME),
|
|
17
|
-
statementPlaceholderRule = ruleFromRuleName(STATEMENT_RULE_NAME),
|
|
13
|
+
const referencePlaceholderRule = ruleFromRuleName(REFERENCE_RULE_NAME),
|
|
18
14
|
combinatorPlaceholderRule = ruleFromRuleName(COMBINATOR_RULE_NAME),
|
|
19
15
|
constructorPlaceholderRule = ruleFromRuleName(CONSTRUCTOR_RULE_NAME),
|
|
20
16
|
equivalencePlaceholderRule = ruleFromRuleName(EQUIVALENCE_RULE_NAME),
|
|
@@ -23,12 +19,8 @@ const termPlaceholderRule = ruleFromRuleName(TERM_RULE_NAME),
|
|
|
23
19
|
statementSubstitutionPlaceholderRule = ruleFromRuleName(STATEMENT_SUBSTITUTION_RULE_NAME),
|
|
24
20
|
referenceSubstitutionPlaceholderRule = ruleFromRuleName(REFERENCE_SUBSTITUTION_RULE_NAME);
|
|
25
21
|
|
|
26
|
-
export function instantiateTerm(string, context) { return instantiate(termPlaceholderRule, string, context); }
|
|
27
|
-
|
|
28
22
|
export function instantiateReference(string, context) { return instantiate(referencePlaceholderRule, string, context); }
|
|
29
23
|
|
|
30
|
-
export function instantiateStatement(string, context) { return instantiate(statementPlaceholderRule, string, context); }
|
|
31
|
-
|
|
32
24
|
export function instantiateCombinator(string, context) { return instantiate(combinatorPlaceholderRule, string, context); }
|
|
33
25
|
|
|
34
26
|
export function instantiateConstructor(string, context) { return instantiate(constructorPlaceholderRule, string, context); }
|
package/src/process/unify.js
CHANGED
|
@@ -13,16 +13,16 @@ const typeNodeQuery = nodeQuery("/type"),
|
|
|
13
13
|
metaTypeNodeQuery = nodeQuery("/metaType"),
|
|
14
14
|
statementNodeQuery = nodeQuery("/statement"),
|
|
15
15
|
termVariableNodeQuery = nodeQuery("/term/variable!"),
|
|
16
|
+
frameAMetavariableNodeQuery = nodeQuery("/frame/metavariable!"),
|
|
16
17
|
statementMetavariableNodeQuery = nodeQuery("/statement/metavariable!"),
|
|
17
|
-
assumptionMetavariableNodeQuery = nodeQuery("/assumption/metavariable!")
|
|
18
|
-
frameAssumptionMetavariableNodeQuery = nodeQuery("/frame/assumption!/metavariable!");
|
|
18
|
+
assumptionMetavariableNodeQuery = nodeQuery("/assumption/metavariable!");
|
|
19
19
|
|
|
20
20
|
class MetaLevelPass extends ZipPass {
|
|
21
21
|
static maps = [
|
|
22
22
|
{
|
|
23
23
|
generalNodeQuery: assumptionMetavariableNodeQuery,
|
|
24
24
|
specificNodeQuery: assumptionMetavariableNodeQuery,
|
|
25
|
-
run: (generalAssumptionMetavariableNode, specificAssumptionMetavariableNode,
|
|
25
|
+
run: (generalAssumptionMetavariableNode, specificAssumptionMetavariableNode, generalContext, specificContext) => {
|
|
26
26
|
let success = false;
|
|
27
27
|
|
|
28
28
|
let context,
|
|
@@ -40,7 +40,7 @@ class MetaLevelPass extends ZipPass {
|
|
|
40
40
|
metavariableNode = specificAssumptionMetavariableNode; ///
|
|
41
41
|
|
|
42
42
|
const reference = context.findReferenceByMetavariableNode(metavariableNode),
|
|
43
|
-
referenceUnifies = metavariable.unifyReference(reference,
|
|
43
|
+
referenceUnifies = metavariable.unifyReference(reference, generalContext, specificContext);
|
|
44
44
|
|
|
45
45
|
if (referenceUnifies) {
|
|
46
46
|
success = true;
|
|
@@ -52,7 +52,7 @@ class MetaLevelPass extends ZipPass {
|
|
|
52
52
|
{
|
|
53
53
|
generalNodeQuery: statementMetavariableNodeQuery,
|
|
54
54
|
specificNodeQuery: statementNodeQuery,
|
|
55
|
-
run: (generalStatementMetavariableNode, specificStatementNode,
|
|
55
|
+
run: (generalStatementMetavariableNode, specificStatementNode, generalContext, specificContext) => {
|
|
56
56
|
let success = false;
|
|
57
57
|
|
|
58
58
|
let context,
|
|
@@ -79,7 +79,7 @@ class MetaLevelPass extends ZipPass {
|
|
|
79
79
|
statementNode = specificStatementNode; ///
|
|
80
80
|
|
|
81
81
|
const statement = context.findStatementByStatementNode(statementNode),
|
|
82
|
-
statementUnifies = metavariable.unifyStatement(statement, substitution,
|
|
82
|
+
statementUnifies = metavariable.unifyStatement(statement, substitution, generalContext, specificContext);
|
|
83
83
|
|
|
84
84
|
if (statementUnifies) {
|
|
85
85
|
success = true;
|
|
@@ -89,13 +89,13 @@ class MetaLevelPass extends ZipPass {
|
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
{
|
|
92
|
-
generalNodeQuery:
|
|
92
|
+
generalNodeQuery: frameAMetavariableNodeQuery,
|
|
93
93
|
specificNodeQuery: frameNodeQuery,
|
|
94
|
-
run: (
|
|
94
|
+
run: (generalFrameMetavariableNode, specificFrameNode, generalContext, specificContext) => {
|
|
95
95
|
let success = false;
|
|
96
96
|
|
|
97
97
|
const frameNode = specificFrameNode, ///
|
|
98
|
-
metavariableNode =
|
|
98
|
+
metavariableNode = generalFrameMetavariableNode, ///
|
|
99
99
|
metavariableName = metavariableNode.getMetavariableName();
|
|
100
100
|
|
|
101
101
|
let context;
|
|
@@ -107,7 +107,7 @@ class MetaLevelPass extends ZipPass {
|
|
|
107
107
|
context = specificContext; ///
|
|
108
108
|
|
|
109
109
|
const frame = context.findFrameByFrameNode(frameNode),
|
|
110
|
-
frameUnifies = metavariable.unifyFrame(frame,
|
|
110
|
+
frameUnifies = metavariable.unifyFrame(frame, generalContext, specificContext);
|
|
111
111
|
|
|
112
112
|
if (frameUnifies) {
|
|
113
113
|
success = true;
|
|
@@ -119,7 +119,7 @@ class MetaLevelPass extends ZipPass {
|
|
|
119
119
|
{
|
|
120
120
|
generalNodeQuery: termVariableNodeQuery,
|
|
121
121
|
specificNodeQuery: termNodeQuery,
|
|
122
|
-
run: (generalTermVariableNode, specificTermNode,
|
|
122
|
+
run: (generalTermVariableNode, specificTermNode, generalContext, specificContext) => {
|
|
123
123
|
let success = false;
|
|
124
124
|
|
|
125
125
|
const termNode = specificTermNode, ///
|
|
@@ -135,7 +135,7 @@ class MetaLevelPass extends ZipPass {
|
|
|
135
135
|
context = specificContext; ///
|
|
136
136
|
|
|
137
137
|
const term = context.findTermByTermNode(termNode),
|
|
138
|
-
termUnifies = variable.unifyTerm(term,
|
|
138
|
+
termUnifies = variable.unifyTerm(term, generalContext, specificContext);
|
|
139
139
|
|
|
140
140
|
if (termUnifies) {
|
|
141
141
|
success = true;
|
|
@@ -338,14 +338,14 @@ const metaLevelPass = new MetaLevelPass(),
|
|
|
338
338
|
metavariablePass = new MetavariablePass(),
|
|
339
339
|
intrinsicLevelPass = new IntrinsicLevelPass();
|
|
340
340
|
|
|
341
|
-
export function unifyStatement(generalStatement, specificStatement,
|
|
341
|
+
export function unifyStatement(generalStatement, specificStatement, generalContext, specificContext) {
|
|
342
342
|
let statementUnifies = false;
|
|
343
343
|
|
|
344
344
|
const generalStatementNode = generalStatement.getNode(),
|
|
345
345
|
specificStatementNode = specificStatement.getNode(),
|
|
346
346
|
generalNode = generalStatementNode, ///
|
|
347
347
|
specificNode = specificStatementNode, ///
|
|
348
|
-
success = metaLevelPass.run(generalNode, specificNode,
|
|
348
|
+
success = metaLevelPass.run(generalNode, specificNode, generalContext, specificContext);
|
|
349
349
|
|
|
350
350
|
if (success) {
|
|
351
351
|
statementUnifies = true;
|
package/src/process/validate.js
CHANGED
|
@@ -17,7 +17,7 @@ class TermPass extends ForwardPass {
|
|
|
17
17
|
|
|
18
18
|
const nonTerminalNode = statementNode, ///
|
|
19
19
|
childNodes = nonTerminalNode.getChildNodes(), ///
|
|
20
|
-
descended = this.descend(childNodes,context);
|
|
20
|
+
descended = this.descend(childNodes, context);
|
|
21
21
|
|
|
22
22
|
if (descended) {
|
|
23
23
|
success = true;
|
|
@@ -76,7 +76,7 @@ class StatementPass extends ForwardPass {
|
|
|
76
76
|
|
|
77
77
|
const nonTerminalNode = statementNode, ///
|
|
78
78
|
childNodes = nonTerminalNode.getChildNodes(), ///
|
|
79
|
-
descended = this.descend(childNodes,context);
|
|
79
|
+
descended = this.descend(childNodes, context);
|
|
80
80
|
|
|
81
81
|
if (descended) {
|
|
82
82
|
success = true;
|
package/src/utilities/context.js
CHANGED
|
@@ -44,3 +44,20 @@ export function synthetically(innerFunction, generalContext, specificContext) {
|
|
|
44
44
|
|
|
45
45
|
return innerFunction(context);
|
|
46
46
|
}
|
|
47
|
+
|
|
48
|
+
export async function asyncAttempt(innerFunction, context) {
|
|
49
|
+
const ephemeralContext = EphemeralContext.fromNothing(context);
|
|
50
|
+
|
|
51
|
+
context = ephemeralContext; ///
|
|
52
|
+
|
|
53
|
+
return await innerFunction(context);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function asyncScope(innerFunction, context) {
|
|
57
|
+
const scopedContext = ScopedContext.fromNothing(context);
|
|
58
|
+
|
|
59
|
+
context = scopedContext; ///
|
|
60
|
+
|
|
61
|
+
return await innerFunction(context);
|
|
62
|
+
}
|
|
63
|
+
|
package/src/utilities/element.js
CHANGED
|
@@ -117,7 +117,8 @@ export function frameFromFrameNode(frameNode, context) {
|
|
|
117
117
|
node = frameNode, ///
|
|
118
118
|
string = context.nodeAsString(node),
|
|
119
119
|
assumptions = assumptionsFromFrameNode(frameNode, context),
|
|
120
|
-
|
|
120
|
+
metavariable = metavariableFromFrameNode(frameNode, context),
|
|
121
|
+
frame = new Frame(context, string, node, assumptions, metavariable);
|
|
121
122
|
|
|
122
123
|
return frame;
|
|
123
124
|
}
|
|
@@ -380,9 +381,9 @@ export function assumptionFromAssumptionNode(assumptionNode, context) {
|
|
|
380
381
|
const { Assumption } = elements,
|
|
381
382
|
node = assumptionNode, ///
|
|
382
383
|
string = context.nodeAsString(node),
|
|
383
|
-
statement = statementFromAssumptionNode(assumptionNode, context),
|
|
384
384
|
reference = referenceFromAssumptionNode(assumptionNode, context),
|
|
385
|
-
|
|
385
|
+
statement = statementFromAssumptionNode(assumptionNode, context),
|
|
386
|
+
assumption = new Assumption(context, string, node, reference, statement);
|
|
386
387
|
|
|
387
388
|
return assumption;
|
|
388
389
|
}
|
|
@@ -870,6 +871,18 @@ export function termsFromEquivalenceNode(equivalenceNode, context) {
|
|
|
870
871
|
return terms;
|
|
871
872
|
}
|
|
872
873
|
|
|
874
|
+
export function metavariableFromFrameNode(frameNode, context) {
|
|
875
|
+
let metavariable = null;
|
|
876
|
+
|
|
877
|
+
const metavariableNode = frameNode.getMetavariableNode();
|
|
878
|
+
|
|
879
|
+
if (metavariableNode !== null) {
|
|
880
|
+
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
return metavariable;
|
|
884
|
+
}
|
|
885
|
+
|
|
873
886
|
export function metavariableFromLabelNode(labelNode, context) {
|
|
874
887
|
const metavariableNode = labelNode.getMetavariableNode(),
|
|
875
888
|
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
@@ -955,6 +968,13 @@ export function assumptionFromJudgementNode(judgementNode, context) {
|
|
|
955
968
|
return assumption;
|
|
956
969
|
}
|
|
957
970
|
|
|
971
|
+
export function referenceFromAssumptionNode(assumptionNode, context) {
|
|
972
|
+
const metavariableNode = assumptionNode.getMetavariableNode(),
|
|
973
|
+
reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
974
|
+
|
|
975
|
+
return reference;
|
|
976
|
+
}
|
|
977
|
+
|
|
958
978
|
export function statementFromCombinatorNode(combinatorNode, context) {
|
|
959
979
|
const statementNode = combinatorNode.getStatementNode(),
|
|
960
980
|
statement = statementFromStatementNode(statementNode, context);
|
|
@@ -986,13 +1006,6 @@ export function statementFromAssumptionNode(assumptionNode, context) {
|
|
|
986
1006
|
return statement;
|
|
987
1007
|
}
|
|
988
1008
|
|
|
989
|
-
export function referenceFromAssumptionNode(assumptionNode, context) {
|
|
990
|
-
const metavariableNode = assumptionNode.getMetavariableNode(),
|
|
991
|
-
reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
992
|
-
|
|
993
|
-
return reference;
|
|
994
|
-
}
|
|
995
|
-
|
|
996
1009
|
export function statementFromHypothesisNode(hypothesisNode, context) {
|
|
997
1010
|
let statement = null;
|
|
998
1011
|
|
|
@@ -110,8 +110,7 @@ function unifyStatementAsSatisfiesAssertion(statement, reference, satisfiesAsser
|
|
|
110
110
|
const satisfiable = axiom.isSatisfiable();
|
|
111
111
|
|
|
112
112
|
if (satisfiable) {
|
|
113
|
-
const
|
|
114
|
-
substitutions = Substitutions.fromNothing(context),
|
|
113
|
+
const substitutions = [],
|
|
115
114
|
topLevelAssertionUnifies = axiom.unifyTopLevelAssertion(topLevelAssertion, substitutions, context);
|
|
116
115
|
|
|
117
116
|
if (topLevelAssertionUnifies) {
|
|
@@ -152,11 +151,8 @@ function unifyStatementWithTopLevelAssertion(statement, reference, satisfiesAsse
|
|
|
152
151
|
|
|
153
152
|
context.trace(`Unifying the '${statementString}' statement with the '${topLevelAssertionString}' top level assertion...`);
|
|
154
153
|
|
|
155
|
-
const subproofOrProofAssertions = context.getSubproofOrProofAssertions()
|
|
156
|
-
|
|
157
|
-
substitutions = Substitutions.fromNothing(context);
|
|
158
|
-
|
|
159
|
-
const statementAndSubproofOrProofAssertionsUnify = topLevelAssertion.unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, substitutions, context);
|
|
154
|
+
const subproofOrProofAssertions = context.getSubproofOrProofAssertions(),
|
|
155
|
+
statementAndSubproofOrProofAssertionsUnify = topLevelAssertion.unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, context);
|
|
160
156
|
|
|
161
157
|
if (statementAndSubproofOrProofAssertionsUnify) {
|
|
162
158
|
const metavariable = reference.getMetavariable();
|