occam-verify-cli 1.0.282 → 1.0.286
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.js +51 -9
- package/lib/context/local.js +11 -6
- package/lib/context/release.js +11 -11
- package/lib/dom/axiom.js +18 -18
- package/lib/dom/conclusion.js +16 -9
- package/lib/dom/conjecture.js +4 -4
- package/lib/dom/constructor/bracketed.js +3 -3
- package/lib/dom/constructor.js +3 -3
- package/lib/dom/declaration/combinator.js +14 -7
- package/lib/dom/declaration/complexType.js +28 -21
- package/lib/dom/declaration/constructor.js +18 -11
- package/lib/dom/declaration/metavariable.js +19 -12
- package/lib/dom/declaration/simpleType.js +21 -14
- package/lib/dom/declaration/variable.js +19 -12
- package/lib/dom/deduction.js +18 -11
- package/lib/dom/error.js +11 -4
- package/lib/dom/hypothesis.js +16 -9
- package/lib/dom/lemma.js +4 -4
- package/lib/dom/metaLemma.js +4 -4
- package/lib/dom/metatheorem.js +4 -4
- package/lib/dom/premise.js +18 -11
- package/lib/dom/procedureCall.js +17 -10
- package/lib/dom/rule.js +14 -7
- package/lib/dom/section.js +12 -5
- package/lib/dom/statement.js +15 -15
- package/lib/dom/step.js +18 -11
- package/lib/dom/subproof.js +11 -10
- package/lib/dom/supposition.js +20 -13
- package/lib/dom/theorem.js +4 -4
- package/lib/dom/topLevelAssertion.js +13 -6
- package/lib/dom/topLevelMetaAssertion.js +11 -4
- package/lib/log.js +25 -10
- package/package.json +1 -1
- package/src/context/file.js +68 -9
- package/src/context/local.js +5 -5
- package/src/context/release.js +5 -5
- package/src/dom/axiom.js +23 -18
- package/src/dom/conclusion.js +14 -8
- package/src/dom/conjecture.js +4 -3
- package/src/dom/constructor/bracketed.js +2 -2
- package/src/dom/constructor.js +2 -2
- package/src/dom/declaration/combinator.js +11 -6
- package/src/dom/declaration/complexType.js +26 -20
- package/src/dom/declaration/constructor.js +16 -11
- package/src/dom/declaration/metavariable.js +17 -11
- package/src/dom/declaration/simpleType.js +19 -13
- package/src/dom/declaration/variable.js +17 -12
- package/src/dom/deduction.js +16 -10
- package/src/dom/error.js +8 -3
- package/src/dom/hypothesis.js +14 -8
- package/src/dom/lemma.js +5 -4
- package/src/dom/metaLemma.js +4 -3
- package/src/dom/metatheorem.js +4 -3
- package/src/dom/premise.js +16 -10
- package/src/dom/procedureCall.js +16 -9
- package/src/dom/rule.js +14 -7
- package/src/dom/section.js +10 -4
- package/src/dom/statement.js +14 -14
- package/src/dom/step.js +16 -10
- package/src/dom/subproof.js +8 -6
- package/src/dom/supposition.js +18 -12
- package/src/dom/theorem.js +4 -3
- package/src/dom/topLevelAssertion.js +11 -5
- package/src/dom/topLevelMetaAssertion.js +9 -3
- package/src/log.js +29 -16
package/src/dom/premise.js
CHANGED
|
@@ -8,12 +8,17 @@ import { subproofAssertionFromStatement } from "../utilities/context";
|
|
|
8
8
|
import { statementFromJSON, procedureCallFromJSON, statementToStatementJSON, procedureCallToProcedureCallJSON } from "../utilities/json";
|
|
9
9
|
|
|
10
10
|
export default domAssigned(class Premise {
|
|
11
|
-
constructor(string, statement, procedureCall) {
|
|
11
|
+
constructor(node, string, statement, procedureCall) {
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.statement = statement;
|
|
14
15
|
this.procedureCall = procedureCall;
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
getNode() {
|
|
19
|
+
return this.node;
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
getString() {
|
|
18
23
|
return this.string;
|
|
19
24
|
}
|
|
@@ -31,7 +36,7 @@ export default domAssigned(class Premise {
|
|
|
31
36
|
|
|
32
37
|
const premiseString = this.string; ///
|
|
33
38
|
|
|
34
|
-
context.trace(`Verifying the '${premiseString}' premise
|
|
39
|
+
context.trace(`Verifying the '${premiseString}' premise...`, this.node);
|
|
35
40
|
|
|
36
41
|
if (false) {
|
|
37
42
|
///
|
|
@@ -62,11 +67,11 @@ export default domAssigned(class Premise {
|
|
|
62
67
|
verifies = true;
|
|
63
68
|
}
|
|
64
69
|
} else {
|
|
65
|
-
context.debug(`Unable to verify the '${premiseString}' premise because it is nonsense
|
|
70
|
+
context.debug(`Unable to verify the '${premiseString}' premise because it is nonsense.`, this.node);
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
if (verifies) {
|
|
69
|
-
context.debug(`...verified the '${premiseString}' premise
|
|
74
|
+
context.debug(`...verified the '${premiseString}' premise.`, this.node);
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
return verifies;
|
|
@@ -147,7 +152,7 @@ export default domAssigned(class Premise {
|
|
|
147
152
|
premiseStatement = premise.getStatement(),
|
|
148
153
|
premiseStatementString = premiseStatement.getString();
|
|
149
154
|
|
|
150
|
-
specificContext.trace(`Unifying the '${subproofString}' subproof with the premise's '${premiseStatementString}' statement
|
|
155
|
+
specificContext.trace(`Unifying the '${subproofString}' subproof with the premise's '${premiseStatementString}' statement...`, this.node);
|
|
151
156
|
|
|
152
157
|
if (this.statement !== null) {
|
|
153
158
|
const context = generalContext,
|
|
@@ -159,7 +164,7 @@ export default domAssigned(class Premise {
|
|
|
159
164
|
}
|
|
160
165
|
|
|
161
166
|
if (subproofUnifies) {
|
|
162
|
-
specificContext.debug(`...unified the '${subproofString}' subproof with the premise's '${premiseStatementString}' statement
|
|
167
|
+
specificContext.debug(`...unified the '${subproofString}' subproof with the premise's '${premiseStatementString}' statement.`, this.node);
|
|
163
168
|
}
|
|
164
169
|
|
|
165
170
|
return subproofUnifies;
|
|
@@ -172,14 +177,14 @@ export default domAssigned(class Premise {
|
|
|
172
177
|
premiseString = premise.getString(),
|
|
173
178
|
statementString = statement.getString();
|
|
174
179
|
|
|
175
|
-
specificContext.trace(`Unifying the '${statementString}' statement with the '${premiseString}' premise
|
|
180
|
+
specificContext.trace(`Unifying the '${statementString}' statement with the '${premiseString}' premise...`, this.node);
|
|
176
181
|
|
|
177
182
|
if (this.statement !== null) {
|
|
178
183
|
statementUnifies = this.statement.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
if (statementUnifies) {
|
|
182
|
-
specificContext.debug(`...unified the '${statementString}' statement with the '${premiseString}' premise
|
|
187
|
+
specificContext.debug(`...unified the '${statementString}' statement with the '${premiseString}' premise.`, this.node);
|
|
183
188
|
}
|
|
184
189
|
|
|
185
190
|
return statementUnifies;
|
|
@@ -214,7 +219,8 @@ export default domAssigned(class Premise {
|
|
|
214
219
|
string = procedureCall.getString();
|
|
215
220
|
}
|
|
216
221
|
|
|
217
|
-
const
|
|
222
|
+
const node = null,
|
|
223
|
+
premise = new Premise(node, string, statement, procedureCall);
|
|
218
224
|
|
|
219
225
|
return premise;
|
|
220
226
|
}
|
|
@@ -225,7 +231,7 @@ export default domAssigned(class Premise {
|
|
|
225
231
|
string = context.nodeAsString(node),
|
|
226
232
|
statement = Statement.fromPremiseNode(premiseNode, context),
|
|
227
233
|
procedureCall = ProcedureCall.fromPremiseNode(premiseNode, context),
|
|
228
|
-
premise = new Premise(string, statement, procedureCall);
|
|
234
|
+
premise = new Premise(node, string, statement, procedureCall);
|
|
229
235
|
|
|
230
236
|
return premise
|
|
231
237
|
}
|
package/src/dom/procedureCall.js
CHANGED
|
@@ -8,12 +8,17 @@ import { domAssigned } from "../dom";
|
|
|
8
8
|
import { referenceFromJSON, parametersFromJSON, parametersToParametersJSON } from "../utilities/json";
|
|
9
9
|
|
|
10
10
|
export default domAssigned(class ProcedureCall {
|
|
11
|
-
constructor(string, reference, parameters) {
|
|
11
|
+
constructor(node, string, reference, parameters) {
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.reference = reference;
|
|
14
15
|
this.parameters = parameters;
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
getNode() {
|
|
19
|
+
return this.node;
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
getString() {
|
|
18
23
|
return this.string;
|
|
19
24
|
}
|
|
@@ -42,7 +47,7 @@ export default domAssigned(class ProcedureCall {
|
|
|
42
47
|
|
|
43
48
|
const procedureCallString = this.string; ///
|
|
44
49
|
|
|
45
|
-
context.trace(`Verifying the '${procedureCallString}' procedure call
|
|
50
|
+
context.trace(`Verifying the '${procedureCallString}' procedure call...`, this.node);
|
|
46
51
|
|
|
47
52
|
const procedure = context.findProcedureByReference(this.reference);
|
|
48
53
|
|
|
@@ -52,14 +57,14 @@ export default domAssigned(class ProcedureCall {
|
|
|
52
57
|
if (procedureBoolean) {
|
|
53
58
|
verifies = true;
|
|
54
59
|
} else {
|
|
55
|
-
context.trace(`The '${procedureCallString}' procedure is not boolean
|
|
60
|
+
context.trace(`The '${procedureCallString}' procedure is not boolean.`, this.node);
|
|
56
61
|
}
|
|
57
62
|
} else {
|
|
58
|
-
context.trace(`The '${procedureCallString}' procedure is not present
|
|
63
|
+
context.trace(`The '${procedureCallString}' procedure is not present.`, this.node);
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
if (verifies) {
|
|
62
|
-
context.debug(`...verified the '${procedureCallString}' procedure call
|
|
67
|
+
context.debug(`...verified the '${procedureCallString}' procedure call.`, this.node);
|
|
63
68
|
}
|
|
64
69
|
|
|
65
70
|
return verifies;
|
|
@@ -70,7 +75,7 @@ export default domAssigned(class ProcedureCall {
|
|
|
70
75
|
|
|
71
76
|
const procedureCallString = this.string; ///
|
|
72
77
|
|
|
73
|
-
context.trace(`Unifying the '${procedureCallString}' procedure call independently
|
|
78
|
+
context.trace(`Unifying the '${procedureCallString}' procedure call independently...`, this.node);
|
|
74
79
|
|
|
75
80
|
const procedure = context.findProcedureByReference(this.reference),
|
|
76
81
|
nodes = this.findNodes(substitutions),
|
|
@@ -88,7 +93,7 @@ export default domAssigned(class ProcedureCall {
|
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
if (unifiesIndependently) {
|
|
91
|
-
context.debug(`...unified the '${procedureCallString}' procedure call independently
|
|
96
|
+
context.debug(`...unified the '${procedureCallString}' procedure call independently.`, this.node);
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
return unifiesIndependently;
|
|
@@ -112,8 +117,9 @@ export default domAssigned(class ProcedureCall {
|
|
|
112
117
|
static fromJSON(json, context) {
|
|
113
118
|
const reference = referenceFromJSON(json, context),
|
|
114
119
|
parameters = parametersFromJSON(json, context),
|
|
120
|
+
node = null,
|
|
115
121
|
string = stringFromReferenceAndParameters(reference, parameters),
|
|
116
|
-
procedureCall = new ProcedureCall(string, reference, parameters);
|
|
122
|
+
procedureCall = new ProcedureCall(node, string, reference, parameters);
|
|
117
123
|
|
|
118
124
|
return procedureCall;
|
|
119
125
|
}
|
|
@@ -145,10 +151,11 @@ export default domAssigned(class ProcedureCall {
|
|
|
145
151
|
|
|
146
152
|
function procedureCallFromProcedureCallNode(procedureCallNode, context) {
|
|
147
153
|
const { Reference, ProcedureCall } = dom,
|
|
154
|
+
node = procedureCallNode, ///
|
|
148
155
|
parameters = parametersFromProcedureCallNode(procedureCallNode, context),
|
|
149
156
|
reference = Reference.fromProcedureCallNode(procedureCallNode, context),
|
|
150
157
|
string = stringFromReferenceAndParameters(reference, parameters),
|
|
151
|
-
procedureCall = new ProcedureCall(string, reference, parameters);
|
|
158
|
+
procedureCall = new ProcedureCall(node, string, reference, parameters);
|
|
152
159
|
|
|
153
160
|
return procedureCall;
|
|
154
161
|
}
|
package/src/dom/rule.js
CHANGED
|
@@ -18,8 +18,9 @@ import { labelsFromJSON,
|
|
|
18
18
|
const { reverse, extract, backwardsEvery } = arrayUtilities;
|
|
19
19
|
|
|
20
20
|
export default domAssigned(class Rule {
|
|
21
|
-
constructor(context, string, labels, premises, conclusion, proof) {
|
|
21
|
+
constructor(context, node, string, labels, premises, conclusion, proof) {
|
|
22
22
|
this.context = context;
|
|
23
|
+
this.node = node;
|
|
23
24
|
this.string = string;
|
|
24
25
|
this.labels = labels;
|
|
25
26
|
this.premises = premises;
|
|
@@ -31,6 +32,10 @@ export default domAssigned(class Rule {
|
|
|
31
32
|
return this.context;
|
|
32
33
|
}
|
|
33
34
|
|
|
35
|
+
getNode() {
|
|
36
|
+
return this.node;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
getString() {
|
|
35
40
|
return this.string;
|
|
36
41
|
}
|
|
@@ -147,7 +152,7 @@ export default domAssigned(class Rule {
|
|
|
147
152
|
|
|
148
153
|
const ruleString = this.string; ///
|
|
149
154
|
|
|
150
|
-
this.context.trace(`Verifying the '${ruleString}' rule
|
|
155
|
+
this.context.trace(`Verifying the '${ruleString}' rule...`, this.node);
|
|
151
156
|
|
|
152
157
|
const labelsVerify = this.verifyLabels();
|
|
153
158
|
|
|
@@ -174,7 +179,7 @@ export default domAssigned(class Rule {
|
|
|
174
179
|
}
|
|
175
180
|
|
|
176
181
|
if (verifies) {
|
|
177
|
-
this.context.debug(`...verified the '${ruleString}' rule
|
|
182
|
+
this.context.debug(`...verified the '${ruleString}' rule.`, this.node);
|
|
178
183
|
}
|
|
179
184
|
|
|
180
185
|
return verifies;
|
|
@@ -252,24 +257,26 @@ export default domAssigned(class Rule {
|
|
|
252
257
|
static fromJSON(json, context) {
|
|
253
258
|
let rule;
|
|
254
259
|
|
|
255
|
-
const
|
|
260
|
+
const node = null,
|
|
261
|
+
proof = null,
|
|
256
262
|
labels = labelsFromJSON(json, context),
|
|
257
263
|
premises = premisesFromJSON(json, context),
|
|
258
264
|
conclusion = conclusionFromJSON(json, context),
|
|
259
265
|
string = stringFromLabelsPremisesAndConclusion(labels, premises, conclusion);
|
|
260
266
|
|
|
261
|
-
rule = new Rule(context, string, labels, premises, conclusion, proof);
|
|
267
|
+
rule = new Rule(context, node, string, labels, premises, conclusion, proof);
|
|
262
268
|
|
|
263
269
|
return rule;
|
|
264
270
|
}
|
|
265
271
|
|
|
266
272
|
static fromRuleNode(ruleNode, context) {
|
|
267
|
-
const
|
|
273
|
+
const node = ruleNode, ///
|
|
274
|
+
proof = proofFromRuleNode(ruleNode, context),
|
|
268
275
|
labels = labelsFromRuleNode(ruleNode, context),
|
|
269
276
|
premises = premisesFromRuleNode(ruleNode, context),
|
|
270
277
|
conclusion = conclusionFromRuleNode(ruleNode, context),
|
|
271
278
|
string = stringFromLabelsPremisesAndConclusion(labels, premises, conclusion),
|
|
272
|
-
rule = new Rule(context, string, labels, premises, conclusion, proof);
|
|
279
|
+
rule = new Rule(context, node, string, labels, premises, conclusion, proof);
|
|
273
280
|
|
|
274
281
|
return rule;
|
|
275
282
|
}
|
package/src/dom/section.js
CHANGED
|
@@ -6,8 +6,9 @@ import LocalContext from "../context/local";
|
|
|
6
6
|
import { domAssigned } from "../dom";
|
|
7
7
|
|
|
8
8
|
export default domAssigned(class Section {
|
|
9
|
-
constructor(context, string, hypotheses, axiom, lemma, theorem, conjecture) {
|
|
9
|
+
constructor(context, node, string, hypotheses, axiom, lemma, theorem, conjecture) {
|
|
10
10
|
this.context = context;
|
|
11
|
+
this.node = node;
|
|
11
12
|
this.string = string;
|
|
12
13
|
this.hypotheses = hypotheses;
|
|
13
14
|
this.axiom = axiom;
|
|
@@ -20,6 +21,10 @@ export default domAssigned(class Section {
|
|
|
20
21
|
return this.context;
|
|
21
22
|
}
|
|
22
23
|
|
|
24
|
+
getNode() {
|
|
25
|
+
return this.node;
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
getString() {
|
|
24
29
|
return this.string;
|
|
25
30
|
}
|
|
@@ -49,7 +54,7 @@ export default domAssigned(class Section {
|
|
|
49
54
|
|
|
50
55
|
const sectionString = this.string; ///
|
|
51
56
|
|
|
52
|
-
this.context.trace(`Verifying the '${sectionString}' section
|
|
57
|
+
this.context.trace(`Verifying the '${sectionString}' section...`, this.node);
|
|
53
58
|
|
|
54
59
|
const hypothesesVerify = this.verifyHypotheses();
|
|
55
60
|
|
|
@@ -65,7 +70,7 @@ export default domAssigned(class Section {
|
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
if (verifies) {
|
|
68
|
-
this.context.debug(`...verified the '${sectionString}' section
|
|
73
|
+
this.context.debug(`...verified the '${sectionString}' section.`, this.node);
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
return verifies;
|
|
@@ -96,8 +101,9 @@ export default domAssigned(class Section {
|
|
|
96
101
|
lemma = lemmaFroSectionNode(sectionNode, context),
|
|
97
102
|
theorem = theoremFroSectionNode(sectionNode, context),
|
|
98
103
|
conjecture = conjectureFroSectionNode(sectionNode, context),
|
|
104
|
+
node = sectionNode, ///
|
|
99
105
|
string = stringFromHypothesesAxiomLemmaTheoremAndConjecture(hypotheses, axiom, lemma, theorem, conjecture, context),
|
|
100
|
-
section = new Section(context, string, hypotheses, axiom, lemma, theorem, conjecture);
|
|
106
|
+
section = new Section(context, node, string, hypotheses, axiom, lemma, theorem, conjecture);
|
|
101
107
|
|
|
102
108
|
return section;
|
|
103
109
|
}
|
package/src/dom/statement.js
CHANGED
|
@@ -46,7 +46,7 @@ export default domAssigned(class Statement {
|
|
|
46
46
|
const termString = term.getString(),
|
|
47
47
|
statementString = this.string; ///
|
|
48
48
|
|
|
49
|
-
context.trace(`Is the '${termString}' term contained in the '${statementString}' statement
|
|
49
|
+
context.trace(`Is the '${termString}' term contained in the '${statementString}' statement...`, this.node);
|
|
50
50
|
|
|
51
51
|
const termNode = term.getNode(),
|
|
52
52
|
statementNode = this.node,
|
|
@@ -61,7 +61,7 @@ export default domAssigned(class Statement {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
if (termContained) {
|
|
64
|
-
context.debug(`...the '${termString}' term is contained in the '${statementString}' statement
|
|
64
|
+
context.debug(`...the '${termString}' term is contained in the '${statementString}' statement.`, this.node);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
return termContained;
|
|
@@ -73,7 +73,7 @@ export default domAssigned(class Statement {
|
|
|
73
73
|
const frameString = frame.getString(),
|
|
74
74
|
statementString = this.string; ///
|
|
75
75
|
|
|
76
|
-
context.trace(`Is the '${frameString}' frame contained in the '${statementString}' statement
|
|
76
|
+
context.trace(`Is the '${frameString}' frame contained in the '${statementString}' statement...`, this.node);
|
|
77
77
|
|
|
78
78
|
const frameNode = frame.getNode(),
|
|
79
79
|
statementNode = this.node,
|
|
@@ -88,7 +88,7 @@ export default domAssigned(class Statement {
|
|
|
88
88
|
});
|
|
89
89
|
|
|
90
90
|
if (frameContained) {
|
|
91
|
-
context.debug(`...the '${frameString}' frame is contained in the '${statementString}' statement
|
|
91
|
+
context.debug(`...the '${frameString}' frame is contained in the '${statementString}' statement.`, this.node);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
return frameContained;
|
|
@@ -99,7 +99,7 @@ export default domAssigned(class Statement {
|
|
|
99
99
|
|
|
100
100
|
const statementString = this.string; ///
|
|
101
101
|
|
|
102
|
-
context.trace(`Verifying the '${statementString}' statement
|
|
102
|
+
context.trace(`Verifying the '${statementString}' statement...`, this.node);
|
|
103
103
|
|
|
104
104
|
verifies = verifyMixins.some((verifyMixin) => {
|
|
105
105
|
const statement = this, ///
|
|
@@ -111,7 +111,7 @@ export default domAssigned(class Statement {
|
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
if (verifies) {
|
|
114
|
-
context.debug(`...verified the '${statementString}' statement
|
|
114
|
+
context.debug(`...verified the '${statementString}' statement.`, this.node);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
return verifies;
|
|
@@ -123,7 +123,7 @@ export default domAssigned(class Statement {
|
|
|
123
123
|
const metaTypeString = metaType.getString(),
|
|
124
124
|
statementString = this.string; ///
|
|
125
125
|
|
|
126
|
-
context.trace(`Verifying the '${statementString}' statement given the '${metaTypeString}' meta-type
|
|
126
|
+
context.trace(`Verifying the '${statementString}' statement given the '${metaTypeString}' meta-type...`, this.node);
|
|
127
127
|
|
|
128
128
|
const metaTypeName = metaType.getName();
|
|
129
129
|
|
|
@@ -134,7 +134,7 @@ export default domAssigned(class Statement {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
if (verifiesGivenMetaType) {
|
|
137
|
-
context.debug(`...verified the '${statementString}' statement given the '${metaTypeString}' meta-type
|
|
137
|
+
context.debug(`...verified the '${statementString}' statement given the '${metaTypeString}' meta-type.`, this.node);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
return verifiesGivenMetaType;
|
|
@@ -151,7 +151,7 @@ export default domAssigned(class Statement {
|
|
|
151
151
|
const subproofString = subproof.getString(),
|
|
152
152
|
subproofAssertionString = subproofAssertion.getString();
|
|
153
153
|
|
|
154
|
-
specificContext.trace(`Unifying the '${subproofString}' subproof with the '${subproofAssertionString}' subproof assertion
|
|
154
|
+
specificContext.trace(`Unifying the '${subproofString}' subproof with the '${subproofAssertionString}' subproof assertion...`, this.node);
|
|
155
155
|
|
|
156
156
|
const subproofStatements = subproof.getStatements(),
|
|
157
157
|
subproofAssertionStatements = subproofAssertion.getStatements();
|
|
@@ -167,7 +167,7 @@ export default domAssigned(class Statement {
|
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
if (subproofUnifies) {
|
|
170
|
-
specificContext.debug(`...unified the '${subproofString}' subproof with the '${subproofAssertionString}' subproof assertion
|
|
170
|
+
specificContext.debug(`...unified the '${subproofString}' subproof with the '${subproofAssertionString}' subproof assertion.`, this.node);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -182,12 +182,12 @@ export default domAssigned(class Statement {
|
|
|
182
182
|
generalStatementString = generalStatement.getString(),
|
|
183
183
|
specificStatementString = specificStatement.getString();
|
|
184
184
|
|
|
185
|
-
specificContext.trace(`Unifying the '${specificStatementString}' statement with the '${generalStatementString}' statement
|
|
185
|
+
specificContext.trace(`Unifying the '${specificStatementString}' statement with the '${generalStatementString}' statement...`, this.node);
|
|
186
186
|
|
|
187
187
|
statementUnifies = unifyStatement(generalStatement, specificStatement, substitutions, generalContext, specificContext);
|
|
188
188
|
|
|
189
189
|
if (statementUnifies) {
|
|
190
|
-
specificContext.debug(`...unified the '${specificStatementString}' statement with the '${generalStatementString}' statement
|
|
190
|
+
specificContext.debug(`...unified the '${specificStatementString}' statement with the '${generalStatementString}' statement.`, this.node);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
return statementUnifies;
|
|
@@ -199,7 +199,7 @@ export default domAssigned(class Statement {
|
|
|
199
199
|
const statement = this, ///
|
|
200
200
|
statementString = this.string; ///
|
|
201
201
|
|
|
202
|
-
context.trace(`Unifying the '${statementString}' statement independently
|
|
202
|
+
context.trace(`Unifying the '${statementString}' statement independently...`, this.node);
|
|
203
203
|
|
|
204
204
|
const definedAssertion = definedAssertionFromStatement(statement, context),
|
|
205
205
|
containedAssertion = containedAssertionFromStatement(statement, context);
|
|
@@ -217,7 +217,7 @@ export default domAssigned(class Statement {
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
if (unifiesIndependently) {
|
|
220
|
-
context.debug(`...unified the '${statementString}' statement independently
|
|
220
|
+
context.debug(`...unified the '${statementString}' statement independently.`, this.node);
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
return unifiesIndependently;
|
package/src/dom/step.js
CHANGED
|
@@ -9,13 +9,18 @@ import { domAssigned } from "../dom";
|
|
|
9
9
|
import { propertyAssertionFromStatement } from "../utilities/context";
|
|
10
10
|
|
|
11
11
|
export default domAssigned(class Step {
|
|
12
|
-
constructor(string, statement, reference, satisfiesAssertion) {
|
|
12
|
+
constructor(node, string, statement, reference, satisfiesAssertion) {
|
|
13
|
+
this.node = node;
|
|
13
14
|
this.string = string;
|
|
14
15
|
this.statement = statement;
|
|
15
16
|
this.reference = reference;
|
|
16
17
|
this.satisfiesAssertion = satisfiesAssertion;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
getNode() {
|
|
21
|
+
return this.node;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
getString() {
|
|
20
25
|
return this.string;
|
|
21
26
|
}
|
|
@@ -74,7 +79,7 @@ export default domAssigned(class Step {
|
|
|
74
79
|
|
|
75
80
|
const stepString = this.string; ///
|
|
76
81
|
|
|
77
|
-
context.trace(`Unifying the '${stepString}' step
|
|
82
|
+
context.trace(`Unifying the '${stepString}' step...`, this.node);
|
|
78
83
|
|
|
79
84
|
unifies = unifyMixins.some((unifyMixin) => {
|
|
80
85
|
const unifies = unifyMixin(this.statement, this.reference, this.satisfiesAssertion, substitutions, context);
|
|
@@ -85,7 +90,7 @@ export default domAssigned(class Step {
|
|
|
85
90
|
});
|
|
86
91
|
|
|
87
92
|
if (unifies) {
|
|
88
|
-
context.debug(`...unified the '${stepString}' step
|
|
93
|
+
context.debug(`...unified the '${stepString}' step.`, this.node);
|
|
89
94
|
}
|
|
90
95
|
|
|
91
96
|
return unifies;
|
|
@@ -96,7 +101,7 @@ export default domAssigned(class Step {
|
|
|
96
101
|
|
|
97
102
|
const stepString = this.string; ///
|
|
98
103
|
|
|
99
|
-
context.trace(`Verifying the '${stepString}' step
|
|
104
|
+
context.trace(`Verifying the '${stepString}' step...`, this.node);
|
|
100
105
|
|
|
101
106
|
if (this.statement !== null) {
|
|
102
107
|
const stated = this.isStated(),
|
|
@@ -127,11 +132,11 @@ export default domAssigned(class Step {
|
|
|
127
132
|
}
|
|
128
133
|
}
|
|
129
134
|
} else {
|
|
130
|
-
context.debug(`Cannot verify the '${stepString}' step because it is nonsense
|
|
135
|
+
context.debug(`Cannot verify the '${stepString}' step because it is nonsense.`, this.node);
|
|
131
136
|
}
|
|
132
137
|
|
|
133
138
|
if (verifies) {
|
|
134
|
-
context.debug(`...verified the '${stepString}' step
|
|
139
|
+
context.debug(`...verified the '${stepString}' step.`, this.node);
|
|
135
140
|
}
|
|
136
141
|
|
|
137
142
|
return verifies;
|
|
@@ -157,7 +162,7 @@ export default domAssigned(class Step {
|
|
|
157
162
|
const stepString = this.string, ///
|
|
158
163
|
satisfiesAssertionString = satisfiesAssertion.getString();
|
|
159
164
|
|
|
160
|
-
context.trace(`Unifying the '${stepString}' step with the '${satisfiesAssertionString}' satisfies assertion
|
|
165
|
+
context.trace(`Unifying the '${stepString}' step with the '${satisfiesAssertionString}' satisfies assertion...`, this.node);
|
|
161
166
|
|
|
162
167
|
const reference = satisfiesAssertion.getReference(),
|
|
163
168
|
axiom = context.findAxiomByReference(reference);
|
|
@@ -177,7 +182,7 @@ export default domAssigned(class Step {
|
|
|
177
182
|
}
|
|
178
183
|
|
|
179
184
|
if (unifiesWithSatisfiesAssertion) {
|
|
180
|
-
context.debug(`...unified the '${stepString}' step with the '${satisfiesAssertionString}' satisfies assertion
|
|
185
|
+
context.debug(`...unified the '${stepString}' step with the '${satisfiesAssertionString}' satisfies assertion.`, this.node);
|
|
181
186
|
}
|
|
182
187
|
|
|
183
188
|
return unifiesWithSatisfiesAssertion;
|
|
@@ -188,9 +193,10 @@ export default domAssigned(class Step {
|
|
|
188
193
|
static fromStatement(statement, context) {
|
|
189
194
|
const statementString = statement.getString(),
|
|
190
195
|
string = statementString, ///
|
|
196
|
+
node = null,
|
|
191
197
|
reference = null,
|
|
192
198
|
satisfiesAssertion = null,
|
|
193
|
-
step = new Step(string, statement, reference, satisfiesAssertion);
|
|
199
|
+
step = new Step(node, string, statement, reference, satisfiesAssertion);
|
|
194
200
|
|
|
195
201
|
return step;
|
|
196
202
|
}
|
|
@@ -209,7 +215,7 @@ export default domAssigned(class Step {
|
|
|
209
215
|
reference = Reference.fromStepNode(stepNode, context),
|
|
210
216
|
satisfiesAssertion = SatisfiesAssertion.fromStepNode(stepNode, context);
|
|
211
217
|
|
|
212
|
-
step = new Step(string, statement, reference, satisfiesAssertion);
|
|
218
|
+
step = new Step(node, string, statement, reference, satisfiesAssertion);
|
|
213
219
|
}
|
|
214
220
|
|
|
215
221
|
return step;
|
package/src/dom/subproof.js
CHANGED
|
@@ -8,20 +8,21 @@ import { domAssigned } from "../dom";
|
|
|
8
8
|
import { subproofStringFromSubproofNode } from "../utilities/subproof";
|
|
9
9
|
|
|
10
10
|
export default domAssigned(class Subproof {
|
|
11
|
-
constructor(string, suppositions, subDerivation) {
|
|
11
|
+
constructor(node, string, suppositions, subDerivation) {
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.suppositions = suppositions;
|
|
14
15
|
this.subDerivation = subDerivation;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
getString() {
|
|
18
|
-
return this.string;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
18
|
getNode() {
|
|
22
19
|
return this.node;
|
|
23
20
|
}
|
|
24
21
|
|
|
22
|
+
getString() {
|
|
23
|
+
return this.string;
|
|
24
|
+
}
|
|
25
|
+
|
|
25
26
|
getSuppositions() {
|
|
26
27
|
return this.suppositions;
|
|
27
28
|
}
|
|
@@ -142,9 +143,10 @@ export default domAssigned(class Subproof {
|
|
|
142
143
|
suppositions = suppositionsFromSubproofNode(subproofNode, context),
|
|
143
144
|
subDerivation = subDerivationFromSubproofNode(subproofNode, context),
|
|
144
145
|
subproofString = subproofStringFromSubproofNode(subproofNode, context),
|
|
146
|
+
node = subproofNode, ///
|
|
145
147
|
string = subproofString; ///
|
|
146
148
|
|
|
147
|
-
subproof = new Subproof(string, suppositions, subDerivation);
|
|
149
|
+
subproof = new Subproof(node, string, suppositions, subDerivation);
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
return subproof;
|
package/src/dom/supposition.js
CHANGED
|
@@ -8,12 +8,17 @@ import { subproofAssertionFromStatement } from "../utilities/context";
|
|
|
8
8
|
import { statementFromJSON, procedureCallFromJSON, statementToStatementJSON, procedureCallToProcedureCallJSON } from "../utilities/json";
|
|
9
9
|
|
|
10
10
|
export default domAssigned(class Supposition {
|
|
11
|
-
constructor(string, statement, procedureCall) {
|
|
11
|
+
constructor(node, string, statement, procedureCall) {
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.statement = statement;
|
|
14
15
|
this.procedureCall = procedureCall;
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
getNode() {
|
|
19
|
+
return this.node;
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
getString() {
|
|
18
23
|
return this.string;
|
|
19
24
|
}
|
|
@@ -31,7 +36,7 @@ export default domAssigned(class Supposition {
|
|
|
31
36
|
|
|
32
37
|
const suppositionString = this.string; ///
|
|
33
38
|
|
|
34
|
-
context.trace(`Verifying the '${suppositionString}' supposition
|
|
39
|
+
context.trace(`Verifying the '${suppositionString}' supposition...`, this.node);
|
|
35
40
|
|
|
36
41
|
if (false) {
|
|
37
42
|
///
|
|
@@ -62,11 +67,11 @@ export default domAssigned(class Supposition {
|
|
|
62
67
|
verifies = true;
|
|
63
68
|
}
|
|
64
69
|
} else {
|
|
65
|
-
context.debug(`Unable to verify the '${suppositionString}' supposition because it is nonsense
|
|
70
|
+
context.debug(`Unable to verify the '${suppositionString}' supposition because it is nonsense.`, this.node);
|
|
66
71
|
}
|
|
67
72
|
|
|
68
73
|
if (verifies) {
|
|
69
|
-
context.debug(`...verified the '${suppositionString}' supposition
|
|
74
|
+
context.debug(`...verified the '${suppositionString}' supposition.`, this.node);
|
|
70
75
|
}
|
|
71
76
|
|
|
72
77
|
return verifies;
|
|
@@ -80,7 +85,7 @@ export default domAssigned(class Supposition {
|
|
|
80
85
|
generalSuppositionString = this.string, ///
|
|
81
86
|
specificSuppositionString = specificSupposition.getString();
|
|
82
87
|
|
|
83
|
-
context.trace(`Unifying the '${specificSuppositionString}' supposition with the '${generalSuppositionString}' supposition
|
|
88
|
+
context.trace(`Unifying the '${specificSuppositionString}' supposition with the '${generalSuppositionString}' supposition...`, this.node);
|
|
84
89
|
|
|
85
90
|
const statement = specificSupposition.getStatement(),
|
|
86
91
|
statementUnifies = this.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
@@ -88,7 +93,7 @@ export default domAssigned(class Supposition {
|
|
|
88
93
|
suppositionUnifies = statementUnifies; ///
|
|
89
94
|
|
|
90
95
|
if (suppositionUnifies) {
|
|
91
|
-
context.debug(`...unified the '${specificSuppositionString}' supposition with the '${generalSuppositionString}' supposition
|
|
96
|
+
context.debug(`...unified the '${specificSuppositionString}' supposition with the '${generalSuppositionString}' supposition.`, this.node);
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
return suppositionUnifies;
|
|
@@ -167,7 +172,7 @@ export default domAssigned(class Supposition {
|
|
|
167
172
|
suppositionStatement = supposition.getStatement(),
|
|
168
173
|
suppositionStatementString = suppositionStatement.getString();
|
|
169
174
|
|
|
170
|
-
specificContext.trace(`Unifying the '${subproofString}' subproof with the supposition's '${suppositionStatementString}' statement
|
|
175
|
+
specificContext.trace(`Unifying the '${subproofString}' subproof with the supposition's '${suppositionStatementString}' statement...`, this.node);
|
|
171
176
|
|
|
172
177
|
if (this.statement !== null) {
|
|
173
178
|
const context = generalContext, ///
|
|
@@ -179,7 +184,7 @@ export default domAssigned(class Supposition {
|
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
if (subproofUnifies) {
|
|
182
|
-
specificContext.debug(`...unified the '${subproofString}' subproof with the supposition's '${suppositionStatementString}' statement
|
|
187
|
+
specificContext.debug(`...unified the '${subproofString}' subproof with the supposition's '${suppositionStatementString}' statement.`, this.node);
|
|
183
188
|
}
|
|
184
189
|
|
|
185
190
|
return subproofUnifies;
|
|
@@ -192,14 +197,14 @@ export default domAssigned(class Supposition {
|
|
|
192
197
|
statementString = statement.getString(),
|
|
193
198
|
suppositionString = supposition.getString();
|
|
194
199
|
|
|
195
|
-
specificContext.trace(`Unifying the '${statementString}' statement with the '${suppositionString}' supposition
|
|
200
|
+
specificContext.trace(`Unifying the '${statementString}' statement with the '${suppositionString}' supposition...`, this.node);
|
|
196
201
|
|
|
197
202
|
if (this.statement !== null) {
|
|
198
203
|
statementUnifies = this.statement.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
199
204
|
}
|
|
200
205
|
|
|
201
206
|
if (statementUnifies) {
|
|
202
|
-
specificContext.debug(`...unified the '${statementString}' statement with the '${suppositionString}' supposition
|
|
207
|
+
specificContext.debug(`...unified the '${statementString}' statement with the '${suppositionString}' supposition.`, this.node);
|
|
203
208
|
}
|
|
204
209
|
|
|
205
210
|
return statementUnifies;
|
|
@@ -234,7 +239,8 @@ export default domAssigned(class Supposition {
|
|
|
234
239
|
string = procedureCall.getString();
|
|
235
240
|
}
|
|
236
241
|
|
|
237
|
-
const
|
|
242
|
+
const node = null,
|
|
243
|
+
supposition = new Supposition(node, string, statement, procedureCall);
|
|
238
244
|
|
|
239
245
|
return supposition;
|
|
240
246
|
}
|
|
@@ -245,7 +251,7 @@ export default domAssigned(class Supposition {
|
|
|
245
251
|
string = context.nodeAsString(node),
|
|
246
252
|
statement = Statement.fromSuppositionNode(suppositionNode, context),
|
|
247
253
|
procedureCall = ProcedureCall.fromSuppositionNode(suppositionNode, context),
|
|
248
|
-
supposition = new Supposition(string, statement, procedureCall);
|
|
254
|
+
supposition = new Supposition(node, string, statement, procedureCall);
|
|
249
255
|
|
|
250
256
|
return supposition
|
|
251
257
|
}
|