occam-verify-cli 1.0.405 → 1.0.414
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 +3 -3
- package/lib/context/local.js +3 -3
- package/lib/context/release.js +2 -2
- package/lib/context/temporary.js +103 -54
- package/lib/mixins/statement/verify.js +2 -2
- package/lib/mixins/step/unify.js +2 -2
- package/lib/node/argument.js +2 -2
- package/lib/node/assumption.js +6 -6
- package/lib/node/frame.js +19 -7
- package/lib/node/judgement.js +8 -1
- package/lib/node/statement.js +34 -15
- package/lib/node/substitution/term.js +3 -11
- package/lib/node/term.js +20 -8
- package/lib/nonTerminalNode.js +3 -3
- package/lib/ontology/assertion/contained.js +7 -7
- package/lib/ontology/assertion/defined.js +8 -8
- package/lib/ontology/assertion/subproof.js +3 -3
- package/lib/ontology/assumption.js +49 -45
- package/lib/ontology/combinator.js +3 -3
- package/lib/ontology/constructor.js +3 -3
- package/lib/ontology/equality.js +4 -4
- package/lib/ontology/equivalence.js +2 -2
- package/lib/ontology/frame.js +37 -12
- package/lib/ontology/judgement.js +13 -6
- package/lib/ontology/metavariable.js +75 -76
- package/lib/ontology/propertyRelation.js +2 -2
- package/lib/ontology/reference.js +33 -4
- package/lib/ontology/signature.js +2 -2
- package/lib/ontology/statement.js +33 -8
- package/lib/ontology/step.js +4 -4
- package/lib/ontology/substitution/frame.js +13 -15
- package/lib/ontology/substitution/statement.js +31 -32
- package/lib/ontology/substitution/term.js +26 -25
- package/lib/ontology/substitution.js +2 -2
- package/lib/ontology/substitutions.js +4 -4
- package/lib/ontology/term.js +26 -12
- package/lib/ontology/variable.js +2 -2
- package/lib/process/equate.js +322 -0
- package/lib/process/unify.js +623 -0
- package/lib/process/verify.js +332 -0
- package/lib/utilities/brackets.js +3 -8
- package/lib/utilities/context.js +4 -14
- package/lib/utilities/json.js +18 -1
- package/lib/utilities/pass.js +68 -0
- package/lib/utilities/substitutions.js +11 -16
- package/package.json +2 -2
- package/src/context/file.js +2 -2
- package/src/context/local.js +2 -2
- package/src/context/release.js +1 -1
- package/src/context/temporary.js +124 -54
- package/src/mixins/statement/verify.js +3 -1
- package/src/mixins/step/unify.js +0 -1
- package/src/node/argument.js +1 -1
- package/src/node/assumption.js +4 -4
- package/src/node/frame.js +19 -5
- package/src/node/judgement.js +7 -0
- package/src/node/statement.js +35 -13
- package/src/node/substitution/term.js +4 -14
- package/src/node/term.js +20 -6
- package/src/nonTerminalNode.js +1 -1
- package/src/ontology/assertion/contained.js +6 -6
- package/src/ontology/assertion/defined.js +7 -7
- package/src/ontology/assertion/subproof.js +1 -1
- package/src/ontology/assumption.js +52 -57
- package/src/ontology/combinator.js +1 -1
- package/src/ontology/constructor.js +1 -1
- package/src/ontology/equality.js +3 -3
- package/src/ontology/equivalence.js +1 -1
- package/src/ontology/frame.js +44 -10
- package/src/ontology/judgement.js +8 -3
- package/src/ontology/metavariable.js +108 -102
- package/src/ontology/propertyRelation.js +3 -2
- package/src/ontology/reference.js +39 -1
- package/src/ontology/signature.js +3 -3
- package/src/ontology/statement.js +38 -4
- package/src/ontology/step.js +7 -7
- package/src/ontology/substitution/frame.js +13 -17
- package/src/ontology/substitution/statement.js +45 -48
- package/src/ontology/substitution/term.js +19 -19
- package/src/ontology/substitution.js +3 -2
- package/src/ontology/substitutions.js +3 -3
- package/src/ontology/term.js +26 -5
- package/src/ontology/variable.js +3 -2
- package/src/process/equate.js +212 -0
- package/src/process/unify.js +634 -0
- package/src/process/verify.js +204 -0
- package/src/utilities/brackets.js +2 -11
- package/src/utilities/context.js +1 -21
- package/src/utilities/json.js +19 -0
- package/src/utilities/{unifier.js → pass.js} +17 -1
- package/src/utilities/substitutions.js +10 -20
- package/lib/unifier/equantional.js +0 -170
- package/lib/unifier/intrinsicLevel.js +0 -144
- package/lib/unifier/metaLevel.js +0 -197
- package/lib/unifier/metavariable.js +0 -140
- package/lib/unifier/statementWithCombinator.js +0 -177
- package/lib/unifier/termWithConstructor.js +0 -145
- package/lib/unifier.js +0 -241
- package/lib/utilities/arguments.js +0 -28
- package/lib/utilities/frame.js +0 -18
- package/lib/utilities/metavariable.js +0 -18
- package/lib/utilities/statement.js +0 -18
- package/lib/utilities/unification.js +0 -109
- package/lib/utilities/unifier.js +0 -51
- package/lib/utilities/variable.js +0 -18
- package/lib/verifier/combinator.js +0 -158
- package/lib/verifier.js +0 -219
- package/src/unifier/equantional.js +0 -90
- package/src/unifier/intrinsicLevel.js +0 -52
- package/src/unifier/metaLevel.js +0 -151
- package/src/unifier/metavariable.js +0 -50
- package/src/unifier/statementWithCombinator.js +0 -114
- package/src/unifier/termWithConstructor.js +0 -56
- package/src/unifier.js +0 -183
- package/src/utilities/arguments.js +0 -21
- package/src/utilities/frame.js +0 -13
- package/src/utilities/metavariable.js +0 -13
- package/src/utilities/statement.js +0 -13
- package/src/utilities/unification.js +0 -136
- package/src/utilities/variable.js +0 -13
- package/src/verifier/combinator.js +0 -72
- package/src/verifier.js +0 -150
|
@@ -67,10 +67,10 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
67
67
|
|
|
68
68
|
context.trace(`Verifying the '${termString}' term...`);
|
|
69
69
|
|
|
70
|
-
const
|
|
70
|
+
const termSingular = this.term.isSingular();
|
|
71
71
|
|
|
72
|
-
if (!
|
|
73
|
-
context.debug(`The '${termString}' term is not
|
|
72
|
+
if (!termSingular) {
|
|
73
|
+
context.debug(`The '${termString}' term is not singular.`);
|
|
74
74
|
} else {
|
|
75
75
|
termVerifies = this.term.verify(context, () => {
|
|
76
76
|
const verifiesAhead = true;
|
|
@@ -95,10 +95,10 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
95
95
|
|
|
96
96
|
context.trace(`Verifying the '${frameString}' frame...`);
|
|
97
97
|
|
|
98
|
-
const
|
|
98
|
+
const frameSingular = this.frame.isSingular();
|
|
99
99
|
|
|
100
|
-
if (!
|
|
101
|
-
context.debug(`The '${frameString}' frame is not
|
|
100
|
+
if (!frameSingular) {
|
|
101
|
+
context.debug(`The '${frameString}' frame is not singular.`);
|
|
102
102
|
} else {
|
|
103
103
|
stated = true; ///
|
|
104
104
|
|
|
@@ -153,7 +153,7 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
153
153
|
unifyIndependently(substitutions, generalContext, specificContext) {
|
|
154
154
|
let unifiesIndependently;
|
|
155
155
|
|
|
156
|
-
const context =
|
|
156
|
+
const context = specificContext, ///
|
|
157
157
|
definedAssertionString = this.getString(); ///
|
|
158
158
|
|
|
159
159
|
context.trace(`Unifying the '${definedAssertionString}' defined assertion independently...`);
|
|
@@ -6,7 +6,7 @@ import ontology from "../../ontology";
|
|
|
6
6
|
import Assertion from "../assertion";
|
|
7
7
|
|
|
8
8
|
import { define } from "../../ontology";
|
|
9
|
-
import { unifyStatement } from "../../
|
|
9
|
+
import { unifyStatement } from "../../process/unify";
|
|
10
10
|
|
|
11
11
|
const { match } = arrayUtilities;
|
|
12
12
|
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import ontology from "../ontology";
|
|
4
4
|
|
|
5
5
|
import { define } from "../ontology";
|
|
6
|
-
import { unifyStatementIntrinsically } from "../
|
|
7
|
-
import {
|
|
6
|
+
import { unifyStatementIntrinsically } from "../process/unify";
|
|
7
|
+
import { referenceFromJSON, referenceToReferenceJSON } from "../utilities/json";
|
|
8
8
|
|
|
9
9
|
export default define(class Assumption {
|
|
10
|
-
constructor(string, node, statement,
|
|
10
|
+
constructor(string, node, statement, reference) {
|
|
11
11
|
this.string = string;
|
|
12
12
|
this.node = node;
|
|
13
13
|
this.statement = statement;
|
|
14
|
-
this.
|
|
14
|
+
this.reference = reference;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
getString() {
|
|
@@ -26,10 +26,12 @@ export default define(class Assumption {
|
|
|
26
26
|
return this.statement;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
return this.
|
|
29
|
+
getReference() {
|
|
30
|
+
return this.reference;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
getMetavariable() { return this.reference.getMetavariable(); }
|
|
34
|
+
|
|
33
35
|
isSimple() {
|
|
34
36
|
const simple = (this.statement === null);
|
|
35
37
|
|
|
@@ -47,7 +49,8 @@ export default define(class Assumption {
|
|
|
47
49
|
const simple = this.isSimple();
|
|
48
50
|
|
|
49
51
|
if (simple) {
|
|
50
|
-
const
|
|
52
|
+
const metavariable = this.reference.getMetavariable(),
|
|
53
|
+
judgement = context.findJudgementByMetavariable(metavariable);
|
|
51
54
|
|
|
52
55
|
if (judgement !== null) {
|
|
53
56
|
const assumption = judgement.getDeclaration();
|
|
@@ -58,9 +61,9 @@ export default define(class Assumption {
|
|
|
58
61
|
const statement = substitution.getStatement(),
|
|
59
62
|
metavariable = substitution.getMetavariable(),
|
|
60
63
|
statementEqualToStatement = this.statement.isEqualTo(statement),
|
|
61
|
-
|
|
64
|
+
referenceMetavariableEqualToMetavariable = this.reference.isMetavariableEqualToMetavariable(metavariable);
|
|
62
65
|
|
|
63
|
-
if (
|
|
66
|
+
if (statementEqualToStatement && referenceMetavariableEqualToMetavariable) {
|
|
64
67
|
substitutionMatches = true;
|
|
65
68
|
}
|
|
66
69
|
}
|
|
@@ -82,13 +85,13 @@ export default define(class Assumption {
|
|
|
82
85
|
const simple = this.isSimple();
|
|
83
86
|
|
|
84
87
|
if (simple) {
|
|
85
|
-
const
|
|
88
|
+
const referenceVerifiesAsMetavariable = this.verifyReferenceAsMetavariable(assignments, stated, context);
|
|
86
89
|
|
|
87
|
-
verifies =
|
|
90
|
+
verifies = referenceVerifiesAsMetavariable; ///
|
|
88
91
|
} else {
|
|
89
|
-
const
|
|
92
|
+
const referenceVerified = this.verifyReference(assignments, stated, context);
|
|
90
93
|
|
|
91
|
-
if (
|
|
94
|
+
if (referenceVerified) {
|
|
92
95
|
const statementVerifies = this.verifyStatement(assignments, stated, context);
|
|
93
96
|
|
|
94
97
|
if (statementVerifies) {
|
|
@@ -115,24 +118,21 @@ export default define(class Assumption {
|
|
|
115
118
|
return verifies;
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
|
|
119
|
-
let
|
|
120
|
-
|
|
121
|
-
const assumptionString = this.string,
|
|
122
|
-
metavariableString = this.metavariable.getString();
|
|
121
|
+
verifyReference(assignments, stated, context) {
|
|
122
|
+
let referenceVerified;
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
const referenceString = this.reference.getString(),
|
|
125
|
+
assumptionString = this.string; ///
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
referenceVerifies = reference.verify(context);
|
|
127
|
+
context.trace(`Verifying the '${assumptionString}' assumption's '${referenceString}' reference...`);
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
referenceVerified = this.reference.verify(context);
|
|
130
130
|
|
|
131
|
-
if (
|
|
132
|
-
context.debug(`...verified the '${assumptionString}' assumption's '${
|
|
131
|
+
if (referenceVerified) {
|
|
132
|
+
context.debug(`...verified the '${assumptionString}' assumption's '${referenceString}' reference.`);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
return
|
|
135
|
+
return referenceVerified;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
verifyStatement(assignments, stated, context) {
|
|
@@ -159,21 +159,27 @@ export default define(class Assumption {
|
|
|
159
159
|
return statementVerifies;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
|
|
163
|
-
let
|
|
162
|
+
verifyReferenceAsMetavariable(assignments, stated, context) {
|
|
163
|
+
let referenceVerifiesAsMetavariable = false;
|
|
164
164
|
|
|
165
|
-
const
|
|
166
|
-
|
|
165
|
+
const referenceString = this.reference.getString(),
|
|
166
|
+
assumptionString = this.string; ///
|
|
167
167
|
|
|
168
|
-
context.trace(`Verifying the '${assumptionString}' assumption's '${
|
|
168
|
+
context.trace(`Verifying the '${assumptionString}' assumption's '${referenceString}' reference as s metavariable...`);
|
|
169
169
|
|
|
170
|
-
|
|
170
|
+
const metavariable = this.reference.getMetavariable(),
|
|
171
|
+
metavariableName = metavariable.getName(),
|
|
172
|
+
metavariablePresent = context.isMetavariablePresentByMetavariableName(metavariableName);
|
|
171
173
|
|
|
172
|
-
if (
|
|
173
|
-
|
|
174
|
+
if (metavariablePresent) {
|
|
175
|
+
referenceVerifiesAsMetavariable = true;
|
|
174
176
|
}
|
|
175
177
|
|
|
176
|
-
|
|
178
|
+
if (referenceVerifiesAsMetavariable) {
|
|
179
|
+
context.debug(`...verified the '${assumptionString}' assumption's '${referenceString}' reference as a metavariable.`);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
return referenceVerifiesAsMetavariable;
|
|
177
183
|
}
|
|
178
184
|
|
|
179
185
|
verifyWhenStated(assignments, context) {
|
|
@@ -183,13 +189,12 @@ export default define(class Assumption {
|
|
|
183
189
|
|
|
184
190
|
context.trace(`Verifying the '${assumptionString}' stated assumption...`);
|
|
185
191
|
|
|
186
|
-
const
|
|
187
|
-
metavariablePresent = context.isMetavariablePresentByReference(reference);
|
|
192
|
+
const metavariablePresent = context.isMetavariablePresentByReference(this.reference);
|
|
188
193
|
|
|
189
194
|
if (metavariablePresent) {
|
|
190
195
|
verifiesWhenStated = true;
|
|
191
196
|
} else {
|
|
192
|
-
const metaLemmaMetatheorems = context.findMetaLemmaMetatheoremsByReference(reference),
|
|
197
|
+
const metaLemmaMetatheorems = context.findMetaLemmaMetatheoremsByReference(this.reference),
|
|
193
198
|
metaLemmaMetatheoremsUnify = metaLemmaMetatheorems.every((metaLemmaMetatheorem) => {
|
|
194
199
|
const metaLemmaMetatheoremUnifies = this.unifyMetaLemmaMetatheorem(metaLemmaMetatheorem, context);
|
|
195
200
|
|
|
@@ -215,8 +220,7 @@ export default define(class Assumption {
|
|
|
215
220
|
|
|
216
221
|
context.trace(`Verifying the '${assumptionString}' derived assumption...`);
|
|
217
222
|
|
|
218
|
-
const
|
|
219
|
-
metaLemmaMetatheoremPresent = context.isMetaLemmaMetatheoremPresentByReference(reference);
|
|
223
|
+
const metaLemmaMetatheoremPresent = context.isMetaLemmaMetatheoremPresentByReference(this.reference);
|
|
220
224
|
|
|
221
225
|
verifiesWhenDerived = metaLemmaMetatheoremPresent; ///
|
|
222
226
|
|
|
@@ -264,8 +268,7 @@ export default define(class Assumption {
|
|
|
264
268
|
|
|
265
269
|
context.trace(`Unifying the '${labelString}' label with the '${assumptionString}' assumption...`);
|
|
266
270
|
|
|
267
|
-
const
|
|
268
|
-
labelUnifies = reference.unifyLabel(label, substitutions, context);
|
|
271
|
+
const labelUnifies = this.reference.unifyLabel(label, substitutions, context);
|
|
269
272
|
|
|
270
273
|
labelUnifiesWithReference = labelUnifies; ///
|
|
271
274
|
|
|
@@ -325,10 +328,10 @@ export default define(class Assumption {
|
|
|
325
328
|
const simple = this.isSimple();
|
|
326
329
|
|
|
327
330
|
if (simple) {
|
|
328
|
-
const
|
|
329
|
-
|
|
331
|
+
const reference = this, ///
|
|
332
|
+
referenceJSON = referenceToReferenceJSON(reference);
|
|
330
333
|
|
|
331
|
-
json =
|
|
334
|
+
json = referenceJSON; ///
|
|
332
335
|
}
|
|
333
336
|
|
|
334
337
|
return json;
|
|
@@ -343,9 +346,9 @@ export default define(class Assumption {
|
|
|
343
346
|
const string = null,
|
|
344
347
|
node = null,
|
|
345
348
|
statement = null,
|
|
346
|
-
|
|
349
|
+
reference = referenceFromJSON(json, context);
|
|
347
350
|
|
|
348
|
-
assumption = new Assumption(string, node, statement,
|
|
351
|
+
assumption = new Assumption(string, node, statement, reference)
|
|
349
352
|
}
|
|
350
353
|
|
|
351
354
|
return assumption;
|
|
@@ -365,21 +368,13 @@ export default define(class Assumption {
|
|
|
365
368
|
}
|
|
366
369
|
});
|
|
367
370
|
|
|
368
|
-
function referenceFromMetavariable(metavariable, context) {
|
|
369
|
-
const { Reference } = ontology,
|
|
370
|
-
metavariableNode = metavariable.getNode(),
|
|
371
|
-
reference = Reference.fromMetavariableNode(metavariableNode, context);
|
|
372
|
-
|
|
373
|
-
return reference;
|
|
374
|
-
}
|
|
375
|
-
|
|
376
371
|
function assumptionFromAssumptionNode(assumptionNode, context) {
|
|
377
|
-
const {
|
|
372
|
+
const { Reference, Assumption, Statement } = ontology,
|
|
378
373
|
node = assumptionNode, ///
|
|
379
374
|
string = context.nodeAsString(node),
|
|
380
375
|
statement = Statement.fromAssumptionNode(assumptionNode, context),
|
|
381
|
-
|
|
382
|
-
assumption = new Assumption(string, node, statement,
|
|
376
|
+
reference = Reference.fromAssumptionNode(assumptionNode, context),
|
|
377
|
+
assumption = new Assumption(string, node, statement, reference);
|
|
383
378
|
|
|
384
379
|
return assumption;
|
|
385
380
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import ontology from "../ontology";
|
|
4
4
|
|
|
5
5
|
import { define } from "../ontology";
|
|
6
|
-
import { unifyStatementWithCombinator } from "../
|
|
6
|
+
import { unifyStatementWithCombinator } from "../process/unify";
|
|
7
7
|
import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
|
|
8
8
|
|
|
9
9
|
export default define(class Combinator {
|
|
@@ -4,7 +4,7 @@ import ontology from "../ontology";
|
|
|
4
4
|
|
|
5
5
|
import { define } from "../ontology";
|
|
6
6
|
import { baseType } from ".//type";
|
|
7
|
-
import { unifyTermWithConstructor } from "../
|
|
7
|
+
import { unifyTermWithConstructor } from "../process/unify";
|
|
8
8
|
import { termFromJSON, termToTermJSON } from "../utilities/json";
|
|
9
9
|
|
|
10
10
|
export default define(class Constructor {
|
package/src/ontology/equality.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import ontology from "../ontology";
|
|
4
|
-
import equationalUnifier from "../unifier/equantional";
|
|
5
4
|
import EqualityAssignment from "../assignment/equality";
|
|
6
5
|
import VariableAssignment from "../assignment/variable";
|
|
7
6
|
|
|
8
7
|
import { define } from "../ontology";
|
|
8
|
+
import { equateTerms } from "../process/equate";
|
|
9
9
|
|
|
10
10
|
export default define(class Equality {
|
|
11
11
|
constructor(string, leftTerm, rightTerm) {
|
|
@@ -67,9 +67,9 @@ export default define(class Equality {
|
|
|
67
67
|
|
|
68
68
|
const leftTermNode = this.leftTerm.getNode(),
|
|
69
69
|
rightTermNode = this.rightTerm.getNode(),
|
|
70
|
-
|
|
70
|
+
termsEquate = equateTerms(leftTermNode, rightTermNode, context);
|
|
71
71
|
|
|
72
|
-
if (
|
|
72
|
+
if (termsEquate) {
|
|
73
73
|
equal = true;
|
|
74
74
|
}
|
|
75
75
|
|
package/src/ontology/frame.js
CHANGED
|
@@ -53,9 +53,9 @@ export default define(class Frame {
|
|
|
53
53
|
getMetavariable() {
|
|
54
54
|
let metavariable = null;
|
|
55
55
|
|
|
56
|
-
const
|
|
56
|
+
const singular = this.isSingular();
|
|
57
57
|
|
|
58
|
-
if (
|
|
58
|
+
if (singular) {
|
|
59
59
|
const assumption = this.getAssumption();
|
|
60
60
|
|
|
61
61
|
metavariable = assumption.getMetavariable();
|
|
@@ -64,15 +64,49 @@ export default define(class Frame {
|
|
|
64
64
|
return metavariable;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
getMetavariableName() {
|
|
68
|
+
let metavariableName = null;
|
|
69
|
+
|
|
70
|
+
const singular = this.isSingular();
|
|
71
|
+
|
|
72
|
+
if (singular) {
|
|
73
|
+
metavariableName = this.node.getMetavariableName();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return metavariableName;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
isSingular() { return this.node.isSingular(); }
|
|
68
80
|
|
|
69
81
|
isEqualTo(frame) {
|
|
70
|
-
const
|
|
71
|
-
|
|
82
|
+
const frameNode = frame.getNode(),
|
|
83
|
+
matches = this.node.match(frameNode),
|
|
84
|
+
equalTo = matches; ///
|
|
72
85
|
|
|
73
86
|
return equalTo;
|
|
74
87
|
}
|
|
75
88
|
|
|
89
|
+
isMetavariableEqualToMetavariable(metavariable, context) {
|
|
90
|
+
let metavariableEqualToMetavariable;
|
|
91
|
+
|
|
92
|
+
const singular = this.isSingular();
|
|
93
|
+
|
|
94
|
+
if (singular) {
|
|
95
|
+
const metavariableA = metavariable, ///
|
|
96
|
+
singularMetavariableNode = this.node.getSingularMetavariableNode(),
|
|
97
|
+
metavariableName = singularMetavariableNode.getMetavariableName();
|
|
98
|
+
|
|
99
|
+
metavariable = context.findMetavariableByMetavariableName(metavariableName)
|
|
100
|
+
|
|
101
|
+
const metavariableB = metavariable,
|
|
102
|
+
equalTo = metavariableA.isEqualTo(metavariableB);
|
|
103
|
+
|
|
104
|
+
metavariableEqualToMetavariable = equalTo; ///
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return metavariableEqualToMetavariable;
|
|
108
|
+
}
|
|
109
|
+
|
|
76
110
|
matchFrameNode(frameNode) { return this.node.match(frameNode); }
|
|
77
111
|
|
|
78
112
|
matchSubstitution(substitution, context) {
|
|
@@ -165,10 +199,10 @@ export default define(class Frame {
|
|
|
165
199
|
|
|
166
200
|
context.trace(`Verifying the '${frameString}' stated frame...`);
|
|
167
201
|
|
|
168
|
-
const
|
|
202
|
+
const singular = this.isSingular();
|
|
169
203
|
|
|
170
|
-
if (!
|
|
171
|
-
context.trace(`The '${frameString}' stated frame must be
|
|
204
|
+
if (!singular) {
|
|
205
|
+
context.trace(`The '${frameString}' stated frame must be singular.`);
|
|
172
206
|
} else {
|
|
173
207
|
verifiesWhenStated = true;
|
|
174
208
|
}
|
|
@@ -253,9 +287,9 @@ export default define(class Frame {
|
|
|
253
287
|
toJSON() {
|
|
254
288
|
let json = null;
|
|
255
289
|
|
|
256
|
-
const
|
|
290
|
+
const singular = this.isSingular();
|
|
257
291
|
|
|
258
|
-
if (
|
|
292
|
+
if (singular) {
|
|
259
293
|
const assumption = this.getAssumption(),
|
|
260
294
|
assumptionJSON = assumption.toJSON();
|
|
261
295
|
|
|
@@ -6,8 +6,9 @@ import JudgementAssignment from "../assignment/judgement";
|
|
|
6
6
|
import { define } from "../ontology";
|
|
7
7
|
|
|
8
8
|
export default define(class Judgement {
|
|
9
|
-
constructor(string, frame, assumption) {
|
|
9
|
+
constructor(string, node, frame, assumption) {
|
|
10
10
|
this.string = string;
|
|
11
|
+
this.node = node;
|
|
11
12
|
this.frame = frame;
|
|
12
13
|
this.assumption = assumption;
|
|
13
14
|
}
|
|
@@ -16,6 +17,10 @@ export default define(class Judgement {
|
|
|
16
17
|
return this.string;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
getNode() {
|
|
21
|
+
return this.node;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
getFrame() {
|
|
20
25
|
return this.frame;
|
|
21
26
|
}
|
|
@@ -24,7 +29,7 @@ export default define(class Judgement {
|
|
|
24
29
|
return this.assumption;
|
|
25
30
|
}
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
isSingular() { return this.node.isSingular(); }
|
|
28
33
|
|
|
29
34
|
getMetavariable() { return this.frame.getMetavariable(); }
|
|
30
35
|
|
|
@@ -157,7 +162,7 @@ export default define(class Judgement {
|
|
|
157
162
|
frame = Frame.fromJudgementNode(judgementNode, context),
|
|
158
163
|
assumption = Assumption.fromJudgementNode(judgementNode, context);
|
|
159
164
|
|
|
160
|
-
judgement = new Judgement(string, frame, assumption);
|
|
165
|
+
judgement = new Judgement(string, node, frame, assumption);
|
|
161
166
|
}
|
|
162
167
|
|
|
163
168
|
return judgement;
|