occam-verify-cli 1.0.192 → 1.0.199
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/file.js +3 -3
- package/lib/dom/assertion/contained.js +12 -24
- package/lib/dom/assertion/defined.js +9 -21
- package/lib/dom/assertion/property.js +7 -7
- package/lib/dom/assertion/satisfies.js +6 -8
- package/lib/dom/declaration/complexType.js +3 -3
- package/lib/dom/declaration/constructor.js +6 -6
- package/lib/dom/declaration/variable.js +6 -6
- package/lib/dom/declaration.js +13 -13
- package/lib/dom/frame.js +7 -7
- package/lib/dom/judgement.js +7 -7
- package/lib/dom/propertyRelation.js +7 -7
- package/lib/dom/term.js +1 -3
- package/lib/dom/topLevelMetaAssertion.js +77 -131
- package/lib/dom/type.js +2 -2
- package/lib/equivalence.js +4 -6
- package/lib/mixins/term/verify.js +4 -8
- package/lib/node/argument.js +116 -0
- package/lib/node/assertion/contained.js +31 -23
- package/lib/node/assertion/defined.js +30 -17
- package/lib/node/assertion/property.js +14 -19
- package/lib/node/assertion/satisfies.js +20 -13
- package/lib/node/assertion/subproof.js +11 -11
- package/lib/node/assertion/type.js +12 -17
- package/lib/node/combinator.js +9 -4
- package/lib/node/conclusion.js +11 -11
- package/lib/node/constructor.js +9 -4
- package/lib/node/declaration/combinator.js +11 -11
- package/lib/node/declaration/complexType.js +38 -34
- package/lib/node/declaration/constructor.js +24 -29
- package/lib/node/declaration/metavariable.js +12 -17
- package/lib/node/declaration/property.js +19 -24
- package/lib/node/declaration/type.js +41 -28
- package/lib/node/declaration/variable.js +12 -17
- package/lib/node/declaration.js +12 -17
- package/lib/node/deduction.js +11 -11
- package/lib/node/derivation.js +39 -11
- package/lib/node/equality.js +21 -18
- package/lib/node/error.js +9 -4
- package/lib/node/frame.js +13 -30
- package/lib/node/judgement.js +13 -18
- package/lib/node/label.js +11 -11
- package/lib/node/labels.js +11 -11
- package/lib/node/metaArgument.js +116 -0
- package/lib/node/metaType.js +9 -8
- package/lib/node/metavariable.js +12 -17
- package/lib/node/nonTerminal.js +218 -0
- package/lib/node/parameter.js +9 -4
- package/lib/node/parenthesisedLabel.js +116 -0
- package/lib/node/parenthesisedLabels.js +11 -11
- package/lib/node/premise.js +12 -17
- package/lib/node/procedureCall.js +12 -17
- package/lib/node/proof.js +11 -11
- package/lib/node/property.js +9 -4
- package/lib/node/propertyRelation.js +12 -17
- package/lib/node/reference.js +11 -11
- package/lib/node/rule.js +44 -7
- package/lib/node/statement.js +92 -53
- package/lib/node/step.js +12 -17
- package/lib/node/subDerivation.js +46 -11
- package/lib/node/subproof.js +19 -17
- package/lib/node/substitution/frame.js +123 -0
- package/lib/node/substitution/reference.js +123 -0
- package/lib/node/substitution/statement.js +123 -0
- package/lib/node/substitution/term.js +123 -0
- package/lib/node/supposition.js +12 -17
- package/lib/node/term.js +22 -33
- package/lib/node/topLevelAssertion.js +14 -29
- package/lib/node/topLevelMetaAssertion.js +26 -41
- package/lib/node/type.js +9 -4
- package/lib/node/types.js +116 -0
- package/lib/node/variable.js +9 -4
- package/lib/nonTerminalNodeMap.js +11 -3
- package/lib/ruleNames.js +33 -1
- package/lib/substitution/frame.js +5 -7
- package/lib/substitution/reference.js +5 -7
- package/lib/substitution/term.js +5 -7
- package/lib/unifier/metaLevel.js +4 -4
- package/lib/utilities/brackets.js +5 -5
- package/lib/utilities/json.js +18 -1
- package/lib/utilities/node.js +1 -313
- package/lib/utilities/subproof.js +13 -4
- package/package.json +1 -1
- package/src/context/file.js +2 -2
- package/src/dom/assertion/contained.js +12 -34
- package/src/dom/assertion/defined.js +9 -30
- package/src/dom/assertion/property.js +6 -8
- package/src/dom/assertion/satisfies.js +5 -10
- package/src/dom/declaration/complexType.js +2 -2
- package/src/dom/declaration/constructor.js +6 -7
- package/src/dom/declaration/variable.js +6 -7
- package/src/dom/declaration.js +11 -15
- package/src/dom/frame.js +4 -6
- package/src/dom/judgement.js +6 -8
- package/src/dom/propertyRelation.js +6 -8
- package/src/dom/term.js +0 -3
- package/src/dom/topLevelMetaAssertion.js +83 -39
- package/src/dom/type.js +2 -2
- package/src/equivalence.js +3 -6
- package/src/mixins/term/verify.js +5 -11
- package/src/node/argument.js +16 -0
- package/src/node/assertion/contained.js +30 -22
- package/src/node/assertion/defined.js +28 -15
- package/src/node/assertion/property.js +7 -17
- package/src/node/assertion/satisfies.js +11 -9
- package/src/node/assertion/subproof.js +4 -9
- package/src/node/assertion/type.js +6 -16
- package/src/node/combinator.js +1 -1
- package/src/node/conclusion.js +4 -9
- package/src/node/constructor.js +1 -1
- package/src/node/declaration/combinator.js +4 -9
- package/src/node/declaration/complexType.js +31 -35
- package/src/node/declaration/constructor.js +16 -26
- package/src/node/declaration/metavariable.js +6 -16
- package/src/node/declaration/property.js +13 -23
- package/src/node/declaration/type.js +35 -29
- package/src/node/declaration/variable.js +6 -16
- package/src/node/declaration.js +6 -16
- package/src/node/deduction.js +4 -9
- package/src/node/derivation.js +7 -10
- package/src/node/equality.js +19 -18
- package/src/node/error.js +1 -1
- package/src/node/frame.js +8 -35
- package/src/node/judgement.js +7 -17
- package/src/node/label.js +4 -9
- package/src/node/labels.js +4 -9
- package/src/node/metaArgument.js +16 -0
- package/src/node/metaType.js +1 -5
- package/src/node/metavariable.js +6 -16
- package/src/node/nonTerminal.js +130 -0
- package/src/node/parameter.js +1 -1
- package/src/node/parenthesisedLabel.js +16 -0
- package/src/node/parenthesisedLabels.js +5 -10
- package/src/node/premise.js +6 -16
- package/src/node/procedureCall.js +6 -16
- package/src/node/proof.js +4 -9
- package/src/node/property.js +1 -1
- package/src/node/propertyRelation.js +7 -16
- package/src/node/reference.js +4 -9
- package/src/node/rule.js +40 -3
- package/src/node/statement.js +109 -66
- package/src/node/step.js +6 -16
- package/src/node/subDerivation.js +14 -10
- package/src/node/subproof.js +13 -16
- package/src/node/substitution/frame.js +23 -0
- package/src/node/substitution/reference.js +23 -0
- package/src/node/substitution/statement.js +23 -0
- package/src/node/substitution/term.js +23 -0
- package/src/node/supposition.js +6 -16
- package/src/node/term.js +15 -39
- package/src/node/topLevelAssertion.js +13 -33
- package/src/node/topLevelMetaAssertion.js +20 -39
- package/src/node/type.js +1 -1
- package/src/node/types.js +16 -0
- package/src/node/variable.js +1 -1
- package/src/nonTerminalNodeMap.js +60 -36
- package/src/ruleNames.js +8 -0
- package/src/substitution/frame.js +7 -10
- package/src/substitution/reference.js +7 -10
- package/src/substitution/term.js +7 -9
- package/src/unifier/metaLevel.js +2 -3
- package/src/utilities/brackets.js +8 -8
- package/src/utilities/json.js +19 -0
- package/src/utilities/node.js +0 -168
- package/src/utilities/subproof.js +22 -6
|
@@ -103,10 +103,9 @@ export default domAssigned(class PropertyAssertion {
|
|
|
103
103
|
verifyTerm(assignments, stated, context) {
|
|
104
104
|
let termVerified;
|
|
105
105
|
|
|
106
|
-
const termString = this.term.getString()
|
|
107
|
-
propertyAssertionString = this.string; ///
|
|
106
|
+
const termString = this.term.getString();
|
|
108
107
|
|
|
109
|
-
context.trace(`Verifying the '${
|
|
108
|
+
context.trace(`Verifying the '${termString}' term...`);
|
|
110
109
|
|
|
111
110
|
termVerified = this.term.verify(context, () => {
|
|
112
111
|
const verifiedAhead = true;
|
|
@@ -115,7 +114,7 @@ export default domAssigned(class PropertyAssertion {
|
|
|
115
114
|
});
|
|
116
115
|
|
|
117
116
|
if (termVerified) {
|
|
118
|
-
context.debug(`...verified the '${
|
|
117
|
+
context.debug(`...verified the '${termString}' term.`);
|
|
119
118
|
}
|
|
120
119
|
|
|
121
120
|
return termVerified;
|
|
@@ -124,15 +123,14 @@ export default domAssigned(class PropertyAssertion {
|
|
|
124
123
|
verifyPropertyRelation(assignments, stated, context) {
|
|
125
124
|
let propertyRelationVerified;
|
|
126
125
|
|
|
127
|
-
const propertyRelationString = this.propertyRelation.getString()
|
|
128
|
-
propertyAssertionString = this.string; ///
|
|
126
|
+
const propertyRelationString = this.propertyRelation.getString();
|
|
129
127
|
|
|
130
|
-
context.trace(`Verifying the '${
|
|
128
|
+
context.trace(`Verifying the '${propertyRelationString}' property relation...`);
|
|
131
129
|
|
|
132
130
|
propertyRelationVerified = this.propertyRelation.verify(context);
|
|
133
131
|
|
|
134
132
|
if (propertyRelationVerified) {
|
|
135
|
-
context.debug(`...verified the '${
|
|
133
|
+
context.debug(`...verified the '${propertyRelationString}' property relation.`);
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
return propertyRelationVerified;
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
import dom from "../../dom";
|
|
4
4
|
|
|
5
5
|
import { domAssigned } from "../../dom";
|
|
6
|
-
import { nodeQuery, nodesQuery } from "../../utilities/query";
|
|
7
|
-
|
|
8
|
-
const termNodesQuery = nodesQuery("/satisfiesAssertion/term"),
|
|
9
|
-
satisfiesAssertionNodeQuery = nodeQuery("/statement/satisfiesAssertion");
|
|
10
6
|
|
|
11
7
|
export default domAssigned(class SatisfiesAssertion {
|
|
12
8
|
constructor(string, node, tokens, terms, reference) {
|
|
@@ -107,10 +103,9 @@ export default domAssigned(class SatisfiesAssertion {
|
|
|
107
103
|
verifyReference(assignments, stated, context) {
|
|
108
104
|
let referenceVerified = false;
|
|
109
105
|
|
|
110
|
-
const referenceString = this.reference.getString()
|
|
111
|
-
satisfiesAssertionString = this.string; ///
|
|
106
|
+
const referenceString = this.reference.getString();
|
|
112
107
|
|
|
113
|
-
context.trace(`Verifying the '${
|
|
108
|
+
context.trace(`Verifying the '${referenceString}' reference...`);
|
|
114
109
|
|
|
115
110
|
const axiom = context.findAxiomByReference(this.reference, context);
|
|
116
111
|
|
|
@@ -123,7 +118,7 @@ export default domAssigned(class SatisfiesAssertion {
|
|
|
123
118
|
}
|
|
124
119
|
|
|
125
120
|
if (referenceVerified) {
|
|
126
|
-
context.debug(`...verified the '${
|
|
121
|
+
context.debug(`...verified the '${referenceString}' reference.`);
|
|
127
122
|
}
|
|
128
123
|
|
|
129
124
|
return referenceVerified;
|
|
@@ -134,7 +129,7 @@ export default domAssigned(class SatisfiesAssertion {
|
|
|
134
129
|
static fromStatementNode(statementNode, context) {
|
|
135
130
|
let satisfiesAssertion = null;
|
|
136
131
|
|
|
137
|
-
const satisfiesAssertionNode =
|
|
132
|
+
const satisfiesAssertionNode = statementNode.getSatisfiedAssertionNode();
|
|
138
133
|
|
|
139
134
|
if (satisfiesAssertionNode !== null) {
|
|
140
135
|
const { Reference } = dom,
|
|
@@ -166,7 +161,7 @@ function termsStringFromTerms(terms) {
|
|
|
166
161
|
}
|
|
167
162
|
|
|
168
163
|
function termsFromSatisfiesAssertionNode(satisfiesAssertionNode, context) {
|
|
169
|
-
const termNodes =
|
|
164
|
+
const termNodes = satisfiesAssertionNode.getTermNodes(),
|
|
170
165
|
terms = termNodes.map((termNode) => {
|
|
171
166
|
const { Term } = dom,
|
|
172
167
|
term = Term.fromTermNode(termNode, context);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import dom from "../../dom";
|
|
4
4
|
|
|
5
5
|
import { domAssigned } from "../../dom";
|
|
6
|
-
import { stringFromTypeNameNameAndSuperTypes } from "../../utilities/type";
|
|
6
|
+
import { superTypesStringFromSuperTypes, stringFromTypeNameNameAndSuperTypes } from "../../utilities/type";
|
|
7
7
|
|
|
8
8
|
export default domAssigned(class ComplexTypeDeclaration {
|
|
9
9
|
constructor(fileContext, string, type) {
|
|
@@ -160,7 +160,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
160
160
|
this.fileContext.debug(`The '${propertyString}' property appears more than once.`);
|
|
161
161
|
} else {
|
|
162
162
|
const superTypeProperty = superTypeProperties.find((superTypeProperty) => {
|
|
163
|
-
const propertyNameMatches = superTypeProperty.
|
|
163
|
+
const propertyNameMatches = superTypeProperty.matchPropertyName(propertyName);
|
|
164
164
|
|
|
165
165
|
if (propertyNameMatches) {
|
|
166
166
|
return true;
|
|
@@ -78,10 +78,9 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
78
78
|
type = this.constructor.getType();
|
|
79
79
|
|
|
80
80
|
const typeName = type.getName(),
|
|
81
|
-
typeString = type.getString()
|
|
82
|
-
constructorString = this.constructor.getString();
|
|
81
|
+
typeString = type.getString();
|
|
83
82
|
|
|
84
|
-
this.fileContext.trace(`Verifying the '${
|
|
83
|
+
this.fileContext.trace(`Verifying the '${typeString}' type...`);
|
|
85
84
|
|
|
86
85
|
const includeSupertypes = false,
|
|
87
86
|
provisional = type.isProvisional(includeSupertypes);
|
|
@@ -91,14 +90,14 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
91
90
|
const typePresent = (type !== null)
|
|
92
91
|
|
|
93
92
|
if (!typePresent) {
|
|
94
|
-
this.fileContext.debug(`The '${
|
|
93
|
+
this.fileContext.debug(`The '${typeString}' type is not present.`);
|
|
95
94
|
} else {
|
|
96
95
|
const provisionalMatches = type.matchProvisional(provisional);
|
|
97
96
|
|
|
98
97
|
if (!provisionalMatches) {
|
|
99
98
|
provisional ?
|
|
100
|
-
this.fileContext.debug(`The '${
|
|
101
|
-
this.fileContext.debug(`The '${
|
|
99
|
+
this.fileContext.debug(`The '${typeString}' type is present but it should be provisional.`) :
|
|
100
|
+
this.fileContext.debug(`The '${typeString}' type is present but it should not be provisional.`);
|
|
102
101
|
} else {
|
|
103
102
|
this.constructor.setType(type);
|
|
104
103
|
|
|
@@ -107,7 +106,7 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
if (constructorTypeVerified) {
|
|
110
|
-
this.fileContext.debug(`...verified the '${
|
|
109
|
+
this.fileContext.debug(`...verified the '${typeString}' type.`);
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
return constructorTypeVerified;
|
|
@@ -80,10 +80,9 @@ export default domAssigned(class VariableDeclaration {
|
|
|
80
80
|
type = this.variable.getType();
|
|
81
81
|
|
|
82
82
|
const typeName = type.getName(),
|
|
83
|
-
typeString = type.getString()
|
|
84
|
-
variableString = this.variable.getString();
|
|
83
|
+
typeString = type.getString();
|
|
85
84
|
|
|
86
|
-
this.fileContext.trace(`Verifying the '${
|
|
85
|
+
this.fileContext.trace(`Verifying the '${typeString}' type...`);
|
|
87
86
|
|
|
88
87
|
const includeSupertypes = false,
|
|
89
88
|
provisional = type.isProvisional(includeSupertypes);
|
|
@@ -93,14 +92,14 @@ export default domAssigned(class VariableDeclaration {
|
|
|
93
92
|
const typePresent = (type !== null)
|
|
94
93
|
|
|
95
94
|
if (!typePresent) {
|
|
96
|
-
this.fileContext.debug(`The '${
|
|
95
|
+
this.fileContext.debug(`The '${typeString}' type is not present.`);
|
|
97
96
|
} else {
|
|
98
97
|
const provisionalMatches = type.matchProvisional(provisional);
|
|
99
98
|
|
|
100
99
|
if (!provisionalMatches) {
|
|
101
100
|
provisional ?
|
|
102
|
-
this.fileContext.debug(`The '${
|
|
103
|
-
this.fileContext.debug(`The '${
|
|
101
|
+
this.fileContext.debug(`The '${typeString}' type is present but it should be provisional.`) :
|
|
102
|
+
this.fileContext.debug(`The '${typeString}' type is present but it should not be provisional.`);
|
|
104
103
|
} else {
|
|
105
104
|
this.variable.setType(type);
|
|
106
105
|
|
|
@@ -109,7 +108,7 @@ export default domAssigned(class VariableDeclaration {
|
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
if (variableTypeVerified) {
|
|
112
|
-
this.fileContext.debug(`...verified the '${
|
|
111
|
+
this.fileContext.debug(`...verified the '${typeString}' type.`);
|
|
113
112
|
}
|
|
114
113
|
|
|
115
114
|
return variableTypeVerified;
|
package/src/dom/declaration.js
CHANGED
|
@@ -85,15 +85,14 @@ export default domAssigned(class Declaration {
|
|
|
85
85
|
verifyReference(assignments, stated, context) {
|
|
86
86
|
let referenceVerified;
|
|
87
87
|
|
|
88
|
-
const referenceString = this.reference.getString()
|
|
89
|
-
declarationString = this.string; ///
|
|
88
|
+
const referenceString = this.reference.getString();
|
|
90
89
|
|
|
91
|
-
context.trace(`Verifying the '${
|
|
90
|
+
context.trace(`Verifying the '${referenceString}' reference...`);
|
|
92
91
|
|
|
93
92
|
referenceVerified = this.reference.verify(context);
|
|
94
93
|
|
|
95
94
|
if (referenceVerified) {
|
|
96
|
-
context.debug(`...verified the '${
|
|
95
|
+
context.debug(`...verified the '${referenceString}' reference.`);
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
return referenceVerified;
|
|
@@ -102,10 +101,9 @@ export default domAssigned(class Declaration {
|
|
|
102
101
|
verifyStatement(assignments, stated, context) {
|
|
103
102
|
let statementVerified;
|
|
104
103
|
|
|
105
|
-
const statementString = this.statement.getString()
|
|
106
|
-
declarationString = this.string; ///
|
|
104
|
+
const statementString = this.statement.getString();
|
|
107
105
|
|
|
108
|
-
context.trace(`Verifying the '${
|
|
106
|
+
context.trace(`Verifying the '${statementString}' statement...`);
|
|
109
107
|
|
|
110
108
|
stated = true; ///
|
|
111
109
|
|
|
@@ -114,7 +112,7 @@ export default domAssigned(class Declaration {
|
|
|
114
112
|
statementVerified = this.statement.verify(assignments, stated, context);
|
|
115
113
|
|
|
116
114
|
if (statementVerified) {
|
|
117
|
-
context.debug(`...verified the '${
|
|
115
|
+
context.debug(`...verified the '${statementString}' statement.`);
|
|
118
116
|
}
|
|
119
117
|
|
|
120
118
|
return statementVerified;
|
|
@@ -174,10 +172,9 @@ export default domAssigned(class Declaration {
|
|
|
174
172
|
|
|
175
173
|
const context = generalContext, ///
|
|
176
174
|
statementString = statement.getString(),
|
|
177
|
-
declarationString = this.string, ///
|
|
178
175
|
declarationStatementString = this.statement.getString();
|
|
179
176
|
|
|
180
|
-
context.trace(`Unifying the '${statementString}' statement with the '${
|
|
177
|
+
context.trace(`Unifying the '${statementString}' statement with the '${declarationStatementString}' statement...`);
|
|
181
178
|
|
|
182
179
|
const generalStatement = this.statement,
|
|
183
180
|
specificStatement = statement, ///
|
|
@@ -186,7 +183,7 @@ export default domAssigned(class Declaration {
|
|
|
186
183
|
statementUnified = statementUUnifiedIntrinsically; ///
|
|
187
184
|
|
|
188
185
|
if (statementUnified) {
|
|
189
|
-
context.debug(`...unified the '${statementString}' statement with the '${
|
|
186
|
+
context.debug(`...unified the '${statementString}' statement with the '${declarationStatementString}' statement.`);
|
|
190
187
|
}
|
|
191
188
|
|
|
192
189
|
return statementUnified;
|
|
@@ -197,17 +194,16 @@ export default domAssigned(class Declaration {
|
|
|
197
194
|
|
|
198
195
|
const context = generalContext, ///
|
|
199
196
|
labelString = label.getString(),
|
|
200
|
-
referenceString = this.reference.getString()
|
|
201
|
-
declarationString = this.string; ///
|
|
197
|
+
referenceString = this.reference.getString();
|
|
202
198
|
|
|
203
|
-
context.trace(`Unifying the '${labelString}' label with the '${
|
|
199
|
+
context.trace(`Unifying the '${labelString}' label with the '${referenceString}' reference...`);
|
|
204
200
|
|
|
205
201
|
const labelUnified = this.reference.unifyLabel(label, substitutions, context);
|
|
206
202
|
|
|
207
203
|
labelUnifiedWithReference = labelUnified; ///
|
|
208
204
|
|
|
209
205
|
if (labelUnifiedWithReference) {
|
|
210
|
-
context.debug(`...unified the '${labelString}' label with the '${
|
|
206
|
+
context.debug(`...unified the '${labelString}' label with the '${referenceString}' reference.`);
|
|
211
207
|
}
|
|
212
208
|
|
|
213
209
|
return labelUnifiedWithReference;
|
package/src/dom/frame.js
CHANGED
|
@@ -214,10 +214,9 @@ export default domAssigned(class Frame {
|
|
|
214
214
|
const sOrNothing = (declarationsLength > 1) ?
|
|
215
215
|
S :
|
|
216
216
|
NOTHING,
|
|
217
|
-
frameString = this.string, ///
|
|
218
217
|
declarationsString = declarationsStringFromDeclarations(this.declarations);
|
|
219
218
|
|
|
220
|
-
context.trace(`Verifying the '${
|
|
219
|
+
context.trace(`Verifying the '${declarationsString}' declaration${sOrNothing}...`);
|
|
221
220
|
|
|
222
221
|
stated = true; ///
|
|
223
222
|
|
|
@@ -230,7 +229,7 @@ export default domAssigned(class Frame {
|
|
|
230
229
|
});
|
|
231
230
|
|
|
232
231
|
if (declarationsVerified) {
|
|
233
|
-
context.debug(`...verified the '${
|
|
232
|
+
context.debug(`...verified the '${declarationsString}' declaration${sOrNothing}.`);
|
|
234
233
|
}
|
|
235
234
|
}
|
|
236
235
|
|
|
@@ -246,10 +245,9 @@ export default domAssigned(class Frame {
|
|
|
246
245
|
const sOrNothing = (metavariablesLength > 1) ?
|
|
247
246
|
S :
|
|
248
247
|
NOTHING,
|
|
249
|
-
frameString = this.string, ///
|
|
250
248
|
metavariablesString = metavariablesStringFromMetavariables(this.metavariables);
|
|
251
249
|
|
|
252
|
-
context.trace(`Verifying the '${
|
|
250
|
+
context.trace(`Verifying the '${metavariablesString}' metavariable${sOrNothing}...`);
|
|
253
251
|
|
|
254
252
|
metavariablesVerified = this.metavariables.every((metavariable) => {
|
|
255
253
|
const metavariableVerified = metavariable.verify(context);
|
|
@@ -258,7 +256,7 @@ export default domAssigned(class Frame {
|
|
|
258
256
|
});
|
|
259
257
|
|
|
260
258
|
if (metavariablesVerified) {
|
|
261
|
-
context.debug(`...verified the '${
|
|
259
|
+
context.debug(`...verified the '${metavariablesString}' metavariable${sOrNothing}.`);
|
|
262
260
|
}
|
|
263
261
|
}
|
|
264
262
|
|
package/src/dom/judgement.js
CHANGED
|
@@ -70,15 +70,14 @@ export default domAssigned(class Judgement {
|
|
|
70
70
|
verifyFrame(assignments, stated, context) {
|
|
71
71
|
let frameVerified;
|
|
72
72
|
|
|
73
|
-
const frameString = this.frame.getString()
|
|
74
|
-
judgementString = this.string; ///
|
|
73
|
+
const frameString = this.frame.getString();
|
|
75
74
|
|
|
76
|
-
context.trace(`Verifying the '${
|
|
75
|
+
context.trace(`Verifying the '${frameString}' frame...`);
|
|
77
76
|
|
|
78
77
|
frameVerified = this.frame.verify(assignments, stated, context);
|
|
79
78
|
|
|
80
79
|
if (frameVerified) {
|
|
81
|
-
context.debug(`...verified the '${
|
|
80
|
+
context.debug(`...verified the '${frameString}' frame.`);
|
|
82
81
|
}
|
|
83
82
|
|
|
84
83
|
return frameVerified;
|
|
@@ -87,15 +86,14 @@ export default domAssigned(class Judgement {
|
|
|
87
86
|
verifyDeclaration(assignments, stated, context) {
|
|
88
87
|
let declarationVerified;
|
|
89
88
|
|
|
90
|
-
const
|
|
91
|
-
declarationString = this.declaration.getString();
|
|
89
|
+
const declarationString = this.declaration.getString();
|
|
92
90
|
|
|
93
|
-
context.trace(`Verifying the '${
|
|
91
|
+
context.trace(`Verifying the '${declarationString}' declaration...`);
|
|
94
92
|
|
|
95
93
|
declarationVerified = this.declaration.verify(assignments, stated, context);
|
|
96
94
|
|
|
97
95
|
if (declarationVerified) {
|
|
98
|
-
context.debug(`...verified the '${
|
|
96
|
+
context.debug(`...verified the '${declarationString}' declaration.`);
|
|
99
97
|
}
|
|
100
98
|
|
|
101
99
|
return declarationVerified;
|
|
@@ -67,10 +67,9 @@ export default domAssigned(class PropertyRelation {
|
|
|
67
67
|
verifyTerm(context) {
|
|
68
68
|
let termVerified;
|
|
69
69
|
|
|
70
|
-
const termString = this.term.getString()
|
|
71
|
-
propertyRelationString = this.string; ///
|
|
70
|
+
const termString = this.term.getString();
|
|
72
71
|
|
|
73
|
-
context.trace(`Verifying the '${
|
|
72
|
+
context.trace(`Verifying the '${termString}' term...`);
|
|
74
73
|
|
|
75
74
|
termVerified = this.term.verify(context, () => {
|
|
76
75
|
const verifiedAhead = true;
|
|
@@ -79,7 +78,7 @@ export default domAssigned(class PropertyRelation {
|
|
|
79
78
|
});
|
|
80
79
|
|
|
81
80
|
if (termVerified) {
|
|
82
|
-
context.debug(`...verified the '${
|
|
81
|
+
context.debug(`...verified the '${termString}' term.`);
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
return termVerified;
|
|
@@ -88,10 +87,9 @@ export default domAssigned(class PropertyRelation {
|
|
|
88
87
|
verifyProperty(context) {
|
|
89
88
|
let propertyVerified;
|
|
90
89
|
|
|
91
|
-
const propertyString = this.property.getString()
|
|
92
|
-
propertyRelationString = this.string; ///
|
|
90
|
+
const propertyString = this.property.getString();
|
|
93
91
|
|
|
94
|
-
context.trace(`Verifying the '${
|
|
92
|
+
context.trace(`Verifying the '${propertyString}' property...`);
|
|
95
93
|
|
|
96
94
|
const termType = this.term.getType(),
|
|
97
95
|
propertyName = this.property.getName(),
|
|
@@ -118,7 +116,7 @@ export default domAssigned(class PropertyRelation {
|
|
|
118
116
|
}
|
|
119
117
|
|
|
120
118
|
if (propertyVerified) {
|
|
121
|
-
context.debug(`...verified the '${
|
|
119
|
+
context.debug(`...verified the '${propertyString}' property.`);
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
return propertyVerified;
|
package/src/dom/term.js
CHANGED
|
@@ -6,7 +6,6 @@ import dom from "../dom";
|
|
|
6
6
|
import LocalContext from "../context/local";
|
|
7
7
|
import verifyMixins from "../mixins/term/verify";
|
|
8
8
|
|
|
9
|
-
import { nodeQuery } from "../utilities/query"
|
|
10
9
|
import { domAssigned } from "../dom";
|
|
11
10
|
import { termFromTermNode } from "../utilities/node";
|
|
12
11
|
import { termNodeFromTermString } from "../context/partial/term";
|
|
@@ -14,8 +13,6 @@ import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
|
|
|
14
13
|
|
|
15
14
|
const { filter, compress } = arrayUtilities;
|
|
16
15
|
|
|
17
|
-
const containedAssertionTermNodeQuery = nodeQuery("/containedAssertion/term");
|
|
18
|
-
|
|
19
16
|
export default domAssigned(class Term {
|
|
20
17
|
constructor(string, node, type) {
|
|
21
18
|
this.string = string;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
3
|
+
import dom from "../dom";
|
|
5
4
|
import LocalContext from "../context/local";
|
|
6
|
-
import
|
|
5
|
+
import Substitutions from "../substitutions";
|
|
7
6
|
|
|
8
|
-
import { proofFromProofNode,
|
|
9
|
-
import {
|
|
10
|
-
|
|
7
|
+
import { proofFromProofNode, deductionFromDeductionNode, suppositionsFromSuppositionNodes } from "./topLevelAssertion";
|
|
8
|
+
import { labelFromJSON,
|
|
9
|
+
labelToLabelJSON,
|
|
11
10
|
deductionFromJSON,
|
|
12
11
|
suppositionsFromJSON,
|
|
13
12
|
substitutionsFromJSON,
|
|
@@ -15,27 +14,47 @@ import { labelsFromJSON,
|
|
|
15
14
|
suppositionsToSuppositionsJSON,
|
|
16
15
|
substitutionsToSubstitutionsJSON } from "../utilities/json";
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
export default class TopLevelMetaAssertion {
|
|
18
|
+
constructor(fileContext, string, label, suppositions, deduction, proof, substitutions) {
|
|
19
|
+
this.fileContext = fileContext;
|
|
20
|
+
this.string = string;
|
|
21
|
+
this.label = label;
|
|
22
|
+
this.suppositions = suppositions;
|
|
23
|
+
this.deduction = deduction;
|
|
24
|
+
this.proof = proof;
|
|
24
25
|
this.substitutions = substitutions;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
return this.
|
|
28
|
+
getFileContext() {
|
|
29
|
+
return this.fileContext;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
getString() {
|
|
33
|
+
return this.string;
|
|
29
34
|
}
|
|
30
35
|
|
|
31
36
|
getLabel() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
label = firstLabel; ///
|
|
37
|
+
return this.label;
|
|
38
|
+
}
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
getSuppositions() {
|
|
41
|
+
return this.suppositions;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
getDeduction() {
|
|
45
|
+
return this.deduction;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
getProof() {
|
|
49
|
+
return this.proof;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
getSubstitutions() {
|
|
53
|
+
return this.substitutions;
|
|
37
54
|
}
|
|
38
55
|
|
|
56
|
+
getStatement() { return this.deduction.getStatement(); }
|
|
57
|
+
|
|
39
58
|
matchReference(reference) {
|
|
40
59
|
const label = this.getLabel(),
|
|
41
60
|
referenceMatches = label.matchReference(reference);
|
|
@@ -46,9 +65,9 @@ export default class TopLevelMetaAssertion extends TopLevelAssertion {
|
|
|
46
65
|
verify() {
|
|
47
66
|
let verified = false;
|
|
48
67
|
|
|
49
|
-
const
|
|
68
|
+
const labelVerified = this.verifyLabels();
|
|
50
69
|
|
|
51
|
-
if (
|
|
70
|
+
if (labelVerified) {
|
|
52
71
|
const localContext = LocalContext.fromFileContext(this.fileContext),
|
|
53
72
|
context = localContext, ///
|
|
54
73
|
suppositionsVerified = this.suppositions.every((supposition) => {
|
|
@@ -78,29 +97,23 @@ export default class TopLevelMetaAssertion extends TopLevelAssertion {
|
|
|
78
97
|
}
|
|
79
98
|
|
|
80
99
|
verifyLabels() {
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
labelVerified = label.verify(nameOnly);
|
|
84
|
-
|
|
85
|
-
if (labelVerified) {
|
|
86
|
-
return true;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
100
|
+
const nameOnly = false,
|
|
101
|
+
labelVerified = this.label.verify(nameOnly);
|
|
89
102
|
|
|
90
|
-
return
|
|
103
|
+
return labelVerified;
|
|
91
104
|
}
|
|
92
105
|
|
|
93
106
|
toJSON() {
|
|
94
|
-
const
|
|
107
|
+
const labelJSON = labelToLabelJSON(this.label),
|
|
95
108
|
deductionJSON = deductionToDeductionJSON(this.deduction),
|
|
96
109
|
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
97
110
|
substitutionsJSON = substitutionsToSubstitutionsJSON(this.substitutions),
|
|
98
|
-
|
|
111
|
+
label = labelJSON, ///
|
|
99
112
|
deduction = deductionJSON, ///
|
|
100
113
|
suppositions = suppositionsJSON, ///
|
|
101
114
|
substitutions = substitutionsJSON, ///
|
|
102
115
|
json = {
|
|
103
|
-
|
|
116
|
+
label,
|
|
104
117
|
deduction,
|
|
105
118
|
suppositions,
|
|
106
119
|
substitutions
|
|
@@ -110,13 +123,13 @@ export default class TopLevelMetaAssertion extends TopLevelAssertion {
|
|
|
110
123
|
}
|
|
111
124
|
|
|
112
125
|
static fromJSON(Class, json, fileContext) {
|
|
113
|
-
const
|
|
126
|
+
const label = labelFromJSON(json, fileContext),
|
|
114
127
|
deduction = deductionFromJSON(json, fileContext),
|
|
115
128
|
suppositions = suppositionsFromJSON(json, fileContext),
|
|
116
129
|
substitutions = substitutionsFromJSON(json, fileContext),
|
|
117
130
|
proof = null,
|
|
118
|
-
string =
|
|
119
|
-
topLevelMetaAssertion = new Class(fileContext, string,
|
|
131
|
+
string = stringFromLabelAndDeduction(label, deduction),
|
|
132
|
+
topLevelMetaAssertion = new Class(fileContext, string, label, suppositions, deduction, proof, substitutions);
|
|
120
133
|
|
|
121
134
|
return topLevelMetaAssertion;
|
|
122
135
|
}
|
|
@@ -124,16 +137,47 @@ export default class TopLevelMetaAssertion extends TopLevelAssertion {
|
|
|
124
137
|
static fromNode(Class, node, fileContext) {
|
|
125
138
|
const topLevelAssertionNode = node, ///
|
|
126
139
|
proofNode = topLevelAssertionNode.getProofNode(),
|
|
127
|
-
|
|
140
|
+
labelNode = topLevelAssertionNode.getLabelNode(),
|
|
128
141
|
deductionNode = topLevelAssertionNode.getDeductionNode(),
|
|
129
142
|
suppositionNodes = topLevelAssertionNode.getSuppositionNodes(),
|
|
130
143
|
proof = proofFromProofNode(proofNode, fileContext),
|
|
131
|
-
|
|
144
|
+
label = labelFromLabelNode(labelNode, fileContext),
|
|
132
145
|
deduction = deductionFromDeductionNode(deductionNode, fileContext),
|
|
133
146
|
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, fileContext),
|
|
134
|
-
|
|
135
|
-
|
|
147
|
+
substitutions = Substitutions.fromNothing(),
|
|
148
|
+
string = stringFromLabelAndDeduction(label, deduction),
|
|
149
|
+
topLevelMetaAssertion = new Class(fileContext, string, label, suppositions, deduction, proof, substitutions);
|
|
136
150
|
|
|
137
151
|
return topLevelMetaAssertion;
|
|
138
152
|
}
|
|
139
153
|
}
|
|
154
|
+
|
|
155
|
+
function labelFromLabelNode(labelNode, fileContext) {
|
|
156
|
+
let label = null;
|
|
157
|
+
|
|
158
|
+
const { Label } = dom;
|
|
159
|
+
|
|
160
|
+
if (labelNode !== null) {
|
|
161
|
+
label = Label.fromLabelNode(labelNode, fileContext);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return label;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function labelStringFromLabel(label) {
|
|
168
|
+
const labelsString = (label !== null) ?
|
|
169
|
+
label.getString() :
|
|
170
|
+
null;
|
|
171
|
+
|
|
172
|
+
return labelsString;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function stringFromLabelAndDeduction(label, deduction) {
|
|
176
|
+
const deductionString = deduction.getString(),
|
|
177
|
+
labelString = labelStringFromLabel(label),
|
|
178
|
+
string = (labelString === null) ?
|
|
179
|
+
deductionString : ///
|
|
180
|
+
`${labelString} :: ${deductionString}`;
|
|
181
|
+
|
|
182
|
+
return string;
|
|
183
|
+
}
|
package/src/dom/type.js
CHANGED
|
@@ -286,11 +286,11 @@ class Type {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext) {
|
|
289
|
-
const
|
|
290
|
-
provisional = complexTypeDeclarationNode.isProvisional(),
|
|
289
|
+
const provisional = complexTypeDeclarationNode.isProvisional(),
|
|
291
290
|
typeName = complexTypeDeclarationNode.getTypeName(),
|
|
292
291
|
name = typeName,
|
|
293
292
|
superTypes = superTypesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext),
|
|
293
|
+
properties = propertiesFromComplexTypeDeclarationNode(complexTypeDeclarationNode, fileContext),
|
|
294
294
|
string = stringFromTypeNameNameAndSuperTypes(typeName, superTypes),
|
|
295
295
|
type = new Type(string, name, superTypes, properties, provisional);
|
|
296
296
|
|
package/src/equivalence.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { nodeQuery } from "./utilities/query";
|
|
4
3
|
import { stripBracketsFromTermNode } from "./utilities/brackets";
|
|
5
4
|
|
|
6
|
-
const variableNodeQuery = nodeQuery("/term/variable!");
|
|
7
|
-
|
|
8
5
|
export default class Equivalence {
|
|
9
6
|
constructor(terms) {
|
|
10
7
|
this.terms = terms;
|
|
@@ -100,10 +97,10 @@ export default class Equivalence {
|
|
|
100
97
|
const variableNodeA = variableNode, ///
|
|
101
98
|
variableNodeMatches = this.someTerm((term) => {
|
|
102
99
|
const termNode = term.getNode(),
|
|
103
|
-
|
|
100
|
+
singularVariableNode = termNode.getSingularVariableNode();
|
|
104
101
|
|
|
105
|
-
if (
|
|
106
|
-
const variableNodeB =
|
|
102
|
+
if (singularVariableNode !== null) {
|
|
103
|
+
const variableNodeB = singularVariableNode, ///
|
|
107
104
|
variableNodeAMatchesVariableNodeB = variableNodeA.match(variableNodeB);
|
|
108
105
|
|
|
109
106
|
if (variableNodeAMatchesVariableNodeB) {
|