occam-verify-cli 1.0.444 → 1.0.457
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/constants.js +1 -5
- package/lib/context/file.js +54 -82
- package/lib/context/fragment.js +77 -0
- package/lib/context/release.js +5 -9
- package/lib/context/scoped.js +314 -0
- package/lib/context/transient.js +371 -0
- package/lib/element/assumption.js +71 -84
- package/lib/element/combinator/bracketed.js +1 -10
- package/lib/element/conclusion.js +11 -8
- package/lib/element/constructor/bracketed.js +1 -10
- package/lib/element/declaration/combinator.js +1 -2
- package/lib/element/declaration/metavariable.js +3 -3
- package/lib/element/declaration/variable.js +3 -3
- package/lib/element/deduction.js +18 -13
- package/lib/element/derivation.js +14 -14
- package/lib/element/frame.js +40 -46
- package/lib/element/hypothesis.js +14 -55
- package/lib/element/judgement.js +35 -56
- package/lib/element/metaType.js +5 -4
- package/lib/element/metavariable.js +14 -10
- package/lib/element/proof.js +10 -10
- package/lib/element/proofAssertion/premise.js +308 -0
- package/lib/element/proofAssertion/step.js +305 -0
- package/lib/element/proofAssertion/supposition.js +322 -0
- package/lib/element/proofAssertion.js +199 -0
- package/lib/element/reference.js +28 -25
- package/lib/element/rule.js +29 -29
- package/lib/element/section.js +4 -4
- package/lib/element/statement.js +9 -14
- package/lib/element/subDerivation.js +14 -14
- package/lib/element/subproof.js +14 -14
- package/lib/element/substitution/frame.js +7 -7
- package/lib/element/substitution/statement.js +15 -39
- package/lib/element/substitution.js +5 -5
- package/lib/element/term.js +12 -10
- package/lib/element/topLevelAssertion/axiom.js +329 -0
- package/lib/element/{conjecture.js → topLevelAssertion/conjecture.js} +7 -7
- package/lib/element/{lemma.js → topLevelAssertion/lemma.js} +6 -6
- package/lib/element/{theorem.js → topLevelAssertion/theorem.js} +7 -7
- package/lib/element/topLevelAssertion.js +427 -0
- package/lib/element/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +7 -7
- package/lib/element/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +7 -7
- package/lib/element/topLevelMetaAssertion.js +289 -0
- package/lib/element/type.js +4 -4
- package/lib/element/variable.js +20 -20
- package/lib/metaTypes.js +33 -19
- package/lib/node/proofAssertion/premise.js +116 -0
- package/lib/node/proofAssertion/step.js +152 -0
- package/lib/node/proofAssertion/supposition.js +116 -0
- package/lib/node/{premise.js → proofAssertion.js} +11 -18
- package/lib/node/statement.js +2 -2
- package/lib/node/subDerivation.js +1 -8
- package/lib/node/subproof.js +1 -8
- package/lib/node/substitution/statement.js +2 -2
- package/lib/node/{axiom.js → topLevelAssertion/axiom.js} +7 -7
- package/lib/node/{conjecture.js → topLevelAssertion/conjecture.js} +7 -7
- package/lib/node/{lemma.js → topLevelAssertion/lemma.js} +7 -7
- package/lib/node/{theorem.js → topLevelAssertion/theorem.js} +7 -7
- package/lib/node/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +9 -9
- package/lib/node/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +7 -7
- package/lib/node/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +7 -7
- package/lib/node/{metaLemmaMetaTheorem.js → topLevelMetaAssertion.js} +9 -9
- package/lib/nonTerminalNodeMap.js +13 -13
- package/lib/preamble.js +10 -10
- package/lib/process/instantiate.js +6 -9
- package/lib/process/unify.js +7 -6
- package/lib/types.js +3 -3
- package/lib/utilities/bnf.js +5 -5
- package/lib/utilities/brackets.js +6 -11
- package/lib/utilities/context.js +28 -0
- package/lib/utilities/element.js +101 -99
- package/lib/utilities/fragment.js +23 -0
- package/lib/utilities/instance.js +12 -21
- package/lib/utilities/json.js +3 -2
- package/lib/utilities/string.js +44 -23
- package/lib/utilities/unification.js +36 -36
- package/lib/utilities/validation.js +22 -25
- package/package.json +6 -6
- package/src/constants.js +0 -1
- package/src/context/file.js +51 -58
- package/src/context/fragment.js +38 -0
- package/src/context/release.js +6 -11
- package/src/context/{local.js → scoped.js} +35 -127
- package/src/context/{temporary.js → transient.js} +9 -131
- package/src/element/assumption.js +69 -85
- package/src/element/combinator/bracketed.js +0 -7
- package/src/element/conclusion.js +14 -10
- package/src/element/constructor/bracketed.js +0 -7
- package/src/element/declaration/combinator.js +0 -1
- package/src/element/declaration/metavariable.js +2 -2
- package/src/element/declaration/variable.js +5 -5
- package/src/element/deduction.js +22 -15
- package/src/element/derivation.js +12 -12
- package/src/element/frame.js +36 -48
- package/src/element/hypothesis.js +14 -16
- package/src/element/judgement.js +33 -58
- package/src/element/metaType.js +4 -4
- package/src/element/metavariable.js +17 -10
- package/src/element/proof.js +9 -9
- package/src/element/{premise.js → proofAssertion/premise.js} +107 -75
- package/src/element/{step.js → proofAssertion/step.js} +43 -89
- package/src/element/{supposition.js → proofAssertion/supposition.js} +89 -88
- package/src/element/proofAssertion.js +69 -0
- package/src/element/reference.js +27 -23
- package/src/element/rule.js +25 -25
- package/src/element/section.js +4 -4
- package/src/element/statement.js +8 -15
- package/src/element/subDerivation.js +12 -12
- package/src/element/subproof.js +10 -10
- package/src/element/substitution/frame.js +10 -13
- package/src/element/substitution/statement.js +20 -52
- package/src/element/substitution.js +3 -3
- package/src/element/term.js +10 -9
- package/src/element/{axiom.js → topLevelAssertion/axiom.js} +41 -41
- package/src/element/{conjecture.js → topLevelAssertion/conjecture.js} +4 -4
- package/src/element/{lemma.js → topLevelAssertion/lemma.js} +3 -3
- package/src/element/{theorem.js → topLevelAssertion/theorem.js} +4 -4
- package/src/element/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +30 -49
- package/src/element/{metaLemma.js → topLevelMetaAssertion/metaLemma.js} +4 -4
- package/src/element/{metatheorem.js → topLevelMetaAssertion/metatheorem.js} +4 -4
- package/src/element/{metaLemmaMetatheorem.js → topLevelMetaAssertion.js} +7 -72
- package/src/element/type.js +2 -4
- package/src/element/variable.js +17 -17
- package/src/metaTypes.js +42 -13
- package/src/node/proofAssertion/premise.js +16 -0
- package/src/node/{step.js → proofAssertion/step.js} +4 -18
- package/src/node/proofAssertion/supposition.js +16 -0
- package/src/node/proofAssertion.js +23 -0
- package/src/node/statement.js +1 -1
- package/src/node/subDerivation.js +0 -7
- package/src/node/subproof.js +0 -7
- package/src/node/substitution/statement.js +1 -1
- package/src/node/topLevelAssertion/axiom.js +13 -0
- package/src/node/topLevelAssertion/conjecture.js +13 -0
- package/src/node/topLevelAssertion/lemma.js +13 -0
- package/src/node/topLevelAssertion/theorem.js +13 -0
- package/src/node/{axiomLemmaTheoremConjecture.js → topLevelAssertion.js} +1 -1
- package/src/node/topLevelMetaAssertion/metaLemma.js +13 -0
- package/src/node/topLevelMetaAssertion/metatheorem.js +13 -0
- package/src/node/{metaLemmaMetaTheorem.js → topLevelMetaAssertion.js} +1 -1
- package/src/nonTerminalNodeMap.js +12 -12
- package/src/preamble.js +9 -9
- package/src/process/instantiate.js +31 -32
- package/src/process/unify.js +6 -5
- package/src/types.js +4 -2
- package/src/utilities/bnf.js +3 -2
- package/src/utilities/brackets.js +5 -8
- package/src/utilities/context.js +20 -0
- package/src/utilities/element.js +169 -162
- package/src/utilities/fragment.js +11 -0
- package/src/utilities/instance.js +19 -24
- package/src/utilities/json.js +3 -1
- package/src/utilities/string.js +57 -32
- package/src/utilities/unification.js +39 -39
- package/src/utilities/validation.js +26 -35
- package/lib/context/local.js +0 -605
- package/lib/context/temporary.js +0 -752
- package/lib/element/axiom.js +0 -329
- package/lib/element/axiomLemmaTheoremConjecture.js +0 -434
- package/lib/element/metaLemmaMetatheorem.js +0 -322
- package/lib/element/premise.js +0 -380
- package/lib/element/step.js +0 -390
- package/lib/element/supposition.js +0 -410
- package/lib/node/step.js +0 -166
- package/lib/node/supposition.js +0 -130
- package/src/node/axiom.js +0 -13
- package/src/node/conjecture.js +0 -13
- package/src/node/lemma.js +0 -13
- package/src/node/metaLemma.js +0 -13
- package/src/node/metatheorem.js +0 -13
- package/src/node/premise.js +0 -30
- package/src/node/supposition.js +0 -30
- package/src/node/theorem.js +0 -13
|
@@ -10,35 +10,35 @@ import { define } from "../elements";
|
|
|
10
10
|
const { last } = arrayUtilities;
|
|
11
11
|
|
|
12
12
|
export default define(class SubDerivation extends Element {
|
|
13
|
-
constructor(context, string, node,
|
|
13
|
+
constructor(context, string, node, subproofOrProofAssertions) {
|
|
14
14
|
super(context, string, node);
|
|
15
15
|
|
|
16
|
-
this.
|
|
16
|
+
this.subproofOrProofAssertions = subproofOrProofAssertions;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
return this.
|
|
19
|
+
getSubproofOrProofAssertions() {
|
|
20
|
+
return this.subproofOrProofAssertions;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
23
|
+
getLastProofAssertion() {
|
|
24
|
+
const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions),
|
|
25
|
+
lastProofAssertion = lastSubproofOrProofAssertion; ///
|
|
26
26
|
|
|
27
|
-
return
|
|
27
|
+
return lastProofAssertion;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
verify(substitutions, context) {
|
|
31
31
|
let verifies;
|
|
32
32
|
|
|
33
|
-
verifies = this.
|
|
33
|
+
verifies = this.subproofOrProofAssertions.every((subproofOrProofAssertion) => { ///
|
|
34
34
|
const assignments = [],
|
|
35
|
-
|
|
35
|
+
subproofOrProofAssertionVarifies = subproofOrProofAssertion.verify(substitutions, assignments, context);
|
|
36
36
|
|
|
37
|
-
if (
|
|
37
|
+
if (subproofOrProofAssertionVarifies) {
|
|
38
38
|
const assignmentsAssigned = assignAssignments(assignments, context);
|
|
39
39
|
|
|
40
40
|
if (assignmentsAssigned) {
|
|
41
|
-
context.
|
|
41
|
+
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
42
42
|
|
|
43
43
|
return true;
|
|
44
44
|
}
|
package/src/element/subproof.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import Element from "../element";
|
|
4
4
|
import elements from "../elements";
|
|
5
|
-
import
|
|
5
|
+
import ScopedContext from "../context/scoped";
|
|
6
6
|
|
|
7
7
|
import { define } from "../elements";
|
|
8
8
|
|
|
@@ -22,36 +22,36 @@ export default define(class Subproof extends Element {
|
|
|
22
22
|
return this.subDerivation;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
getLastProofAssertion() { return this.subDerivation.getLastProofAssertion(); }
|
|
26
26
|
|
|
27
27
|
getStatements() {
|
|
28
|
-
const
|
|
28
|
+
const lastProofAssertion = this.getLastProofAssertion(),
|
|
29
29
|
suppositionStatements = this.suppositions.map((supposition) => {
|
|
30
30
|
const suppositionStatement = supposition.getStatement();
|
|
31
31
|
|
|
32
32
|
return suppositionStatement;
|
|
33
33
|
}),
|
|
34
|
-
|
|
34
|
+
lastProofAssertionStatement = lastProofAssertion.getStatement(),
|
|
35
35
|
statements = [
|
|
36
36
|
...suppositionStatements,
|
|
37
|
-
|
|
37
|
+
lastProofAssertionStatement
|
|
38
38
|
];
|
|
39
39
|
|
|
40
40
|
return statements;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
const
|
|
43
|
+
isProofAssertion() {
|
|
44
|
+
const proofAssertion = false;
|
|
45
45
|
|
|
46
|
-
return
|
|
46
|
+
return proofAssertion;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
verify(substitutions, assignments, context) {
|
|
50
50
|
let verifies = false;
|
|
51
51
|
|
|
52
|
-
const
|
|
52
|
+
const scopedContext = ScopedContext.fromNothing(context); ///
|
|
53
53
|
|
|
54
|
-
context =
|
|
54
|
+
context = scopedContext; ///
|
|
55
55
|
|
|
56
56
|
const suppositionsVerify = this.suppositions.every((supposition) => {
|
|
57
57
|
const suppositionVerifies = supposition.verify(context);
|
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
import Substitution from "../substitution";
|
|
4
4
|
|
|
5
5
|
import { define } from "../../elements";
|
|
6
|
+
import { withinFragment } from "../../utilities/fragment";
|
|
6
7
|
import { instantiateFrameSubstitution } from "../../process/instantiate";
|
|
8
|
+
import { frameSubstitutionStringFromFrameAndMetavariable } from "../../utilities/string";
|
|
7
9
|
import { frameSubstitutionFromFrameSubstitutionNode, frameSubstitutionFromStatementNode } from "../../utilities/element";
|
|
8
10
|
|
|
9
11
|
export default define(class FrameSubstitution extends Substitution {
|
|
@@ -86,18 +88,13 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
86
88
|
}
|
|
87
89
|
|
|
88
90
|
static fromFrameAndMetavariable(frame, metavariable, context) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
return withinFragment((context) => {
|
|
92
|
+
const frameAndMetavariableString = frameSubstitutionStringFromFrameAndMetavariable(frame, metavariable),
|
|
93
|
+
string = frameAndMetavariableString, ///
|
|
94
|
+
frameSubstitutionNode = instantiateFrameSubstitution(string, context),
|
|
95
|
+
frameSubstitution = frameSubstitutionFromFrameSubstitutionNode(frameSubstitutionNode, context);
|
|
96
|
+
|
|
97
|
+
return frameSubstitution;
|
|
98
|
+
}, context);
|
|
94
99
|
}
|
|
95
100
|
});
|
|
96
|
-
|
|
97
|
-
function stringFromFrameAndMetavariable(frame, metavariable) {
|
|
98
|
-
const frameString = frame.getString(),
|
|
99
|
-
metavariableString = metavariable.getString(),
|
|
100
|
-
string = `[${frameString} for [${metavariableString}]]`;
|
|
101
|
-
|
|
102
|
-
return string;
|
|
103
|
-
}
|
|
@@ -4,11 +4,13 @@ import elements from "../../elements";
|
|
|
4
4
|
import Substitution from "../substitution";
|
|
5
5
|
|
|
6
6
|
import { define } from "../../elements";
|
|
7
|
+
import { withinFragment } from "../../utilities/fragment";
|
|
7
8
|
import { unifySubstitution } from "../../process/unify";
|
|
8
9
|
import { stripBracketsFromStatement } from "../../utilities/brackets";
|
|
9
10
|
import { instantiateStatementSubstitution } from "../../process/instantiate";
|
|
10
11
|
import { statementSubstitutionFromStatementSubstitutionNode } from "../../utilities/element";
|
|
11
12
|
import { statementFromJSON, statementToStatementJSON, metavariableFromJSON, metavariableToMetavariableJSON } from "../../utilities/json";
|
|
13
|
+
import { statementSubstitutionStringFromStatementAndMetavariable, statementSubstitutionStringFromStatementMetavariableAndSubstitution } from "../../utilities/string";
|
|
12
14
|
|
|
13
15
|
export default define(class StatementSubstitution extends Substitution {
|
|
14
16
|
constructor(context, string, node, resolved, statement, metavariable, substitution) {
|
|
@@ -73,12 +75,13 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
73
75
|
return substitutionEqualToSubstitution;
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
compareStatesment(statement, context) {
|
|
77
79
|
statement = stripBracketsFromStatement(statement, context); ///
|
|
78
80
|
|
|
79
|
-
const statementEqualToStatement = this.statement.isEqualTo(statement)
|
|
81
|
+
const statementEqualToStatement = this.statement.isEqualTo(statement),
|
|
82
|
+
comparesToStatement = statementEqualToStatement; ///
|
|
80
83
|
|
|
81
|
-
return
|
|
84
|
+
return comparesToStatement;
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
isSimple() {
|
|
@@ -214,18 +217,14 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
214
217
|
static fromStatementAndMetavariable(statement, metavariable, context) {
|
|
215
218
|
statement = stripBracketsFromStatement(statement, context); ///
|
|
216
219
|
|
|
217
|
-
const
|
|
218
|
-
|
|
220
|
+
const statementSubstitution = withinFragment((context) => {
|
|
221
|
+
const statementSubstitutionString = statementSubstitutionStringFromStatementAndMetavariable(statement, metavariable, context),
|
|
222
|
+
string = statementSubstitutionString, ///
|
|
223
|
+
statementSubstitutionNode = instantiateStatementSubstitution(string, context),
|
|
224
|
+
statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, context)
|
|
219
225
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
const statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, context);
|
|
225
|
-
|
|
226
|
-
statementSubstitution.setStatement(statement);
|
|
227
|
-
|
|
228
|
-
statementSubstitution.setMetavariable(metavariable);
|
|
226
|
+
return statementSubstitution;
|
|
227
|
+
}, context);
|
|
229
228
|
|
|
230
229
|
return statementSubstitution;
|
|
231
230
|
}
|
|
@@ -233,46 +232,15 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
233
232
|
static fromStatementMetavariableAndSubstitution(statement, metavariable, substitution, context) {
|
|
234
233
|
statement = stripBracketsFromStatement(statement, context); ///
|
|
235
234
|
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
};
|
|
235
|
+
const statementSubstitution = withinFragment((context) => {
|
|
236
|
+
const statementSubstitutionString = statementSubstitutionStringFromStatementMetavariableAndSubstitution(statement, metavariable, substitution),
|
|
237
|
+
string = statementSubstitutionString, ///
|
|
238
|
+
statementSubstitutionNode = instantiateStatementSubstitution(string, context),
|
|
239
|
+
statementSubstitution = statementSubstitutionFromStatementSubstitutionNode(statementSubstitutionNode, context)
|
|
242
240
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
statementSubstitution.setStatement(statement);
|
|
246
|
-
|
|
247
|
-
statementSubstitution.setMetavariable(metavariable);
|
|
248
|
-
|
|
249
|
-
statementSubstitution.setSubstitution(substitution);
|
|
241
|
+
return statementSubstitution;
|
|
242
|
+
}, context);
|
|
250
243
|
|
|
251
244
|
return statementSubstitution;
|
|
252
245
|
}
|
|
253
246
|
});
|
|
254
|
-
|
|
255
|
-
function stringFromStatementAndMetavariable(statement, metavariable) {
|
|
256
|
-
const statementString = statement.getString(),
|
|
257
|
-
metavariableString = metavariable.getString(),
|
|
258
|
-
string = `[${statementString} for ${metavariableString}]`;
|
|
259
|
-
|
|
260
|
-
return string;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
function stringFromStatementMetavariableAndSubstitution(statement, metavariable, substitution) {
|
|
264
|
-
let string;
|
|
265
|
-
|
|
266
|
-
const statementString = statement.getString(),
|
|
267
|
-
metavariableString = metavariable.getString();
|
|
268
|
-
|
|
269
|
-
if (substitution === null) {
|
|
270
|
-
string = `[${statementString} for ${metavariableString}]`;
|
|
271
|
-
} else {
|
|
272
|
-
const substitutionString = substitution.getString();
|
|
273
|
-
|
|
274
|
-
string = `[${statementString} for ${metavariableString}${substitutionString}]`;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
return string;
|
|
278
|
-
}
|
|
@@ -92,10 +92,10 @@ export default class Substitution extends Element {
|
|
|
92
92
|
return referenceEqualToReference;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
const
|
|
95
|
+
compareStatement(statement, context) {
|
|
96
|
+
const comparesToStatement = false;
|
|
97
97
|
|
|
98
|
-
return
|
|
98
|
+
return comparesToStatement;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
isMetavariableEqualToMetavariable(metavariable) {
|
package/src/element/term.js
CHANGED
|
@@ -112,16 +112,15 @@ export default define(class Term extends Element {
|
|
|
112
112
|
return validates;
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
|
|
116
|
-
let
|
|
115
|
+
validateGivenType(type, context) {
|
|
116
|
+
let validatesGivenType = false;
|
|
117
117
|
|
|
118
118
|
const typeString = type.getString(),
|
|
119
119
|
termString = this.getString(); ///
|
|
120
120
|
|
|
121
|
-
|
|
121
|
+
context.trace(`Validating the '${termString}' term given the '${typeString}' type...`);
|
|
122
122
|
|
|
123
|
-
const
|
|
124
|
-
validates = this.validate(context, () => {
|
|
123
|
+
const validates = this.validate(context, () => {
|
|
125
124
|
let verifiesAhead;
|
|
126
125
|
|
|
127
126
|
const typeEqualToOrSubTypeOfGivenTypeType = this.type.isEqualToOrSubTypeOf(type);
|
|
@@ -133,13 +132,15 @@ export default define(class Term extends Element {
|
|
|
133
132
|
return verifiesAhead;
|
|
134
133
|
});
|
|
135
134
|
|
|
136
|
-
|
|
135
|
+
if (validates) {
|
|
136
|
+
validatesGivenType = true;
|
|
137
|
+
}
|
|
137
138
|
|
|
138
|
-
if (
|
|
139
|
-
|
|
139
|
+
if (validatesGivenType) {
|
|
140
|
+
context.debug(`...validated the '${termString}' term given the '${typeString}' type.`);
|
|
140
141
|
}
|
|
141
142
|
|
|
142
|
-
return
|
|
143
|
+
return validatesGivenType;
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
toJSON() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import TopLevelAssertion from "../../node/topLevelAssertion";
|
|
4
4
|
|
|
5
|
-
import { define } from "
|
|
5
|
+
import { define } from "../../elements";
|
|
6
6
|
|
|
7
|
-
export default define(class Axiom extends
|
|
7
|
+
export default define(class Axiom extends TopLevelAssertion {
|
|
8
8
|
isSatisfiable() {
|
|
9
9
|
const signature = this.getSignature(),
|
|
10
10
|
satisfiable = (signature !== null);
|
|
@@ -110,29 +110,6 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
|
|
|
110
110
|
return stepUnifies;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
unifyLastStep(lastStep, substitutions, context) {
|
|
114
|
-
let lastStepUnifies = false;
|
|
115
|
-
|
|
116
|
-
const node = this.getNode(),
|
|
117
|
-
axiomString = this.getString(),
|
|
118
|
-
lastStepString = lastStep.getString();
|
|
119
|
-
|
|
120
|
-
context.trace(`Unifying the '${lastStepString}' last step with the '${axiomString}' axiom...`, node)
|
|
121
|
-
|
|
122
|
-
const statement = lastStep.getStatement(),
|
|
123
|
-
statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
|
|
124
|
-
|
|
125
|
-
if (statementUnifiesWithDeduction) {
|
|
126
|
-
lastStepUnifies = true;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (lastStepUnifies) {
|
|
130
|
-
context.debug(`...unified the '${lastStepString}' last step with the '${axiomString}' axiom.`, node)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return lastStepUnifies;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
113
|
unifySubproof(subproof, substitutions, context) {
|
|
137
114
|
let subproofUnifies = false;
|
|
138
115
|
|
|
@@ -147,10 +124,10 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
|
|
|
147
124
|
if (unconditional) {
|
|
148
125
|
context.trace(`Unable to unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional.`, node);
|
|
149
126
|
} else {
|
|
150
|
-
const
|
|
151
|
-
|
|
127
|
+
const lastProofAssertion = subproof.getLastProofAssertion(),
|
|
128
|
+
lastProofAssertionUnifies = this.unifyLastProofAssertion(lastProofAssertion, substitutions, context);
|
|
152
129
|
|
|
153
|
-
if (
|
|
130
|
+
if (lastProofAssertionUnifies) {
|
|
154
131
|
const suppositions = subproof.getSuppositions(),
|
|
155
132
|
suppositionsUnify = this.unifySuppositions(suppositions, substitutions, context);
|
|
156
133
|
|
|
@@ -225,19 +202,42 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
|
|
|
225
202
|
return suppositionsUnify;
|
|
226
203
|
}
|
|
227
204
|
|
|
228
|
-
|
|
229
|
-
let
|
|
205
|
+
unifyLastProofAssertion(lastProofAssertion, substitutions, context) {
|
|
206
|
+
let lastProofAssertionUnifies = false;
|
|
207
|
+
|
|
208
|
+
const node = this.getNode(),
|
|
209
|
+
axiomString = this.getString(),
|
|
210
|
+
lastProofAssertionString = lastProofAssertion.getString();
|
|
211
|
+
|
|
212
|
+
context.trace(`Unifying the '${lastProofAssertionString}' last proof assertion with the '${axiomString}' axiom...`, node)
|
|
213
|
+
|
|
214
|
+
const statement = lastProofAssertion.getStatement(),
|
|
215
|
+
statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, context);
|
|
216
|
+
|
|
217
|
+
if (statementUnifiesWithDeduction) {
|
|
218
|
+
lastProofAssertionUnifies = true;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (lastProofAssertionUnifies) {
|
|
222
|
+
context.debug(`...unified the '${lastProofAssertionString}' last proof assertion with the '${axiomString}' axiom.`, node)
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return lastProofAssertionUnifies;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
unifyTopLevelAssertion(topLevelAssertion, substitutions, context) {
|
|
229
|
+
let topLevelAssertionUnifies = false;
|
|
230
230
|
|
|
231
231
|
const node = this.getNode(),
|
|
232
232
|
axiomString = this.getString(),
|
|
233
|
-
|
|
233
|
+
topLevelAssertionString = topLevelAssertion.getString();
|
|
234
234
|
|
|
235
|
-
context.trace(`Unifying the '${
|
|
235
|
+
context.trace(`Unifying the '${topLevelAssertionString}' top level assertion with the '${axiomString}' axiom...`, node);
|
|
236
236
|
|
|
237
|
-
const hypothesesCorrelate =
|
|
237
|
+
const hypothesesCorrelate = topLevelAssertion.correlateHypotheses(context);
|
|
238
238
|
|
|
239
239
|
if (hypothesesCorrelate) {
|
|
240
|
-
const deduction =
|
|
240
|
+
const deduction = topLevelAssertion.getDeduction(), ///
|
|
241
241
|
specificContext = context; ///
|
|
242
242
|
|
|
243
243
|
context = this.getContext();
|
|
@@ -246,21 +246,21 @@ export default define(class Axiom extends AxiomLemmaTheoremConjecture {
|
|
|
246
246
|
deductionUnifies = this.unifyDeduction(deduction, substitutions, generalContext, specificContext);
|
|
247
247
|
|
|
248
248
|
if (deductionUnifies) {
|
|
249
|
-
const suppositions =
|
|
249
|
+
const suppositions = topLevelAssertion.getSuppositions(),
|
|
250
250
|
suppositionsUnify = this.unifySuppositions(suppositions, substitutions, generalContext, specificContext);
|
|
251
251
|
|
|
252
|
-
|
|
252
|
+
topLevelAssertionUnifies = suppositionsUnify; ///
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
if (
|
|
257
|
-
context.debug(`...unified the '${
|
|
256
|
+
if (topLevelAssertionUnifies) {
|
|
257
|
+
context.debug(`...unified the '${topLevelAssertionString}' top level assertion with the '${axiomString}' axiom.`, node);
|
|
258
258
|
}
|
|
259
259
|
|
|
260
|
-
return
|
|
260
|
+
return topLevelAssertionUnifies;
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
static name = "Axiom";
|
|
264
264
|
|
|
265
|
-
static fromJSON(json, context) { return
|
|
265
|
+
static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Axiom, json, context); }
|
|
266
266
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import TopLevelAssertion from "../topLevelAssertion";
|
|
4
4
|
|
|
5
|
-
import { define } from "
|
|
5
|
+
import { define } from "../../elements";
|
|
6
6
|
|
|
7
|
-
export default define(class Conjecture extends
|
|
7
|
+
export default define(class Conjecture extends TopLevelAssertion {
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
@@ -30,5 +30,5 @@ export default define(class Conjecture extends AxiomLemmaTheoremConjecture {
|
|
|
30
30
|
|
|
31
31
|
static name = "Conjecture";
|
|
32
32
|
|
|
33
|
-
static fromJSON(json, context) { return
|
|
33
|
+
static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Conjecture, json, context); }
|
|
34
34
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import TopLevelAssertion from "../topLevelAssertion";
|
|
4
4
|
|
|
5
|
-
import { define } from "
|
|
5
|
+
import { define } from "../../elements";
|
|
6
6
|
|
|
7
|
-
export default define(class Lemma extends
|
|
7
|
+
export default define(class Lemma extends TopLevelAssertion {
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import TopLevelAssertion from "../topLevelAssertion";
|
|
4
4
|
|
|
5
|
-
import { define } from "
|
|
5
|
+
import { define } from "../../elements";
|
|
6
6
|
|
|
7
|
-
export default define(class Theorem extends
|
|
7
|
+
export default define(class Theorem extends TopLevelAssertion {
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
@@ -29,5 +29,5 @@ export default define(class Theorem extends AxiomLemmaTheoremConjecture {
|
|
|
29
29
|
|
|
30
30
|
static name = "Theorem";
|
|
31
31
|
|
|
32
|
-
static fromJSON(json, context) { return
|
|
32
|
+
static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Theorem, json, context); }
|
|
33
33
|
});
|