occam-verify-cli 0.0.1003 → 0.0.1005
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/README.md +0 -2
- package/bin/abbreviations.js +1 -3
- package/bin/action/help.js +0 -2
- package/bin/action/verify.js +4 -24
- package/bin/defaults.js +0 -2
- package/bin/main.js +3 -4
- package/bin/options.js +0 -2
- package/lib/assertion/subproof.js +106 -0
- package/lib/assignment/metavariable.js +2 -2
- package/lib/combinator.js +50 -16
- package/lib/conclusion.js +73 -14
- package/lib/context/file.js +191 -31
- package/lib/context/local.js +37 -49
- package/lib/context/release.js +42 -35
- package/lib/context/release.other.js +605 -0
- package/lib/declaration/combinator.js +83 -0
- package/lib/derivation.js +86 -0
- package/lib/equality.js +3 -11
- package/lib/index.js +1 -1
- package/lib/judgement.js +3 -10
- package/lib/label.js +58 -16
- package/lib/log.js +3 -11
- package/lib/metaType.js +31 -19
- package/lib/metavariable.js +39 -12
- package/lib/mixins/statement/qualified/unify.js +118 -0
- package/lib/mixins/statement/unify.js +57 -0
- package/lib/mixins/statement/verify.js +184 -0
- package/lib/node/statement/combinator/bracketed.js +15 -11
- package/lib/ocmbinator/bracketed.js +52 -8
- package/lib/premise.js +109 -56
- package/lib/proof.js +91 -0
- package/lib/proofStep.js +78 -25
- package/lib/reference.js +62 -16
- package/lib/rule.js +146 -26
- package/lib/ruleNames.js +5 -5
- package/lib/statement/qualified.js +127 -0
- package/lib/statement/unqualified.js +89 -0
- package/lib/statement.js +176 -0
- package/lib/subDerivation.js +86 -0
- package/lib/subproof.js +155 -0
- package/lib/substitution/frameForMetavariable.js +14 -15
- package/lib/substitution/statementForMetavariable.js +23 -24
- package/lib/substitution/termForVariable.js +11 -12
- package/lib/substitution.js +9 -2
- package/lib/substitutions.js +14 -14
- package/lib/supposition.js +92 -60
- package/lib/unifier/statementWithCombinator.js +3 -3
- package/lib/unify/metavariableWithFrame.js +2 -2
- package/lib/unify/metavariableWithStatement.js +2 -2
- package/lib/unify/metavariableWithStatementGivenSubstitution.js +2 -2
- package/lib/unify/variableWithTerm.js +2 -2
- package/lib/utilities/node.js +13 -11
- package/lib/utilities/releaseContext.js +3 -3
- package/lib/utilities/string.js +8 -2
- package/lib/utilities/subproof.js +5 -5
- package/lib/utilities/tokens.js +10 -10
- package/lib/variable.js +1 -10
- package/lib/verifier/metaLevel.js +2 -2
- package/lib/verifier/topLevel.js +5 -5
- package/lib/verify/axiom.js +3 -5
- package/lib/verify/conjecture.js +4 -7
- package/lib/verify/consequent.js +2 -3
- package/lib/verify/declaration/combinator.js +2 -14
- package/lib/verify/declaration/metavariable.js +9 -10
- package/lib/verify/files.js +4 -4
- package/lib/verify/frame.js +12 -12
- package/lib/verify/lemma.js +4 -7
- package/lib/verify/metaLemma.js +4 -7
- package/lib/verify/metatheorem.js +4 -7
- package/lib/verify/proofStep.js +2 -31
- package/lib/verify/theorem.js +4 -7
- package/package.json +1 -1
- package/src/assertion/subproof.js +84 -0
- package/src/assignment/metavariable.js +2 -2
- package/src/combinator.js +45 -15
- package/src/conclusion.js +83 -13
- package/src/context/file.js +223 -11
- package/src/context/local.js +12 -16
- package/src/context/release.js +57 -39
- package/src/context/release.other.js +547 -0
- package/src/declaration/combinator.js +44 -0
- package/src/derivation.js +50 -0
- package/src/equality.js +2 -9
- package/src/index.js +0 -1
- package/src/judgement.js +2 -8
- package/src/label.js +56 -13
- package/src/log.js +2 -9
- package/src/metaType.js +26 -14
- package/src/metavariable.js +57 -9
- package/src/mixins/statement/qualified/unify.js +186 -0
- package/src/mixins/statement/unify.js +70 -0
- package/src/mixins/statement/verify.js +274 -0
- package/src/node/statement/combinator/bracketed.js +4 -3
- package/src/ocmbinator/bracketed.js +15 -12
- package/src/premise.js +136 -44
- package/src/proof.js +58 -0
- package/src/proofStep.js +92 -22
- package/src/reference.js +58 -12
- package/src/rule.js +199 -30
- package/src/ruleNames.js +1 -1
- package/src/statement/qualified.js +104 -0
- package/src/statement/unqualified.js +60 -0
- package/src/statement.js +179 -0
- package/src/subDerivation.js +52 -0
- package/src/subproof.js +99 -0
- package/src/substitution/frameForMetavariable.js +20 -17
- package/src/substitution/statementForMetavariable.js +31 -29
- package/src/substitution/termForVariable.js +15 -14
- package/src/substitution.js +8 -0
- package/src/substitutions.js +12 -13
- package/src/supposition.js +94 -44
- package/src/unifier/statementWithCombinator.js +6 -3
- package/src/unify/metavariableWithFrame.js +1 -1
- package/src/unify/metavariableWithStatement.js +1 -1
- package/src/unify/metavariableWithStatementGivenSubstitution.js +1 -1
- package/src/unify/variableWithTerm.js +1 -1
- package/src/utilities/node.js +18 -12
- package/src/utilities/releaseContext.js +2 -2
- package/src/utilities/string.js +6 -2
- package/src/utilities/subproof.js +2 -2
- package/src/utilities/tokens.js +7 -7
- package/src/variable.js +0 -10
- package/src/verifier/metaLevel.js +3 -2
- package/src/verifier/topLevel.js +6 -4
- package/src/verify/axiom.js +1 -2
- package/src/verify/conjecture.js +2 -3
- package/src/verify/consequent.js +1 -1
- package/src/verify/declaration/combinator.js +0 -20
- package/src/verify/declaration/metavariable.js +8 -12
- package/src/verify/files.js +3 -3
- package/src/verify/frame.js +11 -11
- package/src/verify/lemma.js +2 -3
- package/src/verify/metaLemma.js +2 -3
- package/src/verify/metatheorem.js +2 -3
- package/src/verify/proofStep.js +0 -41
- package/src/verify/theorem.js +2 -3
- package/lib/tokens/combinatorStatement/bracketed.js +0 -17
- package/lib/unify/premiseWithProofStep.js +0 -41
- package/lib/unify/premisesWithProofSteps.js +0 -31
- package/lib/unify/qualifiedStatement.js +0 -136
- package/lib/unify/statementWithBracketedCombinator.js +0 -30
- package/lib/unify/statementWithCombinator.js +0 -29
- package/lib/unify/statementWithCombinators.js +0 -31
- package/lib/unify/statementWithMetaType.js +0 -24
- package/lib/verify/conclusion.js +0 -39
- package/lib/verify/derivation.js +0 -31
- package/lib/verify/label.js +0 -37
- package/lib/verify/labels.js +0 -28
- package/lib/verify/premise.js +0 -45
- package/lib/verify/premises.js +0 -28
- package/lib/verify/proof.js +0 -34
- package/lib/verify/rule.js +0 -56
- package/lib/verify/statement/qualified.js +0 -41
- package/lib/verify/statement/unqualified.js +0 -45
- package/lib/verify/statement.js +0 -219
- package/lib/verify/statementAsCombinator.js +0 -33
- package/lib/verify/statementGivenMetaType.js +0 -52
- package/lib/verify/subproof.js +0 -34
- package/lib/verify/supposition.js +0 -45
- package/lib/verify/suppositions.js +0 -28
- package/src/tokens/combinatorStatement/bracketed.js +0 -10
- package/src/unify/premiseWithProofStep.js +0 -54
- package/src/unify/premisesWithProofSteps.js +0 -23
- package/src/unify/qualifiedStatement.js +0 -208
- package/src/unify/statementWithBracketedCombinator.js +0 -22
- package/src/unify/statementWithCombinator.js +0 -22
- package/src/unify/statementWithCombinators.js +0 -23
- package/src/unify/statementWithMetaType.js +0 -14
- package/src/verify/conclusion.js +0 -40
- package/src/verify/derivation.js +0 -23
- package/src/verify/label.js +0 -34
- package/src/verify/labels.js +0 -17
- package/src/verify/premise.js +0 -49
- package/src/verify/premises.js +0 -17
- package/src/verify/proof.js +0 -31
- package/src/verify/rule.js +0 -71
- package/src/verify/statement/qualified.js +0 -40
- package/src/verify/statement/unqualified.js +0 -49
- package/src/verify/statement.js +0 -312
- package/src/verify/statementAsCombinator.js +0 -27
- package/src/verify/statementGivenMetaType.js +0 -52
- package/src/verify/subproof.js +0 -32
- package/src/verify/supposition.js +0 -49
- package/src/verify/suppositions.js +0 -17
package/src/context/local.js
CHANGED
|
@@ -88,8 +88,6 @@ class LocalContext {
|
|
|
88
88
|
return lastProofStep;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
getTokens() { return this.context.getTokens(); }
|
|
92
|
-
|
|
93
91
|
getAxioms() { return this.context.getAxioms(); }
|
|
94
92
|
|
|
95
93
|
getLemmas() { return this.context.getLemmas(); }
|
|
@@ -377,29 +375,29 @@ class LocalContext {
|
|
|
377
375
|
return metavariable;
|
|
378
376
|
}
|
|
379
377
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
findTypeByTypeNode(typeNode) { return this.context.findTypeByTypeNode(typeNode); }
|
|
378
|
+
findMetaTypeByMetaTypeNode(metaTypeNode) { return this.context.findMetaTypeByMetaTypeNode(metaTypeNode); }
|
|
383
379
|
|
|
384
380
|
findLabelByMetavariableNode(metavariableNode) { return this.context.findLabelByMetavariableNode(metavariableNode); }
|
|
385
381
|
|
|
386
|
-
|
|
382
|
+
findMetavariableByMetavariableName(metavariableName) { return this.context.findMetavariableByMetavariableName(metavariableName); }
|
|
383
|
+
|
|
384
|
+
findTypeByTypeName(typeName) { return this.context.findTypeByTypeName(typeName); }
|
|
387
385
|
|
|
388
|
-
|
|
386
|
+
findTypeByTypeNode(typeNode) { return this.context.findTypeByTypeNode(typeNode); }
|
|
389
387
|
|
|
390
|
-
|
|
388
|
+
findRuleByReference(reference) { return this.context.findRuleByReference(reference); }
|
|
391
389
|
|
|
392
|
-
|
|
390
|
+
findAxiomByReference(reference) { return this.context.findAxiomByReference(reference); }
|
|
393
391
|
|
|
394
|
-
|
|
392
|
+
findLemmaByReference(reference) { return this.context.findLemmaByReference(reference); }
|
|
395
393
|
|
|
396
|
-
|
|
394
|
+
findTheoremByReference(reference) { return this.context.findTheoremByReference(reference); }
|
|
397
395
|
|
|
398
|
-
|
|
396
|
+
findMetaLemmaByReference(reference) { return this.context.findMetaLemmaByReference(reference); }
|
|
399
397
|
|
|
400
|
-
|
|
398
|
+
findConjectureByReference(reference) { return this.context.findConjectureByReference(reference); }
|
|
401
399
|
|
|
402
|
-
|
|
400
|
+
findMetatheoremByReference(reference) { return this.context.findMetatheoremByReference(reference); }
|
|
403
401
|
|
|
404
402
|
nodeAsString(node) { return this.context.nodeAsString(node); }
|
|
405
403
|
|
|
@@ -415,8 +413,6 @@ class LocalContext {
|
|
|
415
413
|
|
|
416
414
|
error(message, node) { this.context.error(message, node); }
|
|
417
415
|
|
|
418
|
-
fatal(message, node) { this.context.fatal(node, message); }
|
|
419
|
-
|
|
420
416
|
static fromFileContext(fileContext) {
|
|
421
417
|
const context = fileContext, ///
|
|
422
418
|
variables = [],
|
package/src/context/release.js
CHANGED
|
@@ -10,8 +10,8 @@ import { tail, push, leftDifference } from "../utilities/array";
|
|
|
10
10
|
import { customGrammarFromNameAndEntries, combinedCustomGrammarFromReleaseContexts } from "../utilities/customGrammar";
|
|
11
11
|
|
|
12
12
|
const { isFilePathFlorenceFilePath } = filePathUtilities,
|
|
13
|
-
{
|
|
14
|
-
{
|
|
13
|
+
{ nominalLexerFromCombinedCustomGrammar } = lexersUtilities,
|
|
14
|
+
{ nominalParserFromCombinedCustomGrammar } = parsersUtilities;
|
|
15
15
|
|
|
16
16
|
export default class ReleaseContext {
|
|
17
17
|
constructor(log, name, entries, released, lexer, parser, verified, initialised, fileContexts, customGrammar, loggingDisabled, dependencyReleaseContexts) {
|
|
@@ -456,61 +456,44 @@ export default class ReleaseContext {
|
|
|
456
456
|
this.log.error(message, node, tokens, filePath);
|
|
457
457
|
}
|
|
458
458
|
|
|
459
|
-
|
|
460
|
-
if (this.loggingDisabled) {
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
this.log.fatal(message, node, tokens, filePath);
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
initialise(releaseContexts, verbose) {
|
|
468
|
-
let initialised;
|
|
469
|
-
|
|
459
|
+
initialise(releaseContexts) {
|
|
470
460
|
const combinedCustomGrammar = combinedCustomGrammarFromReleaseContexts(releaseContexts),
|
|
471
|
-
|
|
472
|
-
|
|
461
|
+
nominalParser = nominalParserFromCombinedCustomGrammar(combinedCustomGrammar),
|
|
462
|
+
nominalLexer = nominalLexerFromCombinedCustomGrammar(combinedCustomGrammar);
|
|
473
463
|
|
|
474
|
-
this.lexer =
|
|
464
|
+
this.lexer = nominalLexer; ///
|
|
475
465
|
|
|
476
|
-
this.parser =
|
|
466
|
+
this.parser = nominalParser; ///
|
|
477
467
|
|
|
478
468
|
this.dependencyReleaseContexts = tail(releaseContexts);
|
|
479
469
|
|
|
480
470
|
if (this.released) {
|
|
481
|
-
const
|
|
471
|
+
const releaseContext = this, ///
|
|
472
|
+
fileContexts = fileContextsFromEntries(this.entries, releaseContext);
|
|
482
473
|
|
|
483
|
-
|
|
484
|
-
} else {
|
|
485
|
-
initialised = true;
|
|
486
|
-
}
|
|
474
|
+
initialiseFileContexts(fileContexts, releaseContext);
|
|
487
475
|
|
|
488
|
-
|
|
476
|
+
this.fileContexts = fileContexts;
|
|
477
|
+
}
|
|
489
478
|
|
|
490
|
-
|
|
479
|
+
this.initialised = true;
|
|
491
480
|
}
|
|
492
481
|
|
|
493
|
-
verify(
|
|
494
|
-
let verified;
|
|
482
|
+
verify() {
|
|
483
|
+
let verified = false;
|
|
495
484
|
|
|
496
|
-
const releaseContext = this
|
|
485
|
+
const releaseContext = this, ///
|
|
486
|
+
fileContexts = fileContextsFromEntries(this.entries, releaseContext),
|
|
487
|
+
fileContextsVerified = verifyFileContexts(fileContexts, releaseContext);
|
|
497
488
|
|
|
498
|
-
if (
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
this.fileContexts = fileContextsFromEntries(this.entries, releaseContext);
|
|
503
|
-
|
|
504
|
-
const fileContextsVerified = verifyFileContexts(this.fileContexts, releaseContext);
|
|
489
|
+
if (fileContextsVerified) {
|
|
490
|
+
this.fileContexts = fileContexts;
|
|
505
491
|
|
|
506
|
-
|
|
492
|
+
this.verified = true;
|
|
507
493
|
|
|
508
|
-
|
|
509
|
-
releaseContext.enableLogging();
|
|
494
|
+
verified = true;
|
|
510
495
|
}
|
|
511
496
|
|
|
512
|
-
this.verified = verified;
|
|
513
|
-
|
|
514
497
|
return verified;
|
|
515
498
|
}
|
|
516
499
|
|
|
@@ -583,6 +566,41 @@ function verifyFileContexts(fileContexts, releaseContext) {
|
|
|
583
566
|
return fileContextsVerified;
|
|
584
567
|
}
|
|
585
568
|
|
|
569
|
+
function initialiseFileContexts(fileContexts, releaseContext) {
|
|
570
|
+
fileContexts = [ ///
|
|
571
|
+
...fileContexts
|
|
572
|
+
];
|
|
573
|
+
|
|
574
|
+
for (;;) {
|
|
575
|
+
const fileContextsLength = fileContexts.length;
|
|
576
|
+
|
|
577
|
+
if (fileContextsLength === 0) {
|
|
578
|
+
break;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
const initialisedFileContexts = [];
|
|
582
|
+
|
|
583
|
+
fileContexts.forEach((fileContext) => {
|
|
584
|
+
const initialised = fileContext.initialise(releaseContext);
|
|
585
|
+
|
|
586
|
+
if (initialised) {
|
|
587
|
+
const initialisedFileContext = fileContext; ///
|
|
588
|
+
|
|
589
|
+
initialisedFileContexts.push(initialisedFileContext);
|
|
590
|
+
}
|
|
591
|
+
});
|
|
592
|
+
|
|
593
|
+
const initialisedFileContextsLength = initialisedFileContexts.length,
|
|
594
|
+
fileInitialised = (initialisedFileContextsLength > 0);
|
|
595
|
+
|
|
596
|
+
if (!fileInitialised) {
|
|
597
|
+
break;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
leftDifference(fileContexts, initialisedFileContexts);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
586
604
|
function fileContextsFromEntries(entries, releaseContext) {
|
|
587
605
|
const fileContexts = [];
|
|
588
606
|
|