occam-verify-cli 1.0.612 → 1.0.631

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 (141) hide show
  1. package/lib/context/ephemeral.js +210 -77
  2. package/lib/context/file/nominal.js +157 -135
  3. package/lib/context/liminal.js +34 -59
  4. package/lib/context/scoped.js +37 -58
  5. package/lib/context.js +103 -53
  6. package/lib/element/assertion/contained.js +3 -1
  7. package/lib/element/assertion/defined.js +3 -1
  8. package/lib/element/assertion/property.js +10 -58
  9. package/lib/element/assertion/satisfies.js +3 -1
  10. package/lib/element/assertion/subproof.js +3 -1
  11. package/lib/element/assertion/type.js +63 -109
  12. package/lib/element/assertion.js +5 -9
  13. package/lib/element/assumption.js +50 -19
  14. package/lib/element/combinator.js +8 -1
  15. package/lib/element/conclusion.js +8 -1
  16. package/lib/element/constructor.js +8 -1
  17. package/lib/element/declaration.js +3 -7
  18. package/lib/element/deduction.js +8 -1
  19. package/lib/element/derivation.js +15 -10
  20. package/lib/element/equality.js +109 -62
  21. package/lib/element/equivalence.js +13 -6
  22. package/lib/element/equivalences.js +11 -4
  23. package/lib/element/error.js +10 -7
  24. package/lib/element/frame.js +21 -21
  25. package/lib/element/hypothesis.js +12 -7
  26. package/lib/element/judgement.js +55 -26
  27. package/lib/element/label.js +8 -1
  28. package/lib/element/metaType.js +9 -2
  29. package/lib/element/metavariable.js +16 -10
  30. package/lib/element/parameter.js +8 -1
  31. package/lib/element/procedureCall.js +21 -29
  32. package/lib/element/procedureReference.js +15 -1
  33. package/lib/element/proof.js +8 -1
  34. package/lib/element/proofAssertion.js +8 -1
  35. package/lib/element/property.js +8 -1
  36. package/lib/element/propertyRelation.js +8 -1
  37. package/lib/element/reference.js +16 -28
  38. package/lib/element/rule.js +22 -21
  39. package/lib/element/section.js +8 -1
  40. package/lib/element/signature.js +8 -1
  41. package/lib/element/statement.js +34 -40
  42. package/lib/element/subDerivation.js +11 -6
  43. package/lib/element/subproof.js +8 -1
  44. package/lib/element/substitution/frame.js +6 -6
  45. package/lib/element/substitution/reference.js +6 -6
  46. package/lib/element/substitution/statement.js +6 -6
  47. package/lib/element/substitution/term.js +9 -3
  48. package/lib/element/substitution.js +73 -49
  49. package/lib/element/term.js +15 -1
  50. package/lib/element/topLevelAssertion/axiom.js +8 -1
  51. package/lib/element/topLevelAssertion/conjecture.js +8 -1
  52. package/lib/element/topLevelAssertion/lemma.js +8 -1
  53. package/lib/element/topLevelAssertion/theorem.js +8 -1
  54. package/lib/element/topLevelAssertion.js +11 -17
  55. package/lib/element/topLevelMetaAssertion/metaLemma.js +8 -1
  56. package/lib/element/topLevelMetaAssertion/metatheorem.js +8 -1
  57. package/lib/element/topLevelMetaAssertion.js +9 -11
  58. package/lib/element/type.js +8 -1
  59. package/lib/element/typePrefix.js +8 -1
  60. package/lib/element/variable.js +51 -5
  61. package/lib/preamble.js +1 -2
  62. package/lib/process/assign.js +96 -27
  63. package/lib/process/unify.js +3 -4
  64. package/lib/process/validate.js +2 -2
  65. package/lib/process/verify.js +2 -2
  66. package/lib/utilities/element.js +74 -12
  67. package/lib/utilities/json.js +2 -2
  68. package/lib/utilities/string.js +9 -24
  69. package/lib/utilities/substitutions.js +15 -23
  70. package/package.json +2 -2
  71. package/src/context/ephemeral.js +234 -82
  72. package/src/context/file/nominal.js +195 -135
  73. package/src/context/liminal.js +43 -80
  74. package/src/context/scoped.js +56 -81
  75. package/src/context.js +97 -46
  76. package/src/element/assertion/contained.js +4 -0
  77. package/src/element/assertion/defined.js +4 -0
  78. package/src/element/assertion/property.js +15 -26
  79. package/src/element/assertion/satisfies.js +4 -0
  80. package/src/element/assertion/subproof.js +4 -0
  81. package/src/element/assertion/type.js +67 -77
  82. package/src/element/assertion.js +4 -8
  83. package/src/element/assumption.js +57 -18
  84. package/src/element/combinator.js +7 -0
  85. package/src/element/conclusion.js +7 -0
  86. package/src/element/constructor.js +7 -0
  87. package/src/element/declaration.js +1 -3
  88. package/src/element/deduction.js +7 -0
  89. package/src/element/derivation.js +10 -5
  90. package/src/element/equality.js +116 -74
  91. package/src/element/equivalence.js +15 -7
  92. package/src/element/equivalences.js +14 -5
  93. package/src/element/error.js +5 -2
  94. package/src/element/frame.js +25 -25
  95. package/src/element/hypothesis.js +11 -6
  96. package/src/element/judgement.js +62 -26
  97. package/src/element/label.js +7 -0
  98. package/src/element/metaType.js +8 -1
  99. package/src/element/metavariable.js +20 -14
  100. package/src/element/parameter.js +7 -0
  101. package/src/element/procedureCall.js +21 -14
  102. package/src/element/procedureReference.js +13 -0
  103. package/src/element/proof.js +7 -0
  104. package/src/element/proofAssertion.js +7 -0
  105. package/src/element/property.js +7 -0
  106. package/src/element/propertyRelation.js +7 -0
  107. package/src/element/reference.js +20 -33
  108. package/src/element/rule.js +16 -19
  109. package/src/element/section.js +7 -0
  110. package/src/element/signature.js +7 -0
  111. package/src/element/statement.js +36 -44
  112. package/src/element/subDerivation.js +10 -5
  113. package/src/element/subproof.js +7 -0
  114. package/src/element/substitution/frame.js +3 -3
  115. package/src/element/substitution/reference.js +3 -3
  116. package/src/element/substitution/statement.js +3 -3
  117. package/src/element/substitution/term.js +4 -2
  118. package/src/element/substitution.js +60 -40
  119. package/src/element/term.js +20 -2
  120. package/src/element/topLevelAssertion/axiom.js +7 -0
  121. package/src/element/topLevelAssertion/conjecture.js +7 -0
  122. package/src/element/topLevelAssertion/lemma.js +7 -0
  123. package/src/element/topLevelAssertion/theorem.js +7 -0
  124. package/src/element/topLevelAssertion.js +5 -15
  125. package/src/element/topLevelMetaAssertion/metaLemma.js +7 -0
  126. package/src/element/topLevelMetaAssertion/metatheorem.js +7 -0
  127. package/src/element/topLevelMetaAssertion.js +4 -6
  128. package/src/element/type.js +7 -0
  129. package/src/element/typePrefix.js +7 -0
  130. package/src/element/variable.js +9 -4
  131. package/src/preamble.js +0 -1
  132. package/src/process/assign.js +113 -38
  133. package/src/process/unify.js +2 -3
  134. package/src/process/validate.js +1 -1
  135. package/src/process/verify.js +1 -1
  136. package/src/utilities/element.js +83 -26
  137. package/src/utilities/json.js +1 -1
  138. package/src/utilities/string.js +7 -29
  139. package/src/utilities/substitutions.js +19 -30
  140. package/lib/element/substitutions.js +0 -225
  141. package/src/element/substitutions.js +0 -84
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
 
3
- import elements from "../../elements";
4
3
  import Assertion from "../assertion";
5
4
 
6
5
  import { define } from "../../elements";
7
- import { variableAssignmentFromVariable } from "../../process/assign";
6
+ import { variableAssignmentFromPrepertyAssertion } from "../../process/assign";
8
7
 
9
8
  export default define(class PropertyAssertion extends Assertion {
10
9
  constructor(context, string, node, term, propertyRelation) {
@@ -76,7 +75,7 @@ export default define(class PropertyAssertion extends Assertion {
76
75
 
77
76
  if (propertyRelationVerifies) {
78
77
  let validatesWhenStated = false,
79
- validatesWhenDerived = false;
78
+ validatesWhenDerived = false;
80
79
 
81
80
  if (stated) {
82
81
  validatesWhenStated = this.validateWhenStated(assignments, context);
@@ -91,12 +90,12 @@ export default define(class PropertyAssertion extends Assertion {
91
90
  }
92
91
 
93
92
  if (validates) {
94
- if (stated) {
95
- this.assign(assignments, context);
96
- }
97
- }
93
+ const assertion = this; ///
94
+
95
+ context.addAssertion(assertion);
96
+
97
+ this.assign(assignments, stated, context);
98
98
 
99
- if (validates) {
100
99
  context.debug(`...validated the '${propertyAssertionString}' property assertion.`);
101
100
  }
102
101
  }
@@ -172,30 +171,20 @@ export default define(class PropertyAssertion extends Assertion {
172
171
  return validatesWhenDerived;
173
172
  }
174
173
 
175
- assign(assignments, context) {
174
+ assign(assignments, stated, context) {
176
175
  if (assignments === null) {
177
176
  return;
178
177
  }
179
178
 
180
- let variable;
181
-
182
- const { Variable } = elements,
183
- termNode = this.term.getNode();
184
-
185
- variable = Variable.fromTermNode(termNode, context);
186
-
187
- if (variable !== null) {
188
- const variableIdentifier = variable.getIdentifier();
189
-
190
- variable = context.findVariableByVariableIdentifier(variableIdentifier);
191
-
192
- variable = Variable.fromVariableAndPropertyRelation(variable, this.propertyRelation);
179
+ if (!stated) {
180
+ return;
181
+ }
193
182
 
194
- const variableAssignment = variableAssignmentFromVariable(variable),
195
- assignment = variableAssignment; ///
183
+ const propertyAssertion = this, ///
184
+ variableAssigment = variableAssignmentFromPrepertyAssertion(propertyAssertion, context),
185
+ assignment = variableAssigment; ///
196
186
 
197
- assignments.push(assignment);
198
- }
187
+ assignments.push(assignment);
199
188
  }
200
189
 
201
190
  static name = "PropertyAssertion";
@@ -54,6 +54,10 @@ export default define(class SatisfiesAssertion extends Assertion {
54
54
  }
55
55
 
56
56
  if (validates) {
57
+ const assertion = this; ///
58
+
59
+ context.addAssertion(assertion);
60
+
57
61
  context.debug(`...validated the '${satisfiesAssertionString}' satisfies assertion.`);
58
62
  }
59
63
  }
@@ -48,6 +48,10 @@ export default define(class SubproofAssertion extends Assertion {
48
48
  }
49
49
 
50
50
  if (validates) {
51
+ const assertion = this; ///
52
+
53
+ context.addAssertion(assertion);
54
+
51
55
  context.debug(`...validated the '${subproofAssertionString}' subproof assertion.`);
52
56
  }
53
57
  }
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
 
3
- import elements from "../../elements";
4
3
  import Assertion from "../assertion";
5
4
 
6
5
  import { define } from "../../elements";
7
- import { variableAssignmentFromVariable } from "../../process/assign";
6
+ import { variableAssignmentFromTypeAssertion } from "../../process/assign";
8
7
 
9
8
  export default define(class TypeAssertion extends Assertion {
10
9
  constructor(context, string, node, term, type) {
@@ -29,49 +28,57 @@ export default define(class TypeAssertion extends Assertion {
29
28
  return typeAssertionNode;
30
29
  }
31
30
 
32
- verify(assignments, stated, context) {
33
- let verifies = false;
31
+ validate(assignments, stated, context) {
32
+ let validates = false;
34
33
 
35
- let typeAssertionString = this.getString(); ///
34
+ const typeAssertionString = this.getString(); ///
36
35
 
37
- context.trace(`Verifying the '${typeAssertionString}' type assertion...`);
36
+ context.trace(`Validating the '${typeAssertionString}' type assertion...`);
38
37
 
39
- const typeVerifies = this.verifyType(context);
38
+ const valid = this.isValid();
40
39
 
41
- if (typeVerifies) {
42
- let verifiesWhenStated = false,
43
- verifiesWhenDerived = false;
40
+ if (valid) {
41
+ validates = true;
44
42
 
45
- if (stated) {
46
- verifiesWhenStated = this.verifyWhenStated(assignments, context);
47
- } else {
48
- verifiesWhenDerived = this.verifyWhenDerived(context);
49
- }
43
+ context.debug(`...the '${typeAssertionString}' type assertion is already valid.`);
44
+ } else {
45
+ const typeValidates = this.validateType(context);
50
46
 
51
- if (verifiesWhenStated || verifiesWhenDerived) {
52
- verifies = true;
53
- }
54
- }
47
+ if (typeValidates) {
48
+ let validatesWhenStated = false,
49
+ validatesWhenDerived = false;
50
+
51
+ if (stated) {
52
+ validatesWhenStated = this.validateWhenStated(assignments, context);
53
+ } else {
54
+ validatesWhenDerived = this.validateWhenDerived(context);
55
+ }
55
56
 
56
- if (verifies) {
57
- if (stated) {
58
- this.assign(assignments, context);
57
+ if (validatesWhenStated || validatesWhenDerived) {
58
+ validates = true;
59
+ }
59
60
  }
60
- }
61
61
 
62
- if (verifies) {
63
- context.debug(`...verified the '${typeAssertionString}' type assertion.`);
62
+ if (validates) {
63
+ const assertion = this; ///
64
+
65
+ context.addAssertion(assertion);
66
+
67
+ this.assign(assignments, stated, context);
68
+
69
+ context.debug(`...verified the '${typeAssertionString}' type assertion.`);
70
+ }
64
71
  }
65
72
 
66
- return verifies;
73
+ return validates;
67
74
  }
68
75
 
69
- verifyType(context) {
70
- let typeVerifies;
76
+ validateType(context) {
77
+ let typeValidates;
71
78
 
72
79
  const typeString = this.type.getString();
73
80
 
74
- context.trace(`Verifying the '${typeString}' type...`);
81
+ context.trace(`Validating the '${typeString}' type...`);
75
82
 
76
83
  const nominalTypeName = this.type.getNominalTypeName(),
77
84
  type = context.findTypeByNominalTypeName(nominalTypeName);
@@ -79,58 +86,58 @@ export default define(class TypeAssertion extends Assertion {
79
86
  if (type !== null) {
80
87
  this.type = type;
81
88
 
82
- typeVerifies = true;
89
+ typeValidates = true;
83
90
  } else {
84
91
  context.debug(`The '${typeString}' type is not present.`);
85
92
  }
86
93
 
87
- if (typeVerifies) {
94
+ if (typeValidates) {
88
95
  context.debug(`...verified the '${typeString}' type.`);
89
96
  }
90
97
 
91
- return typeVerifies;
98
+ return typeValidates;
92
99
  }
93
100
 
94
- verifyWhenStated(assignments, context) {
95
- let verifiesWhenStated = false;
101
+ validateWhenStated(assignments, context) {
102
+ let validatesWhenStated = false;
96
103
 
97
104
  const typeAssertionString = this.getString(); ///
98
105
 
99
- context.trace(`Verifying the '${typeAssertionString}' stated type assertion...`);
106
+ context.trace(`Validating the '${typeAssertionString}' stated type assertion...`);
100
107
 
101
- const termVerifies = this.term.verify(context, () => {
102
- let verifiesForwards;
108
+ const termValidates = this.term.validate(context, () => {
109
+ let validatesForwards;
103
110
 
104
111
  const termType = this.term.getType(),
105
112
  typeEqualToOrSubTypeOfTermType = this.type.isEqualToOrSubTypeOf(termType);
106
113
 
107
114
  if (typeEqualToOrSubTypeOfTermType) {
108
- verifiesForwards = true;
115
+ validatesForwards = true;
109
116
  }
110
117
 
111
- return verifiesForwards;
118
+ return validatesForwards;
112
119
  });
113
120
 
114
- if (termVerifies) {
115
- verifiesWhenStated = true;
121
+ if (termValidates) {
122
+ validatesWhenStated = true;
116
123
  }
117
124
 
118
- if (verifiesWhenStated) {
125
+ if (validatesWhenStated) {
119
126
  context.debug(`...verified the '${typeAssertionString}' stated type assertion.`);
120
127
  }
121
128
 
122
- return verifiesWhenStated;
129
+ return validatesWhenStated;
123
130
  }
124
131
 
125
- verifyWhenDerived(context) {
126
- let verifiesWhenDerived;
132
+ validateWhenDerived(context) {
133
+ let validatesWhenDerived;
127
134
 
128
135
  const typeAssertionString = this.getString(); ///
129
136
 
130
- context.trace(`Verifying the '${typeAssertionString}' derived type assertion...`);
137
+ context.trace(`Validating the '${typeAssertionString}' derived type assertion...`);
131
138
 
132
- const termVerifies = this.term.verify(context, () => {
133
- let verifiesForwards = false;
139
+ const termValidates = this.term.validate(context, () => {
140
+ let validatesForwards = false;
134
141
 
135
142
  const termType = this.term.getType(),
136
143
  termTypeProvisional = termType.isProvisional();
@@ -138,52 +145,35 @@ export default define(class TypeAssertion extends Assertion {
138
145
  if (!termTypeProvisional) {
139
146
  const typeEqualToOrSuperTypeOfTermType = this.type.isEqualToOrSuperTypeOf(termType);
140
147
 
141
- verifiesForwards = typeEqualToOrSuperTypeOfTermType; ///
148
+ validatesForwards = typeEqualToOrSuperTypeOfTermType; ///
142
149
  }
143
150
 
144
- return verifiesForwards;
151
+ return validatesForwards;
145
152
  });
146
153
 
147
- verifiesWhenDerived = termVerifies; ///
154
+ validatesWhenDerived = termValidates; ///
148
155
 
149
- if (verifiesWhenDerived) {
156
+ if (validatesWhenDerived) {
150
157
  context.debug(`...verified the '${typeAssertionString}' derived type assertion.`);
151
158
  }
152
159
 
153
- return verifiesWhenDerived;
160
+ return validatesWhenDerived;
154
161
  }
155
162
 
156
- assign(assignments, context) {
163
+ assign(assignments, stated, context) {
157
164
  if (assignments === null) {
158
165
  return;
159
166
  }
160
167
 
161
- const { Type, Variable } = elements,
162
- termNode = this.term.getNode();
163
-
164
- let type,
165
- provisional;
166
-
167
- provisional = this.type.isProvisional();
168
-
169
- if (!provisional) {
170
- type = this.type;
171
- } else {
172
- provisional = false;
173
-
174
- type = Type.fromTypeAndProvisional(this.type, provisional);
168
+ if (!stated) {
169
+ return;
175
170
  }
176
171
 
177
- const singularVariableNode = termNode.getSingularVariableNode();
172
+ const typeAssertion = this, ///
173
+ variableAssigment = variableAssignmentFromTypeAssertion(typeAssertion, context),
174
+ assignment = variableAssigment; ///
178
175
 
179
- if (singularVariableNode !== null) {
180
- const variableNode = singularVariableNode, ///
181
- variable = Variable.fromVariableNodeAndType(variableNode, type, context),
182
- variableAssignment = variableAssignmentFromVariable(variable),
183
- assignment = variableAssignment; ///
184
-
185
- assignments.push(assignment);
186
- }
176
+ assignments.push(assignment);
187
177
  }
188
178
 
189
179
  static name = "TypeAssertion";
@@ -3,10 +3,6 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  export default class Assertion extends Element {
6
- constructor(context, string, node) {
7
- super(context, string, node);
8
- }
9
-
10
6
  getAssertionNode() {
11
7
  const node = this.getNode(),
12
8
  assertionNode = node; ///
@@ -21,9 +17,9 @@ export default class Assertion extends Element {
21
17
 
22
18
  const assertionNodeB = assertionNode, ///
23
19
  assertionNodeAAMatchesAssertionBNodeB = assertionNodeA.match(assertionNodeB),
24
- equalTo = assertionNodeAAMatchesAssertionBNodeB; ///
20
+ assertionNodeMatches = assertionNodeAAMatchesAssertionBNodeB; ///
25
21
 
26
- return equalTo;
22
+ return assertionNodeMatches;
27
23
  }
28
24
 
29
25
  isValid(context) {
@@ -36,8 +32,8 @@ export default class Assertion extends Element {
36
32
 
37
33
  isEqualTo(assertion) {
38
34
  const assertionNode = assertion.getNode(),
39
- assertionNodeMatches = this.matchAssertionNode(assertionNode),
40
- equalTo = assertionNodeMatches; ///
35
+ assertionNodeMatches = this.matchAssertionNode(assertionNode),
36
+ equalTo = assertionNodeMatches; ///
41
37
 
42
38
  return equalTo;
43
39
  }
@@ -14,16 +14,35 @@ export default define(class Assumption extends Element {
14
14
  this.reference = reference;
15
15
  }
16
16
 
17
+ getReference() {
18
+ return this.reference;
19
+ }
20
+
17
21
  getStatement() {
18
22
  return this.statement;
19
23
  }
20
24
 
21
- getReference() {
22
- return this.reference;
25
+ getAssumptionNode() {
26
+ const node = this.getNode(),
27
+ assumptionNode = node; ///
28
+
29
+ return assumptionNode;
23
30
  }
24
31
 
25
32
  getMetavariable() { return this.reference.getMetavariable(); }
26
33
 
34
+ matchAssumptionNode(assumptionode) {
35
+ const assumptionodeA = assumptionode; ///
36
+
37
+ assumptionode = this.getAssumptionNode();
38
+
39
+ const assumptionodeB = assumptionode, ///
40
+ assumptionodeAAMatchesAssumptionBNodeB = assumptionodeA.match(assumptionodeB),
41
+ assumptionodeMatches = assumptionodeAAMatchesAssumptionBNodeB; ///
42
+
43
+ return assumptionodeMatches;
44
+ }
45
+
27
46
  compareSubstitution(substitution, context) {
28
47
  let comparesToSubstituion = false;
29
48
 
@@ -48,6 +67,14 @@ export default define(class Assumption extends Element {
48
67
  return comparesToSubstituion;
49
68
  }
50
69
 
70
+ isValid(context) {
71
+ const assumptionNode = this.getAssumptionNode(),
72
+ assumptionPresent = context.isAssumptionPresentByAssumptionNode(assumptionNode),
73
+ valid = assumptionPresent; ///
74
+
75
+ return valid;
76
+ }
77
+
51
78
  validate(assignments, stated, context) {
52
79
  let validates = false;
53
80
 
@@ -55,29 +82,41 @@ export default define(class Assumption extends Element {
55
82
 
56
83
  context.trace(`Validating the '${assumptionString}' assumption...`);
57
84
 
58
- const referenceValidates = this.validateReference(assignments, stated, context);
85
+ const valid = this.isValid(context);
59
86
 
60
- if (referenceValidates) {
61
- const statementValidates = this.validateStatement(assignments, stated, context);
87
+ if (valid) {
88
+ validates = true;
62
89
 
63
- if (statementValidates) {
64
- let validatesWhenStated = false,
65
- validatesWhenDerived = false;
90
+ context.debug(`...the '${assumptionString}' assumption is already valid.`);
91
+ } else {
92
+ const referenceValidates = this.validateReference(assignments, stated, context);
66
93
 
67
- if (stated) {
68
- validatesWhenStated = this.validateWhenStated(assignments, context);
69
- } else {
70
- validatesWhenDerived = this.validateWhenDerived(context);
71
- }
94
+ if (referenceValidates) {
95
+ const statementValidates = this.validateStatement(assignments, stated, context);
72
96
 
73
- if (validatesWhenStated || validatesWhenDerived) {
74
- validates = true;
97
+ if (statementValidates) {
98
+ let validatesWhenStated = false,
99
+ validatesWhenDerived = false;
100
+
101
+ if (stated) {
102
+ validatesWhenStated = this.validateWhenStated(assignments, context);
103
+ } else {
104
+ validatesWhenDerived = this.validateWhenDerived(context);
105
+ }
106
+
107
+ if (validatesWhenStated || validatesWhenDerived) {
108
+ validates = true;
109
+ }
75
110
  }
76
111
  }
77
- }
78
112
 
79
- if (validates) {
80
- context.debug(`...validated the '${assumptionString}' assumption.`);
113
+ if (validates) {
114
+ const assumption = this; ///
115
+
116
+ context.addAssumption(assumption);
117
+
118
+ context.debug(`...validated the '${assumptionString}' assumption.`);
119
+ }
81
120
  }
82
121
 
83
122
  return validates;
@@ -18,6 +18,13 @@ export default define(class Combinator extends Element {
18
18
  return this.statement;
19
19
  }
20
20
 
21
+ getConbinatorNode() {
22
+ const node = this.getNode(),
23
+ combinatorNode = node; ///
24
+
25
+ return combinatorNode;
26
+ }
27
+
21
28
  verify() {
22
29
  let verifies;
23
30
 
@@ -17,6 +17,13 @@ export default define(class Conclusion extends Element {
17
17
  return this.statement;
18
18
  }
19
19
 
20
+ getConclusionNode() {
21
+ const node = this.getNode(),
22
+ conclusionNode = node; ///
23
+
24
+ return conclusionNode;
25
+ }
26
+
20
27
  verify(context) {
21
28
  let verifies = false;
22
29
 
@@ -17,6 +17,13 @@ export default define(class Constructor extends Element {
17
17
  return this.term;
18
18
  }
19
19
 
20
+ getConclusionNode() {
21
+ const node = this.getNode(),
22
+ constructorNode = node; ///
23
+
24
+ return constructorNode;
25
+ }
26
+
20
27
  isProvisional() { return this.term.isProvisional(); }
21
28
 
22
29
  getType() { return this.term.getType(); }
@@ -3,7 +3,5 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  export default class Declaration extends Element {
6
- constructor(context, string, node) {
7
- super(context, string, node);
8
- }
6
+ ///
9
7
  }
@@ -17,6 +17,13 @@ export default define(class Deduction extends Element {
17
17
  return this.statement;
18
18
  }
19
19
 
20
+ getDeductionNode() {
21
+ const node = this.getNode(),
22
+ deductionNode = node; ///
23
+
24
+ return deductionNode;
25
+ }
26
+
20
27
  verify(context) {
21
28
  let verifies = false;
22
29
 
@@ -21,6 +21,13 @@ export default define(class Derivation extends Element {
21
21
  return this.subproofOrProofAssertions;
22
22
  }
23
23
 
24
+ getDerivationNode() {
25
+ const node = this.getNode(),
26
+ derivationNode = node; ///
27
+
28
+ return derivationNode;
29
+ }
30
+
24
31
  getLastProofAssertion() {
25
32
  const lastSubproofOrProofAssertion = last(this.subproofOrProofAssertions),
26
33
  lastProofAssertion = lastSubproofOrProofAssertion; ///
@@ -36,13 +43,11 @@ export default define(class Derivation extends Element {
36
43
  subproofOrProofAssertionVerifies = await subproofOrProofAssertion.verify(assignments, context);
37
44
 
38
45
  if (subproofOrProofAssertionVerifies) {
39
- const assignmentsAssigned = assignAssignments(assignments, context);
46
+ assignAssignments(assignments, context);
40
47
 
41
- if (assignmentsAssigned) {
42
- context.addSubproofOrProofAssertion(subproofOrProofAssertion);
48
+ context.addSubproofOrProofAssertion(subproofOrProofAssertion);
43
49
 
44
- return true;
45
- }
50
+ return true;
46
51
  }
47
52
  });
48
53