occam-verify-cli 1.0.31 → 1.0.33
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/local.js +2 -2
- package/lib/dom/assertion/satisfying.js +212 -0
- package/lib/dom/axiom.js +37 -1
- package/lib/dom/lemma.js +3 -4
- package/lib/dom/metavariable.js +1 -2
- package/lib/dom/reference.js +24 -9
- package/lib/dom/supposition.js +2 -2
- package/lib/dom/topLevelAssertion.js +2 -2
- package/lib/equivalences.js +2 -2
- package/lib/index.js +2 -1
- package/lib/mixins/proofStep/unify.js +25 -2
- package/lib/mixins/statement/verify.js +29 -14
- package/lib/utilities/context.js +12 -4
- package/package.json +5 -5
- package/src/context/local.js +1 -1
- package/src/dom/assertion/satisfying.js +154 -0
- package/src/dom/axiom.js +61 -0
- package/src/dom/lemma.js +2 -3
- package/src/dom/metavariable.js +0 -1
- package/src/dom/reference.js +38 -29
- package/src/dom/supposition.js +1 -1
- package/src/dom/topLevelAssertion.js +3 -1
- package/src/equivalences.js +1 -1
- package/src/index.js +1 -0
- package/src/mixins/proofStep/unify.js +40 -2
- package/src/mixins/statement/verify.js +38 -14
- package/src/utilities/context.js +14 -4
|
@@ -8,8 +8,9 @@ import { equalityFromStatement,
|
|
|
8
8
|
typeAssertionFromStatement,
|
|
9
9
|
definedAssertionFromStatement,
|
|
10
10
|
propertyAssertionFromStatement,
|
|
11
|
+
subproofAssertionFromStatement,
|
|
11
12
|
containedAssertionFromStatement,
|
|
12
|
-
|
|
13
|
+
satisfyingAssertionFromStatement } from "../../utilities/context";
|
|
13
14
|
|
|
14
15
|
function unifyWithBracketedCombinator(statement, assignments, stated, context) {
|
|
15
16
|
stated = true; ///
|
|
@@ -172,6 +173,28 @@ function verifyAsPropertyAssertion(statement, assignments, stated, context) {
|
|
|
172
173
|
return verifiedAsPropertyAssertion;
|
|
173
174
|
}
|
|
174
175
|
|
|
176
|
+
function verifyAsSubproofAssertion(statement, assignments, stated, context) {
|
|
177
|
+
let verifiedAsSubproofAssertion = false;
|
|
178
|
+
|
|
179
|
+
const subproofAssertion = subproofAssertionFromStatement(statement, context);
|
|
180
|
+
|
|
181
|
+
if (subproofAssertion !== null) {
|
|
182
|
+
const statementString = statement.getString();
|
|
183
|
+
|
|
184
|
+
context.trace(`Verifying the '${statementString}' statement as a subproof assertion...`);
|
|
185
|
+
|
|
186
|
+
const subproofAssertionVerified = subproofAssertion.verify(assignments, stated, context);
|
|
187
|
+
|
|
188
|
+
verifiedAsSubproofAssertion = subproofAssertionVerified; ///
|
|
189
|
+
|
|
190
|
+
if (verifiedAsSubproofAssertion) {
|
|
191
|
+
context.debug(`...verified the '${statementString}' statement as a subproof assertion.`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return verifiedAsSubproofAssertion;
|
|
196
|
+
}
|
|
197
|
+
|
|
175
198
|
function verifyAsContainedAssertion(statement, assignments, stated, context) {
|
|
176
199
|
let verifiedAsContainedAssertion = false;
|
|
177
200
|
|
|
@@ -187,33 +210,33 @@ function verifyAsContainedAssertion(statement, assignments, stated, context) {
|
|
|
187
210
|
verifiedAsContainedAssertion = containedAssertionVerified; ///
|
|
188
211
|
|
|
189
212
|
if (verifiedAsContainedAssertion) {
|
|
190
|
-
context.debug(`...verified the '${statementString}' statement as a
|
|
213
|
+
context.debug(`...verified the '${statementString}' statement as a contained assertion.`);
|
|
191
214
|
}
|
|
192
215
|
}
|
|
193
216
|
|
|
194
217
|
return verifiedAsContainedAssertion;
|
|
195
218
|
}
|
|
196
219
|
|
|
197
|
-
function
|
|
198
|
-
let
|
|
220
|
+
function verifyAsSatisfyingAssertion(statement, assignments, stated, context) {
|
|
221
|
+
let verifiedAsSatisfyingAssertion = false;
|
|
199
222
|
|
|
200
|
-
const
|
|
223
|
+
const satisfyingAssertion = satisfyingAssertionFromStatement(statement, context);
|
|
201
224
|
|
|
202
|
-
if (
|
|
225
|
+
if (satisfyingAssertion !== null) {
|
|
203
226
|
const statementString = statement.getString();
|
|
204
227
|
|
|
205
|
-
context.trace(`Verifying the '${statementString}' statement as a
|
|
228
|
+
context.trace(`Verifying the '${statementString}' statement as a satisfying assertion...`);
|
|
206
229
|
|
|
207
|
-
const
|
|
230
|
+
const satisfyingAssertionVerified = satisfyingAssertion.verify(assignments, stated, context);
|
|
208
231
|
|
|
209
|
-
|
|
232
|
+
verifiedAsSatisfyingAssertion = satisfyingAssertionVerified; ///
|
|
210
233
|
|
|
211
|
-
if (
|
|
212
|
-
context.debug(`...verified the '${statementString}' statement as a
|
|
234
|
+
if (verifiedAsSatisfyingAssertion) {
|
|
235
|
+
context.debug(`...verified the '${statementString}' statement as a defined assertion.`);
|
|
213
236
|
}
|
|
214
237
|
}
|
|
215
238
|
|
|
216
|
-
return
|
|
239
|
+
return verifiedAsSatisfyingAssertion;
|
|
217
240
|
}
|
|
218
241
|
|
|
219
242
|
const verifyMixins = [
|
|
@@ -224,9 +247,10 @@ const verifyMixins = [
|
|
|
224
247
|
verifyAsJudgement,
|
|
225
248
|
verifyAsTypeAssertion,
|
|
226
249
|
verifyAsDefinedAssertion,
|
|
227
|
-
verifyAsContainedAssertion,
|
|
228
250
|
verifyAsPropertyAssertion,
|
|
229
|
-
verifyAsSubproofAssertion
|
|
251
|
+
verifyAsSubproofAssertion,
|
|
252
|
+
verifyAsContainedAssertion,
|
|
253
|
+
verifyAsSatisfyingAssertion
|
|
230
254
|
];
|
|
231
255
|
|
|
232
256
|
export default verifyMixins;
|
package/src/utilities/context.js
CHANGED
|
@@ -73,6 +73,16 @@ export function propertyAssertionFromStatement(statement, context) {
|
|
|
73
73
|
return propertyAssertion;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
+
export function subproofAssertionFromStatement(statement, context) {
|
|
77
|
+
context = contextFromStatement(statement, context); ///
|
|
78
|
+
|
|
79
|
+
const { SubproofAssertion } = dom,
|
|
80
|
+
statementNode = statement.getNode(),
|
|
81
|
+
subproofAssertion = SubproofAssertion.fromStatementNode(statementNode, context);
|
|
82
|
+
|
|
83
|
+
return subproofAssertion;
|
|
84
|
+
}
|
|
85
|
+
|
|
76
86
|
export function containedAssertionFromStatement(statement, context) {
|
|
77
87
|
context = contextFromStatement(statement, context); ///
|
|
78
88
|
|
|
@@ -83,14 +93,14 @@ export function containedAssertionFromStatement(statement, context) {
|
|
|
83
93
|
return containedAssertion;
|
|
84
94
|
}
|
|
85
95
|
|
|
86
|
-
export function
|
|
96
|
+
export function satisfyingAssertionFromStatement(statement, context) {
|
|
87
97
|
context = contextFromStatement(statement, context); ///
|
|
88
98
|
|
|
89
|
-
const {
|
|
99
|
+
const { SatisfyingAssertion } = dom,
|
|
90
100
|
statementNode = statement.getNode(),
|
|
91
|
-
|
|
101
|
+
satisfyingAssertion = SatisfyingAssertion.fromStatementNode(statementNode, context);
|
|
92
102
|
|
|
93
|
-
return
|
|
103
|
+
return satisfyingAssertion;
|
|
94
104
|
}
|
|
95
105
|
|
|
96
106
|
function contextFromFrame(frame, context) {
|