occam-verify-cli 1.0.768 → 1.0.781

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 (108) hide show
  1. package/lib/context/file/nominal.js +11 -11
  2. package/lib/context/illative.js +28 -0
  3. package/lib/context/nested.js +31 -0
  4. package/lib/context/proof.js +242 -0
  5. package/lib/context/thetic.js +28 -0
  6. package/lib/context.js +19 -21
  7. package/lib/element/assertion/contained.js +32 -24
  8. package/lib/element/assertion/defined.js +47 -40
  9. package/lib/element/assertion/property.js +18 -13
  10. package/lib/element/assertion/satisfies.js +12 -9
  11. package/lib/element/assertion/subproof.js +28 -26
  12. package/lib/element/assertion/type.js +14 -12
  13. package/lib/element/assumption.js +40 -50
  14. package/lib/element/combinator/bracketed.js +3 -3
  15. package/lib/element/combinator.js +20 -20
  16. package/lib/element/conclusion.js +33 -29
  17. package/lib/element/constructor.js +19 -18
  18. package/lib/element/deduction.js +33 -29
  19. package/lib/element/equality.js +13 -15
  20. package/lib/element/equivalence.js +59 -52
  21. package/lib/element/equivalences.js +4 -2
  22. package/lib/element/frame.js +74 -53
  23. package/lib/element/hypothesis.js +7 -5
  24. package/lib/element/judgement.js +41 -74
  25. package/lib/element/label.js +22 -22
  26. package/lib/element/metavariable.js +31 -11
  27. package/lib/element/proofAssertion/premise.js +48 -35
  28. package/lib/element/proofAssertion/step.js +77 -22
  29. package/lib/element/proofAssertion/supposition.js +48 -34
  30. package/lib/element/proofAssertion.js +1 -14
  31. package/lib/element/reference.js +80 -53
  32. package/lib/element/signature.js +44 -3
  33. package/lib/element/statement.js +28 -29
  34. package/lib/element/subproof.js +2 -2
  35. package/lib/element/substitution/frame.js +24 -19
  36. package/lib/element/substitution/metaLevel.js +31 -27
  37. package/lib/element/substitution/reference.js +11 -10
  38. package/lib/element/substitution/statement.js +30 -23
  39. package/lib/element/substitution/term.js +11 -10
  40. package/lib/element/term.js +24 -20
  41. package/lib/element/topLevelMetaAssertion.js +2 -2
  42. package/lib/element/variable.js +6 -2
  43. package/lib/process/assign.js +10 -4
  44. package/lib/process/unify.js +8 -8
  45. package/lib/process/validate.js +10 -8
  46. package/lib/utilities/context.js +68 -23
  47. package/lib/utilities/element.js +55 -27
  48. package/lib/utilities/json.js +8 -8
  49. package/lib/utilities/string.js +12 -1
  50. package/lib/utilities/unification.js +14 -12
  51. package/lib/utilities/validation.js +55 -40
  52. package/package.json +4 -4
  53. package/src/context/file/nominal.js +14 -16
  54. package/src/context/illative.js +17 -0
  55. package/src/context/nested.js +21 -0
  56. package/src/context/{scoped.js → proof.js} +65 -51
  57. package/src/context/thetic.js +17 -0
  58. package/src/context.js +30 -36
  59. package/src/element/assertion/contained.js +44 -31
  60. package/src/element/assertion/defined.js +55 -46
  61. package/src/element/assertion/property.js +23 -15
  62. package/src/element/assertion/satisfies.js +15 -10
  63. package/src/element/assertion/subproof.js +34 -31
  64. package/src/element/assertion/type.js +18 -13
  65. package/src/element/assumption.js +40 -69
  66. package/src/element/combinator/bracketed.js +2 -2
  67. package/src/element/combinator.js +23 -29
  68. package/src/element/conclusion.js +37 -40
  69. package/src/element/constructor.js +29 -34
  70. package/src/element/deduction.js +36 -39
  71. package/src/element/equality.js +16 -18
  72. package/src/element/equivalence.js +76 -67
  73. package/src/element/equivalences.js +5 -2
  74. package/src/element/frame.js +96 -65
  75. package/src/element/hypothesis.js +7 -6
  76. package/src/element/judgement.js +45 -45
  77. package/src/element/label.js +25 -31
  78. package/src/element/metavariable.js +48 -21
  79. package/src/element/proofAssertion/premise.js +63 -49
  80. package/src/element/proofAssertion/step.js +47 -26
  81. package/src/element/proofAssertion/supposition.js +64 -50
  82. package/src/element/proofAssertion.js +0 -22
  83. package/src/element/reference.js +119 -80
  84. package/src/element/signature.js +5 -2
  85. package/src/element/statement.js +30 -35
  86. package/src/element/subproof.js +1 -1
  87. package/src/element/substitution/frame.js +27 -26
  88. package/src/element/substitution/metaLevel.js +38 -42
  89. package/src/element/substitution/reference.js +13 -14
  90. package/src/element/substitution/statement.js +35 -33
  91. package/src/element/substitution/term.js +13 -14
  92. package/src/element/term.js +42 -34
  93. package/src/element/topLevelMetaAssertion.js +1 -1
  94. package/src/element/variable.js +8 -1
  95. package/src/process/assign.js +9 -3
  96. package/src/process/unify.js +7 -7
  97. package/src/process/validate.js +9 -8
  98. package/src/utilities/context.js +82 -31
  99. package/src/utilities/element.js +68 -31
  100. package/src/utilities/json.js +13 -13
  101. package/src/utilities/string.js +16 -2
  102. package/src/utilities/unification.js +18 -16
  103. package/src/utilities/validation.js +73 -53
  104. package/lib/context/scoped.js +0 -232
  105. package/lib/utilities/statement.js +0 -78
  106. package/lib/utilities/term.js +0 -17
  107. package/src/utilities/statement.js +0 -74
  108. package/src/utilities/term.js +0 -10
@@ -6,6 +6,7 @@ import { define } from "../elements";
6
6
  import { instantiate } from "../utilities/context";
7
7
  import { equateTerms } from "../process/equate";
8
8
  import { instantiateEquality } from "../process/instantiate";
9
+ import { equalityFromStatementNode } from "../utilities/element";
9
10
  import { equalityAssignmentFromEquality, leftVariableAssignmentFromEquality, rightVariableAssignmentFromEquality } from "../process/assign";
10
11
 
11
12
  export default define(class Equality extends Element {
@@ -115,7 +116,7 @@ export default define(class Equality extends Element {
115
116
  return validEquality;
116
117
  }
117
118
 
118
- validate(stated, context) {
119
+ validate(context) {
119
120
  let equality = null;
120
121
 
121
122
  const equalityString = this.getString(); ///
@@ -134,6 +135,8 @@ export default define(class Equality extends Element {
134
135
  const termsValidate = this.validateTerms(context);
135
136
 
136
137
  if (termsValidate) {
138
+ const stated = context.isStated();
139
+
137
140
  let validatesWhenStated = false,
138
141
  validatesWhenDerived = false;
139
142
 
@@ -151,7 +154,7 @@ export default define(class Equality extends Element {
151
154
  if (validates) {
152
155
  equality = this; ///
153
156
 
154
- this.assign(stated, context);
157
+ this.assign(context);
155
158
 
156
159
  context.addEquality(equality);
157
160
 
@@ -243,29 +246,17 @@ export default define(class Equality extends Element {
243
246
  return validatesWhenDerived;
244
247
  }
245
248
 
246
- assign(stated, context) {
249
+ assign(context) {
247
250
  const equality = this, ///
248
251
  equalityAssignment = equalityAssignmentFromEquality(equality, context),
249
252
  leftVariableAssignment = leftVariableAssignmentFromEquality(equality, context),
250
253
  rightVariableAssignment = rightVariableAssignmentFromEquality(equality, context);
251
254
 
252
- let assignment;
253
-
254
- assignment = equalityAssignment; ///
255
-
256
- context.addAssignment(assignment);
257
-
258
- if (leftVariableAssignment !== null) {
259
- assignment = leftVariableAssignment; ///
260
-
261
- context.addAssignment(assignment);
262
- }
255
+ context.addAssignment(equalityAssignment);
263
256
 
264
- if (rightVariableAssignment !== null) {
265
- assignment = rightVariableAssignment; ///
257
+ context.addAssignment(leftVariableAssignment);
266
258
 
267
- context.addAssignment(assignment);
268
- }
259
+ context.addAssignment(rightVariableAssignment);
269
260
  }
270
261
 
271
262
  static name = "Equality";
@@ -294,6 +285,13 @@ export default define(class Equality extends Element {
294
285
  return equality;
295
286
  }, context);
296
287
  }
288
+
289
+ static fromStatement(statement, context) {
290
+ const statementNode = statement.getNode(),
291
+ equality = equalityFromStatementNode(statementNode, context);
292
+
293
+ return equality;
294
+ }
297
295
  });
298
296
 
299
297
  function leftTermFromEqualityNode(equalityNode, context) {
@@ -4,25 +4,38 @@ import { Element } from "occam-languages";
4
4
  import { arrayUtilities } from "necessary";
5
5
 
6
6
  import { define } from "../elements";
7
+ import { instantiate } from "../utilities/context";
7
8
  import { instantiateEquivalence } from "../process/instantiate";
8
9
  import { stripBracketsFromTermNode } from "../utilities/brackets";
9
10
  import { equivalenceStringFromTerms } from "../utilities/string";
10
11
  import { equivalenceFromEquivalenceNode } from "../utilities/element";
11
- import { instantiate, sanitisedContextFromContext } from "../utilities/context";
12
12
 
13
13
  const { compress } = arrayUtilities;
14
14
 
15
15
  export default define(class Equivalence extends Element {
16
- constructor(context, string, node, terms) {
16
+ constructor(context, string, node, type, terms) {
17
17
  super(context, string, node);
18
18
 
19
+ this.type = type;
19
20
  this.terms = terms;
20
21
  }
21
22
 
23
+ getType() {
24
+ return this.type;
25
+ }
26
+
22
27
  getTerms() {
23
28
  return this.terms;
24
29
  }
25
30
 
31
+ setType(type) {
32
+ this.type = type;
33
+ }
34
+
35
+ setTerms(terms) {
36
+ this.terms = terms;
37
+ }
38
+
26
39
  getEquivalenceNode() {
27
40
  const node = this.getNode(),
28
41
  equivalenceNode = node; ///
@@ -30,26 +43,6 @@ export default define(class Equivalence extends Element {
30
43
  return equivalenceNode;
31
44
  }
32
45
 
33
- getType() {
34
- const type = this.terms.reduce((type, term) => {
35
- const termType = term.getType();
36
-
37
- if (type === null) {
38
- type = termType; ///
39
- } else {
40
- const termTypeSubTypeOfType = termType.isSubTypeOf(type);
41
-
42
- if (termTypeSubTypeOfType) {
43
- type = termType; ///
44
- }
45
- }
46
-
47
- return type;
48
- }, null);
49
-
50
- return type;
51
- }
52
-
53
46
  getGroundedTerms(definedVariables, groundedTerms, context) {
54
47
  this.terms.forEach((term) => {
55
48
  const termGrounded = term.isGrounded(definedVariables, context);
@@ -133,20 +126,6 @@ export default define(class Equivalence extends Element {
133
126
  return implicitlyGrounded;
134
127
  }
135
128
 
136
- compareTerm(term) {
137
- const termA = term, ///
138
- comparesToTerm = this.someTerm((term) => {
139
- const termB = term, ///
140
- termAEqualToTermB = termA.isEqualTo(termB);
141
-
142
- if (termAEqualToTermB) {
143
- return true;
144
- }
145
- });
146
-
147
- return comparesToTerm;
148
- }
149
-
150
129
  matchTermNode(termNode) {
151
130
  termNode = stripBracketsFromTermNode(termNode); ///
152
131
 
@@ -173,36 +152,31 @@ export default define(class Equivalence extends Element {
173
152
  return termNodesMatch;
174
153
  }
175
154
 
176
- matchVariableNode(variableNode) {
177
- const variableNodeA = variableNode, ///
178
- variableNodeMatches = this.someTerm((term) => {
179
- const termNode = term.getNode(),
180
- singularVariableNode = termNode.getSingularVariableNode();
155
+ someTerm(callback) { return this.terms.some(callback); }
181
156
 
182
- if (singularVariableNode !== null) {
183
- const variableNodeB = singularVariableNode, ///
184
- variableNodeAMatchesVariableNodeB = variableNodeA.match(variableNodeB);
157
+ everyTerm(callback) { return this.terms.every(callback); }
158
+
159
+ compareTerm(term) {
160
+ const termA = term, ///
161
+ comparesToTerm = this.someTerm((term) => {
162
+ const termB = term, ///
163
+ termAComparesToTermB = termA.compareTerm(termB);
185
164
 
186
- if (variableNodeAMatchesVariableNodeB) {
187
- return true;
188
- }
165
+ if (termAComparesToTermB) {
166
+ return true;
189
167
  }
190
168
  });
191
169
 
192
- return variableNodeMatches;
170
+ return comparesToTerm;
193
171
  }
194
172
 
195
- someTerm(callback) { return this.terms.some(callback); }
196
-
197
- everyTerm(callback) { return this.terms.every(callback); }
198
-
199
173
  someOtherTerm(term, callback) {
200
174
  const termA = term, ///
201
175
  terms = this.terms.filter((term) => {
202
176
  const termB = term, ///
203
- termAEqualToTermB = termA.isEqualTo(termB);
177
+ termAComparesToTermB = termA.compareTerm(termB);
204
178
 
205
- if (!termAEqualToTermB) {
179
+ if (!termAComparesToTermB) {
206
180
  return true;
207
181
  }
208
182
  }),
@@ -218,9 +192,9 @@ export default define(class Equivalence extends Element {
218
192
  ];
219
193
 
220
194
  compress(combinedTerms, (combinedTermA, combinedTermB) => {
221
- const combinedTermAEqualToCombinedTermB = combinedTermA.isEqualTo(combinedTermB);
195
+ const combinedTermAComparesToCombinedTermB = combinedTermA.compareTerm(combinedTermB);
222
196
 
223
- if (!combinedTermAEqualToCombinedTermB) {
197
+ if (!combinedTermAComparesToCombinedTermB) {
224
198
  return true;
225
199
  }
226
200
  });
@@ -229,35 +203,70 @@ export default define(class Equivalence extends Element {
229
203
  }
230
204
 
231
205
  mergedWith(equivalence, context) {
232
- const terms = equivalence.getTerms(),
206
+ let type;
207
+
208
+ type = equivalence.getType();
209
+
210
+ const types = [
211
+ this.type,
212
+ type
213
+ ],
214
+ terms = equivalence.getTerms(),
215
+ combinedType = combinedTypeFromTypes(types),
233
216
  combinedTerms = this.combineTerms(terms);
234
217
 
235
- return instantiate((context) => {
218
+ type = combinedType; ///
219
+
220
+ instantiate((context) => {
236
221
  const terms = combinedTerms, ///
237
222
  equivalenceString = equivalenceStringFromTerms(terms),
238
223
  string = equivalenceString, ///
239
- equivalenceNode = instantiateEquivalence(string, context),
240
- equivalence = equivalenceFromEquivalenceNode(equivalenceNode, context);
224
+ equivalenceNode = instantiateEquivalence(string, context);
241
225
 
242
- return equivalence;
226
+ equivalence = equivalenceFromEquivalenceNode(equivalenceNode, context);
243
227
  }, context);
228
+
229
+ equivalence.setType(type);
230
+
231
+ return equivalence;
244
232
  }
245
233
 
246
234
  static name = "Equivalence";
247
235
 
248
236
  static fromEquality(equality, context) {
249
- const santisedContext = sanitisedContextFromContext(context);
237
+ let equivalence;
250
238
 
251
- context = santisedContext; ///
239
+ const type = equality.getType();
252
240
 
253
- return instantiate((context) => {
241
+ instantiate((context) => {
254
242
  const terms = equality.getTerms(),
255
243
  equivalenceString = equivalenceStringFromTerms(terms),
256
244
  string = equivalenceString, ///
257
- equivalenceNode = instantiateEquivalence(string, context),
258
- equivalence = equivalenceFromEquivalenceNode(equivalenceNode, context);
245
+ equivalenceNode = instantiateEquivalence(string, context);
259
246
 
260
- return equivalence;
247
+ equivalence = equivalenceFromEquivalenceNode(equivalenceNode, context);
261
248
  }, context);
249
+
250
+ equivalence.setType(type);
251
+
252
+ return equivalence;
262
253
  }
263
254
  });
255
+
256
+ function combinedTypeFromTypes(types) {
257
+ const combinedType = types.reduce((combinedType, type) => {
258
+ if (combinedType === null) {
259
+ combinedType = type; ///
260
+ } else {
261
+ const typeSubTypeOfCombinedType = type.isSubTypeOf(combinedType);
262
+
263
+ if (typeSubTypeOfCombinedType) {
264
+ combinedType = type; ///
265
+ }
266
+ }
267
+
268
+ return combinedType;
269
+ }, null);
270
+
271
+ return combinedType;
272
+ }
@@ -203,8 +203,11 @@ export default define(class Equivalences extends Element {
203
203
  static fromNothing(context) {
204
204
  const string = EMPTY_STRING,
205
205
  node = null,
206
- array = [],
207
- equivalences = new Equivalences(context, string, node, array);
206
+ array = [];
207
+
208
+ context = null;
209
+
210
+ const equivalences = new Equivalences(context, string, node, array);
208
211
 
209
212
  return equivalences;
210
213
  }
@@ -3,11 +3,11 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { instantiate } from "../utilities/context";
7
6
  import { instantiateFrame } from "../process/instantiate";
8
7
  import { FRAME_META_TYPE_NAME } from "../metaTypeNames";
9
8
  import { metavariableFromFrameNode } from "../utilities/element";
10
- import { assumptionsStringFromAssumptions } from "../utilities/string";
9
+ import { descend, reconcile, instantiate } from "../utilities/context";
10
+ import { assumptionsStringFromAssumptions, metaLevelSubstitutionsStringFromMetaLevelSubstitutions } from "../utilities/string";
11
11
 
12
12
  export default define(class Frame extends Element {
13
13
  constructor(context, string, node, assumptions, metavariable) {
@@ -46,22 +46,6 @@ export default define(class Frame extends Element {
46
46
  return metavariableName;
47
47
  }
48
48
 
49
- matchFrameNode(frameNode) {
50
- const node = frameNode, ///
51
- nodeMatches = this.matchNode(node),
52
- frameNodeMatches = nodeMatches; ///
53
-
54
- return frameNodeMatches;
55
- }
56
-
57
- findValidFrame(context) {
58
- const frameNode = this.getFrameNode(),
59
- frame = context.findFrameByFrameNode(frameNode),
60
- validFrame = frame; ///
61
-
62
- return validFrame;
63
- }
64
-
65
49
  isEqualTo(frame) {
66
50
  const frameNode = frame.getNode(),
67
51
  frameNodeMatches = this.matchFrameNode(frameNode),
@@ -77,6 +61,26 @@ export default define(class Frame extends Element {
77
61
  return singular;
78
62
  }
79
63
 
64
+ matchFrameNode(frameNode) {
65
+ const node = frameNode, ///
66
+ nodeMatches = this.matchNode(node),
67
+ frameNodeMatches = nodeMatches; ///
68
+
69
+ return frameNodeMatches;
70
+ }
71
+
72
+ matchMetavariableNode(metavariableNode) {
73
+ let metavariableNodeMatches = false;
74
+
75
+ const singular = this.isSingular();
76
+
77
+ if (singular) {
78
+ metavariableNodeMatches = this.metavariable.matchMetavariableNode(metavariableNode);
79
+ }
80
+
81
+ return metavariableNodeMatches;
82
+ }
83
+
80
84
  compareParameter(parameter) {
81
85
  let comparesToParamter = false;
82
86
 
@@ -97,73 +101,83 @@ export default define(class Frame extends Element {
97
101
  return comparesToParamter;
98
102
  }
99
103
 
100
- compareSubstitution(substitution, context) {
101
- let comparesToSubstitution = false;
104
+ compareMetavariableName(metavariableName) {
105
+ let comparesToMetavariableName = false;
102
106
 
103
- const frameString = this.getString(), ///
104
- substitutionString = substitution.getString();
107
+ const singular = this.isSingular();
105
108
 
106
- context.trace(`Comparing the '${frameString}' frame to the '${substitutionString}' substitution...`);
109
+ if (singular) {
110
+ const metavariableNameA = metavariableName ///
107
111
 
108
- if (!comparesToSubstitution) {
109
- comparesToSubstitution = this.assumptions.some((assumption) => {
110
- const assumptionComparesToSubstitution = assumption.compareSubstitution(substitution, context);
112
+ metavariableName = this.getMetavariableName();
111
113
 
112
- if (assumptionComparesToSubstitution) {
113
- return true;
114
- }
115
- });
116
- }
114
+ const metavariableNameB = metavariableName; ///
117
115
 
118
- if (comparesToSubstitution) {
119
- context.debug(`...compared the the '${frameString}' frame to the '${substitutionString}' substitutions.`);
116
+ comparesToMetavariableName = (metavariableNameA === metavariableNameB);
120
117
  }
121
118
 
122
- return comparesToSubstitution;
119
+ return comparesToMetavariableName;
123
120
  }
124
121
 
125
- compareSubstitutions(substitutions, context) {
126
- let comparesToSubstitutions;
122
+ compareMetaLevelSubstitution(metaLevelSubstitution, context) {
123
+ let comparesToMetaLevelSubstitution;
127
124
 
128
125
  const frameString = this.getString(), ///
129
- substitutionsString = substitutions.asString();
126
+ metaLevelSubstitutionString = metaLevelSubstitution.getString();
127
+
128
+ context.trace(`Comparing the '${frameString}' frame to the '${metaLevelSubstitutionString}' meta-level substitution...`);
130
129
 
131
- context.trace(`Comparing the '${frameString}' frame to the '${substitutionsString}' substitutions...`);
130
+ const metavariableNode = this.metavariable.getNode(),
131
+ judgements = context.findJudgementsByMetavariableNode(metavariableNode),
132
+ assumptions = assumptionsFromJudgements(judgements);
132
133
 
133
- comparesToSubstitutions = substitutions.every((substitution) => {
134
- const compaaresToSubstitution = this.compareSubstitution(substitution, context);
134
+ comparesToMetaLevelSubstitution = assumptions.some((assumption) => {
135
+ const assumptionComparesToSubstitution = assumption.compareMetaLevelSubstitution(metaLevelSubstitution, context);
135
136
 
136
- if (compaaresToSubstitution) {
137
+ if (assumptionComparesToSubstitution) {
137
138
  return true;
138
139
  }
139
140
  });
140
141
 
141
- if (comparesToSubstitutions) {
142
- context.debug(`...compared the '${frameString}' frame to the '${substitutionsString}' substitutions.`);
142
+ if (comparesToMetaLevelSubstitution) {
143
+ context.debug(`...compared the '${frameString}' frame to the '${metaLevelSubstitutionString}' meta-level substitution.`);
143
144
  }
144
145
 
145
- return comparesToSubstitutions;
146
+ return comparesToMetaLevelSubstitution;
146
147
  }
147
148
 
148
- compareMetavariableName(metavariableName) {
149
- let comparesToMetavariableName = false;
149
+ compareMetaLevelSubstitutions(metaLevelSubstitutions, context) {
150
+ let comparesToMetaLevelSubstitutions;
150
151
 
151
- const singular = this.isSingular();
152
+ const frameString = this.getString(), ///
153
+ metaLevelSubstitutionsString = metaLevelSubstitutionsStringFromMetaLevelSubstitutions(metaLevelSubstitutions);
152
154
 
153
- if (singular) {
154
- const metavariableNameA = metavariableName ///
155
+ context.trace(`Comparing the '${frameString}' frame to the '${metaLevelSubstitutionsString}' meta-level substitution...`);
155
156
 
156
- metavariableName = this.getMetavariableName();
157
+ comparesToMetaLevelSubstitutions = metaLevelSubstitutions.every((metaLevelSubstitution) => {
158
+ const compaaresToMetaLevelSubstitution = this.compareMetaLevelSubstitution(metaLevelSubstitution, context);
157
159
 
158
- const metavariableNameB = metavariableName; ///
160
+ if (compaaresToMetaLevelSubstitution) {
161
+ return true;
162
+ }
163
+ });
159
164
 
160
- comparesToMetavariableName = (metavariableNameA === metavariableNameB);
165
+ if (comparesToMetaLevelSubstitutions) {
166
+ context.debug(`...compared the '${frameString}' frame to the '${metaLevelSubstitutionsString}' metaLevelSubstitutions.`);
161
167
  }
162
168
 
163
- return comparesToMetavariableName;
169
+ return comparesToMetaLevelSubstitutions;
164
170
  }
165
171
 
166
- validate(stated, context) {
172
+ findValidFrame(context) {
173
+ const frameNode = this.getFrameNode(),
174
+ frame = context.findFrameByFrameNode(frameNode),
175
+ validFrame = frame; ///
176
+
177
+ return validFrame;
178
+ }
179
+
180
+ validate(context) {
167
181
  let frame = null;
168
182
 
169
183
  const frameString = this.getString(); ///
@@ -180,12 +194,14 @@ export default define(class Frame extends Element {
180
194
  } else {
181
195
  let validates = false;
182
196
 
183
- const metavariableValidates = this.validatMetavariable(stated, context);
197
+ const metavariableValidates = this.validatMetavariable(context);
184
198
 
185
199
  if (metavariableValidates) {
186
- const assumptionsValidate = this.validateAssumptions(stated, context);
200
+ const assumptionsValidate = this.validateAssumptions(context);
187
201
 
188
202
  if (assumptionsValidate) {
203
+ const stated = context.isStated();
204
+
189
205
  let validatesWhenStated = false,
190
206
  validatesWhenDerived = false;
191
207
 
@@ -251,17 +267,25 @@ export default define(class Frame extends Element {
251
267
  return validatesWhenDerived;
252
268
  }
253
269
 
254
- validateAssumption(assumption, context) {
255
- let assumptionValidates;
270
+ validateAssumption(assumption, assumptions, context) {
271
+ let assumptionValidates = false;
256
272
 
257
273
  const frameString = this.getString(), ///
258
274
  assumptionstring = assumption.getString();
259
275
 
260
276
  context.trace(`Validating the '${frameString}' frame's '${assumptionstring}' assumption.`);
261
277
 
262
- const stated = true; ///
278
+ reconcile((context) => {
279
+ descend((context) => {
280
+ assumption = assumption.validate(context); ///
263
281
 
264
- assumptionValidates = assumption.validate(stated, context);
282
+ if (assumption !== null) {
283
+ assumptions.push(assumption);
284
+
285
+ assumptionValidates = true;
286
+ }
287
+ }, context);
288
+ }, context);
265
289
 
266
290
  if (assumptionValidates) {
267
291
  context.debug(`...validated the '${frameString}' frame's '${assumptionstring}' assumption.`);
@@ -270,7 +294,7 @@ export default define(class Frame extends Element {
270
294
  return assumptionValidates;
271
295
  }
272
296
 
273
- validateAssumptions(stated, context) {
297
+ validateAssumptions(context) {
274
298
  let assumptionsValidate;
275
299
 
276
300
  const singular = this.isSingular();
@@ -284,11 +308,9 @@ export default define(class Frame extends Element {
284
308
  const assumptions = [];
285
309
 
286
310
  assumptionsValidate = this.assumptions.every((assumption) => {
287
- const assumptionValidates = this.validateAssumption(assumption, context);
311
+ const assumptionValidates = this.validateAssumption(assumption, assumptions, context);
288
312
 
289
313
  if (assumptionValidates) {
290
- assumptions.push(assumption);
291
-
292
314
  return true;
293
315
  }
294
316
  });
@@ -305,7 +327,7 @@ export default define(class Frame extends Element {
305
327
  return assumptionsValidate;
306
328
  }
307
329
 
308
- validatMetavariable(stated, context) {
330
+ validatMetavariable(context) {
309
331
  let metavariableValidates = false;
310
332
 
311
333
  const singular = this.isSingular();
@@ -370,3 +392,12 @@ function assumptionsFromFrameNode(frameNode, context) {
370
392
  return assumptions;
371
393
  }
372
394
 
395
+ function assumptionsFromJudgements(judgements) {
396
+ const assumptions = judgements.map((judgement) => {
397
+ const assumption = judgement.getAssumption();
398
+
399
+ return assumption;
400
+ });
401
+
402
+ return assumptions;
403
+ }
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import {instantiate} from "../utilities/context";
6
+ import {descend, instantiate} from "../utilities/context";
7
7
  import { instantiateHypothesis } from "../process/instantiate";
8
8
  import { statementFromHypothesisNode } from "../utilities/element";
9
9
 
@@ -61,12 +61,13 @@ export default define(class Hypothesis extends Element {
61
61
  } else if (this.statement !== null) {
62
62
  let statementValidates = false;
63
63
 
64
- const stated = true,
65
- statement = this.statement.validate(stated, context);
64
+ descend((context) => {
65
+ const statement = this.statement.validate(context);
66
66
 
67
- if (statement !== null) {
68
- statementValidates = true;
69
- }
67
+ if (statement !== null) {
68
+ statementValidates = true;
69
+ }
70
+ }, context);
70
71
 
71
72
  if (statementValidates) {
72
73
  const subproofOrProofAssertion = this; ///