occam-verify-cli 1.0.746 → 1.0.753

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 (111) hide show
  1. package/lib/context/branching.js +56 -0
  2. package/lib/context/ephemeral.js +10 -1
  3. package/lib/context/file/nominal.js +1 -6
  4. package/lib/context/synthetic.js +3 -3
  5. package/lib/context.js +9 -1
  6. package/lib/element/assertion/contained.js +7 -7
  7. package/lib/element/assertion/defined.js +7 -7
  8. package/lib/element/assertion/property.js +3 -3
  9. package/lib/element/assertion/satisfies.js +2 -2
  10. package/lib/element/assertion/subproof.js +2 -2
  11. package/lib/element/assertion/type.js +7 -7
  12. package/lib/element/assumption.js +2 -2
  13. package/lib/element/combinator.js +4 -4
  14. package/lib/element/conclusion.js +3 -3
  15. package/lib/element/constructor/bracketed.js +9 -8
  16. package/lib/element/constructor.js +9 -5
  17. package/lib/element/deduction.js +3 -3
  18. package/lib/element/equality.js +12 -11
  19. package/lib/element/equivalence.js +3 -3
  20. package/lib/element/frame.js +2 -2
  21. package/lib/element/hypothesis.js +2 -2
  22. package/lib/element/judgement.js +2 -2
  23. package/lib/element/label.js +4 -4
  24. package/lib/element/metavariable.js +59 -25
  25. package/lib/element/parameter.js +2 -2
  26. package/lib/element/procedureCall.js +2 -2
  27. package/lib/element/procedureReference.js +2 -2
  28. package/lib/element/proof.js +2 -2
  29. package/lib/element/proofAssertion/premise.js +5 -5
  30. package/lib/element/proofAssertion/step.js +3 -3
  31. package/lib/element/proofAssertion/supposition.js +5 -5
  32. package/lib/element/property.js +2 -2
  33. package/lib/element/propertyRelation.js +3 -3
  34. package/lib/element/reference.js +2 -2
  35. package/lib/element/rule.js +2 -2
  36. package/lib/element/signature.js +3 -3
  37. package/lib/element/statement.js +2 -2
  38. package/lib/element/subproof.js +2 -2
  39. package/lib/element/substitution/frame.js +8 -8
  40. package/lib/element/substitution/metaLevel.js +7 -7
  41. package/lib/element/substitution/reference.js +7 -7
  42. package/lib/element/substitution/statement.js +17 -21
  43. package/lib/element/substitution/term.js +10 -10
  44. package/lib/element/term.js +17 -14
  45. package/lib/element/topLevelAssertion.js +2 -2
  46. package/lib/element/topLevelMetaAssertion.js +2 -2
  47. package/lib/element/type.js +2 -2
  48. package/lib/element/typePrefix.js +2 -2
  49. package/lib/element/variable.js +4 -3
  50. package/lib/process/unify.js +11 -7
  51. package/lib/process/validate.js +5 -5
  52. package/lib/utilities/context.js +28 -20
  53. package/lib/utilities/element.js +2 -2
  54. package/lib/utilities/instance.js +3 -3
  55. package/lib/utilities/validation.js +13 -5
  56. package/package.json +1 -1
  57. package/src/context/branching.js +59 -0
  58. package/src/context/ephemeral.js +12 -0
  59. package/src/context/file/nominal.js +0 -8
  60. package/src/context/synthetic.js +3 -2
  61. package/src/context.js +14 -0
  62. package/src/element/assertion/contained.js +7 -7
  63. package/src/element/assertion/defined.js +7 -7
  64. package/src/element/assertion/property.js +4 -4
  65. package/src/element/assertion/satisfies.js +2 -2
  66. package/src/element/assertion/subproof.js +2 -2
  67. package/src/element/assertion/type.js +7 -7
  68. package/src/element/assumption.js +2 -2
  69. package/src/element/combinator.js +4 -4
  70. package/src/element/conclusion.js +3 -3
  71. package/src/element/constructor/bracketed.js +9 -7
  72. package/src/element/constructor.js +11 -5
  73. package/src/element/deduction.js +3 -3
  74. package/src/element/equality.js +16 -14
  75. package/src/element/equivalence.js +3 -3
  76. package/src/element/frame.js +2 -2
  77. package/src/element/hypothesis.js +2 -2
  78. package/src/element/judgement.js +2 -2
  79. package/src/element/label.js +4 -4
  80. package/src/element/metavariable.js +81 -30
  81. package/src/element/parameter.js +2 -2
  82. package/src/element/procedureCall.js +2 -2
  83. package/src/element/procedureReference.js +2 -2
  84. package/src/element/proof.js +2 -2
  85. package/src/element/proofAssertion/premise.js +5 -5
  86. package/src/element/proofAssertion/step.js +3 -3
  87. package/src/element/proofAssertion/supposition.js +5 -5
  88. package/src/element/property.js +2 -2
  89. package/src/element/propertyRelation.js +3 -3
  90. package/src/element/reference.js +2 -2
  91. package/src/element/rule.js +2 -2
  92. package/src/element/signature.js +3 -3
  93. package/src/element/statement.js +2 -2
  94. package/src/element/subproof.js +2 -2
  95. package/src/element/substitution/frame.js +8 -8
  96. package/src/element/substitution/metaLevel.js +7 -7
  97. package/src/element/substitution/reference.js +7 -7
  98. package/src/element/substitution/statement.js +17 -24
  99. package/src/element/substitution/term.js +10 -10
  100. package/src/element/term.js +22 -16
  101. package/src/element/topLevelAssertion.js +2 -2
  102. package/src/element/topLevelMetaAssertion.js +2 -2
  103. package/src/element/type.js +3 -2
  104. package/src/element/typePrefix.js +2 -2
  105. package/src/element/variable.js +7 -3
  106. package/src/process/unify.js +15 -8
  107. package/src/process/validate.js +4 -4
  108. package/src/utilities/context.js +20 -12
  109. package/src/utilities/element.js +2 -2
  110. package/src/utilities/instance.js +3 -3
  111. package/src/utilities/validation.js +16 -4
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { attempt, literally } from "../utilities/context";
6
+ import { attempt, instantiate } from "../utilities/context";
7
7
  import { instantiateCombinator } from "../process/instantiate";
8
8
  import { statementFromCombinatorNode } from "../utilities/element";
9
9
  import { unifyStatementWithCombinator } from "../process/unify";
@@ -21,7 +21,7 @@ export default define(class Combinator extends Element {
21
21
  return this.statement;
22
22
  }
23
23
 
24
- getConbinatorNode() {
24
+ getCombinatoryNode() {
25
25
  const node = this.getNode(),
26
26
  combinatorNode = node; ///
27
27
 
@@ -39,7 +39,7 @@ export default define(class Combinator extends Element {
39
39
  const statementValidates = this.validateStatement(context);
40
40
 
41
41
  if (statementValidates) {
42
- this.setContext(context);
42
+ context.commit(this);
43
43
 
44
44
  validates = true;
45
45
  }
@@ -128,7 +128,7 @@ export default define(class Combinator extends Element {
128
128
 
129
129
  context = ephemeralContext; ///
130
130
 
131
- const combinator = literally((context) => {
131
+ const combinator = instantiate((context) => {
132
132
  const { string } = json,
133
133
  combinatorNode = instantiateCombinator(string, context),
134
134
  node = combinatorNode, ///
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { attempt, literally } from "../utilities/context";
6
+ import { attempt, instantiate } from "../utilities/context";
7
7
  import { instantiateConclusion } from "../process/instantiate";
8
8
  import { statementFromConclusionNode } from "../utilities/element";
9
9
  import { ephemeralContextFromJSON, ephemeralContextToEphemeralContextJSON } from "../utilities/json";
@@ -63,7 +63,7 @@ export default define(class Conclusion extends Element {
63
63
  const statementValidates = this.validateStatement(context);
64
64
 
65
65
  if (statementValidates) {
66
- this.setContext(context);
66
+ context.commit(this);
67
67
 
68
68
  validates = true;
69
69
  }
@@ -150,7 +150,7 @@ export default define(class Conclusion extends Element {
150
150
 
151
151
  context = ephemeralContext; ///
152
152
 
153
- const conclusion = literally((context) => {
153
+ const conclusion = instantiate((context) => {
154
154
  const { string } = json,
155
155
  conclusionNode = instantiateConclusion(string, context),
156
156
  node = conclusionNode, ///
@@ -20,7 +20,7 @@ export default define(class BracketedConstructor extends Constructor {
20
20
 
21
21
  context.trace(`Unifying the '${termString}' term with the bracketed constructor...`);
22
22
 
23
- termUnifies = super.unifyTerm(term, context, () => {
23
+ termUnifies = super.unifyTerm(term, context, (term) => {
24
24
  let validatesForwards = false;
25
25
 
26
26
  const bracketedTerm = term, ///
@@ -28,23 +28,25 @@ export default define(class BracketedConstructor extends Constructor {
28
28
  singularTermNode = bracketedTermNode.getSingularTermNode();
29
29
 
30
30
  if (singularTermNode !== null) {
31
- const termNode = singularTermNode; ///
31
+ const bracketlessTermNode = singularTermNode; ///
32
32
 
33
- term = termFromTermNode(termNode, context);
33
+ let bracketlessTerm;
34
34
 
35
- term = term.validate(context, () => {
35
+ bracketlessTerm = termFromTermNode(bracketlessTermNode, context);
36
+
37
+ bracketlessTerm = bracketlessTerm.validate(context, (bracketlessTerm) => { ///
36
38
  let validatesForwards;
37
39
 
38
- const type = term.getType();
40
+ const type = bracketlessTerm.getType();
39
41
 
40
42
  bracketedTerm.setType(type);
41
43
 
42
- validatesForwards = validateForwards();
44
+ validatesForwards = validateForwards(bracketedTerm);
43
45
 
44
46
  return validatesForwards;
45
47
  });
46
48
 
47
- if (term !== null) {
49
+ if (bracketlessTerm !== null) {
48
50
  validatesForwards = true;
49
51
  }
50
52
  }
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { attempt, literally } from "../utilities/context";
6
+ import { attempt, instantiate } from "../utilities/context";
7
7
  import { instantiateConstructor } from "../process/instantiate";
8
8
  import { termFromConstructorNode } from "../utilities/element";
9
9
  import { unifyTermWithConstructor } from "../process/unify";
@@ -64,7 +64,7 @@ export default define(class Constructor extends Element {
64
64
  const termValidates = this.validateTerm(context);
65
65
 
66
66
  if (termValidates) {
67
- this.setContext(context);
67
+ context.commit(this);
68
68
 
69
69
  validates = true;
70
70
  }
@@ -122,11 +122,17 @@ export default define(class Constructor extends Element {
122
122
  if (termUnifiesWithConstructor) {
123
123
  let validatesForwards;
124
124
 
125
+ const typeString = this.type.getString();
126
+
127
+ context.trace(`Setting the '${termString}' term's type to the '${constructorString}' constructor's '${typeString}' type.`);
128
+
125
129
  term.setType(this.type);
126
130
 
127
- validatesForwards = validateForwards();
131
+ validatesForwards = validateForwards(term);
128
132
 
129
- termUnifies = validatesForwards; ///
133
+ if (validatesForwards) {
134
+ termUnifies = true;
135
+ }
130
136
  }
131
137
 
132
138
  if (termUnifies) {
@@ -167,7 +173,7 @@ export default define(class Constructor extends Element {
167
173
 
168
174
  context = ephemeralContext; ///
169
175
 
170
- const constructor = literally((context) => {
176
+ const constructor = instantiate((context) => {
171
177
  const { string } = json,
172
178
  constructorNode = instantiateConstructor(string, context),
173
179
  node = constructorNode, ///
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { attempt, literally } from "../utilities/context";
6
+ import { attempt, instantiate } from "../utilities/context";
7
7
  import { instantiateDeduction } from "../process/instantiate";
8
8
  import { ephemeralContextFromJSON, ephemeralContextToEphemeralContextJSON } from "../utilities/json";
9
9
 
@@ -62,7 +62,7 @@ export default define(class Deduction extends Element {
62
62
  const statementValidates = this.validateStatement(context);
63
63
 
64
64
  if (statementValidates) {
65
- this.setContext(context);
65
+ context.commit(this);
66
66
 
67
67
  validates = true;
68
68
  }
@@ -174,7 +174,7 @@ export default define(class Deduction extends Element {
174
174
 
175
175
  context = ephemeralContext; ///
176
176
 
177
- const duduction = literally((context) => {
177
+ const duduction = instantiate((context) => {
178
178
  const { string } = json,
179
179
  deductionNode = instantiateDeduction(string, context),
180
180
  node = deductionNode, ///
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { literally } from "../utilities/context";
6
+ import { instantiate } from "../utilities/context";
7
7
  import { equateTerms } from "../process/equate";
8
8
  import { instantiateEquality } from "../process/instantiate";
9
9
  import { equalityAssignmentFromEquality, leftVariableAssignmentFromEquality, rightVariableAssignmentFromEquality } from "../process/assign";
@@ -172,11 +172,19 @@ export default define(class Equality extends Element {
172
172
  let leftTerm,
173
173
  rightTerm;
174
174
 
175
- leftTerm = this.leftTerm.validate(context, () => {
175
+ leftTerm = this.leftTerm.validate(context, (leftTerm) => {
176
176
  let validatesForwards = false;
177
177
 
178
- rightTerm = this.rightTerm.validate(context, () => {
179
- const validatesForwards = true;
178
+ rightTerm = this.rightTerm.validate(context, (rightTerm) => {
179
+ let validatesForwards = false;
180
+
181
+ const leftTermType = leftTerm.getType(),
182
+ rightTermType = rightTerm.getType(),
183
+ leftTermTypeComparableToRightTermType = leftTermType.isComparableTo(rightTermType);
184
+
185
+ if (leftTermTypeComparableToRightTermType) {
186
+ validatesForwards = true;
187
+ }
180
188
 
181
189
  return validatesForwards;
182
190
  });
@@ -189,17 +197,11 @@ export default define(class Equality extends Element {
189
197
  });
190
198
 
191
199
  if (leftTerm !== null) {
192
- const leftTermType = leftTerm.getType(),
193
- rightTermType = rightTerm.getType(),
194
- leftTermTypeComparableToRightTermType = leftTermType.isComparableTo(rightTermType);
200
+ this.leftTerm = leftTerm;
195
201
 
196
- if (leftTermTypeComparableToRightTermType) {
197
- this.leftTerm = leftTerm;
202
+ this.rightTerm = rightTerm;
198
203
 
199
- this.rightTerm = rightTerm;
200
-
201
- termsValidate = true;
202
- }
204
+ termsValidate = true;
203
205
  }
204
206
 
205
207
  if (termsValidate) {
@@ -278,7 +280,7 @@ export default define(class Equality extends Element {
278
280
  }
279
281
 
280
282
  static fromJSON(json, context) {
281
- const equality = literally((context) => {
283
+ const equality = instantiate((context) => {
282
284
  const { string } = json,
283
285
  equalityNode = instantiateEquality(string, context),
284
286
  node = equalityNode, ///
@@ -4,7 +4,7 @@ import { Element } from "occam-languages";
4
4
  import { arrayUtilities } from "necessary";
5
5
 
6
6
  import { define } from "../elements";
7
- import { literally } from "../utilities/context";
7
+ import { instantiate } from "../utilities/context";
8
8
  import { instantiateEquivalence } from "../process/instantiate";
9
9
  import { stripBracketsFromTermNode } from "../utilities/brackets";
10
10
  import { equivalenceStringFromTerms } from "../utilities/string";
@@ -232,7 +232,7 @@ export default define(class Equivalence extends Element {
232
232
  const terms = equivalence.getTerms(),
233
233
  combinedTerms = this.combineTerms(terms);
234
234
 
235
- return literally((context) => {
235
+ return instantiate((context) => {
236
236
  const terms = combinedTerms, ///
237
237
  equivalenceString = equivalenceStringFromTerms(terms),
238
238
  string = equivalenceString, ///
@@ -246,7 +246,7 @@ export default define(class Equivalence extends Element {
246
246
  static name = "Equivalence";
247
247
 
248
248
  static fromEquality(equality, context) {
249
- return literally((context) => {
249
+ return instantiate((context) => {
250
250
  const terms = equality.getTerms(),
251
251
  equivalenceString = equivalenceStringFromTerms(terms),
252
252
  string = equivalenceString, ///
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { literally } from "../utilities/context";
6
+ import { instantiate } from "../utilities/context";
7
7
  import { instantiateFrame } from "../process/instantiate";
8
8
  import { FRAME_META_TYPE_NAME } from "../metaTypeNames";
9
9
  import { metavariableFromFrameNode } from "../utilities/element";
@@ -343,7 +343,7 @@ export default define(class Frame extends Element {
343
343
  static name = "Frame";
344
344
 
345
345
  static fromJSON(json, context) {
346
- const frame = literally((context) => {
346
+ const frame = instantiate((context) => {
347
347
  const { string } = json,
348
348
  frameNode = instantiateFrame(string, context),
349
349
  node = frameNode, ///
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import {literally} from "../utilities/context";
6
+ import {instantiate} from "../utilities/context";
7
7
  import { instantiateHypothesis } from "../process/instantiate";
8
8
  import { statementFromHypothesisNode } from "../utilities/element";
9
9
 
@@ -100,7 +100,7 @@ export default define(class Hypothesis extends Element {
100
100
  static name = "Hypothesis";
101
101
 
102
102
  static fromJSON(json, context) {
103
- const hypothesis = literally((context) => {
103
+ const hypothesis = instantiate((context) => {
104
104
  const { string } = json,
105
105
  hypothesisNode = instantiateHypothesis(string, context),
106
106
  node = hypothesisNode, ///
@@ -5,7 +5,7 @@ import { Element } from "occam-languages";
5
5
  import elements from "../elements";
6
6
 
7
7
  import { define } from "../elements";
8
- import { literally } from "../utilities/context";
8
+ import { instantiate } from "../utilities/context";
9
9
  import { instantiateJudgement } from "../process/instantiate";
10
10
  import { judgementAssignmentFromJudgement } from "../process/assign";
11
11
 
@@ -218,7 +218,7 @@ export default define(class Judgement extends Element {
218
218
  static name = "Judgement";
219
219
 
220
220
  static fromJSON(json, context) {
221
- const judgement = literally((context) => {
221
+ const judgement = instantiate((context) => {
222
222
  const { string } = json,
223
223
  judgementNode = instantiateJudgement(string, context),
224
224
  node = judgementNode, ///
@@ -4,7 +4,7 @@ import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
6
  import { instantiateLabel } from "../process/instantiate";
7
- import { attempt, literally } from "../utilities/context";
7
+ import { attempt, instantiate } from "../utilities/context";
8
8
  import { metavariableFromLabelNode } from "../utilities/element";
9
9
  import { ephemeralContextFromJSON, ephemeralContextToEphemeralContextJSON } from "../utilities/json";
10
10
 
@@ -90,7 +90,7 @@ export default define(class Label extends Element {
90
90
  const metavariableValidates = this.validateMetavariable(context);
91
91
 
92
92
  if (metavariableValidates) {
93
- this.setContext(context);
93
+ context.commit(this);
94
94
 
95
95
  validates = true;
96
96
  }
@@ -109,7 +109,7 @@ export default define(class Label extends Element {
109
109
  const labelString = this.getString(), ///
110
110
  metavariableString = this.metavariable.getString();
111
111
 
112
- context.trace(`Validating the '${labelString}' label's '${metavariableString}' metavariable...'`);
112
+ context.trace(`Validating the '${labelString}' label's '${metavariableString}' metavariable...`);
113
113
 
114
114
  const metavariable = this.metavariable.validate(context);
115
115
 
@@ -153,7 +153,7 @@ export default define(class Label extends Element {
153
153
 
154
154
  context = ephemeralContext; ///
155
155
 
156
- const label = literally((context) => {
156
+ const label = instantiate((context) => {
157
157
  const { string } = json,
158
158
  labelNode = instantiateLabel(string, context),
159
159
  metavariable = metavariableFromLabelNode(labelNode, context),
@@ -5,7 +5,7 @@ import { Element } from "occam-languages";
5
5
  import elements from "../elements";
6
6
 
7
7
  import { define } from "../elements";
8
- import { literally } from "../utilities/context";
8
+ import { instantiate } from "../utilities/context";
9
9
  import { EMPTY_STRING } from "../constants";
10
10
  import { instantiateMetavariable } from "../process/instantiate";
11
11
  import { metaTypeFromJSON, metaTypeToMetaTypeJSON } from "../utilities/json";
@@ -130,10 +130,12 @@ export default define(class Metavariable extends Element {
130
130
  context.trace(`Verifying the '${metavariableString}' metavariable's '${typeString}' type...`);
131
131
 
132
132
  const typeName = this.type.getName(),
133
- typePresent = context.isTypePresentByTypeName(typeName);
133
+ type = context.findTypeByTypeName(typeName);
134
134
 
135
- if (!typePresent) {
136
- typeVerifies = false;
135
+ if (type !== null) {
136
+ this.type = type;
137
+
138
+ typeVerifies = true;
137
139
 
138
140
  context.error(`Type '${typeName}' is not present.`);
139
141
  }
@@ -155,25 +157,17 @@ export default define(class Metavariable extends Element {
155
157
 
156
158
  let validates = false;
157
159
 
158
- const termValidates = this.validateTerm(context);
159
-
160
- if (termValidates) {
161
- const typeValidates = this.validateType(context);
162
-
163
- if (typeValidates) {
164
- let metavariable;
165
-
166
- metavariable = this; ///
160
+ const typeValidates = this.validateType(context);
167
161
 
168
- metavariable = context.findMetavariable(metavariable, context); ///
162
+ if (typeValidates) {
163
+ const termValidates = this.validateTerm(context);
169
164
 
170
- if (metavariable !== null) {
171
- const metaType = metavariable.getMetaType();
165
+ if (termValidates) {
166
+ const nameValidates = this.validateName(context);
172
167
 
173
- this.metaType = metaType;
168
+ if (nameValidates) {
169
+ validates = true;
174
170
  }
175
-
176
- validates = true;
177
171
  }
178
172
  }
179
173
 
@@ -187,19 +181,43 @@ export default define(class Metavariable extends Element {
187
181
  }
188
182
 
189
183
  validateTerm(context) {
190
- let termValidates = true;
184
+ let termValidates = true; ///
191
185
 
192
186
  if (this.term !== null) {
187
+ termValidates = false;
188
+
193
189
  const termString = this.term.getString(),
194
190
  metavariableString = this.getString();
195
191
 
196
192
  context.trace(`Validating the '${metavariableString}' metavariable's '${termString}' term...`);
197
193
 
198
- termValidates = this.term.validate(context, () => {
199
- const validatesForwards = true;
194
+ const metavariableName = this.getMetavariableName(),
195
+ metavariable = context.findMetavariableByMetavariableName(metavariableName);
196
+
197
+ let term = null;
200
198
 
201
- return validatesForwards;
202
- });
199
+ if (metavariable !== null) {
200
+ const type = metavariable.getType(),
201
+ metavariableString = metavariable.getString();
202
+
203
+ if (type !== null) {
204
+ term = this.term.validateGivenType(type, context);
205
+ } else {
206
+ context.trace(`The '${metavariableString}' metavariable does not have a type`);
207
+ }
208
+ } else {
209
+ term = this.term.validate(context, (term) => {
210
+ const validatesForwards = true;
211
+
212
+ return validatesForwards;
213
+ });
214
+ }
215
+
216
+ if (term !== null) {
217
+ this.term = term;
218
+
219
+ termValidates = true;
220
+ }
203
221
 
204
222
  if (termValidates) {
205
223
  context.debug(`...validated the '${metavariableString}' metavariable's '${termString}' term.`);
@@ -209,18 +227,51 @@ export default define(class Metavariable extends Element {
209
227
  return termValidates;
210
228
  }
211
229
 
230
+ validateName(context) {
231
+ let termValidates = true; ///
232
+
233
+ const metavariableName = this.getMetavariableName(), ///
234
+ metavariableString = this.getString(); ///
235
+
236
+ context.trace(`Validating the '${metavariableString}' metavariable's '${metavariableName}' name...`);
237
+
238
+ const metavariable = context.findMetavariableByMetavariableName(metavariableName);
239
+
240
+ if (metavariable !== null) {
241
+ const metaType = metavariable.getMetaType(),
242
+ metaTypeSTring = metaType.getString();
243
+
244
+ this.metaType = metaType;
245
+
246
+ context.trace(`Setting the '${metavariableString}' metavariable's meta-type to the '${metaTypeSTring}' meta-type.`);
247
+ }
248
+
249
+ if (termValidates) {
250
+ context.debug(`...validated the '${metavariableString}' metavariable's '${metavariableName}' name.`);
251
+ }
252
+
253
+ return termValidates;
254
+ }
255
+
212
256
  validateType(context) {
213
- let typeValidates = true; ///
257
+ let typeValidates = false;
214
258
 
215
- if (this.type !== null) {
216
- const typeString = this.type.getString(),
217
- metavariableString = this.getString();
259
+ const metavariableString = this.getString(); ///
260
+
261
+ context.trace(`Validating the '${metavariableString}' metavariable's type...`);
218
262
 
219
- typeValidates = false;
263
+ if (this.type === null) {
264
+ typeValidates = true;
265
+ } else {
266
+ const typeString = this.type.getString();
220
267
 
221
268
  context.trace(`A '${typeString}' type is present in the '${metavariableString}' metavariable.`);
222
269
  }
223
270
 
271
+ if (typeValidates) {
272
+ context.trace(`...validated the '${metavariableString}' metavariable's type.`);
273
+ }
274
+
224
275
  return typeValidates;
225
276
  }
226
277
 
@@ -545,7 +596,7 @@ export default define(class Metavariable extends Element {
545
596
  static name = "Metavariable";
546
597
 
547
598
  static fromJSON(json, context) {
548
- const metavariable = literally((context) => {
599
+ const metavariable = instantiate((context) => {
549
600
  const { string } = json,
550
601
  metavariableNode = instantiateMetavariable(string, context),
551
602
  node = metavariableNode, ///
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { literally } from "../utilities/context";
6
+ import { instantiate } from "../utilities/context";
7
7
  import { instantiateParameter } from "../process/instantiate";
8
8
  import { nameFromParaneterNode, identifierFromParameterNode } from "../utilities/element";
9
9
 
@@ -61,7 +61,7 @@ export default define(class Parameter extends Element {
61
61
  static name = "Parameter";
62
62
 
63
63
  static fromJSON(json, context) {
64
- const parameter = literally((context) => {
64
+ const parameter = instantiate((context) => {
65
65
  const { string } = json,
66
66
  parameterNode = instantiateParameter(string, context),
67
67
  node = parameterNode, ///
@@ -4,7 +4,7 @@ import { Element } from "occam-languages";
4
4
  import { termsUtilities } from "occam-furtle";
5
5
 
6
6
  import { define } from "../elements";
7
- import { literally } from "../utilities/context";
7
+ import { instantiate } from "../utilities/context";
8
8
  import { instantiateProcedureCall } from "../process/instantiate";
9
9
  import { parametersFromProcedureCallNode, procedureReferenceFromProcedureCallNode } from "../utilities/element";
10
10
 
@@ -125,7 +125,7 @@ export default define(class ProcedureCall extends Element {
125
125
  static name = "ProcedureCall";
126
126
 
127
127
  static fromJSON(json, context) {
128
- const procedureCall = literally((context) => {
128
+ const procedureCall = instantiate((context) => {
129
129
  const { string } = json,
130
130
  procedureCallNode = instantiateProcedureCall(string, context),
131
131
  node = procedureCallNode, ///
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { literally } from "../utilities/context";
6
+ import { instantiate } from "../utilities/context";
7
7
  import { instantiateProcedureReference } from "../process/instantiate";
8
8
  import { nameFromProcedureReferenceNode } from "../utilities/element";
9
9
 
@@ -43,7 +43,7 @@ export default define(class ProcedureReference extends Element {
43
43
  static name = "ProcedureReference";
44
44
 
45
45
  static fromJSON(json, context) {
46
- const procedureReference = literally((context) => {
46
+ const procedureReference = instantiate((context) => {
47
47
  const { string } = json,
48
48
  procedureReferenceNode = instantiateProcedureReference(string, context),
49
49
  node = procedureReferenceNode, ///
@@ -3,7 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import { asyncScope } from "../utilities/context";
6
+ import { asyncRestrict } from "../utilities/context";
7
7
 
8
8
  export default define(class Proof extends Element {
9
9
  constructor(context, string, node, derivation) {
@@ -36,7 +36,7 @@ export default define(class Proof extends Element {
36
36
  async verify(statement, context) {
37
37
  let verifies = false;
38
38
 
39
- await asyncScope(async (context) => {
39
+ await asyncRestrict(async (context) => {
40
40
  const derivationVerifies = await this.derivation.verify(context);
41
41
 
42
42
  if (derivationVerifies) {
@@ -5,7 +5,7 @@ import ProofAssertion from "../proofAssertion";
5
5
  import { define } from "../../elements";
6
6
  import { instantiatePremise } from "../../process/instantiate";
7
7
  import { procedureCallFromPremiseNode } from "../../utilities/element";
8
- import { attempt, liminally, literally } from "../../utilities/context";
8
+ import { attempt, reconcile, instantiate } from "../../utilities/context";
9
9
  import { ephemeralContextFromJSON, ephemeralContextToEphemeralContextJSON } from "../../utilities/json";
10
10
 
11
11
  export default define(class Premise extends ProofAssertion {
@@ -72,7 +72,7 @@ export default define(class Premise extends ProofAssertion {
72
72
  const statementValidates = this.validateStatement(context);
73
73
 
74
74
  if (statementValidates) {
75
- this.setContext(context);
75
+ context.commit(this);
76
76
 
77
77
  validates = true;
78
78
  }
@@ -82,7 +82,7 @@ export default define(class Premise extends ProofAssertion {
82
82
  const procedureCallValidates = this.validateProcedureCall(context);
83
83
 
84
84
  if (procedureCallValidates) {
85
- this.setContext(context);
85
+ context.commit(this);
86
86
 
87
87
  validates = true;
88
88
  }
@@ -168,7 +168,7 @@ export default define(class Premise extends ProofAssertion {
168
168
  premiseContext = this.getContext(), ///
169
169
  generalContext = premiseContext, ///
170
170
  specificContext = proofAssertionContext,
171
- statementUnifies = liminally((specificContext) => {
171
+ statementUnifies = reconcile((specificContext) => {
172
172
  const statement = proofAssertion.getStatement(),
173
173
  statementUnifies = this.unifyStatement(statement, generalContext, specificContext);
174
174
 
@@ -300,7 +300,7 @@ export default define(class Premise extends ProofAssertion {
300
300
 
301
301
  context = ephemeralContext; ///
302
302
 
303
- const premise = literally((context) => {
303
+ const premise = instantiate((context) => {
304
304
  const { string } = json,
305
305
  premiseNode = instantiatePremise(string, context),
306
306
  node = premiseNode, ///