occam-verify-cli 1.0.122 → 1.0.124
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 +4 -4
- package/lib/dom/assertion/satisfies.js +229 -0
- package/lib/dom/axiom.js +17 -17
- package/lib/dom/reference.js +5 -5
- package/lib/index.js +2 -2
- package/lib/mixins/statement/verify.js +12 -12
- package/lib/mixins/step/unify.js +13 -13
- package/lib/utilities/context.js +6 -6
- package/lib/utilities/json.js +6 -6
- package/package.json +5 -5
- package/src/constants.js +1 -1
- package/src/dom/assertion/{satisfying.js → satisfies.js} +28 -28
- package/src/dom/axiom.js +21 -21
- package/src/dom/reference.js +4 -4
- package/src/index.js +1 -1
- package/src/mixins/statement/verify.js +12 -12
- package/src/mixins/step/unify.js +13 -13
- package/src/utilities/context.js +4 -4
- package/src/utilities/json.js +3 -3
- package/lib/dom/assertion/satisfying.js +0 -229
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "occam-verify-cli",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.124",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/occam-verify-cli",
|
|
7
7
|
"description": "Occam's Verifier",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"argumentative": "^2.0.32",
|
|
14
14
|
"necessary": "^14.3.2",
|
|
15
|
-
"occam-custom-grammars": "^5.0.
|
|
16
|
-
"occam-entities": "^1.0.
|
|
17
|
-
"occam-file-system": "^6.0.
|
|
18
|
-
"occam-furtle": "^2.0.
|
|
15
|
+
"occam-custom-grammars": "^5.0.1130",
|
|
16
|
+
"occam-entities": "^1.0.330",
|
|
17
|
+
"occam-file-system": "^6.0.348",
|
|
18
|
+
"occam-furtle": "^2.0.119",
|
|
19
19
|
"occam-grammar-utilities": "^8.0.278",
|
|
20
20
|
"occam-lexers": "^23.0.47",
|
|
21
21
|
"occam-parsers": "^23.0.83",
|
package/src/constants.js
CHANGED
|
@@ -6,8 +6,8 @@ export const MISSING = "missing";
|
|
|
6
6
|
export const FUNCTION = "function";
|
|
7
7
|
export const TYPE_TYPE = "type";
|
|
8
8
|
export const UNDEFINED = "undefined";
|
|
9
|
-
export const SATISFYING = "Satisfying";
|
|
10
9
|
export const PROVISIONAL = "Provisional";
|
|
10
|
+
export const SATISFIABLE = "Satisfiable";
|
|
11
11
|
export const EMPTY_STRING = "";
|
|
12
12
|
export const PROVISIONALLY = "provisionally";
|
|
13
13
|
export const BRACKETED_TERM_DEPTH = 2;
|
|
@@ -5,10 +5,10 @@ import dom from "../../dom";
|
|
|
5
5
|
import { domAssigned } from "../../dom";
|
|
6
6
|
import { nodeQuery, nodesQuery } from "../../utilities/query";
|
|
7
7
|
|
|
8
|
-
const termNodesQuery = nodesQuery("/
|
|
9
|
-
|
|
8
|
+
const termNodesQuery = nodesQuery("/satisfiesAssertion/term"),
|
|
9
|
+
satisfiesAssertionNodeQuery = nodeQuery("/statement/satisfiesAssertion");
|
|
10
10
|
|
|
11
|
-
export default domAssigned(class
|
|
11
|
+
export default domAssigned(class SatisfiesAssertion {
|
|
12
12
|
constructor(string, node, tokens, terms, reference) {
|
|
13
13
|
this.string = string;
|
|
14
14
|
this.node = node;
|
|
@@ -42,16 +42,16 @@ export default domAssigned(class SatisfyingAssertion {
|
|
|
42
42
|
|
|
43
43
|
const termsString = termsStringFromTerms(this.terms),
|
|
44
44
|
substitutionsString = substitutions.asString(),
|
|
45
|
-
|
|
45
|
+
satisfiesAssertionString = this.string; ///
|
|
46
46
|
|
|
47
|
-
context.trace(`Matching the '${substitutionsString}' substitutions against the '${
|
|
47
|
+
context.trace(`Matching the '${substitutionsString}' substitutions against the '${satisfiesAssertionString}' satisfies assertion's ${termsString} terms...`);
|
|
48
48
|
|
|
49
49
|
const termsEquate = substitutions.matchTerms(this.terms);
|
|
50
50
|
|
|
51
51
|
substitutionsMatch = termsEquate; ///
|
|
52
52
|
|
|
53
53
|
if (substitutionsMatch) {
|
|
54
|
-
context.debug(`...matched the '${substitutionsString}' substitutions against the '${
|
|
54
|
+
context.debug(`...matched the '${substitutionsString}' substitutions against the '${satisfiesAssertionString}' satisfies assertion's ${termsString} terms.`);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
return substitutionsMatch;
|
|
@@ -60,9 +60,9 @@ export default domAssigned(class SatisfyingAssertion {
|
|
|
60
60
|
verify(assignments, stated, context) {
|
|
61
61
|
let verified = false;
|
|
62
62
|
|
|
63
|
-
const
|
|
63
|
+
const satisfiesAssertionString = this.string; ///
|
|
64
64
|
|
|
65
|
-
context.trace(`Verifying the '${
|
|
65
|
+
context.trace(`Verifying the '${satisfiesAssertionString}' satisfies assertion...`);
|
|
66
66
|
|
|
67
67
|
const termsVerified = this.verifyTerms(assignments, stated, context);
|
|
68
68
|
|
|
@@ -73,7 +73,7 @@ export default domAssigned(class SatisfyingAssertion {
|
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
if (verified) {
|
|
76
|
-
context.debug(`...verified the '${
|
|
76
|
+
context.debug(`...verified the '${satisfiesAssertionString}' satisfies assertion.`);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
return verified;
|
|
@@ -83,9 +83,9 @@ export default domAssigned(class SatisfyingAssertion {
|
|
|
83
83
|
let termsVerified;
|
|
84
84
|
|
|
85
85
|
const termsString = termsStringFromTerms(this.terms),
|
|
86
|
-
|
|
86
|
+
satisfiesAssertionString = this.string; ///
|
|
87
87
|
|
|
88
|
-
context.trace(`Verifying the '${
|
|
88
|
+
context.trace(`Verifying the '${satisfiesAssertionString}' satisfies assertion's ${termsString} terms...`);
|
|
89
89
|
|
|
90
90
|
termsVerified = this.terms.every((term) => {
|
|
91
91
|
const termVerified = term.verify(context, () => {
|
|
@@ -98,7 +98,7 @@ export default domAssigned(class SatisfyingAssertion {
|
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
if (termsVerified) {
|
|
101
|
-
context.debug(`...verified the '${
|
|
101
|
+
context.debug(`...verified the '${satisfiesAssertionString}' satisfies assertion's ${termsString} terms.`);
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
return termsVerified;
|
|
@@ -108,46 +108,46 @@ export default domAssigned(class SatisfyingAssertion {
|
|
|
108
108
|
let referenceVerified = false;
|
|
109
109
|
|
|
110
110
|
const referenceString = this.reference.getString(),
|
|
111
|
-
|
|
111
|
+
satisfiesAssertionString = this.string; ///
|
|
112
112
|
|
|
113
|
-
context.trace(`Verifying the '${
|
|
113
|
+
context.trace(`Verifying the '${satisfiesAssertionString}' satisfies assertion's '${referenceString}' reference...`);
|
|
114
114
|
|
|
115
115
|
const axiom = context.findAxiomByReference(this.reference, context);
|
|
116
116
|
|
|
117
117
|
if (axiom !== null) {
|
|
118
|
-
const
|
|
118
|
+
const axiomSatisfiable = axiom.isSatisfiable();
|
|
119
119
|
|
|
120
|
-
if (
|
|
120
|
+
if (axiomSatisfiable) {
|
|
121
121
|
referenceVerified = true;
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
if (referenceVerified) {
|
|
126
|
-
context.debug(`...verified the '${
|
|
126
|
+
context.debug(`...verified the '${satisfiesAssertionString}' satisfies assertion's '${referenceString}' reference.`);
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
return referenceVerified;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
static name = "
|
|
132
|
+
static name = "SatisfiesAssertion";
|
|
133
133
|
|
|
134
134
|
static fromStatementNode(statementNode, context) {
|
|
135
|
-
let
|
|
135
|
+
let satisfiesAssertion = null;
|
|
136
136
|
|
|
137
|
-
const
|
|
137
|
+
const satisfiesAssertionNode = satisfiesAssertionNodeQuery(statementNode);
|
|
138
138
|
|
|
139
|
-
if (
|
|
139
|
+
if (satisfiesAssertionNode !== null) {
|
|
140
140
|
const { Reference } = dom,
|
|
141
|
-
node =
|
|
141
|
+
node = satisfiesAssertionNode, ///
|
|
142
142
|
string = context.nodeAsString(node),
|
|
143
143
|
tokens = context.nodeAsTokens(node),
|
|
144
|
-
terms =
|
|
145
|
-
reference = Reference.
|
|
144
|
+
terms = termsFromSatisfiesAssertionNode(satisfiesAssertionNode, context),
|
|
145
|
+
reference = Reference.fromSatisfiesAssertionNode(satisfiesAssertionNode, context);
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
satisfiesAssertion = new SatisfiesAssertion(string, node, tokens, terms, reference);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
return
|
|
150
|
+
return satisfiesAssertion;
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
|
|
@@ -165,8 +165,8 @@ function termsStringFromTerms(terms) {
|
|
|
165
165
|
return termsString;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
function
|
|
169
|
-
const termNodes = termNodesQuery(
|
|
168
|
+
function termsFromSatisfiesAssertionNode(satisfiesAssertionNode, context) {
|
|
169
|
+
const termNodes = termNodesQuery(satisfiesAssertionNode),
|
|
170
170
|
terms = termNodes.map((termNode) => {
|
|
171
171
|
const { Term } = dom,
|
|
172
172
|
term = Term.fromTermNode(termNode, context);
|
package/src/dom/axiom.js
CHANGED
|
@@ -5,16 +5,16 @@ import { arrayUtilities } from "necessary";
|
|
|
5
5
|
import TopLevelAssertion from "./topLevelAssertion";
|
|
6
6
|
|
|
7
7
|
import { nodeQuery } from "../utilities/query";
|
|
8
|
-
import {
|
|
8
|
+
import { SATISFIABLE } from "../constants";
|
|
9
9
|
import { domAssigned } from "../dom";
|
|
10
10
|
import { labelsFromJSON,
|
|
11
11
|
deductionFromJSON,
|
|
12
|
-
|
|
12
|
+
satisfiableFromJSON,
|
|
13
13
|
labelsToLabelsJSON,
|
|
14
14
|
suppositionsFromJSON,
|
|
15
15
|
deductionToDeductionJSON,
|
|
16
16
|
suppositionsToSuppositionsJSON } from "../utilities/json";
|
|
17
|
-
import {
|
|
17
|
+
import { satisfiesAssertionFromStatement } from "../utilities/context";
|
|
18
18
|
import { proofFromNode, labelsFromNode, deductionFromNode, suppositionsFromNode, stringFromLabelsAndDeduction } from "./topLevelAssertion";
|
|
19
19
|
|
|
20
20
|
const { match, backwardsSome } = arrayUtilities;
|
|
@@ -22,14 +22,14 @@ const { match, backwardsSome } = arrayUtilities;
|
|
|
22
22
|
const firstPrimaryKeywordTerminalNodeQuery = nodeQuery("/axiom/@primary-keyword[0]");
|
|
23
23
|
|
|
24
24
|
export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
25
|
-
constructor(fileContext, string, labels, suppositions, deduction, proof,
|
|
25
|
+
constructor(fileContext, string, labels, suppositions, deduction, proof, satisfiable) {
|
|
26
26
|
super(fileContext, string, labels, suppositions, deduction, proof);
|
|
27
27
|
|
|
28
|
-
this.
|
|
28
|
+
this.satisfiable = satisfiable;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
return this.
|
|
31
|
+
isSatisfiable() {
|
|
32
|
+
return this.satisfiable;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
verify() {
|
|
@@ -163,17 +163,17 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
163
163
|
statementAndStepsOrSubproofsUnified = super.unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, substitutions, context);
|
|
164
164
|
|
|
165
165
|
if (statementAndStepsOrSubproofsUnified) {
|
|
166
|
-
if (this.
|
|
166
|
+
if (this.satisfiable) {
|
|
167
167
|
const substitutionsMatch = backwardsSome(stepsOrSubproofs, (stepOrSubproof) => {
|
|
168
168
|
const stepSubstep = stepOrSubproof.isStep();
|
|
169
169
|
|
|
170
170
|
if (stepSubstep) {
|
|
171
171
|
const step = stepOrSubproof, ///
|
|
172
172
|
statement = step.getStatement(),
|
|
173
|
-
|
|
173
|
+
satisfiesAssertion = satisfiesAssertionFromStatement(statement, context);
|
|
174
174
|
|
|
175
|
-
if (
|
|
176
|
-
const substitutionsMatch =
|
|
175
|
+
if (satisfiesAssertion !== null) {
|
|
176
|
+
const substitutionsMatch = satisfiesAssertion.matchSubstitutions(substitutions, context);
|
|
177
177
|
|
|
178
178
|
if (substitutionsMatch) {
|
|
179
179
|
return true;
|
|
@@ -202,12 +202,12 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
202
202
|
deduction = deductionJSON; ///
|
|
203
203
|
suppositions = suppositionsJSON; ///
|
|
204
204
|
|
|
205
|
-
const
|
|
205
|
+
const satisfiable = this.satisfiable,
|
|
206
206
|
json = {
|
|
207
207
|
labels,
|
|
208
208
|
deduction,
|
|
209
209
|
suppositions,
|
|
210
|
-
|
|
210
|
+
satisfiable
|
|
211
211
|
};
|
|
212
212
|
|
|
213
213
|
return json;
|
|
@@ -220,9 +220,9 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
220
220
|
suppositions = suppositionsFromJSON(json, fileContext),
|
|
221
221
|
deduction = deductionFromJSON(json, fileContext),
|
|
222
222
|
proof = null,
|
|
223
|
-
|
|
223
|
+
satisfiable = satisfiableFromJSON(json, fileContext),
|
|
224
224
|
string = stringFromLabelsAndDeduction(labels, deduction),
|
|
225
|
-
topLevelAssertion = new Axiom(fileContext, string, labels, suppositions, deduction, proof,
|
|
225
|
+
topLevelAssertion = new Axiom(fileContext, string, labels, suppositions, deduction, proof, satisfiable);
|
|
226
226
|
|
|
227
227
|
return topLevelAssertion;
|
|
228
228
|
}
|
|
@@ -233,20 +233,20 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
233
233
|
suppositions = suppositionsFromNode(node, fileContext),
|
|
234
234
|
deduction = deductionFromNode(node, fileContext),
|
|
235
235
|
proof = proofFromNode(node, fileContext),
|
|
236
|
-
|
|
236
|
+
satisfiable = satisfiableFromNode(node, fileContext),
|
|
237
237
|
string = stringFromLabelsAndDeduction(labels, deduction),
|
|
238
|
-
topLevelAssertion = new Axiom(fileContext, string, labels, suppositions, deduction, proof,
|
|
238
|
+
topLevelAssertion = new Axiom(fileContext, string, labels, suppositions, deduction, proof, satisfiable);
|
|
239
239
|
|
|
240
240
|
return topLevelAssertion;
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
243
|
|
|
244
|
-
function
|
|
244
|
+
function satisfiableFromNode(node, fileContext) {
|
|
245
245
|
const firstPrimaryKeywordTerminalNode = firstPrimaryKeywordTerminalNodeQuery(node),
|
|
246
246
|
content = firstPrimaryKeywordTerminalNode.getContent(),
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
contentSatisfiable = (content === SATISFIABLE),
|
|
248
|
+
satisfiable = contentSatisfiable; ///
|
|
249
249
|
|
|
250
|
-
return
|
|
250
|
+
return satisfiable;
|
|
251
251
|
}
|
|
252
252
|
|
package/src/dom/reference.js
CHANGED
|
@@ -13,7 +13,7 @@ import { metavariableFromJSON, metavariableToMetavariableJSON } from "../utiliti
|
|
|
13
13
|
const stepReferenceNodeQuery = nodeQuery("/step/reference"),
|
|
14
14
|
procedureCallReferenceNodeQuery = nodeQuery("/procedureCall/reference"),
|
|
15
15
|
declarationMetavariableNodeQuery = nodeQuery("/declaration/metavariable"),
|
|
16
|
-
|
|
16
|
+
satisfiesAssertionMetavariableNodeQuery = nodeQuery("/satisfiesAssertion/metavariable");
|
|
17
17
|
|
|
18
18
|
export default domAssigned(class Reference {
|
|
19
19
|
constructor(metavariable) {
|
|
@@ -228,9 +228,9 @@ export default domAssigned(class Reference {
|
|
|
228
228
|
return reference;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
static
|
|
232
|
-
const
|
|
233
|
-
metavariableNode =
|
|
231
|
+
static fromSatisfiesAssertionNode(satisfiesAssertionNode, fileContext) {
|
|
232
|
+
const satisfiesAssertionMetavariableNode = satisfiesAssertionMetavariableNodeQuery(satisfiesAssertionNode),
|
|
233
|
+
metavariableNode = satisfiesAssertionMetavariableNode, ///
|
|
234
234
|
reference = referenceFromMetavariableNode(metavariableNode, fileContext);
|
|
235
235
|
|
|
236
236
|
return reference;
|
package/src/index.js
CHANGED
|
@@ -41,7 +41,7 @@ import PropertyRelation from "./dom/relation/property";
|
|
|
41
41
|
import SubproofAssertion from "./dom/assertion/subproof";
|
|
42
42
|
import PropertyAssertion from "./dom/assertion/property";
|
|
43
43
|
import ContainedAssertion from "./dom/assertion/contained";
|
|
44
|
-
import
|
|
44
|
+
import SatisfiesAssertion from "./dom/assertion/satisfies";
|
|
45
45
|
import VariableDeclaration from "./dom/declaration/variable";
|
|
46
46
|
import BracketedCombinator from "./dom/combinator/bracketed";
|
|
47
47
|
import BracketedConstructor from "./dom/constructor/bracketed";
|
|
@@ -10,7 +10,7 @@ import { equalityFromStatement,
|
|
|
10
10
|
propertyAssertionFromStatement,
|
|
11
11
|
subproofAssertionFromStatement,
|
|
12
12
|
containedAssertionFromStatement,
|
|
13
|
-
|
|
13
|
+
satisfiesAssertionFromStatement } from "../../utilities/context";
|
|
14
14
|
|
|
15
15
|
function unifyWithBracketedCombinator(statement, assignments, stated, context) {
|
|
16
16
|
stated = true; ///
|
|
@@ -217,26 +217,26 @@ function verifyAsContainedAssertion(statement, assignments, stated, context) {
|
|
|
217
217
|
return verifiedAsContainedAssertion;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
function
|
|
221
|
-
let
|
|
220
|
+
function verifyAsSatisfiesAssertion(statement, assignments, stated, context) {
|
|
221
|
+
let verifiedAsSatisfiesAssertion = false;
|
|
222
222
|
|
|
223
|
-
const
|
|
223
|
+
const satisfiesAssertion = satisfiesAssertionFromStatement(statement, context);
|
|
224
224
|
|
|
225
|
-
if (
|
|
225
|
+
if (satisfiesAssertion !== null) {
|
|
226
226
|
const statementString = statement.getString();
|
|
227
227
|
|
|
228
|
-
context.trace(`Verifying the '${statementString}' statement as a
|
|
228
|
+
context.trace(`Verifying the '${statementString}' statement as a satisfies assertion...`);
|
|
229
229
|
|
|
230
|
-
const
|
|
230
|
+
const satisfiesAssertionVerified = satisfiesAssertion.verify(assignments, stated, context);
|
|
231
231
|
|
|
232
|
-
|
|
232
|
+
verifiedAsSatisfiesAssertion = satisfiesAssertionVerified; ///
|
|
233
233
|
|
|
234
|
-
if (
|
|
235
|
-
context.debug(`...verified the '${statementString}' statement as a
|
|
234
|
+
if (verifiedAsSatisfiesAssertion) {
|
|
235
|
+
context.debug(`...verified the '${statementString}' statement as a satisfies assertion.`);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
-
return
|
|
239
|
+
return verifiedAsSatisfiesAssertion;
|
|
240
240
|
}
|
|
241
241
|
|
|
242
242
|
const verifyMixins = [
|
|
@@ -250,7 +250,7 @@ const verifyMixins = [
|
|
|
250
250
|
verifyAsPropertyAssertion,
|
|
251
251
|
verifyAsSubproofAssertion,
|
|
252
252
|
verifyAsContainedAssertion,
|
|
253
|
-
|
|
253
|
+
verifyAsSatisfiesAssertion
|
|
254
254
|
];
|
|
255
255
|
|
|
256
256
|
export default verifyMixins;
|
package/src/mixins/step/unify.js
CHANGED
|
@@ -7,7 +7,7 @@ import { equalityFromStatement,
|
|
|
7
7
|
judgementFromStatement,
|
|
8
8
|
typeAssertionFromStatement,
|
|
9
9
|
propertyAssertionFromStatement,
|
|
10
|
-
|
|
10
|
+
satisfiesAssertionFromStatement } from "../../utilities/context";
|
|
11
11
|
|
|
12
12
|
function unifyAWithRule(statement, reference, substitutions, context) {
|
|
13
13
|
let unifiedWithRule = false;
|
|
@@ -65,40 +65,40 @@ function unifyAWithReference(statement, reference, substitutions, context) {
|
|
|
65
65
|
return unifiedWithReference;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function
|
|
69
|
-
let
|
|
68
|
+
function unifyAsSatisfiesAssertion(statement, reference, substitutions, context) {
|
|
69
|
+
let unifiedAsSatisfiesAssertion = false;
|
|
70
70
|
|
|
71
71
|
if (reference !== null) {
|
|
72
|
-
const
|
|
72
|
+
const satisfiesAssertion = satisfiesAssertionFromStatement(statement, context);
|
|
73
73
|
|
|
74
|
-
if (
|
|
74
|
+
if (satisfiesAssertion !== null) {
|
|
75
75
|
const statementString = statement.getString();
|
|
76
76
|
|
|
77
|
-
context.trace(`Unifying the '${statementString}' statement as a
|
|
77
|
+
context.trace(`Unifying the '${statementString}' statement as a satisfies assertion...`);
|
|
78
78
|
|
|
79
79
|
const axiomLemmaTheoremConjecture = context.findAxiomLemmaTheoremConjectureByReference(reference);
|
|
80
80
|
|
|
81
81
|
if (axiomLemmaTheoremConjecture !== null) {
|
|
82
|
-
reference =
|
|
82
|
+
reference = satisfiesAssertion.getReference();
|
|
83
83
|
|
|
84
84
|
const axiom = context.findAxiomByReference(reference),
|
|
85
85
|
substitutions = Substitutions.fromNothing(),
|
|
86
86
|
axiomLemmaTheoremConjectureUnified = axiom.unifyAxiomLemmaTheoremConjecture(axiomLemmaTheoremConjecture, substitutions, context);
|
|
87
87
|
|
|
88
88
|
if (axiomLemmaTheoremConjectureUnified) {
|
|
89
|
-
const substitutionsMatch =
|
|
89
|
+
const substitutionsMatch = satisfiesAssertion.matchSubstitutions(substitutions, context);
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
unifiedAsSatisfiesAssertion = substitutionsMatch; ///
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
if (
|
|
96
|
-
context.debug(`...unified the '${statementString}' statement as a
|
|
95
|
+
if (unifiedAsSatisfiesAssertion) {
|
|
96
|
+
context.debug(`...unified the '${statementString}' statement as a satisfies assertion.`);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
return
|
|
101
|
+
return unifiedAsSatisfiesAssertion;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
function unifyAWithAxiomLemmaTheoremOrConjecture(statement, reference, substitutions, context) {
|
|
@@ -253,7 +253,7 @@ function unifyWithStepsOrSubproofs(statement, reference, substitutions, context)
|
|
|
253
253
|
const unifyMixins = [
|
|
254
254
|
unifyAWithRule,
|
|
255
255
|
unifyAWithReference,
|
|
256
|
-
|
|
256
|
+
unifyAsSatisfiesAssertion,
|
|
257
257
|
unifyAWithAxiomLemmaTheoremOrConjecture,
|
|
258
258
|
unifyAsEquality,
|
|
259
259
|
unifyAsJudgement,
|
package/src/utilities/context.js
CHANGED
|
@@ -93,14 +93,14 @@ export function containedAssertionFromStatement(statement, context) {
|
|
|
93
93
|
return containedAssertion;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
export function
|
|
96
|
+
export function satisfiesAssertionFromStatement(statement, context) {
|
|
97
97
|
context = contextFromStatement(statement, context); ///
|
|
98
98
|
|
|
99
|
-
const {
|
|
99
|
+
const { SatisfiesAssertion } = dom,
|
|
100
100
|
statementNode = statement.getNode(),
|
|
101
|
-
|
|
101
|
+
satisfiesAssertion = SatisfiesAssertion.fromStatementNode(statementNode, context);
|
|
102
102
|
|
|
103
|
-
return
|
|
103
|
+
return satisfiesAssertion;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
function contextFromFrame(frame, context) {
|
package/src/utilities/json.js
CHANGED
|
@@ -84,10 +84,10 @@ export function deductionFromJSON(json, fileContext) {
|
|
|
84
84
|
return deduction;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
export function
|
|
88
|
-
const {
|
|
87
|
+
export function satisfiableFromJSON(json, fileContext) {
|
|
88
|
+
const { satisfiable } = json;
|
|
89
89
|
|
|
90
|
-
return
|
|
90
|
+
return satisfiable;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
export function conclusionFromJSON(json, fileContext) {
|