occam-verify-cli 1.0.421 → 1.0.428
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 +7 -3
- package/lib/context/file.js +8 -44
- package/lib/context/local.js +8 -26
- package/lib/context/nominal.js +64 -0
- package/lib/context/release.js +2 -2
- package/lib/context/temporary.js +6 -58
- package/lib/element/assertion/contained.js +303 -0
- package/lib/element/assertion/defined.js +318 -0
- package/lib/element/assertion/property.js +299 -0
- package/lib/element/assertion/satisfies.js +264 -0
- package/lib/element/assertion/subproof.js +178 -0
- package/lib/element/assertion/type.js +294 -0
- package/lib/{ontology → element}/assertion.js +9 -9
- package/lib/element/assumption.js +365 -0
- package/lib/element/axiom.js +332 -0
- package/lib/element/axiomLemmaTheoremConjecture.js +346 -0
- package/lib/element/conclusion.js +151 -0
- package/lib/{ontology → element}/conjecture.js +7 -14
- package/lib/element/declaration/combinator.js +161 -0
- package/lib/element/declaration/complexType.js +343 -0
- package/lib/element/declaration/constructor.js +193 -0
- package/lib/element/declaration/metavariable.js +193 -0
- package/lib/element/declaration/simpleType.js +240 -0
- package/lib/element/declaration/typePrefix.js +179 -0
- package/lib/element/declaration/variable.js +196 -0
- package/lib/{ontology → element}/declaration.js +9 -9
- package/lib/element/deduction.js +207 -0
- package/lib/element/derivation.js +96 -0
- package/lib/element/equality.js +275 -0
- package/lib/element/equivalence.js +312 -0
- package/lib/element/equivalences.js +264 -0
- package/lib/{ontology → element}/error.js +12 -12
- package/lib/element/frame.js +387 -0
- package/lib/element/hypothesis.js +195 -0
- package/lib/element/judgement.js +243 -0
- package/lib/element/label.js +198 -0
- package/lib/{ontology → element}/lemma.js +7 -7
- package/lib/{ontology → element}/metaLemma.js +8 -8
- package/lib/element/metaLemmaMetatheorem.js +234 -0
- package/lib/{ontology → element}/metaType.js +18 -11
- package/lib/{ontology → element}/metatheorem.js +8 -8
- package/lib/element/metavariable.js +459 -0
- package/lib/element/parameter.js +108 -0
- package/lib/element/premise.js +310 -0
- package/lib/element/procedureCall.js +243 -0
- package/lib/{ontology → element}/procedureReference.js +3 -3
- package/lib/{ontology → element}/proof.js +4 -4
- package/lib/element/property.js +128 -0
- package/lib/element/propertyRelation.js +195 -0
- package/lib/element/reference.js +304 -0
- package/lib/element/rule.js +373 -0
- package/lib/element/section.js +255 -0
- package/lib/element/signature.js +217 -0
- package/lib/element/statement/combinator/bracketed.js +166 -0
- package/lib/element/statement/combinator.js +105 -0
- package/lib/element/statement.js +386 -0
- package/lib/element/step.js +274 -0
- package/lib/element/subDerivation.js +137 -0
- package/lib/element/subproof.js +240 -0
- package/lib/element/substitution/frame.js +216 -0
- package/lib/{ontology → element}/substitution/reference.js +5 -4
- package/lib/{ontology → element}/substitution/statement.js +7 -6
- package/lib/element/substitution/term.js +265 -0
- package/lib/element/substitution.js +206 -0
- package/lib/element/substitutions.js +425 -0
- package/lib/element/supposition.js +323 -0
- package/lib/{ontology → element/term}/constructor/bracketed.js +11 -7
- package/lib/element/term/constructor.js +172 -0
- package/lib/element/term.js +322 -0
- package/lib/{ontology → element}/theorem.js +8 -8
- package/lib/element/type.js +490 -0
- package/lib/element/typePrefix.js +99 -0
- package/lib/element/variable.js +345 -0
- package/lib/elements.js +27 -0
- package/lib/mixins/statement/verify.js +14 -14
- package/lib/mixins/step/unify.js +12 -12
- package/lib/mixins/term/verify.js +4 -4
- package/lib/node/equivalence.js +116 -0
- package/lib/node/substitution/frame.js +15 -1
- package/lib/node/substitution/statement.js +37 -1
- package/lib/node/substitution/term.js +15 -1
- package/lib/nonTerminalNodeMap.js +4 -3
- package/lib/preamble.js +63 -63
- package/lib/process/assign.js +58 -0
- package/lib/process/instantiate.js +74 -7
- package/lib/process/unify.js +26 -26
- package/lib/process/verify.js +21 -21
- package/lib/ruleNames.js +5 -1
- package/lib/utilities/brackets.js +9 -18
- package/lib/utilities/customGrammar.js +1 -1
- package/lib/utilities/element.js +1141 -0
- package/lib/utilities/json.js +32 -32
- package/lib/utilities/node.js +49 -61
- package/lib/utilities/statement.js +83 -0
- package/lib/utilities/string.js +80 -57
- package/package.json +6 -6
- package/src/action/verify.js +8 -1
- package/src/context/file.js +9 -39
- package/src/context/local.js +5 -11
- package/src/context/nominal.js +30 -0
- package/src/context/release.js +1 -1
- package/src/context/temporary.js +6 -63
- package/src/{ontology → element}/assertion/contained.js +4 -25
- package/src/{ontology → element}/assertion/defined.js +7 -26
- package/src/{ontology → element}/assertion/property.js +7 -26
- package/src/{ontology → element}/assertion/satisfies.js +5 -53
- package/src/{ontology → element}/assertion/subproof.js +3 -32
- package/src/{ontology → element}/assertion/type.js +7 -26
- package/src/{ontology → element}/assertion.js +6 -6
- package/src/{ontology → element}/assumption.js +3 -27
- package/src/{ontology → element}/axiom.js +4 -11
- package/src/{ontology/topLevelAssertion.js → element/axiomLemmaTheoremConjecture.js} +9 -105
- package/src/{ontology → element}/conclusion.js +4 -19
- package/src/{ontology → element}/conjecture.js +4 -11
- package/src/{ontology → element}/declaration/combinator.js +3 -14
- package/src/{ontology → element}/declaration/complexType.js +3 -19
- package/src/{ontology → element}/declaration/constructor.js +3 -14
- package/src/{ontology → element}/declaration/metavariable.js +3 -39
- package/src/{ontology → element}/declaration/simpleType.js +3 -19
- package/src/{ontology → element}/declaration/typePrefix.js +3 -15
- package/src/{ontology → element}/declaration/variable.js +3 -14
- package/src/{ontology → element}/declaration.js +6 -6
- package/src/{ontology → element}/deduction.js +9 -22
- package/src/{ontology → element}/derivation.js +2 -32
- package/src/{ontology → element}/equality.js +18 -42
- package/src/{ontology → element}/equivalence.js +37 -22
- package/src/{ontology → element}/equivalences.js +1 -2
- package/src/{ontology → element}/error.js +8 -8
- package/src/{ontology → element}/frame.js +8 -56
- package/src/{ontology → element}/hypothesis.js +5 -5
- package/src/{ontology → element}/judgement.js +7 -7
- package/src/{ontology → element}/label.js +3 -3
- package/src/{ontology → element}/lemma.js +4 -4
- package/src/{ontology → element}/metaLemma.js +5 -5
- package/src/{ontology/topLevelMetaAssertion.js → element/metaLemmaMetatheorem.js} +11 -11
- package/src/{ontology → element}/metaType.js +11 -7
- package/src/{ontology → element}/metatheorem.js +5 -5
- package/src/{ontology → element}/metavariable.js +10 -60
- package/src/{ontology → element}/parameter.js +1 -1
- package/src/{ontology → element}/premise.js +14 -14
- package/src/{ontology → element}/procedureCall.js +4 -4
- package/src/{ontology → element}/procedureReference.js +1 -1
- package/src/{ontology → element}/proof.js +3 -3
- package/src/{ontology → element}/property.js +7 -15
- package/src/{ontology → element}/propertyRelation.js +5 -11
- package/src/{ontology → element}/reference.js +5 -19
- package/src/{ontology → element}/rule.js +13 -13
- package/src/{ontology → element}/section.js +10 -10
- package/src/{ontology → element}/signature.js +12 -15
- package/src/element/statement/combinator/bracketed.js +38 -0
- package/src/element/statement/combinator.js +59 -0
- package/src/{ontology → element}/statement.js +11 -27
- package/src/{ontology → element}/step.js +10 -44
- package/src/{ontology → element}/subDerivation.js +3 -24
- package/src/{ontology → element}/subproof.js +3 -43
- package/src/{ontology → element}/substitution/frame.js +4 -21
- package/src/{ontology → element}/substitution/reference.js +3 -3
- package/src/{ontology → element}/substitution/statement.js +6 -10
- package/src/{ontology → element}/substitution/term.js +7 -23
- package/src/{ontology → element}/substitutions.js +1 -1
- package/src/{ontology → element}/supposition.js +10 -10
- package/src/{ontology → element/term}/constructor/bracketed.js +12 -13
- package/src/element/term/constructor.js +82 -0
- package/src/{ontology → element}/term.js +6 -38
- package/src/{ontology → element}/theorem.js +5 -5
- package/src/{ontology → element}/type.js +17 -64
- package/src/{ontology → element}/typePrefix.js +8 -12
- package/src/{ontology → element}/variable.js +9 -20
- package/src/elements.js +13 -0
- package/src/mixins/statement/verify.js +4 -4
- package/src/mixins/step/unify.js +6 -6
- package/src/mixins/term/verify.js +3 -3
- package/src/node/equivalence.js +16 -0
- package/src/node/substitution/frame.js +14 -0
- package/src/node/substitution/statement.js +40 -0
- package/src/node/substitution/term.js +15 -0
- package/src/nonTerminalNodeMap.js +4 -1
- package/src/preamble.js +62 -62
- package/src/process/assign.js +59 -0
- package/src/process/instantiate.js +71 -15
- package/src/process/unify.js +37 -39
- package/src/process/verify.js +20 -20
- package/src/ruleNames.js +1 -0
- package/src/utilities/brackets.js +12 -17
- package/src/utilities/customGrammar.js +3 -3
- package/src/utilities/element.js +1399 -0
- package/src/utilities/json.js +31 -31
- package/src/utilities/node.js +56 -64
- package/src/utilities/{context.js → statement.js} +10 -39
- package/src/utilities/string.js +83 -53
- package/lib/assignment/equality.js +0 -62
- package/lib/assignment/judgement.js +0 -62
- package/lib/assignment/variable.js +0 -64
- package/lib/context/bracketed/combinator.js +0 -121
- package/lib/context/bracketed/constructor.js +0 -121
- package/lib/context/bracketted.js +0 -86
- package/lib/context/partial/metavariable.js +0 -180
- package/lib/context/partial/statement.js +0 -180
- package/lib/context/partial/term.js +0 -192
- package/lib/context/partial/variable.js +0 -192
- package/lib/context/partial.js +0 -93
- package/lib/ontology/assertion/contained.js +0 -357
- package/lib/ontology/assertion/defined.js +0 -331
- package/lib/ontology/assertion/property.js +0 -313
- package/lib/ontology/assertion/satisfies.js +0 -302
- package/lib/ontology/assertion/subproof.js +0 -240
- package/lib/ontology/assertion/type.js +0 -308
- package/lib/ontology/assumption.js +0 -383
- package/lib/ontology/axiom.js +0 -339
- package/lib/ontology/combinator/bracketed.js +0 -202
- package/lib/ontology/combinator.js +0 -155
- package/lib/ontology/conclusion.js +0 -201
- package/lib/ontology/constructor.js +0 -185
- package/lib/ontology/declaration/combinator.js +0 -210
- package/lib/ontology/declaration/complexType.js +0 -393
- package/lib/ontology/declaration/constructor.js +0 -242
- package/lib/ontology/declaration/metavariable.js +0 -257
- package/lib/ontology/declaration/simpleType.js +0 -290
- package/lib/ontology/declaration/typePrefix.js +0 -228
- package/lib/ontology/declaration/variable.js +0 -245
- package/lib/ontology/deduction.js +0 -215
- package/lib/ontology/derivation.js +0 -155
- package/lib/ontology/equality.js +0 -288
- package/lib/ontology/equivalence.js +0 -295
- package/lib/ontology/equivalences.js +0 -264
- package/lib/ontology/frame.js +0 -419
- package/lib/ontology/hypothesis.js +0 -190
- package/lib/ontology/judgement.js +0 -248
- package/lib/ontology/label.js +0 -198
- package/lib/ontology/metavariable.js +0 -502
- package/lib/ontology/parameter.js +0 -108
- package/lib/ontology/premise.js +0 -310
- package/lib/ontology/procedureCall.js +0 -243
- package/lib/ontology/property.js +0 -166
- package/lib/ontology/propertyRelation.js +0 -202
- package/lib/ontology/reference.js +0 -315
- package/lib/ontology/rule.js +0 -373
- package/lib/ontology/section.js +0 -255
- package/lib/ontology/signature.js +0 -217
- package/lib/ontology/statement.js +0 -398
- package/lib/ontology/step.js +0 -295
- package/lib/ontology/subDerivation.js +0 -147
- package/lib/ontology/subproof.js +0 -265
- package/lib/ontology/substitution/frame.js +0 -261
- package/lib/ontology/substitution/term.js +0 -269
- package/lib/ontology/substitution.js +0 -206
- package/lib/ontology/substitutions.js +0 -425
- package/lib/ontology/supposition.js +0 -323
- package/lib/ontology/term.js +0 -351
- package/lib/ontology/topLevelAssertion.js +0 -431
- package/lib/ontology/topLevelMetaAssertion.js +0 -234
- package/lib/ontology/type.js +0 -556
- package/lib/ontology/typePrefix.js +0 -99
- package/lib/ontology/variable.js +0 -343
- package/lib/ontology.js +0 -27
- package/lib/utilities/assignments.js +0 -19
- package/lib/utilities/context.js +0 -101
- package/lib/utilities/subproof.js +0 -42
- package/lib/utilities/type.js +0 -40
- package/src/assignment/equality.js +0 -29
- package/src/assignment/judgement.js +0 -29
- package/src/assignment/variable.js +0 -34
- package/src/context/bracketed/combinator.js +0 -31
- package/src/context/bracketed/constructor.js +0 -31
- package/src/context/bracketted.js +0 -41
- package/src/context/partial/metavariable.js +0 -39
- package/src/context/partial/statement.js +0 -39
- package/src/context/partial/term.js +0 -49
- package/src/context/partial/variable.js +0 -49
- package/src/context/partial.js +0 -71
- package/src/ontology/combinator/bracketed.js +0 -38
- package/src/ontology/combinator.js +0 -72
- package/src/ontology/constructor.js +0 -105
- package/src/ontology.js +0 -13
- package/src/utilities/assignments.js +0 -11
- package/src/utilities/subproof.js +0 -56
- package/src/utilities/type.js +0 -35
- /package/src/{ontology → element}/substitution.js +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import elements from "../elements";
|
|
6
6
|
import LocalContext from "../context/local";
|
|
7
7
|
|
|
8
8
|
import { labelsFromJSON,
|
|
@@ -18,11 +18,11 @@ import { labelsFromJSON,
|
|
|
18
18
|
|
|
19
19
|
const { extract, reverse, correlate, backwardsEvery } = arrayUtilities;
|
|
20
20
|
|
|
21
|
-
export default class
|
|
22
|
-
constructor(context,
|
|
21
|
+
export default class AxiomLemmaTheoremConjecture {
|
|
22
|
+
constructor(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses) {
|
|
23
23
|
this.context = context;
|
|
24
|
-
this.node = node;
|
|
25
24
|
this.string = string;
|
|
25
|
+
this.node = node;
|
|
26
26
|
this.labels = labels;
|
|
27
27
|
this.suppositions = suppositions;
|
|
28
28
|
this.deduction = deduction;
|
|
@@ -174,7 +174,7 @@ export default class TopLevelAssertion {
|
|
|
174
174
|
if (this.proof === null) {
|
|
175
175
|
proofVerifies = true;
|
|
176
176
|
} else {
|
|
177
|
-
const { Substitutions } =
|
|
177
|
+
const { Substitutions } = elements,
|
|
178
178
|
substitutions = Substitutions.fromNothing();
|
|
179
179
|
|
|
180
180
|
proofVerifies = this.proof.verify(substitutions, this.deduction, context);
|
|
@@ -318,9 +318,9 @@ export default class TopLevelAssertion {
|
|
|
318
318
|
node = null,
|
|
319
319
|
proof = null,
|
|
320
320
|
string = stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
|
|
321
|
-
|
|
321
|
+
axiomLemmaTheoremConjecture = new Class(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
322
322
|
|
|
323
|
-
return
|
|
323
|
+
return axiomLemmaTheoremConjecture;
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
static fromNode(Class, node, context) {
|
|
@@ -337,104 +337,8 @@ export default class TopLevelAssertion {
|
|
|
337
337
|
signature = signatureFromSignatureNode(signatureNode, context),
|
|
338
338
|
hypotheses = [],
|
|
339
339
|
string = stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
return topLevelAssertion;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
export function proofFromProofNode(proofNode, context) {
|
|
347
|
-
const { Proof } = ontology,
|
|
348
|
-
proof = Proof.fromProofNode(proofNode, context);
|
|
349
|
-
|
|
350
|
-
return proof;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
export function labelsFromLabelNodes(labelNodes, context) {
|
|
354
|
-
const { Label } = ontology,
|
|
355
|
-
labels = labelNodes.map((labelNode) => {
|
|
356
|
-
const label = Label.fromLabelNode(labelNode, context);
|
|
357
|
-
|
|
358
|
-
return label;
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
return labels;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
export function signatureFromSignatureNode(signatureNode, context) {
|
|
365
|
-
let signature = null;
|
|
366
|
-
|
|
367
|
-
if (signatureNode !== null) {
|
|
368
|
-
const { Signature } = ontology;
|
|
369
|
-
|
|
370
|
-
signature = Signature.fromSignatureNode(signatureNode, context);
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
return signature;
|
|
374
|
-
}
|
|
340
|
+
axiomLemmaTheoremConjecture = new Class(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
|
|
375
341
|
|
|
376
|
-
|
|
377
|
-
const { Deduction } = ontology,
|
|
378
|
-
deduction = Deduction.fromDeductionNode(deductionNode, context);
|
|
379
|
-
|
|
380
|
-
return deduction;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
export function suppositionsFromSuppositionNodes(suppositionNodes, context) {
|
|
384
|
-
const { Supposition } = ontology,
|
|
385
|
-
suppositions = suppositionNodes.map((suppositionNode) => {
|
|
386
|
-
const supposition = Supposition.fromSuppositionNode(suppositionNode, context);
|
|
387
|
-
|
|
388
|
-
return supposition;
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
return suppositions;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
export function labelsStringFromLabels(labels) {
|
|
395
|
-
const labelsString = labels.reduce((labelsString, label) => {
|
|
396
|
-
const labelString = label.getString();
|
|
397
|
-
|
|
398
|
-
labelsString = (labelsString === null) ?
|
|
399
|
-
labelString: ///
|
|
400
|
-
`${labelsString}, ${labelString}`;
|
|
401
|
-
|
|
402
|
-
return labelsString;
|
|
403
|
-
}, null);
|
|
404
|
-
|
|
405
|
-
return labelsString;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
export function suppositionsStringFromSuppositions(suppositions) {
|
|
409
|
-
const suppositionsString = suppositions.reduce((suppositionsString, supposition) => {
|
|
410
|
-
const suppositionString = supposition.getString();
|
|
411
|
-
|
|
412
|
-
suppositionsString = (suppositionsString !== null) ?
|
|
413
|
-
`${suppositionsString}, ${suppositionString}` :
|
|
414
|
-
suppositionString; ///
|
|
415
|
-
|
|
416
|
-
return suppositionsString;
|
|
417
|
-
}, null);
|
|
418
|
-
|
|
419
|
-
return suppositionsString;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
export function stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction) {
|
|
423
|
-
let string;
|
|
424
|
-
|
|
425
|
-
const suppositionsString = suppositionsStringFromSuppositions(suppositions),
|
|
426
|
-
deductionString = deduction.getString(),
|
|
427
|
-
labelsString = labelsStringFromLabels(labels);
|
|
428
|
-
|
|
429
|
-
if (labelsString !== null) {
|
|
430
|
-
string = (suppositionsString !== null) ?
|
|
431
|
-
`${labelsString} :: [${suppositionsString}] ... ${deductionString}` :
|
|
432
|
-
`${labelsString} :: ${deductionString}`;
|
|
433
|
-
} else {
|
|
434
|
-
string = (suppositionsString !== null) ?
|
|
435
|
-
`[${suppositionsString}] ... ${deductionString}` :
|
|
436
|
-
deductionString;
|
|
342
|
+
return axiomLemmaTheoremConjecture;
|
|
437
343
|
}
|
|
438
|
-
|
|
439
|
-
return string;
|
|
440
344
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../ontology";
|
|
4
3
|
import TemporaryContext from "../context/temporary";
|
|
5
4
|
|
|
6
|
-
import { define } from "../
|
|
5
|
+
import { define } from "../elements";
|
|
7
6
|
import { termsFromJSON, framesFromJSON, statementFromJSON, termsToTermsJSON, framesToFramesJSON, statementToStatementJSON } from "../utilities/json";
|
|
8
7
|
|
|
9
8
|
export default define(class Conclusion {
|
|
10
|
-
constructor(context,
|
|
9
|
+
constructor(context, string, node, statement) {
|
|
11
10
|
this.context = context;
|
|
12
|
-
this.node = node;
|
|
13
11
|
this.string = string;
|
|
12
|
+
this.node = node;
|
|
14
13
|
this.statement = statement;
|
|
15
14
|
}
|
|
16
15
|
|
|
@@ -120,21 +119,7 @@ export default define(class Conclusion {
|
|
|
120
119
|
|
|
121
120
|
context = temporaryContext; ///
|
|
122
121
|
|
|
123
|
-
const conclusion = new Conclusion(context,
|
|
124
|
-
|
|
125
|
-
return conclusion;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
static fromConclusionNode(conclusionNode, context) {
|
|
129
|
-
const { Statement } = ontology,
|
|
130
|
-
node = conclusionNode, ///
|
|
131
|
-
string = context.nodeAsString(node),
|
|
132
|
-
statement = Statement.fromConclusionNode(conclusionNode, context),
|
|
133
|
-
temporaryContext = null;
|
|
134
|
-
|
|
135
|
-
context = temporaryContext; ///
|
|
136
|
-
|
|
137
|
-
const conclusion = new Conclusion(context, node, string, statement);
|
|
122
|
+
const conclusion = new Conclusion(context, string, node, statement);
|
|
138
123
|
|
|
139
124
|
return conclusion;
|
|
140
125
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import AxiomLemmaTheoremConjecture from "./axiomLemmaTheoremConjecture";
|
|
4
4
|
|
|
5
|
-
import { define } from "../
|
|
5
|
+
import { define } from "../elements";
|
|
6
6
|
|
|
7
|
-
export default define(class Conjecture extends
|
|
7
|
+
export default define(class Conjecture extends AxiomLemmaTheoremConjecture {
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
@@ -30,12 +30,5 @@ export default define(class Conjecture extends TopLevelAssertion {
|
|
|
30
30
|
|
|
31
31
|
static name = "Conjecture";
|
|
32
32
|
|
|
33
|
-
static fromJSON(json, context) { return
|
|
34
|
-
|
|
35
|
-
static fromConjectureNode(conjectureNode, context) {
|
|
36
|
-
const node = conjectureNode, ///
|
|
37
|
-
conjecture = TopLevelAssertion.fromNode(Conjecture, node, context);
|
|
38
|
-
|
|
39
|
-
return conjecture;
|
|
40
|
-
}
|
|
33
|
+
static fromJSON(json, context) { return AxiomLemmaTheoremConjecture.fromJSON(Conjecture, json, context); }
|
|
41
34
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../../ontology";
|
|
4
3
|
import Declaration from "../declaration";
|
|
5
4
|
|
|
6
|
-
import { define } from "../../
|
|
5
|
+
import { define } from "../../elements";
|
|
7
6
|
import { verifyStatement } from "../../process/verify";
|
|
8
7
|
|
|
9
8
|
export default define(class CombinatorDeclaration extends Declaration {
|
|
10
|
-
constructor(context,
|
|
11
|
-
super(context,
|
|
9
|
+
constructor(context, string, node, combinator) {
|
|
10
|
+
super(context, string, node);
|
|
12
11
|
|
|
13
12
|
this.combinator = combinator;
|
|
14
13
|
}
|
|
@@ -63,14 +62,4 @@ export default define(class CombinatorDeclaration extends Declaration {
|
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
static name = "CombinatorDeclaration";
|
|
66
|
-
|
|
67
|
-
static fromCombinatorDeclarationNode(combinatorDeclarationNode, context) {
|
|
68
|
-
const { Combinator } = ontology,
|
|
69
|
-
node = combinatorDeclarationNode, ///
|
|
70
|
-
string = context.nodeAsString(node),
|
|
71
|
-
combinator = Combinator.fromCombinatorDeclarationNode(combinatorDeclarationNode, context),
|
|
72
|
-
combinatorDeclaration = new CombinatorDeclaration(context, node, string, combinator);
|
|
73
|
-
|
|
74
|
-
return combinatorDeclaration;
|
|
75
|
-
}
|
|
76
65
|
});
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../../ontology";
|
|
4
3
|
import Declaration from "../declaration";
|
|
5
4
|
|
|
6
|
-
import { define } from "../../
|
|
7
|
-
import { stringFromTypeNameTypePrefixNameAndSuperTypes } from "../../utilities/type";
|
|
5
|
+
import { define } from "../../elements";
|
|
8
6
|
|
|
9
7
|
export default define(class ComplexTypeDeclaration extends Declaration {
|
|
10
|
-
constructor(context,
|
|
11
|
-
super(context,
|
|
8
|
+
constructor(context, string, node, type, prefixed) {
|
|
9
|
+
super(context, string, node);
|
|
12
10
|
|
|
13
11
|
this.type = type;
|
|
14
12
|
this.prefixed = prefixed;
|
|
@@ -313,18 +311,4 @@ export default define(class ComplexTypeDeclaration extends Declaration {
|
|
|
313
311
|
}
|
|
314
312
|
|
|
315
313
|
static name = "ComplexTypeDeclaration";
|
|
316
|
-
|
|
317
|
-
static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
318
|
-
const { Type } = ontology,
|
|
319
|
-
type = Type.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
320
|
-
node = complexTypeDeclarationNode, ///
|
|
321
|
-
prefixed = complexTypeDeclarationNode.isPrefixed(),
|
|
322
|
-
typePrefixName = complexTypeDeclarationNode.getTypePrefixName(),
|
|
323
|
-
typeName = type.getName(),
|
|
324
|
-
superTypes = type.getSuperTypes(),
|
|
325
|
-
string = stringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes),
|
|
326
|
-
complexTypeDeclaration = new ComplexTypeDeclaration(context, node, string, type, prefixed);
|
|
327
|
-
|
|
328
|
-
return complexTypeDeclaration;
|
|
329
|
-
}
|
|
330
314
|
});
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../../ontology";
|
|
4
3
|
import Declaration from "../declaration";
|
|
5
4
|
|
|
6
|
-
import { define } from "../../
|
|
5
|
+
import { define } from "../../elements";
|
|
7
6
|
import { verifyTerm } from "../../process/verify";
|
|
8
7
|
|
|
9
8
|
export default define(class ConstructorDeclaration extends Declaration {
|
|
10
|
-
constructor(context,
|
|
11
|
-
super(context,
|
|
9
|
+
constructor(context, string, node, constructor) {
|
|
10
|
+
super(context, string, node);
|
|
12
11
|
|
|
13
12
|
this.constructor = constructor;
|
|
14
13
|
}
|
|
@@ -112,14 +111,4 @@ export default define(class ConstructorDeclaration extends Declaration {
|
|
|
112
111
|
}
|
|
113
112
|
|
|
114
113
|
static name = "ConstructorDeclaration";
|
|
115
|
-
|
|
116
|
-
static fromConstructorDeclarationNode(constructorDeclarationNode, context) {
|
|
117
|
-
const { Constructor } = ontology,
|
|
118
|
-
node = constructorDeclarationNode, ///
|
|
119
|
-
string = context.nodeAsString(node),
|
|
120
|
-
constructor = Constructor.fromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
121
|
-
constructorDeclaration = new ConstructorDeclaration(context, node, string, constructor);
|
|
122
|
-
|
|
123
|
-
return constructorDeclaration;
|
|
124
|
-
}
|
|
125
114
|
});
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../../ontology";
|
|
4
3
|
import Declaration from "../declaration";
|
|
5
4
|
|
|
6
|
-
import { define } from "../../
|
|
5
|
+
import { define } from "../../elements";
|
|
7
6
|
|
|
8
7
|
export default define(class MetavariableDeclaration extends Declaration {
|
|
9
|
-
constructor(context,
|
|
10
|
-
super(context,
|
|
8
|
+
constructor(context, string, node, metavariable) {
|
|
9
|
+
super(context, string, node);
|
|
11
10
|
|
|
12
11
|
this.metavariable = metavariable;
|
|
13
12
|
}
|
|
@@ -106,39 +105,4 @@ export default define(class MetavariableDeclaration extends Declaration {
|
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
static name = "MetavariableDeclaration";
|
|
109
|
-
|
|
110
|
-
static fromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
111
|
-
const { Metavariable } = ontology,
|
|
112
|
-
node = metavariableDeclarationNode, ///
|
|
113
|
-
metaType = metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
114
|
-
metavariable = Metavariable.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
|
|
115
|
-
string = stringFromMetavariableAndMetaType(metavariable, metaType),
|
|
116
|
-
metavariableDeclaration = new MetavariableDeclaration(context, node, string, metavariable);
|
|
117
|
-
|
|
118
|
-
return metavariableDeclaration;
|
|
119
|
-
}
|
|
120
108
|
});
|
|
121
|
-
|
|
122
|
-
function stringFromMetavariableAndMetaType(metavariable, metaType) {
|
|
123
|
-
let string;
|
|
124
|
-
|
|
125
|
-
const metavariableString = metavariable.getString();
|
|
126
|
-
|
|
127
|
-
if (metaType === null) {
|
|
128
|
-
string = metavariableString; ///
|
|
129
|
-
} else {
|
|
130
|
-
const metaTypeString = metaType.getString();
|
|
131
|
-
|
|
132
|
-
string = `${metavariableString}:${metaTypeString}`;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return string;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
|
|
139
|
-
const { MetaType } = ontology,
|
|
140
|
-
metaTypeNode = metavariableDeclarationNode.getMetaTypeNode(),
|
|
141
|
-
metaType = MetaType.fromMetaTypeNode(metaTypeNode, context);
|
|
142
|
-
|
|
143
|
-
return metaType;
|
|
144
|
-
}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../../ontology";
|
|
4
3
|
import Declaration from "../declaration";
|
|
5
4
|
|
|
6
|
-
import { define } from "../../
|
|
7
|
-
import { stringFromTypeNameTypePrefixNameAndSuperTypes } from "../../utilities/type";
|
|
5
|
+
import { define } from "../../elements";
|
|
8
6
|
|
|
9
7
|
export default define(class SimpleTypeDeclaration extends Declaration {
|
|
10
|
-
constructor(context,
|
|
11
|
-
super(context,
|
|
8
|
+
constructor(context, string, node, type, prefixed) {
|
|
9
|
+
super(context, string, node);
|
|
12
10
|
|
|
13
11
|
this.type = type;
|
|
14
12
|
this.prefixed = prefixed;
|
|
@@ -172,18 +170,4 @@ export default define(class SimpleTypeDeclaration extends Declaration {
|
|
|
172
170
|
}
|
|
173
171
|
|
|
174
172
|
static name = "SimpleTypeDeclaration";
|
|
175
|
-
|
|
176
|
-
static fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
|
|
177
|
-
const { Type } = ontology,
|
|
178
|
-
type = Type.fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
|
|
179
|
-
node = simpleTypeDeclarationNode, ///
|
|
180
|
-
prefixed = simpleTypeDeclarationNode.isPrefixed(),
|
|
181
|
-
typePrefixName = simpleTypeDeclarationNode.getTypePrefixName(),
|
|
182
|
-
typeName = type.getName(),
|
|
183
|
-
superTypes = type.getSuperTypes(),
|
|
184
|
-
string = stringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes),
|
|
185
|
-
simpleTypeDeclaration = new SimpleTypeDeclaration(context, node, string, type, prefixed);
|
|
186
|
-
|
|
187
|
-
return simpleTypeDeclaration;
|
|
188
|
-
}
|
|
189
173
|
});
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../../ontology";
|
|
4
3
|
import Declaration from "../declaration";
|
|
5
4
|
|
|
6
|
-
import { define } from "../../
|
|
5
|
+
import { define } from "../../elements";
|
|
7
6
|
|
|
8
7
|
export default define(class TypePrefixDeclaration extends Declaration {
|
|
9
|
-
constructor(context,
|
|
10
|
-
super(context,
|
|
8
|
+
constructor(context, string, node, typePrefix) {
|
|
9
|
+
super(context, string, node);
|
|
11
10
|
|
|
12
11
|
this.typePrefix = typePrefix;
|
|
13
12
|
}
|
|
@@ -89,15 +88,4 @@ export default define(class TypePrefixDeclaration extends Declaration {
|
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
static name = "TypePrefixDeclaration";
|
|
92
|
-
|
|
93
|
-
static fromTypePrefixDeclarationNode(typePrefixDeclarationNode, context) {
|
|
94
|
-
const { TypePrefix } = ontology,
|
|
95
|
-
node = typePrefixDeclarationNode, ///
|
|
96
|
-
typePrefix = TypePrefix.fromTypePrefixDeclarationNode(typePrefixDeclarationNode, context),
|
|
97
|
-
typePrefixName = typePrefix.getName(),
|
|
98
|
-
string = typePrefixName, ///
|
|
99
|
-
simpleTypeDeclaration = new TypePrefixDeclaration(context, node, string, typePrefix);
|
|
100
|
-
|
|
101
|
-
return simpleTypeDeclaration;
|
|
102
|
-
}
|
|
103
91
|
});
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../../ontology";
|
|
4
3
|
import Declaration from "../declaration";
|
|
5
4
|
|
|
6
|
-
import { define } from "../../
|
|
5
|
+
import { define } from "../../elements";
|
|
7
6
|
|
|
8
7
|
export default define(class VariableDeclaration extends Declaration {
|
|
9
|
-
constructor(context,
|
|
10
|
-
super(context,
|
|
8
|
+
constructor(context, string, node, variable) {
|
|
9
|
+
super(context, string, node);
|
|
11
10
|
|
|
12
11
|
this.variable = variable;
|
|
13
12
|
}
|
|
@@ -115,14 +114,4 @@ export default define(class VariableDeclaration extends Declaration {
|
|
|
115
114
|
}
|
|
116
115
|
|
|
117
116
|
static name = "VariableDeclaration";
|
|
118
|
-
|
|
119
|
-
static fromVariableDeclarationNode(variableDeclarationNode, context) {
|
|
120
|
-
const { Variable } = ontology,
|
|
121
|
-
node = variableDeclarationNode, ///
|
|
122
|
-
string = context.nodeAsString(node),
|
|
123
|
-
variable = Variable.fromVariableDeclarationNode(variableDeclarationNode, context),
|
|
124
|
-
variableDeclaration = new VariableDeclaration(context, node, string, variable);
|
|
125
|
-
|
|
126
|
-
return variableDeclaration;
|
|
127
|
-
}
|
|
128
117
|
});
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export default class Declaration {
|
|
4
|
-
constructor(context,
|
|
4
|
+
constructor(context, string, node) {
|
|
5
5
|
this.context = context;
|
|
6
|
-
this.node = node;
|
|
7
6
|
this.string = string;
|
|
7
|
+
this.node = node;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
getContext() {
|
|
11
11
|
return this.context;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
getNode() {
|
|
15
|
-
return this.node;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
14
|
getString() {
|
|
19
15
|
return this.string;
|
|
20
16
|
}
|
|
17
|
+
|
|
18
|
+
getNode() {
|
|
19
|
+
return this.node;
|
|
20
|
+
}
|
|
21
21
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../elements";
|
|
4
4
|
import TemporaryContext from "../context/temporary";
|
|
5
5
|
|
|
6
|
-
import { define } from "../
|
|
6
|
+
import { define } from "../elements";
|
|
7
7
|
import { termsFromJSON, framesFromJSON, statementFromJSON, termsToTermsJSON, framesToFramesJSON, statementToStatementJSON } from "../utilities/json";
|
|
8
8
|
|
|
9
9
|
export default define(class Deduction {
|
|
10
|
-
constructor(context,
|
|
10
|
+
constructor(context, string, statement) {
|
|
11
11
|
this.context = context;
|
|
12
|
+
this.string = string;
|
|
12
13
|
this.node = node;
|
|
13
14
|
this.string = string;
|
|
14
15
|
this.statement = statement;
|
|
@@ -18,14 +19,14 @@ export default define(class Deduction {
|
|
|
18
19
|
return this.context;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
getNode(node) {
|
|
22
|
-
return this.node;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
22
|
getString() {
|
|
26
23
|
return this.string;
|
|
27
24
|
}
|
|
28
25
|
|
|
26
|
+
getNode() {
|
|
27
|
+
return this.node;
|
|
28
|
+
}
|
|
29
|
+
|
|
29
30
|
getStatement() {
|
|
30
31
|
return this.statement;
|
|
31
32
|
}
|
|
@@ -141,21 +142,7 @@ export default define(class Deduction {
|
|
|
141
142
|
|
|
142
143
|
context = temporaryContext; ///
|
|
143
144
|
|
|
144
|
-
const deduction = new Deduction(context,
|
|
145
|
-
|
|
146
|
-
return deduction;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
static fromDeductionNode(deductionNode, context) {
|
|
150
|
-
const { Statement } = ontology,
|
|
151
|
-
node = deductionNode, ///
|
|
152
|
-
string = context.nodeAsString(node),
|
|
153
|
-
statement = Statement.fromDeductionNode(deductionNode, context),
|
|
154
|
-
temporaryContext = null;
|
|
155
|
-
|
|
156
|
-
context = temporaryContext; ///
|
|
157
|
-
|
|
158
|
-
const deduction = new Deduction(context, node, string, statement);
|
|
145
|
+
const deduction = new Deduction(context, string, statement);
|
|
159
146
|
|
|
160
147
|
return deduction;
|
|
161
148
|
}
|
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import assignAssignments from "../process/assign";
|
|
6
6
|
|
|
7
|
-
import { define } from "../
|
|
8
|
-
import { assignAssignments } from "../utilities/assignments";
|
|
7
|
+
import { define } from "../elements";
|
|
9
8
|
|
|
10
9
|
const { last } = arrayUtilities;
|
|
11
10
|
|
|
@@ -51,34 +50,5 @@ export default define(class Derivation {
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
static name = "Derivation";
|
|
54
|
-
|
|
55
|
-
static fromDerivationNode(derivationNode, context) {
|
|
56
|
-
const stepsOrSubproofs = stepsOrSubproofsFromDerivationNode(derivationNode, context),
|
|
57
|
-
derivation = new Derivation(stepsOrSubproofs);
|
|
58
|
-
|
|
59
|
-
return derivation;
|
|
60
|
-
}
|
|
61
53
|
});
|
|
62
54
|
|
|
63
|
-
function stepsOrSubproofsFromDerivationNode(derivationNode, context) {
|
|
64
|
-
const { Step, Subproof } = ontology,
|
|
65
|
-
stepOrSubproofNodes = derivationNode.getStepOrSubproofNodes(),
|
|
66
|
-
stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
|
|
67
|
-
let stepOrSubproof;
|
|
68
|
-
|
|
69
|
-
const step = Step.fromStepOrSubproofNode(stepOrSubproofNode, context),
|
|
70
|
-
subproof = Subproof.fromStepOrSubproofNode(stepOrSubproofNode, context);
|
|
71
|
-
|
|
72
|
-
if (false) {
|
|
73
|
-
///
|
|
74
|
-
} else if (step !== null) {
|
|
75
|
-
stepOrSubproof = step; ///
|
|
76
|
-
} else if (subproof !== null) {
|
|
77
|
-
stepOrSubproof = subproof; ///
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return stepOrSubproof;
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
return stepsOrSubproofs;
|
|
84
|
-
}
|