occam-verify-cli 1.0.724 → 1.0.728
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/context/file/nominal.js +10 -27
- package/lib/context.js +5 -1
- package/lib/element/assertion.js +2 -4
- package/lib/element/assumption.js +4 -6
- package/lib/element/equality.js +2 -4
- package/lib/element/frame.js +2 -4
- package/lib/element/judgement.js +2 -4
- package/lib/element/label.js +48 -21
- package/lib/element/metavariable.js +6 -5
- package/lib/element/reference.js +5 -7
- package/lib/element/rule.js +17 -5
- package/lib/element/statement.js +4 -6
- package/lib/element/substitution/term.js +2 -2
- package/lib/element/substitution.js +3 -5
- package/lib/element/term.js +3 -5
- package/lib/element/topLevelAssertion.js +18 -6
- package/lib/element/topLevelMetaAssertion.js +20 -7
- package/lib/utilities/element.js +2 -11
- package/lib/utilities/unification.js +1 -7
- package/package.json +1 -1
- package/src/context/file/nominal.js +13 -40
- package/src/context.js +7 -0
- package/src/element/assertion.js +3 -7
- package/src/element/assumption.js +5 -9
- package/src/element/equality.js +3 -7
- package/src/element/frame.js +3 -7
- package/src/element/judgement.js +3 -7
- package/src/element/label.js +67 -22
- package/src/element/metavariable.js +8 -8
- package/src/element/reference.js +6 -10
- package/src/element/rule.js +26 -7
- package/src/element/statement.js +5 -9
- package/src/element/substitution/term.js +1 -1
- package/src/element/substitution.js +4 -8
- package/src/element/term.js +4 -8
- package/src/element/topLevelAssertion.js +27 -9
- package/src/element/topLevelMetaAssertion.js +31 -10
- package/src/utilities/element.js +2 -15
- package/src/utilities/unification.js +0 -2
|
@@ -23,15 +23,11 @@ export default class Substitution extends Element {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
matchSubstitutionNode(substitutionNode) {
|
|
26
|
-
const
|
|
26
|
+
const node = substitutionNode, ///
|
|
27
|
+
nodeMatches = this.matchNode(node),
|
|
28
|
+
substitutionNodeMatches = nodeMatches; ///
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const substitutionNodeB = substitutionNode, ///
|
|
31
|
-
substitutionNodeAAMatchesSubstitutionBNodeB = substitutionNodeA.match(substitutionNodeB),
|
|
32
|
-
equalTo = substitutionNodeAAMatchesSubstitutionBNodeB; ///
|
|
33
|
-
|
|
34
|
-
return equalTo;
|
|
30
|
+
return substitutionNodeMatches;
|
|
35
31
|
}
|
|
36
32
|
|
|
37
33
|
findValidSubstiution(context) {
|
package/src/element/term.js
CHANGED
|
@@ -42,15 +42,11 @@ export default define(class Term extends Element {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
matchTermNode(termNode) {
|
|
45
|
-
const
|
|
45
|
+
const node = termNode, ///
|
|
46
|
+
nodeMatches = this.matchNode(node),
|
|
47
|
+
termNodeMatches = nodeMatches; ///
|
|
46
48
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const termNodeB = termNode, ///
|
|
50
|
-
termNodeAAMatchesTermBNodeB = termNodeA.match(termNodeB),
|
|
51
|
-
equalTo = termNodeAAMatchesTermBNodeB; ///
|
|
52
|
-
|
|
53
|
-
return equalTo;
|
|
49
|
+
return termNodeMatches;
|
|
54
50
|
}
|
|
55
51
|
|
|
56
52
|
compareVariableIdentifier(variableIdentifier) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Element } from "occam-languages";
|
|
4
3
|
import { arrayUtilities } from "necessary";
|
|
5
|
-
import { asynchronousUtilities } from "occam-languages";
|
|
4
|
+
import { Element, asynchronousUtilities } from "occam-languages";
|
|
6
5
|
|
|
7
6
|
import { asyncScope } from "../utilities/context";
|
|
8
7
|
import { topLevelAssertionStringFromLabelsSuppositionsAndDeduction } from "../utilities/string";
|
|
@@ -259,6 +258,31 @@ export default class TopLevelAssertion extends Element {
|
|
|
259
258
|
return deductionVerifies;
|
|
260
259
|
}
|
|
261
260
|
|
|
261
|
+
async verifySupposition(supposition, context) {
|
|
262
|
+
let suppositionVerifies;
|
|
263
|
+
|
|
264
|
+
const suppositionString = supposition.getString(),
|
|
265
|
+
topLevelAssertionString = this.getString(); ///
|
|
266
|
+
|
|
267
|
+
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's '${suppositionString}' supposition...`);
|
|
268
|
+
|
|
269
|
+
suppositionVerifies = await supposition.verify(context)
|
|
270
|
+
|
|
271
|
+
if (suppositionVerifies) {
|
|
272
|
+
const subproofOrProofAssertion = supposition; ////
|
|
273
|
+
|
|
274
|
+
context.assignAssignments();
|
|
275
|
+
|
|
276
|
+
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (suppositionVerifies) {
|
|
280
|
+
context.debug(`...verified the '${topLevelAssertionString}' top level assertion's '${suppositionString}' supposition.`);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return suppositionVerifies;
|
|
284
|
+
}
|
|
285
|
+
|
|
262
286
|
async verifySuppositions(context) {
|
|
263
287
|
let suppositionsVerify;
|
|
264
288
|
|
|
@@ -267,15 +291,9 @@ export default class TopLevelAssertion extends Element {
|
|
|
267
291
|
context.trace(`Verifying the '${topLevelAssertionString}' top level assertion's suppositions...`);
|
|
268
292
|
|
|
269
293
|
suppositionsVerify = await asyncForwardsEvery(this.suppositions, async (supposition) => {
|
|
270
|
-
const suppositionVerifies = await
|
|
294
|
+
const suppositionVerifies = await this.verifySupposition(supposition, context);
|
|
271
295
|
|
|
272
296
|
if (suppositionVerifies) {
|
|
273
|
-
const subproofOrProofAssertion = supposition; ////
|
|
274
|
-
|
|
275
|
-
context.assignAssignments();
|
|
276
|
-
|
|
277
|
-
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
278
|
-
|
|
279
297
|
return true;
|
|
280
298
|
}
|
|
281
299
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { Element } from "occam-languages";
|
|
3
|
+
import { Element, asynchronousUtilities } from "occam-languages";
|
|
4
4
|
|
|
5
5
|
import { asyncScope } from "../utilities/context";
|
|
6
6
|
import { labelFromJSON,
|
|
@@ -12,6 +12,8 @@ import { labelFromJSON,
|
|
|
12
12
|
suppositionsToSuppositionsJSON,
|
|
13
13
|
substitutionsToSubstitutionsJSON } from "../utilities/json";
|
|
14
14
|
|
|
15
|
+
const { asyncForwardsEvery } = asynchronousUtilities;
|
|
16
|
+
|
|
15
17
|
export default class TopLevelMetaAssertion extends Element {
|
|
16
18
|
constructor(context, string, node, label, suppositions, deduction, proof, substitutions) {
|
|
17
19
|
super(context, string, node);
|
|
@@ -144,29 +146,48 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
144
146
|
return deductionVerifies;
|
|
145
147
|
}
|
|
146
148
|
|
|
149
|
+
async verifySupposition(supposition, context) {
|
|
150
|
+
let suppositionVerifies;
|
|
151
|
+
|
|
152
|
+
const suppositionString = supposition.getString(),
|
|
153
|
+
topLevelMetaAssertionString = this.getString(); ///
|
|
154
|
+
|
|
155
|
+
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta-assertion's '${suppositionString}' supposition...`);
|
|
156
|
+
|
|
157
|
+
suppositionVerifies = await supposition.verify(context)
|
|
158
|
+
|
|
159
|
+
if (suppositionVerifies) {
|
|
160
|
+
const subproofOrProofAssertion = supposition; ////
|
|
161
|
+
|
|
162
|
+
context.assignAssignments();
|
|
163
|
+
|
|
164
|
+
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (suppositionVerifies) {
|
|
168
|
+
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta-assertion's '${suppositionString}' supposition.`);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
return suppositionVerifies;
|
|
172
|
+
}
|
|
173
|
+
|
|
147
174
|
async verifySuppositions(context) {
|
|
148
175
|
let suppositionsVerify;
|
|
149
176
|
|
|
150
177
|
const topLevelMetaAssertionString = this.getString(); ///
|
|
151
178
|
|
|
152
|
-
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta
|
|
179
|
+
context.trace(`Verifying the '${topLevelMetaAssertionString}' top level meta-assertion's suppositions...`);
|
|
153
180
|
|
|
154
181
|
suppositionsVerify = await asyncForwardsEvery(this.suppositions, async (supposition) => {
|
|
155
|
-
const suppositionVerifies = await
|
|
182
|
+
const suppositionVerifies = await this.verifySupposition(supposition, context);
|
|
156
183
|
|
|
157
184
|
if (suppositionVerifies) {
|
|
158
|
-
const subproofOrProofAssertion = supposition; ////
|
|
159
|
-
|
|
160
|
-
context.assignAssignments();
|
|
161
|
-
|
|
162
|
-
context.addSubproofOrProofAssertion(subproofOrProofAssertion);
|
|
163
|
-
|
|
164
185
|
return true;
|
|
165
186
|
}
|
|
166
187
|
});
|
|
167
188
|
|
|
168
189
|
if (suppositionsVerify) {
|
|
169
|
-
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta
|
|
190
|
+
context.debug(`...verified the '${topLevelMetaAssertionString}' top level meta-assertion's suppositions.`);
|
|
170
191
|
}
|
|
171
192
|
|
|
172
193
|
return suppositionsVerify;
|
package/src/utilities/element.js
CHANGED
|
@@ -520,7 +520,7 @@ export function equivalenceFromEquivalenceNode(equivalenceNode, context) {
|
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
export function metatheoremFromMetatheoremNode(metatheoremNode, context) {
|
|
523
|
-
const {
|
|
523
|
+
const { Metatheorem } = elements,
|
|
524
524
|
metaLemmaMetathoremNode = metatheoremNode, ///
|
|
525
525
|
proof = proofFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
526
526
|
label = labelFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context),
|
|
@@ -530,24 +530,11 @@ export function metatheoremFromMetatheoremNode(metatheoremNode, context) {
|
|
|
530
530
|
node = metatheoremNode, ///
|
|
531
531
|
string = topLevelMetaAssertionString, ///
|
|
532
532
|
substitutions = null,
|
|
533
|
-
metatheorem = new
|
|
533
|
+
metatheorem = new Metatheorem(context, string, node, label, suppositions, deduction, proof, substitutions);
|
|
534
534
|
|
|
535
535
|
return metatheorem;
|
|
536
536
|
}
|
|
537
537
|
|
|
538
|
-
export function referencesFromMetavariableNode(metavariableNode, context) {
|
|
539
|
-
const { Reference } = elements,
|
|
540
|
-
node = metavariableNode, ///
|
|
541
|
-
string = context.nodeAsString(node),
|
|
542
|
-
metavariable = metavariableFromMetavariableNode(metavariableNode, context);
|
|
543
|
-
|
|
544
|
-
context = null;
|
|
545
|
-
|
|
546
|
-
const reference = new Reference(context, string, node, metavariable);
|
|
547
|
-
|
|
548
|
-
return reference
|
|
549
|
-
}
|
|
550
|
-
|
|
551
538
|
export function metavariableFromMetavariableNode(metavariableNode, context) {
|
|
552
539
|
const { Metavariable } = elements,
|
|
553
540
|
node = metavariableNode, ///
|