occam-verify-cli 1.0.421 → 1.0.427
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 +316 -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/substitution/frame.js +15 -1
- package/lib/node/substitution/statement.js +37 -1
- package/lib/node/substitution/term.js +15 -1
- package/lib/preamble.js +63 -63
- package/lib/process/assign.js +58 -0
- package/lib/process/instantiate.js +68 -7
- package/lib/process/unify.js +26 -26
- package/lib/process/verify.js +21 -21
- package/lib/utilities/brackets.js +9 -18
- package/lib/utilities/customGrammar.js +1 -1
- package/lib/utilities/element.js +1128 -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 +98 -56
- 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 +17 -2
- package/src/{ontology → element}/equivalences.js +1 -1
- 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/substitution/frame.js +14 -0
- package/src/node/substitution/statement.js +40 -0
- package/src/node/substitution/term.js +15 -0
- package/src/preamble.js +62 -62
- package/src/process/assign.js +59 -0
- package/src/process/instantiate.js +67 -15
- package/src/process/unify.js +37 -39
- package/src/process/verify.js +20 -20
- package/src/utilities/brackets.js +12 -17
- package/src/utilities/customGrammar.js +3 -3
- package/src/utilities/element.js +1380 -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 +120 -52
- 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
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { nominalLexer, nominalParser } from "../utilities/nominal";
|
|
4
|
+
|
|
5
|
+
class NominalContext {
|
|
6
|
+
constructor(lexer, parser) {
|
|
7
|
+
this.lexer = lexer;
|
|
8
|
+
this.parser = parser;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getLexer() {
|
|
12
|
+
return this.lexer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
getParser() {
|
|
16
|
+
return this.parser;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
static fromNothing() {
|
|
20
|
+
const lexer = nominalLexer, ///
|
|
21
|
+
parser = nominalParser, ///
|
|
22
|
+
nominalContext = new NominalContext(lexer, parser);
|
|
23
|
+
|
|
24
|
+
return nominalContext;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const nominalContext = NominalContext.fromNothing();
|
|
29
|
+
|
|
30
|
+
export default nominalContext;
|
package/src/context/release.js
CHANGED
|
@@ -10,7 +10,7 @@ import FileContext from "../context/file";
|
|
|
10
10
|
import NominalLexer from "../nominal/lexer";
|
|
11
11
|
import NominalParser from "../nominal/parser";
|
|
12
12
|
|
|
13
|
-
import { frameMetaType, referenceMetaType, statementMetaType } from "../
|
|
13
|
+
import { frameMetaType, referenceMetaType, statementMetaType } from "../element/metaType";
|
|
14
14
|
import { customGrammarFromNameAndEntries, combinedCustomGrammarFromReleaseContexts } from "../utilities/customGrammar";
|
|
15
15
|
|
|
16
16
|
const { nominalLexerFromCombinedCustomGrammar } = lexersUtilities,
|
package/src/context/temporary.js
CHANGED
|
@@ -5,9 +5,8 @@ import { arrayUtilities } from "necessary";
|
|
|
5
5
|
const { extract, compress } = arrayUtilities;
|
|
6
6
|
|
|
7
7
|
export default class TemporaryContext {
|
|
8
|
-
constructor(context,
|
|
8
|
+
constructor(context, terms, frames, statements, assertions, references, substitutions) {
|
|
9
9
|
this.context = context;
|
|
10
|
-
this.tokens = tokens;
|
|
11
10
|
this.terms = terms;
|
|
12
11
|
this.frames = frames;
|
|
13
12
|
this.statements = statements;
|
|
@@ -20,10 +19,6 @@ export default class TemporaryContext {
|
|
|
20
19
|
return this.context;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
getTokens() {
|
|
24
|
-
return tokens;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
22
|
getTerms() {
|
|
28
23
|
return this.terms;
|
|
29
24
|
}
|
|
@@ -356,47 +351,9 @@ export default class TemporaryContext {
|
|
|
356
351
|
|
|
357
352
|
matchTermAndPropertyRelation(term, propertyRelation) { return this.context.matchTermAndPropertyRelation(term, propertyRelation); }
|
|
358
353
|
|
|
359
|
-
nodeAsString(node
|
|
360
|
-
if (tokens === null) {
|
|
361
|
-
tokens = this.tokens;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
const string = this.context.nodeAsString(node, tokens);
|
|
365
|
-
|
|
366
|
-
return string;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
nodesAsString(node, tokens = null) {
|
|
370
|
-
if (tokens === null) {
|
|
371
|
-
tokens = this.tokens;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
const string = this.context.nodesAsString(node, tokens);
|
|
375
|
-
|
|
376
|
-
return string;
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
nodeAsTokens(node, tokens = null) {
|
|
380
|
-
if (tokens === null) {
|
|
381
|
-
tokens = this.tokens;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
tokens = this.context.nodeAsTokens(node, tokens); ///
|
|
385
|
-
|
|
386
|
-
return tokens;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
nodesAsTokens(node, tokens = null) {
|
|
390
|
-
if (tokens === null) {
|
|
391
|
-
tokens = this.tokens;
|
|
392
|
-
}
|
|
354
|
+
nodeAsString(node) { return this.context.nodeAsString(node); }
|
|
393
355
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
return tokens;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
tokensAsString(tokens) { return this.context.tokensAsString(tokens); }
|
|
356
|
+
nodesAsString(node) { return this.context.nodesAsString(node); }
|
|
400
357
|
|
|
401
358
|
trace(message, node = null) { this.context.trace(message, node); }
|
|
402
359
|
|
|
@@ -498,35 +455,21 @@ export default class TemporaryContext {
|
|
|
498
455
|
static fromNothing(context) {
|
|
499
456
|
const terms = [],
|
|
500
457
|
frames = [],
|
|
501
|
-
tokens = null,
|
|
502
458
|
statements = [],
|
|
503
459
|
assertions = [],
|
|
504
460
|
references = [],
|
|
505
461
|
substitutions = [],
|
|
506
|
-
temporaryContext = new TemporaryContext(context,
|
|
462
|
+
temporaryContext = new TemporaryContext(context, terms, frames, statements, assertions, references, substitutions);
|
|
507
463
|
|
|
508
464
|
return temporaryContext;
|
|
509
465
|
}
|
|
510
466
|
|
|
511
467
|
static fromTermsAndFrames(terms, frames, context) {
|
|
512
|
-
const
|
|
513
|
-
statements = [],
|
|
514
|
-
assertions = [],
|
|
515
|
-
references = [],
|
|
516
|
-
substitutions = [],
|
|
517
|
-
temporaryContext = new TemporaryContext(context, tokens, terms, frames, statements, assertions, references, substitutions);
|
|
518
|
-
|
|
519
|
-
return temporaryContext;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
static fromContextAndTokens(context, tokens) {
|
|
523
|
-
const terms = [],
|
|
524
|
-
frames = [],
|
|
525
|
-
statements = [],
|
|
468
|
+
const statements = [],
|
|
526
469
|
assertions = [],
|
|
527
470
|
references = [],
|
|
528
471
|
substitutions = [],
|
|
529
|
-
temporaryContext = new TemporaryContext(context,
|
|
472
|
+
temporaryContext = new TemporaryContext(context, terms, frames, statements, assertions, references, substitutions);
|
|
530
473
|
|
|
531
474
|
return temporaryContext;
|
|
532
475
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import ontology from "../../ontology";
|
|
4
3
|
import Assertion from "../assertion";
|
|
5
4
|
|
|
6
|
-
import { define } from "../../
|
|
5
|
+
import { define } from "../../elements";
|
|
6
|
+
import { containedAssertionFromStatementNode } from "../../utilities/element";
|
|
7
7
|
import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions, statementFromStatementAndSubstitutions } from "../../utilities/substitutions";
|
|
8
8
|
|
|
9
9
|
export default define(class ContainedAssertion extends Assertion {
|
|
10
|
-
constructor(string, node,
|
|
11
|
-
super(string, node
|
|
10
|
+
constructor(string, node, term, frame, negated, statement) {
|
|
11
|
+
super(string, node);
|
|
12
12
|
|
|
13
13
|
this.term = term;
|
|
14
14
|
this.frame = frame;
|
|
@@ -201,27 +201,6 @@ export default define(class ContainedAssertion extends Assertion {
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
static name = "ContainedAssertion";
|
|
204
|
-
|
|
205
|
-
static fromStatementNode(statementNode, context) {
|
|
206
|
-
let containedAssertion = null;
|
|
207
|
-
|
|
208
|
-
const containedAssertionNode = statementNode.getContainedAssertionNode();
|
|
209
|
-
|
|
210
|
-
if (containedAssertionNode !== null) {
|
|
211
|
-
const { Term, Frame, Statement } = ontology,
|
|
212
|
-
node = containedAssertionNode, ///
|
|
213
|
-
string = context.nodeAsString(node),
|
|
214
|
-
tokens = context.nodeAsTokens(node),
|
|
215
|
-
negated = containedAssertionNode.isNegated(),
|
|
216
|
-
term = Term.fromContainedAssertionNode(containedAssertionNode, context),
|
|
217
|
-
frame = Frame.fromContainedAssertionNode(containedAssertionNode, context),
|
|
218
|
-
statement = Statement.fromContainedAssertionNode(containedAssertionNode, context);
|
|
219
|
-
|
|
220
|
-
containedAssertion = new ContainedAssertion(string, node, tokens, term, frame, negated, statement);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return containedAssertion;
|
|
224
|
-
}
|
|
225
204
|
});
|
|
226
205
|
|
|
227
206
|
function verifyWhenDerived(term, frame, statement, negated, generalContext, specificContext) {
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../../elements";
|
|
4
4
|
import Assertion from "../assertion";
|
|
5
5
|
|
|
6
|
-
import { define } from "../../
|
|
6
|
+
import { define } from "../../elements";
|
|
7
|
+
import { definedAssertionFromStatementNode } from "../../utilities/element";
|
|
7
8
|
import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions } from "../../utilities/substitutions";
|
|
8
9
|
|
|
9
10
|
export default define(class DefinedAssertion extends Assertion {
|
|
10
|
-
constructor(string, node,
|
|
11
|
-
super(string, node
|
|
11
|
+
constructor(string, node, term, frame, negated) {
|
|
12
|
+
super(string, node);
|
|
12
13
|
|
|
13
14
|
this.term = term;
|
|
14
15
|
this.frame= frame;
|
|
@@ -172,26 +173,6 @@ export default define(class DefinedAssertion extends Assertion {
|
|
|
172
173
|
}
|
|
173
174
|
|
|
174
175
|
static name = "DefinedAssertion";
|
|
175
|
-
|
|
176
|
-
static fromStatementNode(statementNode, context) {
|
|
177
|
-
let definedAssertion = null;
|
|
178
|
-
|
|
179
|
-
const definedAssertionNode = statementNode.getDefinedAssertionNode();
|
|
180
|
-
|
|
181
|
-
if (definedAssertionNode !== null) {
|
|
182
|
-
const { Term, Frame } = ontology,
|
|
183
|
-
node = definedAssertionNode, ///
|
|
184
|
-
string = context.nodeAsString(node),
|
|
185
|
-
tokens = context.nodeAsTokens(node),
|
|
186
|
-
negated = definedAssertionNode.isNegated(),
|
|
187
|
-
term = Term.fromDefinedAssertionNode(definedAssertionNode, context),
|
|
188
|
-
frame = Frame.fromDefinedAssertionNode(definedAssertionNode, context);
|
|
189
|
-
|
|
190
|
-
definedAssertion = new DefinedAssertion(string, node, tokens, term, frame, negated);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return definedAssertion;
|
|
194
|
-
}
|
|
195
176
|
});
|
|
196
177
|
|
|
197
178
|
function verifyWhenDerived(term, frame, negated, generalContext, specificContext) {
|
|
@@ -200,7 +181,7 @@ function verifyWhenDerived(term, frame, negated, generalContext, specificContext
|
|
|
200
181
|
const context = specificContext; ///
|
|
201
182
|
|
|
202
183
|
if (term !== null) {
|
|
203
|
-
const { Variable } =
|
|
184
|
+
const { Variable } = elements,
|
|
204
185
|
termNode = term.getNode(),
|
|
205
186
|
variable = Variable.fromTermNode(termNode, context),
|
|
206
187
|
generalContext = context, ///
|
|
@@ -216,7 +197,7 @@ function verifyWhenDerived(term, frame, negated, generalContext, specificContext
|
|
|
216
197
|
}
|
|
217
198
|
|
|
218
199
|
if (frame!== null) {
|
|
219
|
-
const { Metavariable } =
|
|
200
|
+
const { Metavariable } = elements,
|
|
220
201
|
frameNode = frame.getNode(),
|
|
221
202
|
metavariable = Metavariable.fromFrameNode(frameNode, context),
|
|
222
203
|
metavariableDefined = context.isMetavariableDefined(metavariable);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../../elements";
|
|
4
4
|
import Assertion from "../assertion";
|
|
5
|
-
import VariableAssignment from "../../assignment/variable";
|
|
6
5
|
|
|
7
|
-
import { define } from "../../
|
|
6
|
+
import { define } from "../../elements";
|
|
7
|
+
import { variableAssignmentFromVariable } from "../../process/assign";
|
|
8
8
|
|
|
9
9
|
export default define(class PropertyAssertion extends Assertion {
|
|
10
|
-
constructor(string, node,
|
|
11
|
-
super(string, node
|
|
10
|
+
constructor(string, node, term, propertyRelation) {
|
|
11
|
+
super(string, node);
|
|
12
12
|
|
|
13
13
|
this.term = term;
|
|
14
14
|
this.propertyRelation = propertyRelation;
|
|
@@ -164,7 +164,7 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
164
164
|
|
|
165
165
|
let variable;
|
|
166
166
|
|
|
167
|
-
const { Variable } =
|
|
167
|
+
const { Variable } = elements,
|
|
168
168
|
termNode = this.term.getNode();
|
|
169
169
|
|
|
170
170
|
variable = Variable.fromTermNode(termNode, context);
|
|
@@ -176,7 +176,7 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
176
176
|
|
|
177
177
|
variable = Variable.fromVariableAndPropertyRelation(variable, this.propertyRelation);
|
|
178
178
|
|
|
179
|
-
const variableAssignment =
|
|
179
|
+
const variableAssignment = variableAssignmentFromVariable(variable),
|
|
180
180
|
assignment = variableAssignment; ///
|
|
181
181
|
|
|
182
182
|
assignments.push(assignment);
|
|
@@ -184,23 +184,4 @@ export default define(class PropertyAssertion extends Assertion {
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
static name = "PropertyAssertion";
|
|
187
|
-
|
|
188
|
-
static fromStatementNode(statementNode, context) {
|
|
189
|
-
let propertyAssertion = null;
|
|
190
|
-
|
|
191
|
-
const propertyAssertionNode = statementNode.getPropertyAssertionNode();
|
|
192
|
-
|
|
193
|
-
if (propertyAssertionNode !== null) {
|
|
194
|
-
const { Term, PropertyRelation } = ontology,
|
|
195
|
-
node = propertyAssertionNode, ///
|
|
196
|
-
string = context.nodeAsString(node),
|
|
197
|
-
tokens = context.nodeAsTokens(node),
|
|
198
|
-
term = Term.fromPropertyAssertionNode(propertyAssertionNode, context),
|
|
199
|
-
propertyRelation = PropertyRelation.fromPropertyAssertionNode(propertyAssertionNode, context);
|
|
200
|
-
|
|
201
|
-
propertyAssertion = new PropertyAssertion(string, node, tokens, term, propertyRelation);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return propertyAssertion;
|
|
205
|
-
}
|
|
206
187
|
});
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../../elements";
|
|
4
4
|
import Assertion from "../assertion";
|
|
5
5
|
|
|
6
|
-
import { define } from "../../
|
|
6
|
+
import { define } from "../../elements";
|
|
7
7
|
|
|
8
8
|
export default define(class SatisfiesAssertion extends Assertion {
|
|
9
|
-
constructor(string, node,
|
|
10
|
-
super(string, node
|
|
9
|
+
constructor(string, node, signature, reference) {
|
|
10
|
+
super(string, node);
|
|
11
11
|
|
|
12
12
|
this.signature = signature;
|
|
13
13
|
this.reference = reference;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
getTokens() {
|
|
17
|
-
return this.tokens;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
getSignature() {
|
|
21
17
|
return this.signature;
|
|
22
18
|
}
|
|
@@ -97,7 +93,7 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
97
93
|
if (satisfiable) {
|
|
98
94
|
let substitutions;
|
|
99
95
|
|
|
100
|
-
const { Substitutions } =
|
|
96
|
+
const { Substitutions } = elements;
|
|
101
97
|
|
|
102
98
|
substitutions = Substitutions.fromNothing();
|
|
103
99
|
|
|
@@ -134,48 +130,4 @@ export default define(class SatisfiesAssertion extends Assertion {
|
|
|
134
130
|
}
|
|
135
131
|
|
|
136
132
|
static name = "SatisfiesAssertion";
|
|
137
|
-
|
|
138
|
-
static fromStepNode(stepNode, context) {
|
|
139
|
-
let satisfiesAssertion = null;
|
|
140
|
-
|
|
141
|
-
const satisfiesAssertionNode = stepNode.getSatisfiedAssertionNode();
|
|
142
|
-
|
|
143
|
-
if (satisfiesAssertionNode !== null) {
|
|
144
|
-
satisfiesAssertion = satisfiesAssertionFromSatisfiesAssertionNode(satisfiesAssertionNode, context);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
return satisfiesAssertion;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
static fromStatementNode(statementNode, context) {
|
|
151
|
-
let satisfiesAssertion = null;
|
|
152
|
-
|
|
153
|
-
const satisfiesAssertionNode = statementNode.getSatisfiedAssertionNode();
|
|
154
|
-
|
|
155
|
-
if (satisfiesAssertionNode !== null) {
|
|
156
|
-
satisfiesAssertion = satisfiesAssertionFromSatisfiesAssertionNode(satisfiesAssertionNode, context);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return satisfiesAssertion;
|
|
160
|
-
}
|
|
161
133
|
});
|
|
162
|
-
|
|
163
|
-
function signatureFromSatisfiesAssertionNode(satisfiesAssertionNode, context) {
|
|
164
|
-
const { Signature } = ontology,
|
|
165
|
-
signatureNode = satisfiesAssertionNode.getSignatureNode(),
|
|
166
|
-
signature = Signature.fromSignatureNode(signatureNode, context);
|
|
167
|
-
|
|
168
|
-
return signature;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function satisfiesAssertionFromSatisfiesAssertionNode(satisfiesAssertionNode, context) {
|
|
172
|
-
const { Reference, SatisfiesAssertion } = ontology,
|
|
173
|
-
node = satisfiesAssertionNode, ///
|
|
174
|
-
string = context.nodeAsString(node),
|
|
175
|
-
tokens = context.nodeAsTokens(node),
|
|
176
|
-
signature = signatureFromSatisfiesAssertionNode(satisfiesAssertionNode, context),
|
|
177
|
-
reference = Reference.fromSatisfiesAssertionNode(satisfiesAssertionNode, context),
|
|
178
|
-
satisfiesAssertion = new SatisfiesAssertion(string, node, tokens, signature, reference);
|
|
179
|
-
|
|
180
|
-
return satisfiesAssertion;
|
|
181
|
-
}
|
|
@@ -2,17 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
import { arrayUtilities } from "necessary";
|
|
4
4
|
|
|
5
|
-
import ontology from "../../ontology";
|
|
6
5
|
import Assertion from "../assertion";
|
|
7
6
|
|
|
8
|
-
import { define } from "../../
|
|
7
|
+
import { define } from "../../elements";
|
|
9
8
|
import { unifyStatement } from "../../process/unify";
|
|
10
9
|
|
|
11
10
|
const { match } = arrayUtilities;
|
|
12
11
|
|
|
13
12
|
export default define(class SubproofAssertion extends Assertion {
|
|
14
|
-
constructor(string, node,
|
|
15
|
-
super(string, node
|
|
13
|
+
constructor(string, node, statements) {
|
|
14
|
+
super(string, node);
|
|
16
15
|
|
|
17
16
|
this.statements = statements;
|
|
18
17
|
}
|
|
@@ -84,33 +83,5 @@ export default define(class SubproofAssertion extends Assertion {
|
|
|
84
83
|
}
|
|
85
84
|
|
|
86
85
|
static name = "SubproofAssertion";
|
|
87
|
-
|
|
88
|
-
static fromStatementNode(statementNode, context) {
|
|
89
|
-
let subproofAssertion = null;
|
|
90
|
-
|
|
91
|
-
const subproofAssertionNode = statementNode.getSubproofAssertionNode();
|
|
92
|
-
|
|
93
|
-
if (subproofAssertionNode !== null) {
|
|
94
|
-
const node = subproofAssertionNode, ///
|
|
95
|
-
tokens = null,
|
|
96
|
-
string = context.nodeAsString(node),
|
|
97
|
-
statements = statementsFromSubproofAssertionNode(subproofAssertionNode, context);
|
|
98
|
-
|
|
99
|
-
subproofAssertion = new SubproofAssertion(string, node, tokens, statements);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return subproofAssertion;
|
|
103
|
-
}
|
|
104
86
|
});
|
|
105
87
|
|
|
106
|
-
function statementsFromSubproofAssertionNode(subproofAssertionNode, context) {
|
|
107
|
-
const { Statement } = ontology,
|
|
108
|
-
statementNodes = subproofAssertionNode.getStatementNodes(),
|
|
109
|
-
statements = statementNodes.map((statementNode) => {
|
|
110
|
-
const statement = Statement.fromStatementNode(statementNode, context);
|
|
111
|
-
|
|
112
|
-
return statement;
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
return statements;
|
|
116
|
-
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../../elements";
|
|
4
4
|
import Assertion from "../assertion";
|
|
5
|
-
import VariableAssignment from "../../assignment/variable";
|
|
6
5
|
|
|
7
|
-
import { define } from "../../
|
|
6
|
+
import { define } from "../../elements";
|
|
7
|
+
import { variableAssignmentFromVariable } from "../../process/assign";
|
|
8
8
|
|
|
9
9
|
export default define(class TypeAssertion extends Assertion {
|
|
10
|
-
constructor(string, node,
|
|
11
|
-
super(string, node
|
|
10
|
+
constructor(string, node, term, type) {
|
|
11
|
+
super(string, node);
|
|
12
12
|
|
|
13
13
|
this.term = term;
|
|
14
14
|
this.type = type;
|
|
@@ -151,7 +151,7 @@ export default define(class TypeAssertion extends Assertion {
|
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
const { Type, Variable } =
|
|
154
|
+
const { Type, Variable } = elements,
|
|
155
155
|
termNode = this.term.getNode();
|
|
156
156
|
|
|
157
157
|
let type,
|
|
@@ -172,7 +172,7 @@ export default define(class TypeAssertion extends Assertion {
|
|
|
172
172
|
if (singularVariableNode !== null) {
|
|
173
173
|
const variableNode = singularVariableNode, ///
|
|
174
174
|
variable = Variable.fromVariableNodeAndType(variableNode, type, context),
|
|
175
|
-
variableAssignment =
|
|
175
|
+
variableAssignment = variableAssignmentFromVariable(variable),
|
|
176
176
|
assignment = variableAssignment; ///
|
|
177
177
|
|
|
178
178
|
assignments.push(assignment);
|
|
@@ -180,23 +180,4 @@ export default define(class TypeAssertion extends Assertion {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
static name = "TypeAssertion";
|
|
183
|
-
|
|
184
|
-
static fromStatementNode(statementNode, context) {
|
|
185
|
-
let typeAssertion = null;
|
|
186
|
-
|
|
187
|
-
const typeAssertionNode = statementNode.getTypeAssertionNode();
|
|
188
|
-
|
|
189
|
-
if (typeAssertionNode !== null) {
|
|
190
|
-
const { Term, Type } = ontology,
|
|
191
|
-
node = typeAssertionNode, ///
|
|
192
|
-
tokens = null,
|
|
193
|
-
string = context.nodeAsString(node),
|
|
194
|
-
term = Term.fromTypeAssertionNode(typeAssertionNode, context),
|
|
195
|
-
type = Type.fromTypeAssertionNode(typeAssertionNode, context);
|
|
196
|
-
|
|
197
|
-
typeAssertion = new TypeAssertion(string, node, tokens, term, type);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
return typeAssertion;
|
|
201
|
-
}
|
|
202
183
|
});
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export default class Assertion {
|
|
4
|
-
constructor(string, node
|
|
4
|
+
constructor(context, string, node) {
|
|
5
|
+
this.context = context;
|
|
5
6
|
this.string = string;
|
|
6
7
|
this.node = node;
|
|
7
|
-
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
getContext() {
|
|
11
|
+
return this.context;
|
|
8
12
|
}
|
|
9
13
|
|
|
10
14
|
getString() {
|
|
@@ -15,9 +19,5 @@ export default class Assertion {
|
|
|
15
19
|
return this.node;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
getTokens() {
|
|
19
|
-
return this.tokens;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
22
|
matchAssertionNode(assertionNode) { return this.node.match(assertionNode); }
|
|
23
23
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import elements from "../elements";
|
|
4
4
|
|
|
5
|
-
import { define } from "../
|
|
5
|
+
import { define } from "../elements";
|
|
6
6
|
import { unifyStatementIntrinsically } from "../process/unify";
|
|
7
7
|
import { referenceFromJSON, referenceToReferenceJSON } from "../utilities/json";
|
|
8
8
|
|
|
@@ -291,7 +291,7 @@ export default define(class Assumption {
|
|
|
291
291
|
|
|
292
292
|
context = metaLemmaMetatheorem.getContext(); ///
|
|
293
293
|
|
|
294
|
-
const { Substitutions } =
|
|
294
|
+
const { Substitutions } = elements,
|
|
295
295
|
specificContext = context, ///
|
|
296
296
|
labelSubstitutions = Substitutions.fromNothing(),
|
|
297
297
|
label = metaLemmaMetatheorem.getLabel(),
|
|
@@ -353,28 +353,4 @@ export default define(class Assumption {
|
|
|
353
353
|
|
|
354
354
|
return assumption;
|
|
355
355
|
}
|
|
356
|
-
|
|
357
|
-
static fromJudgementNode(judgementNode, context) {
|
|
358
|
-
const assumptionNode = judgementNode.getAssumptionNode(),
|
|
359
|
-
assumption = assumptionFromAssumptionNode(assumptionNode, context);
|
|
360
|
-
|
|
361
|
-
return assumption;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
static fromAssumptionNode(assumptionNode, context) {
|
|
365
|
-
const assumption = assumptionFromAssumptionNode(assumptionNode, context);
|
|
366
|
-
|
|
367
|
-
return assumption;
|
|
368
|
-
}
|
|
369
356
|
});
|
|
370
|
-
|
|
371
|
-
function assumptionFromAssumptionNode(assumptionNode, context) {
|
|
372
|
-
const { Reference, Assumption, Statement } = ontology,
|
|
373
|
-
node = assumptionNode, ///
|
|
374
|
-
string = context.nodeAsString(node),
|
|
375
|
-
statement = Statement.fromAssumptionNode(assumptionNode, context),
|
|
376
|
-
reference = Reference.fromAssumptionNode(assumptionNode, context),
|
|
377
|
-
assumption = new Assumption(string, node, statement, reference);
|
|
378
|
-
|
|
379
|
-
return assumption;
|
|
380
|
-
}
|
|
@@ -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 Axiom extends
|
|
7
|
+
export default define(class Axiom extends AxiomLemmaTheoremConjecture {
|
|
8
8
|
isSatisfiable() {
|
|
9
9
|
const signature = this.getSignature(),
|
|
10
10
|
satisfiable = (signature !== null);
|
|
@@ -266,12 +266,5 @@ export default define(class Axiom extends TopLevelAssertion {
|
|
|
266
266
|
|
|
267
267
|
static name = "Axiom";
|
|
268
268
|
|
|
269
|
-
static fromJSON(json, context) { return
|
|
270
|
-
|
|
271
|
-
static fromAxiomNode(axiomNode, context) {
|
|
272
|
-
const node = axiomNode, ///
|
|
273
|
-
axiom = TopLevelAssertion.fromNode(Axiom, node, context);
|
|
274
|
-
|
|
275
|
-
return axiom;
|
|
276
|
-
}
|
|
269
|
+
static fromJSON(json, context) { return AxiomLemmaTheoremConjecture.fromJSON(Axiom, json, context); }
|
|
277
270
|
});
|