occam-verify-cli 1.0.785 → 1.0.787
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/context/proof.js +2 -2
- package/lib/context.js +1 -5
- package/lib/element/assumption.js +16 -10
- package/lib/element/label.js +9 -1
- package/lib/element/proofAssertion/step.js +3 -3
- package/lib/element/reference.js +24 -22
- package/lib/element/substitution/frame.js +5 -7
- package/lib/element/substitution/reference.js +9 -9
- package/lib/element/substitution/statement.js +7 -11
- package/lib/element/substitution/term.js +4 -6
- package/lib/utilities/context.js +1 -38
- package/lib/utilities/element.js +9 -37
- package/lib/utilities/unification.js +2 -2
- package/package.json +1 -1
- package/src/context/proof.js +1 -1
- package/src/context.js +0 -7
- package/src/element/assumption.js +21 -11
- package/src/element/label.js +14 -0
- package/src/element/proofAssertion/step.js +2 -2
- package/src/element/reference.js +32 -29
- package/src/element/substitution/frame.js +6 -8
- package/src/element/substitution/reference.js +13 -11
- package/src/element/substitution/statement.js +11 -15
- package/src/element/substitution/term.js +6 -8
- package/src/utilities/context.js +0 -61
- package/src/utilities/element.js +21 -46
- package/src/utilities/unification.js +1 -1
package/src/utilities/element.js
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
import elements from "../elements";
|
|
4
4
|
|
|
5
5
|
import { baseTypeFromNothing } from "../utilities/type";
|
|
6
|
-
import { simplify, instantiate,} from "../utilities/context";
|
|
7
|
-
import { instantiateLabel, instantiateReference } from "../process/instantiate";
|
|
8
6
|
import { equivalenceStringFromTerms,
|
|
9
7
|
typeStringFromNominalTypeName,
|
|
10
8
|
rulsStringFromLabelsPremisesAndConclusion,
|
|
@@ -922,9 +920,10 @@ export function referenceFromStepNode(stepNode, context) {
|
|
|
922
920
|
const referenceNode = stepNode.getReferenceNode();
|
|
923
921
|
|
|
924
922
|
if (referenceNode !== null) {
|
|
925
|
-
const
|
|
923
|
+
const { Reference } = elements,
|
|
924
|
+
referenceString = context.nodeAsString(referenceNode);
|
|
926
925
|
|
|
927
|
-
reference =
|
|
926
|
+
reference = Reference.fromReferenceString(referenceString, context);
|
|
928
927
|
}
|
|
929
928
|
|
|
930
929
|
return reference;
|
|
@@ -1346,9 +1345,10 @@ export function metavariableFromReferenceNode(referenceNode, context) {
|
|
|
1346
1345
|
}
|
|
1347
1346
|
|
|
1348
1347
|
export function referenceFromMetavariableNode(metavariableNode, context) {
|
|
1349
|
-
const
|
|
1348
|
+
const { Reference } = elements,
|
|
1349
|
+
metavariableString = context.nodeAsString(metavariableNode),
|
|
1350
1350
|
referenceString = metavariableString, ///
|
|
1351
|
-
reference =
|
|
1351
|
+
reference = Reference.fromReferenceString(referenceString, context);
|
|
1352
1352
|
|
|
1353
1353
|
return reference;
|
|
1354
1354
|
}
|
|
@@ -1586,9 +1586,10 @@ export function proofFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, cont
|
|
|
1586
1586
|
}
|
|
1587
1587
|
|
|
1588
1588
|
export function labelFromTopLevelMetaAssertionNode(metaLemmaMetathoremNode, context) {
|
|
1589
|
-
const
|
|
1589
|
+
const { Label } = elements,
|
|
1590
|
+
labelNode = metaLemmaMetathoremNode.getLabelNode(),
|
|
1590
1591
|
labelString = context.nodeAsString(labelNode),
|
|
1591
|
-
label =
|
|
1592
|
+
label = Label.fromLabelString(labelString, context);
|
|
1592
1593
|
|
|
1593
1594
|
return label;
|
|
1594
1595
|
}
|
|
@@ -1709,9 +1710,10 @@ export function signatureFromJSatisfiesAssertionNode(sasisfiesAssertionNode, con
|
|
|
1709
1710
|
}
|
|
1710
1711
|
|
|
1711
1712
|
export function referenceFromJSatisfiesAssertionNode(sasisfiesAssertionNode, context) {
|
|
1712
|
-
const
|
|
1713
|
+
const { Reference } = elements,
|
|
1714
|
+
referenceNode = sasisfiesAssertionNode.getReferenceNode(),
|
|
1713
1715
|
referenceString = context.nodeAsString(referenceNode),
|
|
1714
|
-
reference =
|
|
1716
|
+
reference = Reference.fromReferenceString(referenceString, context);
|
|
1715
1717
|
|
|
1716
1718
|
return reference;
|
|
1717
1719
|
}
|
|
@@ -1880,9 +1882,10 @@ export function metavariableFromMetavariableDeclarationNode(metavariableDeclarat
|
|
|
1880
1882
|
}
|
|
1881
1883
|
|
|
1882
1884
|
export function targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
|
|
1883
|
-
const
|
|
1885
|
+
const { Reference } = elements,
|
|
1886
|
+
targetReferenceNode = referenceSubstitutionNode.getTargetReferenceNode(),
|
|
1884
1887
|
targetReferenceString = context.nodeAsString(targetReferenceNode),
|
|
1885
|
-
targetReference =
|
|
1888
|
+
targetReference = Reference.fromReferenceString(targetReferenceString, context);
|
|
1886
1889
|
|
|
1887
1890
|
return targetReference;
|
|
1888
1891
|
}
|
|
@@ -1919,9 +1922,10 @@ export function frameSubstitutionFromStatementSubstitutionNode(statementSubstitu
|
|
|
1919
1922
|
}
|
|
1920
1923
|
|
|
1921
1924
|
export function replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context) {
|
|
1922
|
-
const
|
|
1925
|
+
const { Reference } = elements,
|
|
1926
|
+
replacementReferenceNode = referenceSubstitutionNode.getReplacementReferenceNode(),
|
|
1923
1927
|
replacementReferenceString = context.nodeAsString(replacementReferenceNode),
|
|
1924
|
-
replacementReference =
|
|
1928
|
+
replacementReference = Reference.fromReferenceString(replacementReferenceString, context);
|
|
1925
1929
|
|
|
1926
1930
|
return replacementReference;
|
|
1927
1931
|
}
|
|
@@ -1956,8 +1960,9 @@ export function typesFromTypesNode(typesNode, context) {
|
|
|
1956
1960
|
|
|
1957
1961
|
export function labelsFromLabelNodes(labelNodes, context) {
|
|
1958
1962
|
const labels = labelNodes.map((labelNode) => {
|
|
1959
|
-
const
|
|
1960
|
-
|
|
1963
|
+
const { Label } = elements,
|
|
1964
|
+
labelString = context.nodeAsString(labelNode),
|
|
1965
|
+
label = Label.fromLabelString(labelString, context);
|
|
1961
1966
|
|
|
1962
1967
|
return label;
|
|
1963
1968
|
});
|
|
@@ -2046,33 +2051,3 @@ export function stepsOrSubproofsFromSubDerivationNode(subDerivationNode, context
|
|
|
2046
2051
|
|
|
2047
2052
|
return stepsOrSubproofs;
|
|
2048
2053
|
}
|
|
2049
|
-
|
|
2050
|
-
export function labelFromLabelString(labelString, context) {
|
|
2051
|
-
let label;
|
|
2052
|
-
|
|
2053
|
-
simplify((context) => {
|
|
2054
|
-
instantiate((context) => {
|
|
2055
|
-
const string = labelString, ///
|
|
2056
|
-
labelNode = instantiateLabel(string, context);
|
|
2057
|
-
|
|
2058
|
-
label = labelFromLabelNode(labelNode, context);
|
|
2059
|
-
}, context);
|
|
2060
|
-
}, context);
|
|
2061
|
-
|
|
2062
|
-
return label;
|
|
2063
|
-
}
|
|
2064
|
-
|
|
2065
|
-
export function referenceFromReferenceString(referenceString, context) {
|
|
2066
|
-
let reference;
|
|
2067
|
-
|
|
2068
|
-
simplify((context) => {
|
|
2069
|
-
instantiate((context) => {
|
|
2070
|
-
const string = referenceString, ///
|
|
2071
|
-
referenceNode = instantiateReference(string, context);
|
|
2072
|
-
|
|
2073
|
-
reference = referenceFromReferenceNode(referenceNode, context);
|
|
2074
|
-
}, context);
|
|
2075
|
-
}, context);
|
|
2076
|
-
|
|
2077
|
-
return reference;
|
|
2078
|
-
}
|
|
@@ -62,7 +62,7 @@ async function unifyStatementWithReference(statement, reference, satisfiesAssert
|
|
|
62
62
|
const { Assumption } = elements,
|
|
63
63
|
assumption = Assumption.fromStatementAndReference(statement, reference, context);
|
|
64
64
|
|
|
65
|
-
assumption.validate(context
|
|
65
|
+
assumption.validate(context);
|
|
66
66
|
|
|
67
67
|
statementUnifiesWithReference = true;
|
|
68
68
|
}, context);
|