occam-verify-cli 1.0.650 → 1.0.655
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 +1 -2
- package/lib/context/ephemeral.js +42 -1
- package/lib/context/file/nominal.js +26 -33
- package/lib/element/assertion/contained.js +24 -1
- package/lib/element/assertion/defined.js +24 -1
- package/lib/element/assertion/property.js +24 -1
- package/lib/element/assertion/satisfies.js +24 -1
- package/lib/element/assertion/subproof.js +37 -1
- package/lib/element/assertion/type.js +27 -1
- package/lib/element/assumption.js +2 -7
- package/lib/element/combinator.js +16 -3
- package/lib/element/conclusion.js +18 -3
- package/lib/element/constructor.js +8 -2
- package/lib/element/declaration/complexType.js +52 -52
- package/lib/element/declaration/constructor.js +38 -38
- package/lib/element/declaration/metavariable.js +35 -35
- package/lib/element/declaration/simpleType.js +42 -42
- package/lib/element/declaration/typePrefix.js +32 -32
- package/lib/element/declaration/variable.js +39 -39
- package/lib/element/deduction.js +2 -4
- package/lib/element/equivalences.js +3 -3
- package/lib/element/frame.js +2 -9
- package/lib/element/hypothesis.js +18 -24
- package/lib/element/label.js +14 -3
- package/lib/element/metavariable.js +10 -3
- package/lib/element/parameter.js +2 -3
- package/lib/element/procedureCall.js +2 -3
- package/lib/element/procedureReference.js +2 -3
- package/lib/element/proofAssertion/premise.js +54 -49
- package/lib/element/proofAssertion/step.js +86 -86
- package/lib/element/proofAssertion/supposition.js +39 -49
- package/lib/element/property.js +2 -3
- package/lib/element/reference.js +2 -3
- package/lib/element/rule.js +2 -4
- package/lib/element/section.js +14 -14
- package/lib/element/signature.js +2 -3
- package/lib/element/statement.js +8 -2
- package/lib/element/subproof.js +8 -8
- package/lib/element/substitution/statement.js +2 -2
- package/lib/element/term.js +15 -29
- package/lib/element/topLevelAssertion/axiom.js +63 -63
- package/lib/element/topLevelMetaAssertion.js +15 -15
- package/lib/element/type.js +2 -3
- package/lib/element/typePrefix.js +2 -3
- package/lib/element/variable.js +2 -2
- package/lib/process/instantiate.js +38 -2
- package/lib/utilities/equivalence.js +27 -0
- package/lib/utilities/json.js +197 -30
- package/package.json +4 -4
- package/src/action/verify.js +0 -2
- package/src/context/ephemeral.js +84 -0
- package/src/context/file/nominal.js +30 -44
- package/src/element/assertion/contained.js +25 -0
- package/src/element/assertion/defined.js +25 -0
- package/src/element/assertion/property.js +25 -0
- package/src/element/assertion/satisfies.js +25 -0
- package/src/element/assertion/subproof.js +46 -0
- package/src/element/assertion/type.js +32 -0
- package/src/element/assumption.js +1 -12
- package/src/element/combinator.js +33 -3
- package/src/element/conclusion.js +33 -3
- package/src/element/constructor.js +17 -4
- package/src/element/declaration/complexType.js +49 -49
- package/src/element/declaration/constructor.js +32 -32
- package/src/element/declaration/metavariable.js +26 -26
- package/src/element/declaration/simpleType.js +34 -34
- package/src/element/declaration/typePrefix.js +35 -35
- package/src/element/declaration/variable.js +30 -30
- package/src/element/deduction.js +1 -6
- package/src/element/equivalences.js +1 -1
- package/src/element/frame.js +1 -15
- package/src/element/hypothesis.js +23 -34
- package/src/element/label.js +22 -5
- package/src/element/metavariable.js +20 -2
- package/src/element/parameter.js +1 -6
- package/src/element/procedureCall.js +1 -7
- package/src/element/procedureReference.js +1 -6
- package/src/element/proofAssertion/premise.js +54 -39
- package/src/element/proofAssertion/step.js +62 -62
- package/src/element/proofAssertion/supposition.js +27 -44
- package/src/element/property.js +1 -6
- package/src/element/reference.js +1 -6
- package/src/element/rule.js +3 -11
- package/src/element/section.js +12 -12
- package/src/element/signature.js +1 -7
- package/src/element/statement.js +13 -1
- package/src/element/subproof.js +6 -6
- package/src/element/substitution/statement.js +1 -1
- package/src/element/term.js +16 -24
- package/src/element/topLevelAssertion/axiom.js +45 -45
- package/src/element/topLevelMetaAssertion.js +19 -19
- package/src/element/type.js +1 -10
- package/src/element/typePrefix.js +1 -6
- package/src/element/variable.js +1 -1
- package/src/process/instantiate.js +26 -2
- package/src/utilities/equivalence.js +26 -0
- package/src/utilities/json.js +233 -37
package/src/utilities/json.js
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import elements from "../elements";
|
|
4
|
+
import EphemeralContext from "../context/ephemeral";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
export function lemmasFromNothing() {
|
|
7
|
+
const lemmas = [];
|
|
8
|
+
|
|
9
|
+
return lemmas;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function metaLemmasFromNothing() {
|
|
13
|
+
const metaLemmas = [];
|
|
14
|
+
|
|
15
|
+
return metaLemmas;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function nameFromJSON(json, context) {
|
|
19
|
+
let { name } = json;
|
|
20
|
+
|
|
21
|
+
const nameJSON = name; ///
|
|
22
|
+
|
|
23
|
+
name = nameJSON; ///
|
|
24
|
+
|
|
25
|
+
return name;
|
|
26
|
+
}
|
|
6
27
|
|
|
7
28
|
export function termFromJSON(json, context) {
|
|
8
29
|
let { term } = json;
|
|
@@ -314,6 +335,22 @@ export function variablesFromJSON(json, context) {
|
|
|
314
335
|
return variables;
|
|
315
336
|
}
|
|
316
337
|
|
|
338
|
+
export function equalitiesFromJSON(json, context) {
|
|
339
|
+
let { equalities } = json;
|
|
340
|
+
|
|
341
|
+
const { Equality } = elements,
|
|
342
|
+
equalitiesJSON = equalities; ///
|
|
343
|
+
|
|
344
|
+
equalities = equalitiesJSON.map((equalityJSON) => {
|
|
345
|
+
const json = equalityJSON, ///
|
|
346
|
+
equality = Equality.fromJSON(json, context);
|
|
347
|
+
|
|
348
|
+
return equality;
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
return equalities;
|
|
352
|
+
}
|
|
353
|
+
|
|
317
354
|
export function propertiesFromJSON(json, context) {
|
|
318
355
|
let { properties } = json;
|
|
319
356
|
|
|
@@ -379,6 +416,75 @@ export function parametersFromJSON(json, context) {
|
|
|
379
416
|
return parameters;
|
|
380
417
|
}
|
|
381
418
|
|
|
419
|
+
export function judgementsFromJSON(json, context) {
|
|
420
|
+
let { judgements } = json;
|
|
421
|
+
|
|
422
|
+
const { Judgement } = elements,
|
|
423
|
+
judgementsJSON = judgements; ///
|
|
424
|
+
|
|
425
|
+
judgements = judgementsJSON.map((judgementJSON) => {
|
|
426
|
+
const json = judgementJSON, ///
|
|
427
|
+
judgement = Judgement.fromJSON(json, context);
|
|
428
|
+
|
|
429
|
+
return judgement;
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
return judgements;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
export function statementsFromJSON(json, context) {
|
|
436
|
+
let { statements } = json;
|
|
437
|
+
|
|
438
|
+
const { Statement } = elements,
|
|
439
|
+
statementsJSON = statements; ///
|
|
440
|
+
|
|
441
|
+
statements = statementsJSON.map((statementJSON) => {
|
|
442
|
+
const json = statementJSON, ///
|
|
443
|
+
statement = Statement.fromJSON(json, context);
|
|
444
|
+
|
|
445
|
+
return statement;
|
|
446
|
+
});
|
|
447
|
+
|
|
448
|
+
return statements;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
export function assertionsFromJSON(json, context) {
|
|
452
|
+
let { assertions } = json;
|
|
453
|
+
|
|
454
|
+
const { TypeAssertion, DefinedAssertion, PropertyAssertion, SubproofAssertion, SatisfiesAssertion, ContainedAssertion } = elements,
|
|
455
|
+
assertionsJSON = assertions; ///
|
|
456
|
+
|
|
457
|
+
assertions = assertionsJSON.map((assertionJSON) => {
|
|
458
|
+
const json = assertionJSON, ///
|
|
459
|
+
assertion = TypeAssertion.fromJSON(json, context) ||
|
|
460
|
+
DefinedAssertion.fromJSON(json, context) ||
|
|
461
|
+
PropertyAssertion.fromJSON(json, context) ||
|
|
462
|
+
SubproofAssertion.fromJSON(json, context) ||
|
|
463
|
+
SatisfiesAssertion.fromJSON(json, context) ||
|
|
464
|
+
ContainedAssertion.fromJSON(json, context);
|
|
465
|
+
|
|
466
|
+
return assertion;
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
return assertions;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
export function referencesFromJSON(json, context) {
|
|
473
|
+
let { references } = json;
|
|
474
|
+
|
|
475
|
+
const { Reference } = elements,
|
|
476
|
+
referencesJSON = references; ///
|
|
477
|
+
|
|
478
|
+
references = referencesJSON.map((referenceJSON) => {
|
|
479
|
+
const json = referenceJSON, ///
|
|
480
|
+
reference = Reference.fromJSON(json, context);
|
|
481
|
+
|
|
482
|
+
return reference;
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
return references;
|
|
486
|
+
}
|
|
487
|
+
|
|
382
488
|
export function conjecturesFromJSON(json, context) {
|
|
383
489
|
let { conjectures } = json;
|
|
384
490
|
|
|
@@ -411,6 +517,22 @@ export function combinatorsFromJSON(json, context) {
|
|
|
411
517
|
return combinators;
|
|
412
518
|
}
|
|
413
519
|
|
|
520
|
+
export function assumptionsFromJSON(json, context) {
|
|
521
|
+
let { assumptions } = json;
|
|
522
|
+
|
|
523
|
+
const { Assumption } = elements,
|
|
524
|
+
assumptionsJSON = assumptions; ///
|
|
525
|
+
|
|
526
|
+
assumptions = assumptionsJSON.map((assumptionJSON) => {
|
|
527
|
+
const json = assumptionJSON, ///
|
|
528
|
+
assumption = Assumption.fromJSON(json, context);
|
|
529
|
+
|
|
530
|
+
return assumption;
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
return assumptions;
|
|
534
|
+
}
|
|
535
|
+
|
|
414
536
|
export function typePrefixesFromJSON(json, context) {
|
|
415
537
|
let { typePrefixes } = json;
|
|
416
538
|
|
|
@@ -508,16 +630,24 @@ export function metavariablesFromJSON(json, context) {
|
|
|
508
630
|
return metavariables;
|
|
509
631
|
}
|
|
510
632
|
|
|
511
|
-
export function
|
|
512
|
-
const
|
|
633
|
+
export function ephemeralContextFromJSON(json, context) {
|
|
634
|
+
const releaseContext = context;
|
|
513
635
|
|
|
514
|
-
|
|
636
|
+
({context} = json);
|
|
637
|
+
|
|
638
|
+
json = context; ///
|
|
639
|
+
|
|
640
|
+
context = releaseContext; ///
|
|
641
|
+
|
|
642
|
+
const emphemeralContext = EphemeralContext.fromJSON(json, context);
|
|
643
|
+
|
|
644
|
+
return emphemeralContext;
|
|
515
645
|
}
|
|
516
646
|
|
|
517
|
-
export function
|
|
518
|
-
const
|
|
647
|
+
export function nameToNameJSON(name) {
|
|
648
|
+
const nameJSON = name; ///
|
|
519
649
|
|
|
520
|
-
return
|
|
650
|
+
return nameJSON;
|
|
521
651
|
}
|
|
522
652
|
|
|
523
653
|
export function termToTermJSON(term) {
|
|
@@ -602,6 +732,16 @@ export function procedureReferenceToProcedureReferenceJSON(procedureReference) {
|
|
|
602
732
|
return procedureReferenceJSON;
|
|
603
733
|
}
|
|
604
734
|
|
|
735
|
+
export function termsToTermsJSON(terms) {
|
|
736
|
+
const termsJSON = terms.map((term) => {
|
|
737
|
+
const termJSON = term.toJSON();
|
|
738
|
+
|
|
739
|
+
return termJSON;
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
return termsJSON;
|
|
743
|
+
}
|
|
744
|
+
|
|
605
745
|
export function typesToTypesJSON(types) {
|
|
606
746
|
const typesJSON = types.map((type) => {
|
|
607
747
|
const typeJSON = type.toJSON();
|
|
@@ -614,18 +754,6 @@ export function typesToTypesJSON(types) {
|
|
|
614
754
|
return typesJSON;
|
|
615
755
|
}
|
|
616
756
|
|
|
617
|
-
export function termsToTermsJSON(terms) {
|
|
618
|
-
const termsJSON = terms.map((term) => {
|
|
619
|
-
const termJSON = term.toJSON();
|
|
620
|
-
|
|
621
|
-
term = termJSON; ///
|
|
622
|
-
|
|
623
|
-
return term;
|
|
624
|
-
});
|
|
625
|
-
|
|
626
|
-
return termsJSON;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
757
|
export function rulesToRulesJSON(rules) {
|
|
630
758
|
const rulesJSON = rules.map((rule) => {
|
|
631
759
|
const ruleJSON = rule.toJSON();
|
|
@@ -638,18 +766,6 @@ export function rulesToRulesJSON(rules) {
|
|
|
638
766
|
return rulesJSON;
|
|
639
767
|
}
|
|
640
768
|
|
|
641
|
-
export function framesToFramesJSON(frames) {
|
|
642
|
-
const framesJSON = frames.map((frame) => {
|
|
643
|
-
const frameJSON = frame.toJSON();
|
|
644
|
-
|
|
645
|
-
frame = frameJSON; ///
|
|
646
|
-
|
|
647
|
-
return frame;
|
|
648
|
-
});
|
|
649
|
-
|
|
650
|
-
return framesJSON;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
769
|
export function labelsToLabelsJSON(labels) {
|
|
654
770
|
const labelsJSON = labels.map((label) => {
|
|
655
771
|
const labelJSON = label.toJSON();
|
|
@@ -660,6 +776,16 @@ export function labelsToLabelsJSON(labels) {
|
|
|
660
776
|
return labelsJSON;
|
|
661
777
|
}
|
|
662
778
|
|
|
779
|
+
export function framesToFramesJSON(frames) {
|
|
780
|
+
const framesJSON = frames.map((frame) => {
|
|
781
|
+
const frameJSON = frame.toJSON();
|
|
782
|
+
|
|
783
|
+
return frameJSON;
|
|
784
|
+
});
|
|
785
|
+
|
|
786
|
+
return framesJSON;
|
|
787
|
+
}
|
|
788
|
+
|
|
663
789
|
export function axiomsToAxiomsJSON(axioms) {
|
|
664
790
|
const axiomsJSON = axioms.map((axiom) => {
|
|
665
791
|
const axiomJSON = axiom.toJSON();
|
|
@@ -754,16 +880,54 @@ export function propertiesToPropertiesJSON(properties) {
|
|
|
754
880
|
return propertiesJSON;
|
|
755
881
|
}
|
|
756
882
|
|
|
757
|
-
export function
|
|
758
|
-
const
|
|
759
|
-
const
|
|
883
|
+
export function judgementsToJudgementsJSON(judgements) {
|
|
884
|
+
const judgementsJSON = judgements.map((judgement) => {
|
|
885
|
+
const judgementJSON = judgement.toJSON();
|
|
760
886
|
|
|
761
|
-
|
|
887
|
+
return judgementJSON;
|
|
888
|
+
});
|
|
762
889
|
|
|
763
|
-
|
|
890
|
+
return judgementsJSON;
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
export function equalitiesToEqualitiesJSON(equalities) {
|
|
894
|
+
const equalitiesJSON = equalities.map((equality) => {
|
|
895
|
+
const equalityJSON = equality.toJSON();
|
|
896
|
+
|
|
897
|
+
return equalityJSON;
|
|
764
898
|
});
|
|
765
899
|
|
|
766
|
-
return
|
|
900
|
+
return equalitiesJSON;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
export function statementsToStatementsJSON(statements) {
|
|
904
|
+
const statementsJSON = statements.map((statement) => {
|
|
905
|
+
const statementJSON = statement.toJSON();
|
|
906
|
+
|
|
907
|
+
return statementJSON;
|
|
908
|
+
});
|
|
909
|
+
|
|
910
|
+
return statementsJSON;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
export function assertionsToAssertionsJSON(assertions) {
|
|
914
|
+
const assertionsJSON = assertions.map((assertion) => {
|
|
915
|
+
const assertionJSON = assertion.toJSON();
|
|
916
|
+
|
|
917
|
+
return assertionJSON;
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
return assertionsJSON;
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
export function referencesToReferencesJSON(references) {
|
|
924
|
+
const referencesJSON = references.map((reference) => {
|
|
925
|
+
const referenceJSON = reference.toJSON();
|
|
926
|
+
|
|
927
|
+
return referenceJSON;
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
return referencesJSON;
|
|
767
931
|
}
|
|
768
932
|
|
|
769
933
|
export function conjecturesToConjecturesJSON(conjectures) {
|
|
@@ -790,6 +954,16 @@ export function combinatorsToCombinatorsJSON(combinators) {
|
|
|
790
954
|
return combinatorsJSON;
|
|
791
955
|
}
|
|
792
956
|
|
|
957
|
+
export function assumptionsToAssumptionsJSON(assumptions) {
|
|
958
|
+
const assumptionsJSON = assumptions.map((assumption) => {
|
|
959
|
+
const assumptionJSON = assumption.toJSON();
|
|
960
|
+
|
|
961
|
+
return assumptionJSON;
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
return assumptionsJSON;
|
|
965
|
+
}
|
|
966
|
+
|
|
793
967
|
export function suppositionsToSuppositionsJSON(suppositions) {
|
|
794
968
|
const suppositionsJSON = suppositions.map((supposition) => {
|
|
795
969
|
const suppositionJSON = supposition.toJSON();
|
|
@@ -824,6 +998,18 @@ export function metatheoremsToMetatheoremsJSON(metatheorems) {
|
|
|
824
998
|
return metatheoremsJSON;
|
|
825
999
|
}
|
|
826
1000
|
|
|
1001
|
+
export function typePrefixesToTypePrefixesJSON(typePrefixes) {
|
|
1002
|
+
const typePrefixesJSON = typePrefixes.map((typePrefix) => {
|
|
1003
|
+
const typePrefixJSON = typePrefix.toJSON();
|
|
1004
|
+
|
|
1005
|
+
typePrefix = typePrefixJSON; ///
|
|
1006
|
+
|
|
1007
|
+
return typePrefix;
|
|
1008
|
+
});
|
|
1009
|
+
|
|
1010
|
+
return typePrefixesJSON;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
827
1013
|
export function substitutionsToSubstitutionsJSON(substitutions) {
|
|
828
1014
|
const substitutionsJSON = substitutions.mapSubstitution((substitution) => {
|
|
829
1015
|
const substitutionJSON = substitution.toJSON();
|
|
@@ -845,3 +1031,13 @@ export function metavariablesToMetavariablesJSON(metavariables) {
|
|
|
845
1031
|
|
|
846
1032
|
return metavariablesJSON;
|
|
847
1033
|
}
|
|
1034
|
+
|
|
1035
|
+
export function substitutionsToCSubstitutionsJSON(substitutiions) {
|
|
1036
|
+
const substitutionsJSON = substitutiions.map((substitution) => {
|
|
1037
|
+
const substitutionJSON = substitution.toJSON();
|
|
1038
|
+
|
|
1039
|
+
return substitutionJSON;
|
|
1040
|
+
});
|
|
1041
|
+
|
|
1042
|
+
return substitutionsJSON;
|
|
1043
|
+
}
|