occam-verify-cli 1.0.438 → 1.0.448

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 (222) hide show
  1. package/lib/context/file.js +42 -39
  2. package/lib/context/local.js +34 -34
  3. package/lib/context/release.js +3 -7
  4. package/lib/context/temporary.js +26 -26
  5. package/lib/element/assertion/contained.js +45 -45
  6. package/lib/element/assertion/defined.js +13 -13
  7. package/lib/element/assertion/property.js +23 -22
  8. package/lib/element/assertion/satisfies.js +7 -6
  9. package/lib/element/assertion/subproof.js +20 -17
  10. package/lib/element/assertion/type.js +3 -2
  11. package/lib/element/assertion.js +1 -23
  12. package/lib/element/assumption.js +24 -22
  13. package/lib/element/axiom.js +27 -30
  14. package/lib/element/axiomLemmaTheoremConjecture.js +50 -57
  15. package/lib/element/{statement/combinator → combinator}/bracketed.js +16 -16
  16. package/lib/element/combinator.js +229 -0
  17. package/lib/element/conclusion.js +11 -9
  18. package/lib/element/{term/constructor → constructor}/bracketed.js +5 -5
  19. package/lib/element/constructor.js +232 -0
  20. package/lib/element/declaration/combinator.js +2 -16
  21. package/lib/element/declaration/complexType.js +12 -12
  22. package/lib/element/declaration/constructor.js +13 -11
  23. package/lib/element/declaration/simpleType.js +4 -4
  24. package/lib/element/declaration/typePrefix.js +2 -2
  25. package/lib/element/declaration/variable.js +3 -3
  26. package/lib/element/deduction.js +11 -9
  27. package/lib/element/derivation.js +17 -20
  28. package/lib/element/equivalence.js +10 -10
  29. package/lib/element/equivalences.js +5 -5
  30. package/lib/element/frame.js +32 -38
  31. package/lib/element/hypothesis.js +16 -57
  32. package/lib/element/judgement.js +6 -4
  33. package/lib/element/label.js +8 -8
  34. package/lib/element/metaLemmaMetatheorem.js +6 -39
  35. package/lib/element/metaType.js +17 -80
  36. package/lib/element/metavariable.js +38 -34
  37. package/lib/element/parameter.js +3 -3
  38. package/lib/element/premise.js +92 -174
  39. package/lib/element/proof.js +7 -7
  40. package/lib/element/proofAssertion.js +203 -0
  41. package/lib/element/property.js +9 -9
  42. package/lib/element/propertyRelation.js +13 -13
  43. package/lib/element/reference.js +16 -17
  44. package/lib/element/rule.js +46 -46
  45. package/lib/element/signature.js +11 -11
  46. package/lib/element/statement.js +18 -18
  47. package/lib/element/step.js +73 -124
  48. package/lib/element/subDerivation.js +17 -20
  49. package/lib/element/subproof.js +16 -24
  50. package/lib/element/substitution/frame.js +1 -7
  51. package/lib/element/substitution/reference.js +2 -3
  52. package/lib/element/substitution/statement.js +44 -15
  53. package/lib/element/substitution/term.js +10 -57
  54. package/lib/element/substitution.js +5 -11
  55. package/lib/element/substitutions.js +29 -29
  56. package/lib/element/supposition.js +95 -177
  57. package/lib/element/term.js +21 -34
  58. package/lib/element/type.js +47 -60
  59. package/lib/element/typePrefix.js +5 -5
  60. package/lib/element/variable.js +9 -9
  61. package/lib/element.js +9 -3
  62. package/lib/metaTypes.js +63 -0
  63. package/lib/node/axiomLemmaTheoremConjecture.js +9 -9
  64. package/lib/node/body/axiom.js +2 -25
  65. package/lib/node/body/conjecture.js +2 -25
  66. package/lib/node/body/lemma.js +2 -25
  67. package/lib/node/body/metaLemma.js +2 -25
  68. package/lib/node/body/metatheorem.js +2 -25
  69. package/lib/node/body/rule.js +15 -1
  70. package/lib/node/body/theorem.js +2 -25
  71. package/lib/node/body.js +25 -2
  72. package/lib/node/combinator.js +11 -2
  73. package/lib/node/constructor.js +11 -2
  74. package/lib/node/declaration/combinator.js +5 -5
  75. package/lib/node/declaration/constructor.js +8 -8
  76. package/lib/node/declaration/property.js +15 -15
  77. package/lib/node/declaration/simpleType.js +31 -31
  78. package/lib/node/declaration/variable.js +8 -8
  79. package/lib/node/equality.js +8 -8
  80. package/lib/node/frame.js +20 -20
  81. package/lib/node/header.js +22 -22
  82. package/lib/node/metaLemmaMetaTheorem.js +16 -16
  83. package/lib/node/metavariable.js +15 -15
  84. package/lib/node/property.js +8 -8
  85. package/lib/node/propertyRelation.js +8 -8
  86. package/lib/node/rule.js +16 -16
  87. package/lib/node/statement.js +12 -12
  88. package/lib/node/step.js +22 -22
  89. package/lib/node/subDerivation.js +1 -8
  90. package/lib/node/subproof.js +5 -12
  91. package/lib/node/substitution/frame.js +19 -19
  92. package/lib/node/substitution/statement.js +19 -19
  93. package/lib/node/substitution/term.js +19 -19
  94. package/lib/node/term.js +35 -35
  95. package/lib/preamble.js +5 -5
  96. package/lib/process/instantiate.js +20 -2
  97. package/lib/process/unify.js +39 -42
  98. package/lib/process/validate.js +431 -0
  99. package/lib/process/verify.js +44 -135
  100. package/lib/types.js +27 -0
  101. package/lib/utilities/brackets.js +9 -14
  102. package/lib/utilities/element.js +91 -55
  103. package/lib/utilities/instance.js +41 -28
  104. package/lib/utilities/statement.js +2 -2
  105. package/lib/utilities/string.js +25 -14
  106. package/lib/utilities/unification.js +237 -0
  107. package/lib/utilities/validation.js +251 -0
  108. package/package.json +6 -6
  109. package/src/context/file.js +40 -34
  110. package/src/context/local.js +34 -34
  111. package/src/context/release.js +2 -6
  112. package/src/context/temporary.js +15 -15
  113. package/src/element/assertion/contained.js +19 -20
  114. package/src/element/assertion/defined.js +11 -12
  115. package/src/element/assertion/property.js +20 -20
  116. package/src/element/assertion/satisfies.js +6 -6
  117. package/src/element/assertion/subproof.js +17 -15
  118. package/src/element/assertion/type.js +2 -2
  119. package/src/element/assertion.js +0 -2
  120. package/src/element/assumption.js +22 -19
  121. package/src/element/axiom.js +33 -37
  122. package/src/element/axiomLemmaTheoremConjecture.js +54 -73
  123. package/src/element/{statement/combinator → combinator}/bracketed.js +7 -7
  124. package/src/element/combinator.js +90 -0
  125. package/src/element/conclusion.js +12 -10
  126. package/src/element/{term/constructor → constructor}/bracketed.js +5 -5
  127. package/src/element/{term/constructor.js → constructor.js} +17 -25
  128. package/src/element/declaration/combinator.js +1 -22
  129. package/src/element/declaration/complexType.js +11 -11
  130. package/src/element/declaration/constructor.js +13 -10
  131. package/src/element/declaration/simpleType.js +3 -3
  132. package/src/element/declaration/typePrefix.js +1 -1
  133. package/src/element/declaration/variable.js +2 -2
  134. package/src/element/deduction.js +12 -9
  135. package/src/element/derivation.js +15 -19
  136. package/src/element/equivalence.js +8 -8
  137. package/src/element/equivalences.js +4 -4
  138. package/src/element/frame.js +28 -30
  139. package/src/element/hypothesis.js +16 -18
  140. package/src/element/judgement.js +6 -3
  141. package/src/element/label.js +4 -4
  142. package/src/element/metaLemmaMetatheorem.js +5 -69
  143. package/src/element/metaType.js +9 -45
  144. package/src/element/metavariable.js +34 -31
  145. package/src/element/parameter.js +2 -2
  146. package/src/element/premise.js +124 -99
  147. package/src/element/proof.js +6 -6
  148. package/src/element/proofAssertion.js +76 -0
  149. package/src/element/property.js +6 -6
  150. package/src/element/propertyRelation.js +11 -11
  151. package/src/element/reference.js +14 -21
  152. package/src/element/rule.js +39 -38
  153. package/src/element/signature.js +10 -9
  154. package/src/element/statement.js +16 -18
  155. package/src/element/step.js +78 -78
  156. package/src/element/subDerivation.js +15 -19
  157. package/src/element/subproof.js +11 -19
  158. package/src/element/substitution/frame.js +0 -2
  159. package/src/element/substitution/reference.js +1 -5
  160. package/src/element/substitution/statement.js +44 -14
  161. package/src/element/substitution/term.js +10 -13
  162. package/src/element/substitution.js +3 -5
  163. package/src/element/substitutions.js +48 -30
  164. package/src/element/supposition.js +127 -108
  165. package/src/element/term.js +18 -28
  166. package/src/element/type.js +42 -36
  167. package/src/element/typePrefix.js +3 -3
  168. package/src/element/variable.js +7 -7
  169. package/src/element.js +3 -1
  170. package/src/metaTypes.js +55 -0
  171. package/src/node/axiomLemmaTheoremConjecture.js +6 -6
  172. package/src/node/body/axiom.js +0 -21
  173. package/src/node/body/conjecture.js +0 -23
  174. package/src/node/body/lemma.js +0 -23
  175. package/src/node/body/metaLemma.js +0 -23
  176. package/src/node/body/metatheorem.js +0 -23
  177. package/src/node/body/rule.js +12 -0
  178. package/src/node/body/theorem.js +0 -23
  179. package/src/node/body.js +23 -0
  180. package/src/node/combinator.js +9 -0
  181. package/src/node/constructor.js +9 -0
  182. package/src/node/declaration/combinator.js +5 -5
  183. package/src/node/declaration/constructor.js +8 -8
  184. package/src/node/declaration/property.js +14 -14
  185. package/src/node/declaration/simpleType.js +31 -31
  186. package/src/node/declaration/variable.js +7 -7
  187. package/src/node/equality.js +7 -7
  188. package/src/node/frame.js +21 -21
  189. package/src/node/header.js +22 -22
  190. package/src/node/metaLemmaMetaTheorem.js +14 -14
  191. package/src/node/metavariable.js +14 -14
  192. package/src/node/property.js +7 -7
  193. package/src/node/propertyRelation.js +7 -7
  194. package/src/node/rule.js +15 -15
  195. package/src/node/statement.js +12 -12
  196. package/src/node/step.js +21 -21
  197. package/src/node/subDerivation.js +0 -7
  198. package/src/node/subproof.js +4 -11
  199. package/src/node/substitution/frame.js +18 -18
  200. package/src/node/substitution/statement.js +18 -18
  201. package/src/node/substitution/term.js +18 -18
  202. package/src/node/term.js +34 -34
  203. package/src/preamble.js +4 -4
  204. package/src/process/instantiate.js +12 -0
  205. package/src/process/unify.js +53 -57
  206. package/src/process/validate.js +316 -0
  207. package/src/process/verify.js +50 -138
  208. package/src/types.js +18 -0
  209. package/src/utilities/brackets.js +15 -14
  210. package/src/utilities/element.js +125 -82
  211. package/src/utilities/instance.js +42 -24
  212. package/src/utilities/statement.js +2 -2
  213. package/src/utilities/string.js +38 -24
  214. package/src/{mixins/step/unify.js → utilities/unification.js} +99 -85
  215. package/src/{mixins/statement/validate.js → utilities/validation.js} +143 -69
  216. package/lib/element/statement/combinator.js +0 -105
  217. package/lib/element/term/constructor.js +0 -172
  218. package/lib/mixins/statement/validate.js +0 -198
  219. package/lib/mixins/step/unify.js +0 -228
  220. package/lib/mixins/term/verify.js +0 -65
  221. package/src/element/statement/combinator.js +0 -59
  222. package/src/mixins/term/verify.js +0 -81
@@ -2,18 +2,18 @@
2
2
 
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
- import elements from "../../elements";
5
+ import elements from "../elements";
6
6
 
7
7
  import { equalityFromStatement,
8
8
  judgementFromStatement,
9
9
  typeAssertionFromStatement,
10
10
  propertyAssertionFromStatement,
11
- satisfiesAssertionFromStatement } from "../../utilities/statement";
11
+ satisfiesAssertionFromStatement } from "../utilities/statement";
12
12
 
13
13
  const { backwardsSome } = arrayUtilities;
14
14
 
15
- function unifyWithRule(statement, reference, satisfiesAssertion, substitutions, context) {
16
- let unifiesWithRule = false;
15
+ function unifyStatementWithRule(statement, reference, satisfiesAssertion, substitutions, context) {
16
+ let statementUnifiesWithRule = false;
17
17
 
18
18
  if (reference !== null) {
19
19
  const rule = context.findRuleByReference(reference);
@@ -24,34 +24,34 @@ function unifyWithRule(statement, reference, satisfiesAssertion, substitutions,
24
24
 
25
25
  context.trace(`Unifying the '${statementString}' statement with the '${ruleString}' rule...`);
26
26
 
27
- const stepsOrSubproofs = context.getStepsOrSubproofs(),
28
- statementAndStepsUnify = rule.unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, context);
27
+ const subproofOrProofAssertions = context.getSubproofOrProofAssertions(),
28
+ statementAndSubproofOrProofAssertionsUnify = rule.unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, context);
29
29
 
30
- if (statementAndStepsUnify) {
31
- unifiesWithRule = true;
30
+ if (statementAndSubproofOrProofAssertionsUnify) {
31
+ statementUnifiesWithRule = true;
32
32
  }
33
33
 
34
- if (unifiesWithRule) {
34
+ if (statementUnifiesWithRule) {
35
35
  context.debug(`...unified the '${statementString}' statement with the '${ruleString}' rule.`);
36
36
  }
37
37
  }
38
38
  }
39
39
 
40
- return unifiesWithRule;
40
+ return statementUnifiesWithRule;
41
41
  }
42
42
 
43
- function unifyWithReference(statement, reference, satisfiesAssertion, substitutions, context) {
44
- let unifiesWithReference = false;
43
+ function unifyStatementWithReference(statement, reference, satisfiesAssertion, substitutions, context) {
44
+ let statementUnifiesWithReference = false;
45
45
 
46
46
  if (reference !== null) {
47
- const metavariableVerifies = reference.verifyMetavariable(context);
47
+ const statementString = statement.getString(),
48
+ referenceString = reference.getString();
48
49
 
49
- if (metavariableVerifies) {
50
- const statementString = statement.getString(),
51
- referenceString = reference.getString();
50
+ context.trace(`Unifying the '${statementString}' statement with the '${referenceString}' reference...`);
52
51
 
53
- context.trace(`Unifying the '${statementString}' statement with the '${referenceString}' reference...`);
52
+ const metavariableValidates = reference.validateMetavariable(context);
54
53
 
54
+ if (metavariableValidates) {
55
55
  const { StatementSubstitution } = elements,
56
56
  metavariable = reference.getMetavariable(),
57
57
  statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context),
@@ -59,19 +59,19 @@ function unifyWithReference(statement, reference, satisfiesAssertion, substituti
59
59
 
60
60
  substitutions.addSubstitution(substitution, context);
61
61
 
62
- unifiesWithReference = true;
62
+ statementUnifiesWithReference = true;
63
+ }
63
64
 
64
- if (unifiesWithReference) {
65
- context.debug(`...unified the '${statementString}' statement with the '${referenceString}' reference.`);
66
- }
65
+ if (statementUnifiesWithReference) {
66
+ context.debug(`...unified the '${statementString}' statement with the '${referenceString}' reference.`);
67
67
  }
68
68
  }
69
69
 
70
- return unifiesWithReference;
70
+ return statementUnifiesWithReference;
71
71
  }
72
72
 
73
- function unifyAsSatisfiesAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
74
- let unifiesAsSatisfiesAssertion = false;
73
+ function unifyStatementAsSatisfiesAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
74
+ let statementUnifiesAsSatisfiesAssertion = false;
75
75
 
76
76
  satisfiesAssertion = satisfiesAssertionFromStatement(statement, context);
77
77
 
@@ -86,9 +86,9 @@ function unifyAsSatisfiesAssertion(statement, reference, satisfiesAssertion, sub
86
86
  satisfiesAssertion.verifySignature(assignments, stated, context);
87
87
 
88
88
  if (reference === null) {
89
- const stepsOrSubproofs = context.getStepsOrSubproofs();
89
+ const subproofOrProofAssertions = context.getSubproofOrProofAssertions();
90
90
 
91
- unifiesAsSatisfiesAssertion = backwardsSome(stepsOrSubproofs, (stepsOrSubproof) => {
91
+ statementUnifiesAsSatisfiesAssertion = backwardsSome(subproofOrProofAssertions, (stepsOrSubproof) => {
92
92
  const stepOrSubProofUnifiesWIthSatisfiesAssertion = stepsOrSubproof.unifyWithSatisfiesAssertion(satisfiesAssertion, context);
93
93
 
94
94
  if (stepOrSubProofUnifiesWIthSatisfiesAssertion) {
@@ -115,28 +115,28 @@ function unifyAsSatisfiesAssertion(statement, reference, satisfiesAssertion, sub
115
115
  const substitutionsCorrelates = satisfiesAssertion.correlateSubstitutions(substitutions, context);
116
116
 
117
117
  if (substitutionsCorrelates) {
118
- unifiesAsSatisfiesAssertion = true;
118
+ statementUnifiesAsSatisfiesAssertion = true;
119
119
  }
120
120
  }
121
121
  } else {
122
122
  const axiomString = axiom.getString();
123
123
 
124
- context.debug(`Cannot unify with the '${axiomString}' because it is not satisfiable.`)
124
+ context.debug(`Unable to unify with the '${axiomString}' because it is not satisfiable.`)
125
125
  }
126
126
  }
127
127
  }
128
128
  }
129
129
 
130
- if (unifiesAsSatisfiesAssertion) {
130
+ if (statementUnifiesAsSatisfiesAssertion) {
131
131
  context.debug(`...unified the '${statementString}' statement as a satisfies assertion.`);
132
132
  }
133
133
  }
134
134
 
135
- return unifiesAsSatisfiesAssertion;
135
+ return statementUnifiesAsSatisfiesAssertion;
136
136
  }
137
137
 
138
- function unifyWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesAssertion, substitutions, context) {
139
- let unifiesWithAxiomLemmaTheoremOrConjecture = false;
138
+ function unifyStatementWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesAssertion, substitutions, context) {
139
+ let statementUnifiesWithAxiomLemmaTheoremOrConjecture = false;
140
140
 
141
141
  if (reference !== null) {
142
142
  const { Substitutions } = elements,
@@ -149,13 +149,13 @@ function unifyWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesA
149
149
 
150
150
  context.trace(`Unifying the '${statementString}' statement with the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture...`);
151
151
 
152
- const stepsOrSubproofs = context.getStepsOrSubproofs();
152
+ const subproofOrProofAssertions = context.getSubproofOrProofAssertions();
153
153
 
154
154
  substitutions = Substitutions.fromNothing();
155
155
 
156
- const statementAndStepsUnify = axiomLemmaTheoremOrConjecture.unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, substitutions, context);
156
+ const statementAndSubproofOrProofAssertionsUnify = axiomLemmaTheoremOrConjecture.unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, substitutions, context);
157
157
 
158
- if (statementAndStepsUnify) {
158
+ if (statementAndSubproofOrProofAssertionsUnify) {
159
159
  const { StatementSubstitution } = elements,
160
160
  metavariable = reference.getMetavariable(),
161
161
  statementSubstitution = StatementSubstitution.fromStatementAndMetavariable(statement, metavariable, context),
@@ -165,20 +165,20 @@ function unifyWithAxiomLemmaTheoremOrConjecture(statement, reference, satisfiesA
165
165
 
166
166
  substitutions.addSubstitution(substitution, context);
167
167
 
168
- unifiesWithAxiomLemmaTheoremOrConjecture = true;
168
+ statementUnifiesWithAxiomLemmaTheoremOrConjecture = true;
169
169
  }
170
170
 
171
- if (unifiesWithAxiomLemmaTheoremOrConjecture) {
171
+ if (statementUnifiesWithAxiomLemmaTheoremOrConjecture) {
172
172
  context.debug(`...unified the '${statementString}' statement with the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture.`);
173
173
  }
174
174
  }
175
175
  }
176
176
 
177
- return unifiesWithAxiomLemmaTheoremOrConjecture;
177
+ return statementUnifiesWithAxiomLemmaTheoremOrConjecture;
178
178
  }
179
179
 
180
- function unifyAEquality(statement, reference, satisfiesAssertion, substitutions, context) {
181
- let unifiesAEquality = false;
180
+ function unifyStatementAEquality(statement, reference, satisfiesAssertion, substitutions, context) {
181
+ let statementUnifiesAEquality = false;
182
182
 
183
183
  if (reference === null) {
184
184
  const equality = equalityFromStatement(statement, context);
@@ -191,20 +191,20 @@ function unifyAEquality(statement, reference, satisfiesAssertion, substitutions,
191
191
  const equalityEqual = equality.isEqual(context);
192
192
 
193
193
  if (equalityEqual) {
194
- unifiesAEquality = true;
194
+ statementUnifiesAEquality = true;
195
195
  }
196
196
 
197
- if (unifiesAEquality) {
197
+ if (statementUnifiesAEquality) {
198
198
  context.debug(`...unified the '${statementString}' statement as an equality.`);
199
199
  }
200
200
  }
201
201
  }
202
202
 
203
- return unifiesAEquality;
203
+ return statementUnifiesAEquality;
204
204
  }
205
205
 
206
- function unifyAsJudgement(statement, reference, satisfiesAssertion, substitutions, context) {
207
- let unifiesAsJudgement = false;
206
+ function unifyStatementAsJudgement(statement, reference, satisfiesAssertion, substitutions, context) {
207
+ let statementUnifiesAsJudgement = false;
208
208
 
209
209
  if (reference === null) {
210
210
  const judgement = judgementFromStatement(statement, context);
@@ -214,19 +214,19 @@ function unifyAsJudgement(statement, reference, satisfiesAssertion, substitution
214
214
 
215
215
  context.trace(`Unifying the '${statementString}' statement as a judgement...`);
216
216
 
217
- unifiesAsJudgement = true;
217
+ statementUnifiesAsJudgement = true;
218
218
 
219
- if (unifiesAsJudgement) {
219
+ if (statementUnifiesAsJudgement) {
220
220
  context.debug(`...unified the '${statementString}' statement as a judgement.`);
221
221
  }
222
222
  }
223
223
  }
224
224
 
225
- return unifiesAsJudgement;
225
+ return statementUnifiesAsJudgement;
226
226
  }
227
227
 
228
- function unifyAsTypeAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
229
- let unifiesAsTypeAssertion = false;
228
+ function unifyStatementAsTypeAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
229
+ let statementUnifiesAsTypeAssertion = false;
230
230
 
231
231
  if (reference === null) {
232
232
  const typeAssertion = typeAssertionFromStatement(statement, context);
@@ -236,17 +236,17 @@ function unifyAsTypeAssertion(statement, reference, satisfiesAssertion, substitu
236
236
 
237
237
  context.trace(`Unifying the '${statementString}' statement as a type assertion...`);
238
238
 
239
- unifiesAsTypeAssertion = true;
239
+ statementUnifiesAsTypeAssertion = true;
240
240
 
241
241
  context.debug(`...unified the '${statementString}' statement as a type assertion.`);
242
242
  }
243
243
  }
244
244
 
245
- return unifiesAsTypeAssertion;
245
+ return statementUnifiesAsTypeAssertion;
246
246
  }
247
247
 
248
- function unifyAsPropertyAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
249
- let unifiesAsPropertyAssertion = false;
248
+ function unifyStatementAsPropertyAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
249
+ let statementUnifiesAsPropertyAssertion = false;
250
250
 
251
251
  if (reference === null) {
252
252
  const propertyAssertion = propertyAssertionFromStatement(statement, context);
@@ -262,69 +262,83 @@ function unifyAsPropertyAssertion(statement, reference, satisfiesAssertion, subs
262
262
  if (equivalence !== null) {
263
263
  const propertyAssertionMatches = equivalence.someOtherTerm(term, (term) => { ///
264
264
  const propertyRelation = propertyAssertion.getPropertyRelation(),
265
- propertyAssertionMatches = context.matchTermAndPropertyRelation(term, propertyRelation);
265
+ comparesToTermAndPropertyRelation = context.compareTermAndPropertyRelation(term, propertyRelation);
266
266
 
267
- if (propertyAssertionMatches) {
267
+ if (comparesToTermAndPropertyRelation) {
268
268
  return true;
269
269
  }
270
270
  });
271
271
 
272
272
  if (propertyAssertionMatches) {
273
- unifiesAsPropertyAssertion = true;
273
+ statementUnifiesAsPropertyAssertion = true;
274
274
  }
275
275
  }
276
276
 
277
- if (unifiesAsPropertyAssertion) {
277
+ if (statementUnifiesAsPropertyAssertion) {
278
278
  context.debug(`...unified the '${statementString}' statement as a property assertion.`);
279
279
  }
280
280
  }
281
281
  }
282
282
 
283
- return unifiesAsPropertyAssertion;
283
+ return statementUnifiesAsPropertyAssertion;
284
284
  }
285
285
 
286
- function unifyWithSatisfiesAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
287
- let unifiesWithSatisfiesAssertion = false;
286
+ function unifyStatementWithSatisfiesAssertion(statement, reference, satisfiesAssertion, substitutions, context) {
287
+ let statementUnifiesWithSatisfiesAssertion = false;
288
288
 
289
289
  if (satisfiesAssertion !== null) {
290
- const stepsOrSubproofs = context.getStepsOrSubproofs(),
291
- statementUnifies = satisfiesAssertion.unifyStatementAndStepsOrSubproofs(statement, stepsOrSubproofs, context);
290
+ const statementString = statement.getString(),
291
+ satisfiesAssertionString = satisfiesAssertion.getString();
292
+
293
+ context.trace(`Unifying the '${statementString}' statememnt with the '${satisfiesAssertionString}' satisfies assertion...`);
294
+
295
+ const subproofOrProofAssertions = context.getSubproofOrProofAssertions(),
296
+ statementUnifies = satisfiesAssertion.unifyStatementAndSubproofOrProofAssertions(statement, subproofOrProofAssertions, context);
292
297
 
293
298
  if (statementUnifies) {
294
- unifiesWithSatisfiesAssertion = true;
299
+ statementUnifiesWithSatisfiesAssertion = true;
300
+ }
301
+
302
+ if (statementUnifiesWithSatisfiesAssertion) {
303
+ context.debug(`...unified the '${statementString}' statememnt with the '${satisfiesAssertionString}' satisfies assertion.`);
295
304
  }
296
305
  }
297
306
 
298
- return unifiesWithSatisfiesAssertion;
307
+ return statementUnifiesWithSatisfiesAssertion;
299
308
  }
300
309
 
301
- function equateWithStepsOrSubproofs(statement, reference, satisfiesAssertion, substitutions, context) {
302
- let unifiesWithStepOrSubproofs = false;
310
+ function compareStatementWithSubproofOrProofAssertions(statement, reference, satisfiesAssertion, substitutions, context) {
311
+ let statementEquatesWithStepOrSubproofs = false;
303
312
 
304
313
  if (reference === null) {
305
- const stepsOrSubproofs = context.getStepsOrSubproofs(),
306
- statementUnifiesWithSteps = statement.equateWithStepsOrSubproofs(stepsOrSubproofs, context);
314
+ const statementString = statement.getString();
315
+
316
+ context.trace(`Comparing the '${statementString}' statement with the subproofs or proof asssertions...`);
317
+
318
+ const subproofOrProofAssertions = context.getSubproofOrProofAssertions(),
319
+ statementUnifiesWithSteps = statement.compareSubproofOrProofAssertions(subproofOrProofAssertions, context);
307
320
 
308
321
  if (statementUnifiesWithSteps) {
309
- unifiesWithStepOrSubproofs = true;
322
+ statementEquatesWithStepOrSubproofs = true;
323
+ }
324
+
325
+ if (statementEquatesWithStepOrSubproofs) {
326
+ context.debug(`...compared the '${statementString}' statement with the subproofs or proof asssertions.`);
310
327
  }
311
328
  }
312
329
 
313
- return unifiesWithStepOrSubproofs;
330
+ return statementEquatesWithStepOrSubproofs;
314
331
  }
315
332
 
316
- const unifyMixins = [
317
- unifyWithRule,
318
- unifyWithReference,
319
- unifyAsSatisfiesAssertion,
320
- unifyWithAxiomLemmaTheoremOrConjecture,
321
- unifyAEquality,
322
- unifyAsJudgement,
323
- unifyAsTypeAssertion,
324
- unifyAsPropertyAssertion,
325
- unifyWithSatisfiesAssertion,
326
- equateWithStepsOrSubproofs
333
+ export const unifyStatements = [
334
+ unifyStatementWithRule,
335
+ unifyStatementWithReference,
336
+ unifyStatementAsSatisfiesAssertion,
337
+ unifyStatementWithAxiomLemmaTheoremOrConjecture,
338
+ unifyStatementAEquality,
339
+ unifyStatementAsJudgement,
340
+ unifyStatementAsTypeAssertion,
341
+ unifyStatementAsPropertyAssertion,
342
+ unifyStatementWithSatisfiesAssertion,
343
+ compareStatementWithSubproofOrProofAssertions
327
344
  ];
328
-
329
- export default unifyMixins;
330
-