occam-verify-cli 1.0.956 → 1.0.973

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.
Files changed (81) hide show
  1. package/lib/context/bounded.js +11 -7
  2. package/lib/context.js +17 -5
  3. package/lib/element/assertion/signature.js +17 -19
  4. package/lib/element/assertion/subproof.js +36 -39
  5. package/lib/element/assertion/type.js +20 -1
  6. package/lib/element/assumption/metaLevel.js +18 -17
  7. package/lib/element/assumption.js +52 -3
  8. package/lib/element/combinator.js +10 -12
  9. package/lib/element/conclusion.js +33 -33
  10. package/lib/element/constructor.js +7 -11
  11. package/lib/element/deduction.js +33 -33
  12. package/lib/element/equivalence.js +11 -7
  13. package/lib/element/hypothesis.js +45 -19
  14. package/lib/element/judgement.js +1 -1
  15. package/lib/element/label.js +9 -11
  16. package/lib/element/proofAssertion/premise.js +98 -87
  17. package/lib/element/proofAssertion/step.js +27 -27
  18. package/lib/element/proofAssertion/supposition.js +99 -88
  19. package/lib/element/proofAssertion.js +3 -3
  20. package/lib/element/reference.js +30 -38
  21. package/lib/element/signature.js +38 -47
  22. package/lib/element/statement.js +18 -58
  23. package/lib/element/substitution/frame.js +34 -42
  24. package/lib/element/substitution/reference.js +12 -13
  25. package/lib/element/substitution/statement.js +26 -31
  26. package/lib/element/substitution/term.js +32 -37
  27. package/lib/element/term.js +2 -2
  28. package/lib/element/topLevelAssertion/axiom.js +33 -34
  29. package/lib/element/topLevelAssertion.js +30 -7
  30. package/lib/element/topLevelMetaAssertion.js +2 -2
  31. package/lib/process/discharge.js +38 -0
  32. package/lib/process/unification.js +228 -0
  33. package/lib/process/unify.js +9 -5
  34. package/lib/process/validation.js +291 -0
  35. package/lib/utilities/context.js +69 -105
  36. package/lib/utilities/element.js +2 -4
  37. package/lib/utilities/string.js +4 -4
  38. package/package.json +1 -1
  39. package/src/context/bounded.js +19 -7
  40. package/src/context.js +26 -6
  41. package/src/element/assertion/signature.js +21 -26
  42. package/src/element/assertion/subproof.js +43 -45
  43. package/src/element/assertion/type.js +30 -1
  44. package/src/element/assumption/metaLevel.js +26 -22
  45. package/src/element/assumption.js +80 -2
  46. package/src/element/combinator.js +11 -14
  47. package/src/element/conclusion.js +38 -37
  48. package/src/element/constructor.js +8 -13
  49. package/src/element/deduction.js +38 -37
  50. package/src/element/equivalence.js +17 -13
  51. package/src/element/hypothesis.js +59 -19
  52. package/src/element/judgement.js +1 -1
  53. package/src/element/label.js +10 -12
  54. package/src/element/proofAssertion/premise.js +123 -107
  55. package/src/element/proofAssertion/step.js +29 -29
  56. package/src/element/proofAssertion/supposition.js +124 -108
  57. package/src/element/proofAssertion.js +2 -2
  58. package/src/element/reference.js +36 -47
  59. package/src/element/signature.js +42 -53
  60. package/src/element/statement.js +18 -89
  61. package/src/element/substitution/frame.js +45 -58
  62. package/src/element/substitution/reference.js +13 -16
  63. package/src/element/substitution/statement.js +27 -34
  64. package/src/element/substitution/term.js +37 -46
  65. package/src/element/term.js +1 -1
  66. package/src/element/topLevelAssertion/axiom.js +43 -45
  67. package/src/element/topLevelAssertion.js +42 -6
  68. package/src/element/topLevelMetaAssertion.js +2 -2
  69. package/src/process/discharge.js +33 -0
  70. package/src/{utilities → process}/unification.js +21 -27
  71. package/src/process/unify.js +9 -5
  72. package/src/{utilities → process}/validation.js +2 -2
  73. package/src/utilities/context.js +77 -128
  74. package/src/utilities/element.js +2 -5
  75. package/src/utilities/string.js +6 -6
  76. package/lib/context/ephemeral.js +0 -28
  77. package/lib/context/synoptic.js +0 -255
  78. package/lib/utilities/unification.js +0 -233
  79. package/lib/utilities/validation.js +0 -291
  80. package/src/context/ephemeral.js +0 -17
  81. package/src/context/synoptic.js +0 -361
@@ -1,361 +0,0 @@
1
- "use strict";
2
-
3
- import { arrayUtilities } from "necessary";
4
-
5
- import Context from "../context";
6
-
7
- import { compressTerms,
8
- compressFrames,
9
- compressProperties,
10
- compressEqualities,
11
- compressJudgements,
12
- compressAssertions,
13
- compressStatements,
14
- compressSignatures,
15
- compressReferences,
16
- compressAssumptions,
17
- compressMetavariables,
18
- compressSubstitutions,
19
- compressPropertyRelations,} from "../utilities/synoptic";
20
-
21
- const { first, last } = arrayUtilities;
22
-
23
- export default class SynopticContext extends Context {
24
- constructor(context, contexts) {
25
- super(context);
26
-
27
- this.contexts = contexts;
28
- }
29
-
30
- getContexts() {
31
- return this.contexts;
32
- }
33
-
34
- isStated() {
35
- const firstContext = first(this.contexts),
36
- context = firstContext, ///
37
- stated = context.isStated();
38
-
39
- return stated;
40
- }
41
-
42
- getTerms(terms = []) {
43
- this.contexts.forEach((context) => {
44
- context.getTerms(terms);
45
- });
46
-
47
- compressTerms(terms);
48
-
49
- return terms;
50
- }
51
-
52
- getFrames(frames = []) {
53
- this.contexts.forEach((context) => {
54
- context.getFrames(frames);
55
- });
56
-
57
- compressFrames(frames);
58
-
59
- return frames;
60
- }
61
-
62
- getProperties(properties = []) {
63
- this.contexts.forEach((context) => {
64
- context.getProperties(properties);
65
- });
66
-
67
- compressProperties(properties);
68
-
69
- return properties;
70
- }
71
-
72
- getEqualities(equalities = []) {
73
- this.contexts.forEach((context) => {
74
- context.getEqualities(equalities);
75
- });
76
-
77
- compressEqualities(equalities);
78
-
79
- return equalities;
80
- }
81
-
82
- getJudgements(judgements = []) {
83
- this.contexts.forEach((context) => {
84
- context.getJudgements(judgements);
85
- });
86
-
87
- compressJudgements(judgements);
88
-
89
- return judgements;
90
- }
91
-
92
- getAssertions(assertions = []) {
93
- this.contexts.forEach((context) => {
94
- context.getAssertions(assertions);
95
- });
96
-
97
- compressAssertions(assertions);
98
-
99
- return assertions;
100
- }
101
-
102
- getStatements(statements = []) {
103
- this.contexts.forEach((context) => {
104
- context.getStatements(statements);
105
- });
106
-
107
- compressStatements(statements);
108
-
109
- return statements;
110
- }
111
-
112
- getSignatures(signatures = []) {
113
- this.contexts.forEach((context) => {
114
- context.getSignatures(signatures);
115
- });
116
-
117
- compressSignatures(signatures);
118
-
119
- return signatures;
120
- }
121
-
122
- getReferences(references = []) {
123
- this.contexts.forEach((context) => {
124
- context.getReferences(references);
125
- });
126
-
127
- compressReferences(references);
128
-
129
- return references;
130
- }
131
-
132
- getAssumptions(assumptions = []) {
133
- this.contexts.forEach((context) => {
134
- context.getAssumptions(assumptions);
135
- });
136
-
137
- compressAssumptions(assumptions);
138
-
139
- return assumptions;
140
- }
141
-
142
- getMetavariables(metavariables = []) {
143
- this.contexts.forEach((context) => {
144
- context.getMetavariables(metavariables);
145
- });
146
-
147
- compressMetavariables(metavariables);
148
-
149
- return metavariables;
150
- }
151
-
152
- getSubstitutions(substitutions = []) {
153
- this.contexts.forEach((context) => {
154
- context.getSubstitutions(substitutions);
155
- });
156
-
157
- compressSubstitutions(substitutions);
158
-
159
- return substitutions;
160
- }
161
-
162
- getPropertyRelations(propertyRelations = []) {
163
- this.contexts.forEach((context) => {
164
- context.getPropertyRelations(propertyRelations);
165
- });
166
-
167
- compressPropertyRelations(propertyRelations);
168
-
169
- return propertyRelations;
170
- }
171
-
172
- findTermByTermNode(termNode) {
173
- const terms = this.getTerms(),
174
- term = terms.find((term) => {
175
- const termNodeMatches = term.matchTermNode(termNode);
176
-
177
- if (termNodeMatches) {
178
- return true;
179
- }
180
- }) || null;
181
-
182
- return term;
183
- }
184
-
185
- findFrameByFrameNode(frameNode) {
186
- const frames = this.getFrames(),
187
- frame = frames.find((frame) => {
188
- const frameNodeMatches = frame.matchFrameNode(frameNode);
189
-
190
- if (frameNodeMatches) {
191
- return true;
192
- }
193
- }) || null;
194
-
195
- return frame;
196
- }
197
-
198
- findPropertyByPropetyNode(propertyNode) {
199
- const propertys = this.getProperties(),
200
- property = propertys.find((property) => {
201
- const propertyNodeMatches = property.matchFrameNode(propertyNode);
202
-
203
- if (propertyNodeMatches) {
204
- return true;
205
- }
206
- }) || null;
207
-
208
- return property;
209
- }
210
-
211
- findEqualityByEqualityNode(equalityNode) {
212
- const equalities = this.getEqualities(),
213
- equality = equalities.find((equality) => {
214
- const equalityNodeMatches = equality.matchEqualityNode(equalityNode);
215
-
216
- if (equalityNodeMatches) {
217
- return true;
218
- }
219
- }) || null;
220
-
221
- return equality;
222
- }
223
-
224
- findJudgementByJudgementNode(judgementNode) {
225
- const judgements = this.getJudgements(),
226
- judgement = judgements.find((judgement) => {
227
- const judgementNodeMatches = judgement.matchJudgementNode(judgementNode);
228
-
229
- if (judgementNodeMatches) {
230
- return true;
231
- }
232
- }) || null;
233
-
234
- return judgement;
235
- }
236
-
237
- findAssertionByAssertionNode(assertionNode) {
238
- const assertions = this.getAssertions(),
239
- assertion = assertions.find((assertion) => {
240
- const assertionNodeMatches = assertion.matchAssertionNode(assertionNode);
241
-
242
- if (assertionNodeMatches) {
243
- return true;
244
- }
245
- }) || null;
246
-
247
- return assertion;
248
- }
249
-
250
- findStatementByStatementNode(statementNode) {
251
- const statements = this.getStatements(),
252
- statement = statements.find((statement) => {
253
- const statementNodeMatches = statement.matchStatementNode(statementNode);
254
-
255
- if (statementNodeMatches) {
256
- return true;
257
- }
258
- }) || null;
259
-
260
- return statement;
261
- }
262
-
263
- findSignatureBySignatureNode(signatureNode) {
264
- const signatures = this.getSignatures(),
265
- signature = signatures.find((signature) => {
266
- const signatureNodeMatches = signature.matchSignatureNode(signatureNode);
267
-
268
- if (signatureNodeMatches) {
269
- return true;
270
- }
271
- }) || null;
272
-
273
- return signature;
274
- }
275
-
276
- findReferenceByReferenceNode(referenceNode) {
277
- const references = this.getReferences(),
278
- reference = references.find((reference) => {
279
- const referenceMatcheReferenceNode = reference.matchReferenceNode(referenceNode);
280
-
281
- if (referenceMatcheReferenceNode) {
282
- return true;
283
- }
284
- }) || null;
285
-
286
- return reference;
287
- }
288
-
289
- findAssumptionByAssumptionNode(assumptionNode) {
290
- const assumptions = this.getAssumptions(),
291
- assumption = assumptions.find((assumption) => {
292
- const assumptionNodeMatches = assumption.matchAssumptionNode(assumptionNode);
293
-
294
- if (assumptionNodeMatches) {
295
- return true;
296
- }
297
- }) || null;
298
-
299
- return assumption;
300
- }
301
-
302
- findReferenceByMetavariableNode(metavariableNode) {
303
- const references = this.getReferences(),
304
- reference = references.find((reference) => {
305
- const referenceMatcheMetavariableNode = reference.matchMetavariableNode(metavariableNode);
306
-
307
- if (referenceMatcheMetavariableNode) {
308
- return true;
309
- }
310
- }) || null;
311
-
312
- return reference;
313
- }
314
-
315
- findMetavariableByMetavariableNode(metavariableNode) {
316
- const metavariables = this.getMetavariables(),
317
- metavariable = metavariables.find((metavariable) => {
318
- const metavariableNodeMatches = metavariable.matchMetavariableNode(metavariableNode);
319
-
320
- if (metavariableNodeMatches) {
321
- return true;
322
- }
323
- }) || null;
324
-
325
- return metavariable;
326
- }
327
-
328
- findSubstitutionBySubstitutionNode(substitutionNode) {
329
- const substitutions = this.getSubstitutions(),
330
- substitution = substitutions.find((substitution) => {
331
- const substitutionNodeMatches = substitution.matchSubstitutionNode(substitutionNode);
332
-
333
- if (substitutionNodeMatches) {
334
- return true;
335
- }
336
- }) || null;
337
-
338
- return substitution;
339
- }
340
-
341
- findPropertyRelationByPropertyRelationNode(propertyRelationNode) {
342
- const propertyRelations = this.getPropertyRelations(),
343
- propertyRelation = propertyRelations.find((propertyRelation) => {
344
- const propertyRelationNodeMatches = propertyRelation.matchPropertyRelationNode(propertyRelationNode);
345
-
346
- if (propertyRelationNodeMatches) {
347
- return true;
348
- }
349
- }) || null;
350
-
351
- return propertyRelation;
352
- }
353
-
354
- static fromContexts(contexts) {
355
- const lastContext = last(contexts),
356
- context = lastContext, ///
357
- synopticContext = new SynopticContext(context, contexts);
358
-
359
- return synopticContext;
360
- }
361
- }