occam-verify-cli 1.0.857 → 1.0.859
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/nominal.js +13 -1
- package/lib/context/liminal.js +4 -4
- package/lib/context/mnemic.js +4 -1
- package/lib/context/synoptic.js +16 -3
- package/lib/context.js +5 -1
- package/lib/element/assumption/metaLevel.js +48 -2
- package/lib/element/assumption.js +3 -27
- package/lib/element/judgement.js +27 -27
- package/lib/element/metavariable.js +7 -1
- package/lib/element/substitution/statement.js +3 -17
- package/lib/element/variable.js +3 -1
- package/lib/process/unify.js +2 -54
- package/lib/utilities/element.js +10 -9
- package/lib/utilities/string.js +11 -4
- package/package.json +1 -1
- package/src/context/file/nominal.js +18 -0
- package/src/context/liminal.js +3 -3
- package/src/context/mnemic.js +4 -0
- package/src/context/synoptic.js +22 -2
- package/src/context.js +6 -0
- package/src/element/assumption/metaLevel.js +86 -5
- package/src/element/assumption.js +2 -44
- package/src/element/judgement.js +32 -32
- package/src/element/metavariable.js +12 -0
- package/src/element/substitution/statement.js +2 -20
- package/src/element/variable.js +4 -0
- package/src/process/unify.js +0 -83
- package/src/utilities/element.js +16 -15
- package/src/utilities/string.js +9 -1
package/src/process/unify.js
CHANGED
|
@@ -149,72 +149,6 @@ class MetaLevelPass extends ZipPassBase {
|
|
|
149
149
|
];
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
class AssumptionPass extends ZipPass {
|
|
153
|
-
static maps = [
|
|
154
|
-
{
|
|
155
|
-
generalNodeQuery: statementMetavariableNodeQuery,
|
|
156
|
-
specificNodeQuery: statementNodeQuery,
|
|
157
|
-
run: (generalStatementMetavariableNode, specificStatementNode, generalContext, specificContext) => {
|
|
158
|
-
let success = false;
|
|
159
|
-
|
|
160
|
-
const statementNode = specificStatementNode, ///
|
|
161
|
-
metavariableNode = generalStatementMetavariableNode; ///
|
|
162
|
-
|
|
163
|
-
let context;
|
|
164
|
-
|
|
165
|
-
context = generalContext; ///
|
|
166
|
-
|
|
167
|
-
const metavariable = context.findMetavariableByMetavariableNode(metavariableNode);
|
|
168
|
-
|
|
169
|
-
context = specificContext; ///
|
|
170
|
-
|
|
171
|
-
const statement = context.findStatementByStatementNode(statementNode),
|
|
172
|
-
substitution = null,
|
|
173
|
-
statementUnifies = metavariable.unifyStatement(statement, substitution, generalContext, specificContext);
|
|
174
|
-
|
|
175
|
-
if (statementUnifies) {
|
|
176
|
-
success = true;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
return success;
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
generalNodeQuery: metavariableNodeQuery,
|
|
184
|
-
specificNodeQuery: referenceMetavariableNodeQuery,
|
|
185
|
-
run: (generalMetavariableNode, specificReferenceMetavariableNode, generalContext, specificContext) => {
|
|
186
|
-
let success = false;
|
|
187
|
-
|
|
188
|
-
let context,
|
|
189
|
-
reference,
|
|
190
|
-
metavariableNode;
|
|
191
|
-
|
|
192
|
-
context = generalContext; ///
|
|
193
|
-
|
|
194
|
-
metavariableNode = generalMetavariableNode; ///
|
|
195
|
-
|
|
196
|
-
reference = context.findReferenceByMetavariableNode(metavariableNode);
|
|
197
|
-
|
|
198
|
-
const metavariable = reference.getMetavariable();
|
|
199
|
-
|
|
200
|
-
context = specificContext; ///
|
|
201
|
-
|
|
202
|
-
metavariableNode = specificReferenceMetavariableNode; ///
|
|
203
|
-
|
|
204
|
-
reference = context.findReferenceByMetavariableNode(metavariableNode);
|
|
205
|
-
|
|
206
|
-
const referenceUnifies = metavariable.unifyReference(reference, generalContext, specificContext);
|
|
207
|
-
|
|
208
|
-
if (referenceUnifies) {
|
|
209
|
-
success = true;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
return success;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
];
|
|
216
|
-
}
|
|
217
|
-
|
|
218
152
|
class CombinatorPass extends ZipPass {
|
|
219
153
|
static maps = [
|
|
220
154
|
{
|
|
@@ -471,7 +405,6 @@ class IntrinsicLevelPass extends ZipPass {
|
|
|
471
405
|
}
|
|
472
406
|
|
|
473
407
|
const metaLevelPass = new MetaLevelPass(),
|
|
474
|
-
assumptionPass = new AssumptionPass(),
|
|
475
408
|
combinatorPass = new CombinatorPass(),
|
|
476
409
|
constructorPass = new ConstructorPass(),
|
|
477
410
|
metavariablePass = new MetavariablePass(),
|
|
@@ -494,22 +427,6 @@ export function unifyStatement(generalStatement, specificStatement, generalConte
|
|
|
494
427
|
return statementUnifies;
|
|
495
428
|
}
|
|
496
429
|
|
|
497
|
-
export function unifyAssumption(generalAssumption, specificAssumption, generalContext, specificContext) {
|
|
498
|
-
let assumptionUnifies = false;
|
|
499
|
-
|
|
500
|
-
const generalAssumptionNode = generalAssumption.getNode(),
|
|
501
|
-
specificAssumptionNode = specificAssumption.getNode(),
|
|
502
|
-
generalNode = generalAssumptionNode, ///
|
|
503
|
-
specificNode = specificAssumptionNode, ///
|
|
504
|
-
success = assumptionPass.run(generalNode, specificNode, generalContext, specificContext);
|
|
505
|
-
|
|
506
|
-
if (success) {
|
|
507
|
-
assumptionUnifies = true;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
return assumptionUnifies;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
430
|
export function unifySubstitution(generalSubstitution, specificSubstitution, generalContext, specificContext) {
|
|
514
431
|
let substitutionUnifies = false;
|
|
515
432
|
|
package/src/utilities/element.js
CHANGED
|
@@ -11,6 +11,7 @@ import { equivalenceStringFromTerms,
|
|
|
11
11
|
procedureCallStringFromProcedureReferenceAndParameters,
|
|
12
12
|
topLevelAssertionStringFromLabelsSuppositionsAndDeduction,
|
|
13
13
|
topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction } from "../utilities/string";
|
|
14
|
+
import statement from "../element/statement";
|
|
14
15
|
|
|
15
16
|
export function typeFromTypeNode(typeNode, context) {
|
|
16
17
|
let type;
|
|
@@ -1327,11 +1328,18 @@ export function identifierFromParameterNode(parameterNode, context) {
|
|
|
1327
1328
|
|
|
1328
1329
|
export function referenceFromAssumptionNode(assumptionNode, context) {
|
|
1329
1330
|
const metavariableNode = assumptionNode.getMetavariableNode(),
|
|
1330
|
-
|
|
1331
|
+
reference = referenceFromMetavariableNode(metavariableNode, context);
|
|
1331
1332
|
|
|
1332
1333
|
return reference;
|
|
1333
1334
|
}
|
|
1334
1335
|
|
|
1336
|
+
export function statementFromAssumptionNode(assumptionNode, context) {
|
|
1337
|
+
const statesmentNode = assumptionNode.getStatementNode(),
|
|
1338
|
+
statement = statementFromStatementNode(statesmentNode, context);
|
|
1339
|
+
|
|
1340
|
+
return statement;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1335
1343
|
export function statementFromCombinatorNode(combinatorNode, context) {
|
|
1336
1344
|
const statementNode = combinatorNode.getStatementNode(),
|
|
1337
1345
|
statement = statementFromStatementNode(statementNode, context);
|
|
@@ -1351,13 +1359,6 @@ export function statementFromConclusionNode(conclusinoNode, context) {
|
|
|
1351
1359
|
return statement;
|
|
1352
1360
|
}
|
|
1353
1361
|
|
|
1354
|
-
export function statementFromAssumptionNode(assumptionNode, context) {
|
|
1355
|
-
const statementNode = assumptionNode.getStatementNode(),
|
|
1356
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1357
|
-
|
|
1358
|
-
return statement;
|
|
1359
|
-
}
|
|
1360
|
-
|
|
1361
1362
|
export function statementFromHypothesisNode(hypothesisNode, context) {
|
|
1362
1363
|
let statement = null;
|
|
1363
1364
|
|
|
@@ -1827,13 +1828,6 @@ export function targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, cont
|
|
|
1827
1828
|
return targetFrame;
|
|
1828
1829
|
}
|
|
1829
1830
|
|
|
1830
|
-
export function statementFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context) {
|
|
1831
|
-
const statementNode = metaLevelAssumptionNode.getStatementNode(),
|
|
1832
|
-
statement = statementFromStatementNode(statementNode, context);
|
|
1833
|
-
|
|
1834
|
-
return statement;
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
1831
|
export function referenceFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context) {
|
|
1838
1832
|
const { Reference } = elements,
|
|
1839
1833
|
referenceNode = metaLevelAssumptionNode.getReferenceNode(),
|
|
@@ -1843,6 +1837,13 @@ export function referenceFromMetaLevelAssumptionNode(metaLevelAssumptionNode, co
|
|
|
1843
1837
|
return reference;
|
|
1844
1838
|
}
|
|
1845
1839
|
|
|
1840
|
+
export function statementFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context) {
|
|
1841
|
+
const statementNode = metaLevelAssumptionNode.getStatementNode(),
|
|
1842
|
+
statement = statementFromStatementNode(statementNode, context);
|
|
1843
|
+
|
|
1844
|
+
return statement;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1846
1847
|
export function suppositionsFromTopLevelAssertionNode(topLevelAsssertionNode, context) {
|
|
1847
1848
|
const suppositionNodes = topLevelAsssertionNode.getSuppositionNodes(),
|
|
1848
1849
|
suppositions = suppositionsFromSuppositionNodes(suppositionNodes, context);
|
package/src/utilities/string.js
CHANGED
|
@@ -131,6 +131,14 @@ export function termSubstitutionStringFromTermAndVariable(term, variable) {
|
|
|
131
131
|
return termSubstitutionString;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
export function assumptionStringFromReferenceAndStatement(reference, statement) {
|
|
135
|
+
const referenceString = reference.getString(),
|
|
136
|
+
statementString = statement.getString(),
|
|
137
|
+
assumptionString = `${referenceString} :: ${statementString}`;
|
|
138
|
+
|
|
139
|
+
return assumptionString;
|
|
140
|
+
}
|
|
141
|
+
|
|
134
142
|
export function rulsStringFromLabelsPremisesAndConclusion(labels, premises, conclusion) {
|
|
135
143
|
const conclusionString = conclusion.getString(),
|
|
136
144
|
premisesString = premisesStringFromPremises(premises),
|
|
@@ -170,7 +178,7 @@ export function frameSubstitutionStringFromFrameAndMetavariable(frame, metavaria
|
|
|
170
178
|
return string;
|
|
171
179
|
}
|
|
172
180
|
|
|
173
|
-
export function
|
|
181
|
+
export function metaLevelAssumptionStringFromReferenceAndStatement(reference, statement) {
|
|
174
182
|
const statementString = statement.getString(),
|
|
175
183
|
referneceString = reference.getString(),
|
|
176
184
|
metaLevelAssumptionString = `${referneceString} :: ${statementString}`;
|