occam-verify-cli 1.0.382 → 1.0.385
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/action/verify.js +2 -1
- package/lib/context/file.js +2 -2
- package/lib/context/release.js +2 -2
- package/lib/mixins/statement/verify.js +3 -3
- package/lib/mixins/step/unify.js +4 -4
- package/lib/mixins/term/verify.js +4 -4
- package/lib/ontology/assertion/contained.js +316 -0
- package/lib/ontology/assertion/defined.js +290 -0
- package/lib/ontology/assertion/property.js +271 -0
- package/lib/ontology/assertion/satisfies.js +254 -0
- package/lib/ontology/assertion/subproof.js +186 -0
- package/lib/ontology/assertion/type.js +252 -0
- package/lib/{dom → ontology}/axiom.js +3 -3
- package/lib/{dom → ontology}/combinator/bracketed.js +4 -4
- package/lib/ontology/combinator.js +141 -0
- package/lib/ontology/conclusion.js +172 -0
- package/lib/{dom → ontology}/conjecture.js +3 -3
- package/lib/{dom → ontology}/constructor/bracketed.js +5 -5
- package/lib/ontology/constructor.js +171 -0
- package/lib/ontology/declaration/combinator.js +168 -0
- package/lib/ontology/declaration/complexType.js +346 -0
- package/lib/ontology/declaration/constructor.js +199 -0
- package/lib/ontology/declaration/metavariable.js +209 -0
- package/lib/ontology/declaration/simpleType.js +243 -0
- package/lib/ontology/declaration/typePrefix.js +181 -0
- package/lib/ontology/declaration/variable.js +197 -0
- package/lib/ontology/declaration.js +360 -0
- package/lib/ontology/deduction.js +186 -0
- package/lib/ontology/derivation.js +155 -0
- package/lib/ontology/equality.js +288 -0
- package/lib/{dom → ontology}/error.js +3 -3
- package/lib/ontology/frame.js +362 -0
- package/lib/ontology/hypothesis.js +190 -0
- package/lib/ontology/judgement.js +241 -0
- package/lib/ontology/label.js +199 -0
- package/lib/{dom → ontology}/lemma.js +3 -3
- package/lib/{dom → ontology}/metaLemma.js +3 -3
- package/lib/{dom → ontology}/metaType.js +3 -3
- package/lib/{dom → ontology}/metatheorem.js +3 -3
- package/lib/ontology/metavariable.js +504 -0
- package/lib/{dom → ontology}/parameter.js +3 -3
- package/lib/ontology/premise.js +271 -0
- package/lib/ontology/procedureCall.js +243 -0
- package/lib/{dom → ontology}/procedureReference.js +3 -3
- package/lib/{dom → ontology}/proof.js +4 -4
- package/lib/ontology/property.js +166 -0
- package/lib/ontology/propertyRelation.js +202 -0
- package/lib/ontology/reference.js +293 -0
- package/lib/ontology/rule.js +375 -0
- package/lib/ontology/section.js +255 -0
- package/lib/ontology/signature.js +220 -0
- package/lib/{dom → ontology}/statement.js +3 -3
- package/lib/ontology/step.js +283 -0
- package/lib/ontology/subDerivation.js +147 -0
- package/lib/ontology/subproof.js +266 -0
- package/lib/ontology/substitution/frame.js +216 -0
- package/lib/{dom → ontology}/substitution/reference.js +3 -3
- package/lib/{dom → ontology}/substitution/statement.js +3 -3
- package/lib/ontology/substitution/term.js +230 -0
- package/lib/ontology/substitution.js +207 -0
- package/lib/ontology/supposition.js +283 -0
- package/lib/ontology/term.js +339 -0
- package/lib/{dom → ontology}/theorem.js +3 -3
- package/lib/ontology/topLevelAssertion.js +432 -0
- package/lib/ontology/topLevelMetaAssertion.js +235 -0
- package/lib/ontology/type.js +556 -0
- package/lib/ontology/typePrefix.js +99 -0
- package/lib/ontology/variable.js +331 -0
- package/lib/ontology.js +27 -0
- package/lib/preamble.js +60 -60
- package/lib/prepare.js +25 -0
- package/lib/unifier/intrinsicLevel.js +3 -3
- package/lib/unifier/metaLevel.js +7 -7
- package/lib/unifier/metavariable.js +3 -3
- package/lib/unifier/statementWithCombinator.js +5 -5
- package/lib/unifier/termWithConstructor.js +3 -3
- package/lib/utilities/brackets.js +5 -5
- package/lib/utilities/context.js +12 -12
- package/lib/utilities/fileSystem.js +2 -2
- package/lib/utilities/json.js +30 -30
- package/lib/utilities/node.js +7 -7
- package/lib/utilities/release.js +12 -4
- package/lib/utilities/releaseContext.js +1 -1
- package/lib/utilities/substitutions.js +6 -6
- package/lib/utilities/type.js +2 -2
- package/lib/verifier/combinator.js +4 -4
- package/lib/verifier/constructor.js +3 -3
- package/lib/verifier/topLevel.js +18 -18
- package/package.json +1 -1
- package/src/action/verify.js +2 -0
- package/src/context/file.js +1 -1
- package/src/context/release.js +1 -1
- package/src/mixins/statement/verify.js +2 -2
- package/src/mixins/step/unify.js +3 -3
- package/src/mixins/term/verify.js +3 -3
- package/src/{dom → ontology}/assertion/contained.js +4 -4
- package/src/{dom → ontology}/assertion/defined.js +6 -6
- package/src/{dom → ontology}/assertion/property.js +5 -5
- package/src/{dom → ontology}/assertion/satisfies.js +5 -5
- package/src/{dom → ontology}/assertion/subproof.js +4 -4
- package/src/{dom → ontology}/assertion/type.js +5 -5
- package/src/{dom → ontology}/axiom.js +2 -2
- package/src/{dom → ontology}/combinator/bracketed.js +4 -4
- package/src/{dom → ontology}/combinator.js +4 -4
- package/src/{dom → ontology}/conclusion.js +4 -4
- package/src/{dom → ontology}/conjecture.js +2 -2
- package/src/{dom → ontology}/constructor/bracketed.js +5 -5
- package/src/{dom → ontology}/constructor.js +5 -5
- package/src/{dom → ontology}/declaration/combinator.js +4 -4
- package/src/{dom → ontology}/declaration/complexType.js +4 -4
- package/src/{dom → ontology}/declaration/constructor.js +4 -4
- package/src/{dom → ontology}/declaration/metavariable.js +5 -5
- package/src/{dom → ontology}/declaration/simpleType.js +4 -4
- package/src/{dom → ontology}/declaration/typePrefix.js +4 -4
- package/src/{dom → ontology}/declaration/variable.js +4 -4
- package/src/{dom → ontology}/declaration.js +5 -5
- package/src/{dom → ontology}/deduction.js +4 -4
- package/src/{dom → ontology}/derivation.js +4 -4
- package/src/{dom → ontology}/equality.js +6 -6
- package/src/{dom → ontology}/error.js +2 -2
- package/src/{dom → ontology}/frame.js +6 -6
- package/src/{dom → ontology}/hypothesis.js +5 -6
- package/src/{dom → ontology}/judgement.js +5 -5
- package/src/{dom → ontology}/label.js +4 -4
- package/src/{dom → ontology}/lemma.js +2 -2
- package/src/{dom → ontology}/metaLemma.js +2 -2
- package/src/{dom → ontology}/metaType.js +2 -2
- package/src/{dom → ontology}/metatheorem.js +2 -2
- package/src/{dom → ontology}/metavariable.js +8 -8
- package/src/{dom → ontology}/parameter.js +2 -2
- package/src/{dom → ontology}/premise.js +5 -5
- package/src/{dom → ontology}/procedureCall.js +5 -5
- package/src/{dom → ontology}/procedureReference.js +2 -2
- package/src/{dom → ontology}/proof.js +4 -4
- package/src/{dom → ontology}/property.js +4 -4
- package/src/{dom → ontology}/propertyRelation.js +4 -4
- package/src/{dom → ontology}/reference.js +6 -6
- package/src/{dom → ontology}/rule.js +7 -7
- package/src/{dom → ontology}/section.js +8 -8
- package/src/{dom → ontology}/signature.js +4 -4
- package/src/{dom → ontology}/statement.js +2 -2
- package/src/{dom → ontology}/step.js +4 -4
- package/src/{dom → ontology}/subDerivation.js +4 -4
- package/src/{dom → ontology}/subproof.js +5 -5
- package/src/{dom → ontology}/substitution/frame.js +4 -4
- package/src/{dom → ontology}/substitution/reference.js +2 -2
- package/src/{dom → ontology}/substitution/statement.js +2 -2
- package/src/{dom → ontology}/substitution/term.js +5 -5
- package/src/{dom → ontology}/supposition.js +5 -5
- package/src/{dom → ontology}/term.js +6 -6
- package/src/{dom → ontology}/theorem.js +2 -2
- package/src/{dom → ontology}/topLevelAssertion.js +6 -6
- package/src/{dom → ontology}/topLevelMetaAssertion.js +2 -2
- package/src/{dom → ontology}/type.js +4 -4
- package/src/{dom → ontology}/typePrefix.js +3 -5
- package/src/{dom → ontology}/variable.js +6 -6
- package/src/ontology.js +13 -0
- package/src/preamble.js +59 -59
- package/src/{configure.js → prepare.js} +1 -1
- package/src/unifier/intrinsicLevel.js +2 -2
- package/src/unifier/metaLevel.js +6 -6
- package/src/unifier/metavariable.js +2 -2
- package/src/unifier/statementWithCombinator.js +4 -4
- package/src/unifier/termWithConstructor.js +2 -2
- package/src/utilities/brackets.js +4 -4
- package/src/utilities/context.js +11 -11
- package/src/utilities/fileSystem.js +1 -1
- package/src/utilities/json.js +29 -29
- package/src/utilities/node.js +6 -6
- package/src/utilities/release.js +1 -1
- package/src/utilities/releaseContext.js +3 -3
- package/src/utilities/substitutions.js +5 -5
- package/src/utilities/type.js +1 -1
- package/src/verifier/combinator.js +3 -3
- package/src/verifier/constructor.js +2 -2
- package/src/verifier/topLevel.js +17 -17
- package/verify.js +2 -2
- package/lib/configure.js +0 -25
- package/lib/dom/assertion/contained.js +0 -316
- package/lib/dom/assertion/defined.js +0 -290
- package/lib/dom/assertion/property.js +0 -271
- package/lib/dom/assertion/satisfies.js +0 -254
- package/lib/dom/assertion/subproof.js +0 -186
- package/lib/dom/assertion/type.js +0 -252
- package/lib/dom/combinator.js +0 -141
- package/lib/dom/conclusion.js +0 -172
- package/lib/dom/constructor.js +0 -171
- package/lib/dom/declaration/combinator.js +0 -168
- package/lib/dom/declaration/complexType.js +0 -346
- package/lib/dom/declaration/constructor.js +0 -199
- package/lib/dom/declaration/metavariable.js +0 -209
- package/lib/dom/declaration/simpleType.js +0 -243
- package/lib/dom/declaration/typePrefix.js +0 -181
- package/lib/dom/declaration/variable.js +0 -197
- package/lib/dom/declaration.js +0 -360
- package/lib/dom/deduction.js +0 -186
- package/lib/dom/derivation.js +0 -155
- package/lib/dom/equality.js +0 -288
- package/lib/dom/frame.js +0 -362
- package/lib/dom/hypothesis.js +0 -191
- package/lib/dom/judgement.js +0 -241
- package/lib/dom/label.js +0 -199
- package/lib/dom/metavariable.js +0 -504
- package/lib/dom/premise.js +0 -271
- package/lib/dom/procedureCall.js +0 -243
- package/lib/dom/property.js +0 -166
- package/lib/dom/propertyRelation.js +0 -202
- package/lib/dom/reference.js +0 -293
- package/lib/dom/rule.js +0 -375
- package/lib/dom/section.js +0 -255
- package/lib/dom/signature.js +0 -220
- package/lib/dom/step.js +0 -283
- package/lib/dom/subDerivation.js +0 -147
- package/lib/dom/subproof.js +0 -266
- package/lib/dom/substitution/frame.js +0 -216
- package/lib/dom/substitution/term.js +0 -230
- package/lib/dom/substitution.js +0 -207
- package/lib/dom/supposition.js +0 -283
- package/lib/dom/term.js +0 -339
- package/lib/dom/topLevelAssertion.js +0 -432
- package/lib/dom/topLevelMetaAssertion.js +0 -235
- package/lib/dom/type.js +0 -556
- package/lib/dom/typePrefix.js +0 -100
- package/lib/dom/variable.js +0 -331
- package/lib/dom.js +0 -27
- package/src/dom.js +0 -13
- /package/src/{dom → ontology}/substitution.js +0 -0
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import ontology from "../ontology";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { define } from "../ontology";
|
|
8
8
|
import { assignAssignments } from "../utilities/assignments";
|
|
9
9
|
|
|
10
10
|
const { last } = arrayUtilities;
|
|
11
11
|
|
|
12
|
-
export default
|
|
12
|
+
export default define(class Derivation {
|
|
13
13
|
constructor(stepsOrSubproofs) {
|
|
14
14
|
this.stepsOrSubproofs = stepsOrSubproofs;
|
|
15
15
|
}
|
|
@@ -61,7 +61,7 @@ export default domAssigned(class Derivation {
|
|
|
61
61
|
});
|
|
62
62
|
|
|
63
63
|
function stepsOrSubproofsFromDerivationNode(derivationNode, context) {
|
|
64
|
-
const { Step, Subproof } =
|
|
64
|
+
const { Step, Subproof } = ontology,
|
|
65
65
|
stepOrSubproofNodes = derivationNode.getStepOrSubproofNodes(),
|
|
66
66
|
stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
|
|
67
67
|
let stepOrSubproof;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
import equationalUnifier from "../unifier/equantional";
|
|
5
5
|
import EqualityAssignment from "../assignment/equality";
|
|
6
6
|
import VariableAssignment from "../assignment/variable";
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { define } from "../ontology";
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default define(class Equality {
|
|
11
11
|
constructor(string, leftTerm, rightTerm) {
|
|
12
12
|
this.string = string;
|
|
13
13
|
this.leftTerm = leftTerm;
|
|
@@ -186,7 +186,7 @@ export default domAssigned(class Equality {
|
|
|
186
186
|
return;
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
const { Variable } =
|
|
189
|
+
const { Variable } = ontology,
|
|
190
190
|
type = this.getType(),
|
|
191
191
|
leftTermNode = this.leftTerm.getNode(),
|
|
192
192
|
rightTermNode = this.rightTerm.getNode(),
|
|
@@ -244,7 +244,7 @@ export default domAssigned(class Equality {
|
|
|
244
244
|
});
|
|
245
245
|
|
|
246
246
|
function leftTermFromEqualityNode(equalityNode, context) {
|
|
247
|
-
const { Term } =
|
|
247
|
+
const { Term } = ontology,
|
|
248
248
|
leftTermNode = equalityNode.getLeftTermNode(),
|
|
249
249
|
leftTerm = Term.fromTermNode(leftTermNode, context);
|
|
250
250
|
|
|
@@ -252,7 +252,7 @@ function leftTermFromEqualityNode(equalityNode, context) {
|
|
|
252
252
|
}
|
|
253
253
|
|
|
254
254
|
function rightTermFromEqualityNode(equalityNode, context) {
|
|
255
|
-
const { Term } =
|
|
255
|
+
const { Term } = ontology,
|
|
256
256
|
rightTermNode = equalityNode.getRightTermNode(),
|
|
257
257
|
rightTerm = Term.fromTermNode(rightTermNode, context);
|
|
258
258
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { define } from "../ontology";
|
|
4
4
|
|
|
5
|
-
export default
|
|
5
|
+
export default define(class Error {
|
|
6
6
|
constructor(context, node, string) {
|
|
7
7
|
this.context = context;
|
|
8
8
|
this.node = node;
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import ontology from "../ontology";
|
|
6
6
|
|
|
7
|
+
import { define } from "../ontology";
|
|
7
8
|
import { S, NOTHING } from "../constants";
|
|
8
|
-
import { domAssigned } from "../dom";
|
|
9
9
|
import { FRAME_META_TYPE_NAME } from "../metaTypeNames";
|
|
10
10
|
|
|
11
11
|
const { first } = arrayUtilities;
|
|
12
12
|
|
|
13
|
-
export default
|
|
13
|
+
export default define(class Frame {
|
|
14
14
|
constructor(string, node, tokens, declarations) {
|
|
15
15
|
this.string = string;
|
|
16
16
|
this.node = node;
|
|
@@ -289,7 +289,7 @@ export default domAssigned(class Frame {
|
|
|
289
289
|
});
|
|
290
290
|
|
|
291
291
|
function frameFromFrameNode(frameNode, context) {
|
|
292
|
-
const { Frame } =
|
|
292
|
+
const { Frame } = ontology,
|
|
293
293
|
node = frameNode, ///
|
|
294
294
|
string = context.nodeAsString(node),
|
|
295
295
|
tokens = context.nodeAsTokens(node),
|
|
@@ -301,7 +301,7 @@ function frameFromFrameNode(frameNode, context) {
|
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
function declarationsFromFrameNode(frameNode, context) {
|
|
304
|
-
const { Declaration } =
|
|
304
|
+
const { Declaration } = ontology,
|
|
305
305
|
declarationNodes = frameNode.getDeclarationNodes(),
|
|
306
306
|
declarations = declarationNodes.map((declarationNode) => {
|
|
307
307
|
const declaration = Declaration.fromDeclarationNode(declarationNode, context);
|
|
@@ -313,7 +313,7 @@ function declarationsFromFrameNode(frameNode, context) {
|
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
function metavariablesFromFrameNode(frameNode, context) {
|
|
316
|
-
const { Metavariable } =
|
|
316
|
+
const { Metavariable } = ontology,
|
|
317
317
|
metavariableNodes = frameNode.getMetavariableNodes(),
|
|
318
318
|
metavariables = metavariableNodes.map((metavariableNode) => {
|
|
319
319
|
const metavariable = Metavariable.fromMetavariableNode(metavariableNode, context);
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { define } from "../ontology";
|
|
6
6
|
import { assignAssignments } from "../utilities/assignments";
|
|
7
|
-
import { subproofAssertionFromStatement } from "../utilities/context";
|
|
8
7
|
import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
|
|
9
8
|
|
|
10
|
-
export default
|
|
9
|
+
export default define(class Hypothesis {
|
|
11
10
|
constructor(node, string, statement) {
|
|
12
11
|
this.node = node;
|
|
13
12
|
this.string = string;
|
|
@@ -44,7 +43,7 @@ export default domAssigned(class Hypothesis {
|
|
|
44
43
|
const assignmentsAssigned = assignAssignments(assignments, context);
|
|
45
44
|
|
|
46
45
|
if (assignmentsAssigned) {
|
|
47
|
-
const { Step } =
|
|
46
|
+
const { Step } = ontology,
|
|
48
47
|
step = Step.fromStatement(this.statement, context),
|
|
49
48
|
stepOrSubproof = step; ///
|
|
50
49
|
|
|
@@ -114,7 +113,7 @@ export default domAssigned(class Hypothesis {
|
|
|
114
113
|
}
|
|
115
114
|
|
|
116
115
|
static fromHypothesisNode(hypothesisNode, context) {
|
|
117
|
-
const { Statement } =
|
|
116
|
+
const { Statement } = ontology,
|
|
118
117
|
node = hypothesisNode, ///
|
|
119
118
|
string = context.nodeAsString(node),
|
|
120
119
|
statement = Statement.fromHypothesisNode(hypothesisNode, context),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
import JudgementAssignment from "../assignment/judgement";
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { define } from "../ontology";
|
|
7
7
|
|
|
8
|
-
export default
|
|
8
|
+
export default define(class Judgement {
|
|
9
9
|
constructor(string, frame, declaration) {
|
|
10
10
|
this.string = string;
|
|
11
11
|
this.frame = frame;
|
|
@@ -151,7 +151,7 @@ export default domAssigned(class Judgement {
|
|
|
151
151
|
const judgementNode = statementNode.getJudgementNode();
|
|
152
152
|
|
|
153
153
|
if (judgementNode !== null) {
|
|
154
|
-
const { Frame, Declaration} =
|
|
154
|
+
const { Frame, Declaration} = ontology,
|
|
155
155
|
node = judgementNode, ///
|
|
156
156
|
string = context.nodeAsString(node),
|
|
157
157
|
frame = Frame.fromJudgementNode(judgementNode, context),
|
|
@@ -165,7 +165,7 @@ export default domAssigned(class Judgement {
|
|
|
165
165
|
});
|
|
166
166
|
|
|
167
167
|
function referenceFromMetavariable(metavariable, context) {
|
|
168
|
-
const { Reference } =
|
|
168
|
+
const { Reference } = ontology,
|
|
169
169
|
metavariableNode = metavariable.getNode(),
|
|
170
170
|
reference = Reference.fromMetavariableNode(metavariableNode, context);
|
|
171
171
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { define } from "../ontology";
|
|
6
6
|
import { metavariableFromJSON, metavariableToMetavariableJSON } from "../utilities/json";
|
|
7
7
|
|
|
8
|
-
export default
|
|
8
|
+
export default define(class Label {
|
|
9
9
|
constructor(context, metavariable) {
|
|
10
10
|
this.context = context;
|
|
11
11
|
this.metavariable = metavariable;
|
|
@@ -102,7 +102,7 @@ export default domAssigned(class Label {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
static fromLabelNode(labelNode, context) {
|
|
105
|
-
const { Metavariable } =
|
|
105
|
+
const { Metavariable } = ontology,
|
|
106
106
|
metavariable = Metavariable.fromLabelNode(labelNode, context),
|
|
107
107
|
label = new Label(context, metavariable);
|
|
108
108
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import TopLevelAssertion from "./topLevelAssertion";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { define } from "../ontology";
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default define(class Lemma extends TopLevelAssertion {
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import TopLevelMetaAssertion from "./topLevelMetaAssertion";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { define } from "../ontology";
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default define(class MetaLemma extends TopLevelMetaAssertion {
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { define } from "../ontology";
|
|
4
4
|
import { FRAME_META_TYPE_NAME, REFERENCE_META_TYPE_NAME, STATEMENT_META_TYPE_NAME } from "../metaTypeNames";
|
|
5
5
|
|
|
6
6
|
class MetaType {
|
|
@@ -70,7 +70,7 @@ function metaTypeFromMetaTypeNode(metaTypeNode, context) {
|
|
|
70
70
|
return metaType;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
export default
|
|
73
|
+
export default define(MetaType);
|
|
74
74
|
|
|
75
75
|
class FrameMetaType extends MetaType {
|
|
76
76
|
static fromNothing() {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import TopLevelMetaAssertion from "./topLevelMetaAssertion";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { define } from "../ontology";
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default define(class Metatheorem extends TopLevelMetaAssertion {
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
import MetavariablePartialContext from "../context/partial/metavariable";
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { define } from "../ontology";
|
|
7
7
|
import { EMPTY_STRING } from "../constants";
|
|
8
8
|
import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
9
9
|
import { metaTypeFromJSON, metaTypeToMetaTypeJSON } from "../utilities/json";
|
|
10
10
|
import { metavariableFromFrame, metavariableFromStatement } from "../utilities/context";
|
|
11
11
|
import { unifyMetavariable, unifyMetavariableIntrinsically } from "../utilities/unification";
|
|
12
12
|
|
|
13
|
-
export default
|
|
13
|
+
export default define(class Metavariable {
|
|
14
14
|
constructor(string, node, tokens, name, type, metaType) {
|
|
15
15
|
this.string = string;
|
|
16
16
|
this.node = node;
|
|
@@ -161,7 +161,7 @@ export default domAssigned(class Metavariable {
|
|
|
161
161
|
frameUnifies = true;
|
|
162
162
|
}
|
|
163
163
|
} else {
|
|
164
|
-
const { FrameSubstitution } =
|
|
164
|
+
const { FrameSubstitution } = ontology,
|
|
165
165
|
context = specificContext, ///
|
|
166
166
|
metavariable = this, ///
|
|
167
167
|
frameSubstitution = FrameSubstitution.fromFrameAndMetavariable(frame, metavariable, context),
|
|
@@ -206,7 +206,7 @@ export default domAssigned(class Metavariable {
|
|
|
206
206
|
referenceUnifies = true;
|
|
207
207
|
}
|
|
208
208
|
} else {
|
|
209
|
-
const { ReferenceSubstitution } =
|
|
209
|
+
const { ReferenceSubstitution } = ontology,
|
|
210
210
|
metavariable = this,
|
|
211
211
|
referenceSubstitution = ReferenceSubstitution.fromReferenceAndMetavariable(reference, metavariable, context),
|
|
212
212
|
substitution = referenceSubstitution; ///
|
|
@@ -253,7 +253,7 @@ export default domAssigned(class Metavariable {
|
|
|
253
253
|
statementUnifies = true;
|
|
254
254
|
}
|
|
255
255
|
} else {
|
|
256
|
-
const { StatementSubstitution } =
|
|
256
|
+
const { StatementSubstitution } = ontology,
|
|
257
257
|
metavariable = this,
|
|
258
258
|
statementSubstitution = StatementSubstitution.fromStatementMetavariableAndSubstitution(statement, metavariable, substitution, context);
|
|
259
259
|
|
|
@@ -495,7 +495,7 @@ export default domAssigned(class Metavariable {
|
|
|
495
495
|
}
|
|
496
496
|
|
|
497
497
|
static fromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
498
|
-
const { MetaType } =
|
|
498
|
+
const { MetaType } = ontology,
|
|
499
499
|
metavariableNode = metavariableDeclarationNode.getMetavariableNode(),
|
|
500
500
|
type = typeFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
501
501
|
metaType = MetaType.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
@@ -510,7 +510,7 @@ export default domAssigned(class Metavariable {
|
|
|
510
510
|
});
|
|
511
511
|
|
|
512
512
|
function metavariableFromMetavariableNode(metavariableNode, context) {
|
|
513
|
-
const { Metavariable } =
|
|
513
|
+
const { Metavariable } = ontology,
|
|
514
514
|
metavariableName = metavariableNode.getMetavariableName(),
|
|
515
515
|
type = null,
|
|
516
516
|
name = metavariableName, ///
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { define } from "../ontology";
|
|
6
6
|
import { assignAssignments } from "../utilities/assignments";
|
|
7
7
|
import { subproofAssertionFromStatement } from "../utilities/context";
|
|
8
8
|
import { statementFromJSON, procedureCallFromJSON, statementToStatementJSON, procedureCallToProcedureCallJSON } from "../utilities/json";
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default define(class Premise {
|
|
11
11
|
constructor(node, string, statement, procedureCall) {
|
|
12
12
|
this.node = node;
|
|
13
13
|
this.string = string;
|
|
@@ -49,7 +49,7 @@ export default domAssigned(class Premise {
|
|
|
49
49
|
const assignmentsAssigned = assignAssignments(assignments, context);
|
|
50
50
|
|
|
51
51
|
if (assignmentsAssigned) {
|
|
52
|
-
const { Step } =
|
|
52
|
+
const { Step } = ontology,
|
|
53
53
|
step = Step.fromStatement(this.statement, context),
|
|
54
54
|
stepOrSubproof = step; ///
|
|
55
55
|
|
|
@@ -226,7 +226,7 @@ export default domAssigned(class Premise {
|
|
|
226
226
|
}
|
|
227
227
|
|
|
228
228
|
static fromPremiseNode(premiseNode, context) {
|
|
229
|
-
const { Statement, ProcedureCall } =
|
|
229
|
+
const { Statement, ProcedureCall } = ontology,
|
|
230
230
|
node = premiseNode, ///
|
|
231
231
|
string = context.nodeAsString(node),
|
|
232
232
|
statement = Statement.fromPremiseNode(premiseNode, context),
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { Expressions } from "occam-furtle";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import ontology from "../ontology";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { define } from "../ontology";
|
|
8
8
|
import { parametersFromJSON, procedureReferenceFromJSON, parametersToParametersJSON, procedureReferenceToProcedureReferenceJSON } from "../utilities/json";
|
|
9
9
|
|
|
10
|
-
export default
|
|
10
|
+
export default define(class ProcedureCall {
|
|
11
11
|
constructor(node, string, procedureReference, parameters) {
|
|
12
12
|
this.node = node;
|
|
13
13
|
this.string = string;
|
|
@@ -153,7 +153,7 @@ export default domAssigned(class ProcedureCall {
|
|
|
153
153
|
});
|
|
154
154
|
|
|
155
155
|
function procedureCallFromProcedureCallNode(procedureCallNode, context) {
|
|
156
|
-
const { ProcedureCall, ProcedureReference } =
|
|
156
|
+
const { ProcedureCall, ProcedureReference } = ontology,
|
|
157
157
|
node = procedureCallNode, ///
|
|
158
158
|
procedureReference = ProcedureReference.fromProcedureCallNode(procedureCallNode, context),
|
|
159
159
|
parameters = parametersFromProcedureCallNode(procedureCallNode, context),
|
|
@@ -164,7 +164,7 @@ function procedureCallFromProcedureCallNode(procedureCallNode, context) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
function parametersFromProcedureCallNode(procedureCallNode, context) {
|
|
167
|
-
const { Parameter } =
|
|
167
|
+
const { Parameter } = ontology,
|
|
168
168
|
parameterNodes = procedureCallNode.getParameterNodes(),
|
|
169
169
|
parameters = parameterNodes.map((parameterNode) => {
|
|
170
170
|
const parameter = Parameter.fromParameterNode(parameterNode, context);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { define } from "../ontology";
|
|
4
4
|
|
|
5
|
-
export default
|
|
5
|
+
export default define(class ProcedureReference {
|
|
6
6
|
constructor(string, name) {
|
|
7
7
|
this.string = string;
|
|
8
8
|
this.name = name;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
import LocalContext from "../context/local";
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { define } from "../ontology";
|
|
7
7
|
|
|
8
|
-
export default
|
|
8
|
+
export default define(class Proof {
|
|
9
9
|
constructor(derivation) {
|
|
10
10
|
this.derivation = derivation;
|
|
11
11
|
}
|
|
@@ -56,7 +56,7 @@ export default domAssigned(class Proof {
|
|
|
56
56
|
let proof = null;
|
|
57
57
|
|
|
58
58
|
if (proofNode !== null) {
|
|
59
|
-
const { Derivation } =
|
|
59
|
+
const { Derivation } = ontology,
|
|
60
60
|
derivationNode = proofNode.getDerivationNode(),
|
|
61
61
|
derivation = Derivation.fromDerivationNode(derivationNode, context);
|
|
62
62
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { define } from "../ontology";
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default define(class Property {
|
|
8
8
|
constructor(string, name, nominalTypeName) {
|
|
9
9
|
this.string = string;
|
|
10
10
|
this.name = name;
|
|
@@ -75,7 +75,7 @@ export default domAssigned(class Property {
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
77
|
function propertyFromPropertyNode(propertyNode, context) {
|
|
78
|
-
const { Property } =
|
|
78
|
+
const { Property } = ontology,
|
|
79
79
|
propertyName = propertyNode.getPropertyName(),
|
|
80
80
|
nominalTypeName = null,
|
|
81
81
|
name = propertyName, ///
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { define } from "../ontology";
|
|
6
6
|
|
|
7
|
-
export default
|
|
7
|
+
export default define(class PropertyRelation {
|
|
8
8
|
constructor(string, node, tokens, property, term) {
|
|
9
9
|
this.string = string;
|
|
10
10
|
this.node = node;
|
|
@@ -119,7 +119,7 @@ export default domAssigned(class PropertyRelation {
|
|
|
119
119
|
static name = "PropertyRelation";
|
|
120
120
|
|
|
121
121
|
static fromPropertyAssertionNode(propertyAssertionNode, context) {
|
|
122
|
-
const { Term, Property } =
|
|
122
|
+
const { Term, Property } = ontology,
|
|
123
123
|
propertyRelationNode = propertyAssertionNode.getPropertyRelationNode(),
|
|
124
124
|
node = propertyRelationNode, ///
|
|
125
125
|
string = context.nodeAsString(node),
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
import Substitutions from "../substitutions";
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import { referenceMetaType } from "
|
|
6
|
+
import { define } from "../ontology";
|
|
7
|
+
import { referenceMetaType } from ".//metaType";
|
|
8
8
|
import { unifyMetavariableIntrinsically } from "../utilities/unification";
|
|
9
9
|
import { metavariableFromJSON, metavariableToMetavariableJSON } from "../utilities/json";
|
|
10
10
|
|
|
11
|
-
export default
|
|
11
|
+
export default define(class Reference {
|
|
12
12
|
constructor(metavariable) {
|
|
13
13
|
this.metavariable = metavariable;
|
|
14
14
|
}
|
|
@@ -222,7 +222,7 @@ export default domAssigned(class Reference {
|
|
|
222
222
|
});
|
|
223
223
|
|
|
224
224
|
function referenceFromReferenceNode(referenceNode, context) {
|
|
225
|
-
const { Reference, Metavariable } =
|
|
225
|
+
const { Reference, Metavariable } = ontology,
|
|
226
226
|
metavariable = Metavariable.fromReferenceNode(referenceNode, context),
|
|
227
227
|
reference = new Reference(metavariable);
|
|
228
228
|
|
|
@@ -230,7 +230,7 @@ function referenceFromReferenceNode(referenceNode, context) {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
function referenceFromMetavariableNode(metavariableNode, context) {
|
|
233
|
-
const { Reference, Metavariable } =
|
|
233
|
+
const { Reference, Metavariable } = ontology,
|
|
234
234
|
metavariable = Metavariable.fromMetavariableNode(metavariableNode, context),
|
|
235
235
|
reference = new Reference(metavariable);
|
|
236
236
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import ontology from "../ontology";
|
|
6
6
|
import LocalContext from "../context/local";
|
|
7
7
|
import Substitutions from "../substitutions";
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { define } from "../ontology";
|
|
10
10
|
import { labelsStringFromLabels } from "./topLevelAssertion";
|
|
11
11
|
import { labelsFromJSON,
|
|
12
12
|
premisesFromJSON,
|
|
@@ -17,7 +17,7 @@ import { labelsFromJSON,
|
|
|
17
17
|
|
|
18
18
|
const { reverse, extract, backwardsEvery } = arrayUtilities;
|
|
19
19
|
|
|
20
|
-
export default
|
|
20
|
+
export default define(class Rule {
|
|
21
21
|
constructor(context, node, string, labels, premises, conclusion, proof) {
|
|
22
22
|
this.context = context;
|
|
23
23
|
this.node = node;
|
|
@@ -283,7 +283,7 @@ export default domAssigned(class Rule {
|
|
|
283
283
|
});
|
|
284
284
|
|
|
285
285
|
function proofFromRuleNode(ruleNode, context) {
|
|
286
|
-
const { Proof } =
|
|
286
|
+
const { Proof } = ontology,
|
|
287
287
|
proofNode = ruleNode.getProofNode(),
|
|
288
288
|
proof = Proof.fromProofNode(proofNode, context);
|
|
289
289
|
|
|
@@ -291,7 +291,7 @@ function proofFromRuleNode(ruleNode, context) {
|
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
function labelsFromRuleNode(ruleNode, context) {
|
|
294
|
-
const { Label } =
|
|
294
|
+
const { Label } = ontology,
|
|
295
295
|
labelNodes = ruleNode.getLabelNodes(),
|
|
296
296
|
labels = labelNodes.map((labelNode) => {
|
|
297
297
|
const label = Label.fromLabelNode(labelNode, context);
|
|
@@ -303,7 +303,7 @@ function labelsFromRuleNode(ruleNode, context) {
|
|
|
303
303
|
}
|
|
304
304
|
|
|
305
305
|
function premisesFromRuleNode(ruleNode, context) {
|
|
306
|
-
const { Premise } =
|
|
306
|
+
const { Premise } = ontology,
|
|
307
307
|
premiseNodes = ruleNode.getPremiseNodes(),
|
|
308
308
|
premises = premiseNodes.map((premiseNode) => {
|
|
309
309
|
const premise = Premise.fromPremiseNode(premiseNode, context);
|
|
@@ -315,7 +315,7 @@ function premisesFromRuleNode(ruleNode, context) {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
function conclusionFromRuleNode(ruleNode, context) {
|
|
318
|
-
const { Conclusion } =
|
|
318
|
+
const { Conclusion } = ontology,
|
|
319
319
|
conclusionNode = ruleNode.getConclusionNode(),
|
|
320
320
|
conclusion = Conclusion.fromConclusionNode(conclusionNode, context);
|
|
321
321
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import ontology from "../ontology";
|
|
4
4
|
import LocalContext from "../context/local";
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { define } from "../ontology";
|
|
7
7
|
|
|
8
|
-
export default
|
|
8
|
+
export default define(class Section {
|
|
9
9
|
constructor(context, node, string, hypotheses, axiom, lemma, theorem, conjecture) {
|
|
10
10
|
this.context = context;
|
|
11
11
|
this.node = node;
|
|
@@ -115,7 +115,7 @@ function axiomFroSectionNode(sectionNode, context) {
|
|
|
115
115
|
const axiomNode = sectionNode.getAxiomNode();
|
|
116
116
|
|
|
117
117
|
if (axiomNode !== null) {
|
|
118
|
-
const { Axiom } =
|
|
118
|
+
const { Axiom } = ontology;
|
|
119
119
|
|
|
120
120
|
axiom = Axiom.fromAxiomNode(axiomNode, context);
|
|
121
121
|
}
|
|
@@ -129,7 +129,7 @@ function lemmaFroSectionNode(sectionNode, context) {
|
|
|
129
129
|
const lemmaNode = sectionNode.getLemmaNode();
|
|
130
130
|
|
|
131
131
|
if (lemmaNode !== null) {
|
|
132
|
-
const { Lemma } =
|
|
132
|
+
const { Lemma } = ontology;
|
|
133
133
|
|
|
134
134
|
lemma = Lemma.fromLemmaNode(lemmaNode, context);
|
|
135
135
|
}
|
|
@@ -143,7 +143,7 @@ function theoremFroSectionNode(sectionNode, context) {
|
|
|
143
143
|
const theoremNode = sectionNode.getTheoremNode();
|
|
144
144
|
|
|
145
145
|
if (theoremNode !== null) {
|
|
146
|
-
const { Theorem } =
|
|
146
|
+
const { Theorem } = ontology;
|
|
147
147
|
|
|
148
148
|
theorem = Theorem.fromTheoremNode(theoremNode, context);
|
|
149
149
|
}
|
|
@@ -157,7 +157,7 @@ function conjectureFroSectionNode(sectionNode, context) {
|
|
|
157
157
|
const conjectureNode = sectionNode.getConjectureNode();
|
|
158
158
|
|
|
159
159
|
if (conjectureNode !== null) {
|
|
160
|
-
const { Conjecture } =
|
|
160
|
+
const { Conjecture } = ontology;
|
|
161
161
|
|
|
162
162
|
conjecture = Conjecture.fromConjectureNode(conjectureNode, context);
|
|
163
163
|
}
|
|
@@ -167,7 +167,7 @@ function conjectureFroSectionNode(sectionNode, context) {
|
|
|
167
167
|
|
|
168
168
|
function hypothesesFromHypothesisNodes(hypothesisNodes, context) {
|
|
169
169
|
const hypotheses = hypothesisNodes.map((hypothesisNode) => {
|
|
170
|
-
const { Hypothesis } =
|
|
170
|
+
const { Hypothesis } = ontology,
|
|
171
171
|
hypothesis = Hypothesis.fromHypothesisNode(hypothesisNode, context);
|
|
172
172
|
|
|
173
173
|
return hypothesis;
|