occam-verify-cli 1.0.421 → 1.0.428

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 (278) hide show
  1. package/lib/action/verify.js +7 -3
  2. package/lib/context/file.js +8 -44
  3. package/lib/context/local.js +8 -26
  4. package/lib/context/nominal.js +64 -0
  5. package/lib/context/release.js +2 -2
  6. package/lib/context/temporary.js +6 -58
  7. package/lib/element/assertion/contained.js +303 -0
  8. package/lib/element/assertion/defined.js +318 -0
  9. package/lib/element/assertion/property.js +299 -0
  10. package/lib/element/assertion/satisfies.js +264 -0
  11. package/lib/element/assertion/subproof.js +178 -0
  12. package/lib/element/assertion/type.js +294 -0
  13. package/lib/{ontology → element}/assertion.js +9 -9
  14. package/lib/element/assumption.js +365 -0
  15. package/lib/element/axiom.js +332 -0
  16. package/lib/element/axiomLemmaTheoremConjecture.js +346 -0
  17. package/lib/element/conclusion.js +151 -0
  18. package/lib/{ontology → element}/conjecture.js +7 -14
  19. package/lib/element/declaration/combinator.js +161 -0
  20. package/lib/element/declaration/complexType.js +343 -0
  21. package/lib/element/declaration/constructor.js +193 -0
  22. package/lib/element/declaration/metavariable.js +193 -0
  23. package/lib/element/declaration/simpleType.js +240 -0
  24. package/lib/element/declaration/typePrefix.js +179 -0
  25. package/lib/element/declaration/variable.js +196 -0
  26. package/lib/{ontology → element}/declaration.js +9 -9
  27. package/lib/element/deduction.js +207 -0
  28. package/lib/element/derivation.js +96 -0
  29. package/lib/element/equality.js +275 -0
  30. package/lib/element/equivalence.js +312 -0
  31. package/lib/element/equivalences.js +264 -0
  32. package/lib/{ontology → element}/error.js +12 -12
  33. package/lib/element/frame.js +387 -0
  34. package/lib/element/hypothesis.js +195 -0
  35. package/lib/element/judgement.js +243 -0
  36. package/lib/element/label.js +198 -0
  37. package/lib/{ontology → element}/lemma.js +7 -7
  38. package/lib/{ontology → element}/metaLemma.js +8 -8
  39. package/lib/element/metaLemmaMetatheorem.js +234 -0
  40. package/lib/{ontology → element}/metaType.js +18 -11
  41. package/lib/{ontology → element}/metatheorem.js +8 -8
  42. package/lib/element/metavariable.js +459 -0
  43. package/lib/element/parameter.js +108 -0
  44. package/lib/element/premise.js +310 -0
  45. package/lib/element/procedureCall.js +243 -0
  46. package/lib/{ontology → element}/procedureReference.js +3 -3
  47. package/lib/{ontology → element}/proof.js +4 -4
  48. package/lib/element/property.js +128 -0
  49. package/lib/element/propertyRelation.js +195 -0
  50. package/lib/element/reference.js +304 -0
  51. package/lib/element/rule.js +373 -0
  52. package/lib/element/section.js +255 -0
  53. package/lib/element/signature.js +217 -0
  54. package/lib/element/statement/combinator/bracketed.js +166 -0
  55. package/lib/element/statement/combinator.js +105 -0
  56. package/lib/element/statement.js +386 -0
  57. package/lib/element/step.js +274 -0
  58. package/lib/element/subDerivation.js +137 -0
  59. package/lib/element/subproof.js +240 -0
  60. package/lib/element/substitution/frame.js +216 -0
  61. package/lib/{ontology → element}/substitution/reference.js +5 -4
  62. package/lib/{ontology → element}/substitution/statement.js +7 -6
  63. package/lib/element/substitution/term.js +265 -0
  64. package/lib/element/substitution.js +206 -0
  65. package/lib/element/substitutions.js +425 -0
  66. package/lib/element/supposition.js +323 -0
  67. package/lib/{ontology → element/term}/constructor/bracketed.js +11 -7
  68. package/lib/element/term/constructor.js +172 -0
  69. package/lib/element/term.js +322 -0
  70. package/lib/{ontology → element}/theorem.js +8 -8
  71. package/lib/element/type.js +490 -0
  72. package/lib/element/typePrefix.js +99 -0
  73. package/lib/element/variable.js +345 -0
  74. package/lib/elements.js +27 -0
  75. package/lib/mixins/statement/verify.js +14 -14
  76. package/lib/mixins/step/unify.js +12 -12
  77. package/lib/mixins/term/verify.js +4 -4
  78. package/lib/node/equivalence.js +116 -0
  79. package/lib/node/substitution/frame.js +15 -1
  80. package/lib/node/substitution/statement.js +37 -1
  81. package/lib/node/substitution/term.js +15 -1
  82. package/lib/nonTerminalNodeMap.js +4 -3
  83. package/lib/preamble.js +63 -63
  84. package/lib/process/assign.js +58 -0
  85. package/lib/process/instantiate.js +74 -7
  86. package/lib/process/unify.js +26 -26
  87. package/lib/process/verify.js +21 -21
  88. package/lib/ruleNames.js +5 -1
  89. package/lib/utilities/brackets.js +9 -18
  90. package/lib/utilities/customGrammar.js +1 -1
  91. package/lib/utilities/element.js +1141 -0
  92. package/lib/utilities/json.js +32 -32
  93. package/lib/utilities/node.js +49 -61
  94. package/lib/utilities/statement.js +83 -0
  95. package/lib/utilities/string.js +80 -57
  96. package/package.json +6 -6
  97. package/src/action/verify.js +8 -1
  98. package/src/context/file.js +9 -39
  99. package/src/context/local.js +5 -11
  100. package/src/context/nominal.js +30 -0
  101. package/src/context/release.js +1 -1
  102. package/src/context/temporary.js +6 -63
  103. package/src/{ontology → element}/assertion/contained.js +4 -25
  104. package/src/{ontology → element}/assertion/defined.js +7 -26
  105. package/src/{ontology → element}/assertion/property.js +7 -26
  106. package/src/{ontology → element}/assertion/satisfies.js +5 -53
  107. package/src/{ontology → element}/assertion/subproof.js +3 -32
  108. package/src/{ontology → element}/assertion/type.js +7 -26
  109. package/src/{ontology → element}/assertion.js +6 -6
  110. package/src/{ontology → element}/assumption.js +3 -27
  111. package/src/{ontology → element}/axiom.js +4 -11
  112. package/src/{ontology/topLevelAssertion.js → element/axiomLemmaTheoremConjecture.js} +9 -105
  113. package/src/{ontology → element}/conclusion.js +4 -19
  114. package/src/{ontology → element}/conjecture.js +4 -11
  115. package/src/{ontology → element}/declaration/combinator.js +3 -14
  116. package/src/{ontology → element}/declaration/complexType.js +3 -19
  117. package/src/{ontology → element}/declaration/constructor.js +3 -14
  118. package/src/{ontology → element}/declaration/metavariable.js +3 -39
  119. package/src/{ontology → element}/declaration/simpleType.js +3 -19
  120. package/src/{ontology → element}/declaration/typePrefix.js +3 -15
  121. package/src/{ontology → element}/declaration/variable.js +3 -14
  122. package/src/{ontology → element}/declaration.js +6 -6
  123. package/src/{ontology → element}/deduction.js +9 -22
  124. package/src/{ontology → element}/derivation.js +2 -32
  125. package/src/{ontology → element}/equality.js +18 -42
  126. package/src/{ontology → element}/equivalence.js +37 -22
  127. package/src/{ontology → element}/equivalences.js +1 -2
  128. package/src/{ontology → element}/error.js +8 -8
  129. package/src/{ontology → element}/frame.js +8 -56
  130. package/src/{ontology → element}/hypothesis.js +5 -5
  131. package/src/{ontology → element}/judgement.js +7 -7
  132. package/src/{ontology → element}/label.js +3 -3
  133. package/src/{ontology → element}/lemma.js +4 -4
  134. package/src/{ontology → element}/metaLemma.js +5 -5
  135. package/src/{ontology/topLevelMetaAssertion.js → element/metaLemmaMetatheorem.js} +11 -11
  136. package/src/{ontology → element}/metaType.js +11 -7
  137. package/src/{ontology → element}/metatheorem.js +5 -5
  138. package/src/{ontology → element}/metavariable.js +10 -60
  139. package/src/{ontology → element}/parameter.js +1 -1
  140. package/src/{ontology → element}/premise.js +14 -14
  141. package/src/{ontology → element}/procedureCall.js +4 -4
  142. package/src/{ontology → element}/procedureReference.js +1 -1
  143. package/src/{ontology → element}/proof.js +3 -3
  144. package/src/{ontology → element}/property.js +7 -15
  145. package/src/{ontology → element}/propertyRelation.js +5 -11
  146. package/src/{ontology → element}/reference.js +5 -19
  147. package/src/{ontology → element}/rule.js +13 -13
  148. package/src/{ontology → element}/section.js +10 -10
  149. package/src/{ontology → element}/signature.js +12 -15
  150. package/src/element/statement/combinator/bracketed.js +38 -0
  151. package/src/element/statement/combinator.js +59 -0
  152. package/src/{ontology → element}/statement.js +11 -27
  153. package/src/{ontology → element}/step.js +10 -44
  154. package/src/{ontology → element}/subDerivation.js +3 -24
  155. package/src/{ontology → element}/subproof.js +3 -43
  156. package/src/{ontology → element}/substitution/frame.js +4 -21
  157. package/src/{ontology → element}/substitution/reference.js +3 -3
  158. package/src/{ontology → element}/substitution/statement.js +6 -10
  159. package/src/{ontology → element}/substitution/term.js +7 -23
  160. package/src/{ontology → element}/substitutions.js +1 -1
  161. package/src/{ontology → element}/supposition.js +10 -10
  162. package/src/{ontology → element/term}/constructor/bracketed.js +12 -13
  163. package/src/element/term/constructor.js +82 -0
  164. package/src/{ontology → element}/term.js +6 -38
  165. package/src/{ontology → element}/theorem.js +5 -5
  166. package/src/{ontology → element}/type.js +17 -64
  167. package/src/{ontology → element}/typePrefix.js +8 -12
  168. package/src/{ontology → element}/variable.js +9 -20
  169. package/src/elements.js +13 -0
  170. package/src/mixins/statement/verify.js +4 -4
  171. package/src/mixins/step/unify.js +6 -6
  172. package/src/mixins/term/verify.js +3 -3
  173. package/src/node/equivalence.js +16 -0
  174. package/src/node/substitution/frame.js +14 -0
  175. package/src/node/substitution/statement.js +40 -0
  176. package/src/node/substitution/term.js +15 -0
  177. package/src/nonTerminalNodeMap.js +4 -1
  178. package/src/preamble.js +62 -62
  179. package/src/process/assign.js +59 -0
  180. package/src/process/instantiate.js +71 -15
  181. package/src/process/unify.js +37 -39
  182. package/src/process/verify.js +20 -20
  183. package/src/ruleNames.js +1 -0
  184. package/src/utilities/brackets.js +12 -17
  185. package/src/utilities/customGrammar.js +3 -3
  186. package/src/utilities/element.js +1399 -0
  187. package/src/utilities/json.js +31 -31
  188. package/src/utilities/node.js +56 -64
  189. package/src/utilities/{context.js → statement.js} +10 -39
  190. package/src/utilities/string.js +83 -53
  191. package/lib/assignment/equality.js +0 -62
  192. package/lib/assignment/judgement.js +0 -62
  193. package/lib/assignment/variable.js +0 -64
  194. package/lib/context/bracketed/combinator.js +0 -121
  195. package/lib/context/bracketed/constructor.js +0 -121
  196. package/lib/context/bracketted.js +0 -86
  197. package/lib/context/partial/metavariable.js +0 -180
  198. package/lib/context/partial/statement.js +0 -180
  199. package/lib/context/partial/term.js +0 -192
  200. package/lib/context/partial/variable.js +0 -192
  201. package/lib/context/partial.js +0 -93
  202. package/lib/ontology/assertion/contained.js +0 -357
  203. package/lib/ontology/assertion/defined.js +0 -331
  204. package/lib/ontology/assertion/property.js +0 -313
  205. package/lib/ontology/assertion/satisfies.js +0 -302
  206. package/lib/ontology/assertion/subproof.js +0 -240
  207. package/lib/ontology/assertion/type.js +0 -308
  208. package/lib/ontology/assumption.js +0 -383
  209. package/lib/ontology/axiom.js +0 -339
  210. package/lib/ontology/combinator/bracketed.js +0 -202
  211. package/lib/ontology/combinator.js +0 -155
  212. package/lib/ontology/conclusion.js +0 -201
  213. package/lib/ontology/constructor.js +0 -185
  214. package/lib/ontology/declaration/combinator.js +0 -210
  215. package/lib/ontology/declaration/complexType.js +0 -393
  216. package/lib/ontology/declaration/constructor.js +0 -242
  217. package/lib/ontology/declaration/metavariable.js +0 -257
  218. package/lib/ontology/declaration/simpleType.js +0 -290
  219. package/lib/ontology/declaration/typePrefix.js +0 -228
  220. package/lib/ontology/declaration/variable.js +0 -245
  221. package/lib/ontology/deduction.js +0 -215
  222. package/lib/ontology/derivation.js +0 -155
  223. package/lib/ontology/equality.js +0 -288
  224. package/lib/ontology/equivalence.js +0 -295
  225. package/lib/ontology/equivalences.js +0 -264
  226. package/lib/ontology/frame.js +0 -419
  227. package/lib/ontology/hypothesis.js +0 -190
  228. package/lib/ontology/judgement.js +0 -248
  229. package/lib/ontology/label.js +0 -198
  230. package/lib/ontology/metavariable.js +0 -502
  231. package/lib/ontology/parameter.js +0 -108
  232. package/lib/ontology/premise.js +0 -310
  233. package/lib/ontology/procedureCall.js +0 -243
  234. package/lib/ontology/property.js +0 -166
  235. package/lib/ontology/propertyRelation.js +0 -202
  236. package/lib/ontology/reference.js +0 -315
  237. package/lib/ontology/rule.js +0 -373
  238. package/lib/ontology/section.js +0 -255
  239. package/lib/ontology/signature.js +0 -217
  240. package/lib/ontology/statement.js +0 -398
  241. package/lib/ontology/step.js +0 -295
  242. package/lib/ontology/subDerivation.js +0 -147
  243. package/lib/ontology/subproof.js +0 -265
  244. package/lib/ontology/substitution/frame.js +0 -261
  245. package/lib/ontology/substitution/term.js +0 -269
  246. package/lib/ontology/substitution.js +0 -206
  247. package/lib/ontology/substitutions.js +0 -425
  248. package/lib/ontology/supposition.js +0 -323
  249. package/lib/ontology/term.js +0 -351
  250. package/lib/ontology/topLevelAssertion.js +0 -431
  251. package/lib/ontology/topLevelMetaAssertion.js +0 -234
  252. package/lib/ontology/type.js +0 -556
  253. package/lib/ontology/typePrefix.js +0 -99
  254. package/lib/ontology/variable.js +0 -343
  255. package/lib/ontology.js +0 -27
  256. package/lib/utilities/assignments.js +0 -19
  257. package/lib/utilities/context.js +0 -101
  258. package/lib/utilities/subproof.js +0 -42
  259. package/lib/utilities/type.js +0 -40
  260. package/src/assignment/equality.js +0 -29
  261. package/src/assignment/judgement.js +0 -29
  262. package/src/assignment/variable.js +0 -34
  263. package/src/context/bracketed/combinator.js +0 -31
  264. package/src/context/bracketed/constructor.js +0 -31
  265. package/src/context/bracketted.js +0 -41
  266. package/src/context/partial/metavariable.js +0 -39
  267. package/src/context/partial/statement.js +0 -39
  268. package/src/context/partial/term.js +0 -49
  269. package/src/context/partial/variable.js +0 -49
  270. package/src/context/partial.js +0 -71
  271. package/src/ontology/combinator/bracketed.js +0 -38
  272. package/src/ontology/combinator.js +0 -72
  273. package/src/ontology/constructor.js +0 -105
  274. package/src/ontology.js +0 -13
  275. package/src/utilities/assignments.js +0 -11
  276. package/src/utilities/subproof.js +0 -56
  277. package/src/utilities/type.js +0 -35
  278. /package/src/{ontology → element}/substitution.js +0 -0
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
- import ontology from "../ontology";
5
+ import elements from "../elements";
6
6
  import LocalContext from "../context/local";
7
7
 
8
8
  import { labelsFromJSON,
@@ -18,11 +18,11 @@ import { labelsFromJSON,
18
18
 
19
19
  const { extract, reverse, correlate, backwardsEvery } = arrayUtilities;
20
20
 
21
- export default class TopLevelAssertion {
22
- constructor(context, node, string, labels, suppositions, deduction, proof, signature, hypotheses) {
21
+ export default class AxiomLemmaTheoremConjecture {
22
+ constructor(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses) {
23
23
  this.context = context;
24
- this.node = node;
25
24
  this.string = string;
25
+ this.node = node;
26
26
  this.labels = labels;
27
27
  this.suppositions = suppositions;
28
28
  this.deduction = deduction;
@@ -174,7 +174,7 @@ export default class TopLevelAssertion {
174
174
  if (this.proof === null) {
175
175
  proofVerifies = true;
176
176
  } else {
177
- const { Substitutions } = ontology,
177
+ const { Substitutions } = elements,
178
178
  substitutions = Substitutions.fromNothing();
179
179
 
180
180
  proofVerifies = this.proof.verify(substitutions, this.deduction, context);
@@ -318,9 +318,9 @@ export default class TopLevelAssertion {
318
318
  node = null,
319
319
  proof = null,
320
320
  string = stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
321
- topLevelAssertion = new Class(context, node, string, labels, suppositions, deduction, proof, signature, hypotheses);
321
+ axiomLemmaTheoremConjecture = new Class(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
322
322
 
323
- return topLevelAssertion;
323
+ return axiomLemmaTheoremConjecture;
324
324
  }
325
325
 
326
326
  static fromNode(Class, node, context) {
@@ -337,104 +337,8 @@ export default class TopLevelAssertion {
337
337
  signature = signatureFromSignatureNode(signatureNode, context),
338
338
  hypotheses = [],
339
339
  string = stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction),
340
- topLevelAssertion = new Class(context, node, string, labels, suppositions, deduction, proof, signature, hypotheses);
341
-
342
- return topLevelAssertion;
343
- }
344
- }
345
-
346
- export function proofFromProofNode(proofNode, context) {
347
- const { Proof } = ontology,
348
- proof = Proof.fromProofNode(proofNode, context);
349
-
350
- return proof;
351
- }
352
-
353
- export function labelsFromLabelNodes(labelNodes, context) {
354
- const { Label } = ontology,
355
- labels = labelNodes.map((labelNode) => {
356
- const label = Label.fromLabelNode(labelNode, context);
357
-
358
- return label;
359
- });
360
-
361
- return labels;
362
- }
363
-
364
- export function signatureFromSignatureNode(signatureNode, context) {
365
- let signature = null;
366
-
367
- if (signatureNode !== null) {
368
- const { Signature } = ontology;
369
-
370
- signature = Signature.fromSignatureNode(signatureNode, context);
371
- }
372
-
373
- return signature;
374
- }
340
+ axiomLemmaTheoremConjecture = new Class(context, string, node, labels, suppositions, deduction, proof, signature, hypotheses);
375
341
 
376
- export function deductionFromDeductionNode(deductionNode, context) {
377
- const { Deduction } = ontology,
378
- deduction = Deduction.fromDeductionNode(deductionNode, context);
379
-
380
- return deduction;
381
- }
382
-
383
- export function suppositionsFromSuppositionNodes(suppositionNodes, context) {
384
- const { Supposition } = ontology,
385
- suppositions = suppositionNodes.map((suppositionNode) => {
386
- const supposition = Supposition.fromSuppositionNode(suppositionNode, context);
387
-
388
- return supposition;
389
- });
390
-
391
- return suppositions;
392
- }
393
-
394
- export function labelsStringFromLabels(labels) {
395
- const labelsString = labels.reduce((labelsString, label) => {
396
- const labelString = label.getString();
397
-
398
- labelsString = (labelsString === null) ?
399
- labelString: ///
400
- `${labelsString}, ${labelString}`;
401
-
402
- return labelsString;
403
- }, null);
404
-
405
- return labelsString;
406
- }
407
-
408
- export function suppositionsStringFromSuppositions(suppositions) {
409
- const suppositionsString = suppositions.reduce((suppositionsString, supposition) => {
410
- const suppositionString = supposition.getString();
411
-
412
- suppositionsString = (suppositionsString !== null) ?
413
- `${suppositionsString}, ${suppositionString}` :
414
- suppositionString; ///
415
-
416
- return suppositionsString;
417
- }, null);
418
-
419
- return suppositionsString;
420
- }
421
-
422
- export function stringFromLabelsSuppositionsAndDeduction(labels, suppositions, deduction) {
423
- let string;
424
-
425
- const suppositionsString = suppositionsStringFromSuppositions(suppositions),
426
- deductionString = deduction.getString(),
427
- labelsString = labelsStringFromLabels(labels);
428
-
429
- if (labelsString !== null) {
430
- string = (suppositionsString !== null) ?
431
- `${labelsString} :: [${suppositionsString}] ... ${deductionString}` :
432
- `${labelsString} :: ${deductionString}`;
433
- } else {
434
- string = (suppositionsString !== null) ?
435
- `[${suppositionsString}] ... ${deductionString}` :
436
- deductionString;
342
+ return axiomLemmaTheoremConjecture;
437
343
  }
438
-
439
- return string;
440
344
  }
@@ -1,16 +1,15 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../ontology";
4
3
  import TemporaryContext from "../context/temporary";
5
4
 
6
- import { define } from "../ontology";
5
+ import { define } from "../elements";
7
6
  import { termsFromJSON, framesFromJSON, statementFromJSON, termsToTermsJSON, framesToFramesJSON, statementToStatementJSON } from "../utilities/json";
8
7
 
9
8
  export default define(class Conclusion {
10
- constructor(context, node, string, statement) {
9
+ constructor(context, string, node, statement) {
11
10
  this.context = context;
12
- this.node = node;
13
11
  this.string = string;
12
+ this.node = node;
14
13
  this.statement = statement;
15
14
  }
16
15
 
@@ -120,21 +119,7 @@ export default define(class Conclusion {
120
119
 
121
120
  context = temporaryContext; ///
122
121
 
123
- const conclusion = new Conclusion(context, node, string, statement);
124
-
125
- return conclusion;
126
- }
127
-
128
- static fromConclusionNode(conclusionNode, context) {
129
- const { Statement } = ontology,
130
- node = conclusionNode, ///
131
- string = context.nodeAsString(node),
132
- statement = Statement.fromConclusionNode(conclusionNode, context),
133
- temporaryContext = null;
134
-
135
- context = temporaryContext; ///
136
-
137
- const conclusion = new Conclusion(context, node, string, statement);
122
+ const conclusion = new Conclusion(context, string, node, statement);
138
123
 
139
124
  return conclusion;
140
125
  }
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- import TopLevelAssertion from "./topLevelAssertion";
3
+ import AxiomLemmaTheoremConjecture from "./axiomLemmaTheoremConjecture";
4
4
 
5
- import { define } from "../ontology";
5
+ import { define } from "../elements";
6
6
 
7
- export default define(class Conjecture extends TopLevelAssertion {
7
+ export default define(class Conjecture extends AxiomLemmaTheoremConjecture {
8
8
  verify() {
9
9
  let verifies;
10
10
 
@@ -30,12 +30,5 @@ export default define(class Conjecture extends TopLevelAssertion {
30
30
 
31
31
  static name = "Conjecture";
32
32
 
33
- static fromJSON(json, context) { return TopLevelAssertion.fromJSON(Conjecture, json, context); }
34
-
35
- static fromConjectureNode(conjectureNode, context) {
36
- const node = conjectureNode, ///
37
- conjecture = TopLevelAssertion.fromNode(Conjecture, node, context);
38
-
39
- return conjecture;
40
- }
33
+ static fromJSON(json, context) { return AxiomLemmaTheoremConjecture.fromJSON(Conjecture, json, context); }
41
34
  });
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../../ontology";
4
3
  import Declaration from "../declaration";
5
4
 
6
- import { define } from "../../ontology";
5
+ import { define } from "../../elements";
7
6
  import { verifyStatement } from "../../process/verify";
8
7
 
9
8
  export default define(class CombinatorDeclaration extends Declaration {
10
- constructor(context, node, string, combinator) {
11
- super(context, node, string);
9
+ constructor(context, string, node, combinator) {
10
+ super(context, string, node);
12
11
 
13
12
  this.combinator = combinator;
14
13
  }
@@ -63,14 +62,4 @@ export default define(class CombinatorDeclaration extends Declaration {
63
62
  }
64
63
 
65
64
  static name = "CombinatorDeclaration";
66
-
67
- static fromCombinatorDeclarationNode(combinatorDeclarationNode, context) {
68
- const { Combinator } = ontology,
69
- node = combinatorDeclarationNode, ///
70
- string = context.nodeAsString(node),
71
- combinator = Combinator.fromCombinatorDeclarationNode(combinatorDeclarationNode, context),
72
- combinatorDeclaration = new CombinatorDeclaration(context, node, string, combinator);
73
-
74
- return combinatorDeclaration;
75
- }
76
65
  });
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../../ontology";
4
3
  import Declaration from "../declaration";
5
4
 
6
- import { define } from "../../ontology";
7
- import { stringFromTypeNameTypePrefixNameAndSuperTypes } from "../../utilities/type";
5
+ import { define } from "../../elements";
8
6
 
9
7
  export default define(class ComplexTypeDeclaration extends Declaration {
10
- constructor(context, node, string, type, prefixed) {
11
- super(context, node, string);
8
+ constructor(context, string, node, type, prefixed) {
9
+ super(context, string, node);
12
10
 
13
11
  this.type = type;
14
12
  this.prefixed = prefixed;
@@ -313,18 +311,4 @@ export default define(class ComplexTypeDeclaration extends Declaration {
313
311
  }
314
312
 
315
313
  static name = "ComplexTypeDeclaration";
316
-
317
- static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
318
- const { Type } = ontology,
319
- type = Type.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
320
- node = complexTypeDeclarationNode, ///
321
- prefixed = complexTypeDeclarationNode.isPrefixed(),
322
- typePrefixName = complexTypeDeclarationNode.getTypePrefixName(),
323
- typeName = type.getName(),
324
- superTypes = type.getSuperTypes(),
325
- string = stringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes),
326
- complexTypeDeclaration = new ComplexTypeDeclaration(context, node, string, type, prefixed);
327
-
328
- return complexTypeDeclaration;
329
- }
330
314
  });
@@ -1,14 +1,13 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../../ontology";
4
3
  import Declaration from "../declaration";
5
4
 
6
- import { define } from "../../ontology";
5
+ import { define } from "../../elements";
7
6
  import { verifyTerm } from "../../process/verify";
8
7
 
9
8
  export default define(class ConstructorDeclaration extends Declaration {
10
- constructor(context, node, string, constructor) {
11
- super(context, node, string);
9
+ constructor(context, string, node, constructor) {
10
+ super(context, string, node);
12
11
 
13
12
  this.constructor = constructor;
14
13
  }
@@ -112,14 +111,4 @@ export default define(class ConstructorDeclaration extends Declaration {
112
111
  }
113
112
 
114
113
  static name = "ConstructorDeclaration";
115
-
116
- static fromConstructorDeclarationNode(constructorDeclarationNode, context) {
117
- const { Constructor } = ontology,
118
- node = constructorDeclarationNode, ///
119
- string = context.nodeAsString(node),
120
- constructor = Constructor.fromConstructorDeclarationNode(constructorDeclarationNode, context),
121
- constructorDeclaration = new ConstructorDeclaration(context, node, string, constructor);
122
-
123
- return constructorDeclaration;
124
- }
125
114
  });
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../../ontology";
4
3
  import Declaration from "../declaration";
5
4
 
6
- import { define } from "../../ontology";
5
+ import { define } from "../../elements";
7
6
 
8
7
  export default define(class MetavariableDeclaration extends Declaration {
9
- constructor(context, node, string, metavariable) {
10
- super(context, node, string);
8
+ constructor(context, string, node, metavariable) {
9
+ super(context, string, node);
11
10
 
12
11
  this.metavariable = metavariable;
13
12
  }
@@ -106,39 +105,4 @@ export default define(class MetavariableDeclaration extends Declaration {
106
105
  }
107
106
 
108
107
  static name = "MetavariableDeclaration";
109
-
110
- static fromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
111
- const { Metavariable } = ontology,
112
- node = metavariableDeclarationNode, ///
113
- metaType = metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context),
114
- metavariable = Metavariable.fromMetavariableDeclarationNode(metavariableDeclarationNode, context),
115
- string = stringFromMetavariableAndMetaType(metavariable, metaType),
116
- metavariableDeclaration = new MetavariableDeclaration(context, node, string, metavariable);
117
-
118
- return metavariableDeclaration;
119
- }
120
108
  });
121
-
122
- function stringFromMetavariableAndMetaType(metavariable, metaType) {
123
- let string;
124
-
125
- const metavariableString = metavariable.getString();
126
-
127
- if (metaType === null) {
128
- string = metavariableString; ///
129
- } else {
130
- const metaTypeString = metaType.getString();
131
-
132
- string = `${metavariableString}:${metaTypeString}`;
133
- }
134
-
135
- return string;
136
- }
137
-
138
- function metaTypeFromMetavariableDeclarationNode(metavariableDeclarationNode, context) {
139
- const { MetaType } = ontology,
140
- metaTypeNode = metavariableDeclarationNode.getMetaTypeNode(),
141
- metaType = MetaType.fromMetaTypeNode(metaTypeNode, context);
142
-
143
- return metaType;
144
- }
@@ -1,14 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../../ontology";
4
3
  import Declaration from "../declaration";
5
4
 
6
- import { define } from "../../ontology";
7
- import { stringFromTypeNameTypePrefixNameAndSuperTypes } from "../../utilities/type";
5
+ import { define } from "../../elements";
8
6
 
9
7
  export default define(class SimpleTypeDeclaration extends Declaration {
10
- constructor(context, node, string, type, prefixed) {
11
- super(context, node, string);
8
+ constructor(context, string, node, type, prefixed) {
9
+ super(context, string, node);
12
10
 
13
11
  this.type = type;
14
12
  this.prefixed = prefixed;
@@ -172,18 +170,4 @@ export default define(class SimpleTypeDeclaration extends Declaration {
172
170
  }
173
171
 
174
172
  static name = "SimpleTypeDeclaration";
175
-
176
- static fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context) {
177
- const { Type } = ontology,
178
- type = Type.fromSimpleTypeDeclarationNode(simpleTypeDeclarationNode, context),
179
- node = simpleTypeDeclarationNode, ///
180
- prefixed = simpleTypeDeclarationNode.isPrefixed(),
181
- typePrefixName = simpleTypeDeclarationNode.getTypePrefixName(),
182
- typeName = type.getName(),
183
- superTypes = type.getSuperTypes(),
184
- string = stringFromTypeNameTypePrefixNameAndSuperTypes(typeName, typePrefixName, superTypes),
185
- simpleTypeDeclaration = new SimpleTypeDeclaration(context, node, string, type, prefixed);
186
-
187
- return simpleTypeDeclaration;
188
- }
189
173
  });
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../../ontology";
4
3
  import Declaration from "../declaration";
5
4
 
6
- import { define } from "../../ontology";
5
+ import { define } from "../../elements";
7
6
 
8
7
  export default define(class TypePrefixDeclaration extends Declaration {
9
- constructor(context, node, string, typePrefix) {
10
- super(context, node, string);
8
+ constructor(context, string, node, typePrefix) {
9
+ super(context, string, node);
11
10
 
12
11
  this.typePrefix = typePrefix;
13
12
  }
@@ -89,15 +88,4 @@ export default define(class TypePrefixDeclaration extends Declaration {
89
88
  }
90
89
 
91
90
  static name = "TypePrefixDeclaration";
92
-
93
- static fromTypePrefixDeclarationNode(typePrefixDeclarationNode, context) {
94
- const { TypePrefix } = ontology,
95
- node = typePrefixDeclarationNode, ///
96
- typePrefix = TypePrefix.fromTypePrefixDeclarationNode(typePrefixDeclarationNode, context),
97
- typePrefixName = typePrefix.getName(),
98
- string = typePrefixName, ///
99
- simpleTypeDeclaration = new TypePrefixDeclaration(context, node, string, typePrefix);
100
-
101
- return simpleTypeDeclaration;
102
- }
103
91
  });
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../../ontology";
4
3
  import Declaration from "../declaration";
5
4
 
6
- import { define } from "../../ontology";
5
+ import { define } from "../../elements";
7
6
 
8
7
  export default define(class VariableDeclaration extends Declaration {
9
- constructor(context, node, string, variable) {
10
- super(context, node, string);
8
+ constructor(context, string, node, variable) {
9
+ super(context, string, node);
11
10
 
12
11
  this.variable = variable;
13
12
  }
@@ -115,14 +114,4 @@ export default define(class VariableDeclaration extends Declaration {
115
114
  }
116
115
 
117
116
  static name = "VariableDeclaration";
118
-
119
- static fromVariableDeclarationNode(variableDeclarationNode, context) {
120
- const { Variable } = ontology,
121
- node = variableDeclarationNode, ///
122
- string = context.nodeAsString(node),
123
- variable = Variable.fromVariableDeclarationNode(variableDeclarationNode, context),
124
- variableDeclaration = new VariableDeclaration(context, node, string, variable);
125
-
126
- return variableDeclaration;
127
- }
128
117
  });
@@ -1,21 +1,21 @@
1
1
  "use strict";
2
2
 
3
3
  export default class Declaration {
4
- constructor(context, node, string) {
4
+ constructor(context, string, node) {
5
5
  this.context = context;
6
- this.node = node;
7
6
  this.string = string;
7
+ this.node = node;
8
8
  }
9
9
 
10
10
  getContext() {
11
11
  return this.context;
12
12
  }
13
13
 
14
- getNode() {
15
- return this.node;
16
- }
17
-
18
14
  getString() {
19
15
  return this.string;
20
16
  }
17
+
18
+ getNode() {
19
+ return this.node;
20
+ }
21
21
  }
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
 
3
- import ontology from "../ontology";
3
+ import elements from "../elements";
4
4
  import TemporaryContext from "../context/temporary";
5
5
 
6
- import { define } from "../ontology";
6
+ import { define } from "../elements";
7
7
  import { termsFromJSON, framesFromJSON, statementFromJSON, termsToTermsJSON, framesToFramesJSON, statementToStatementJSON } from "../utilities/json";
8
8
 
9
9
  export default define(class Deduction {
10
- constructor(context, node, string, statement) {
10
+ constructor(context, string, statement) {
11
11
  this.context = context;
12
+ this.string = string;
12
13
  this.node = node;
13
14
  this.string = string;
14
15
  this.statement = statement;
@@ -18,14 +19,14 @@ export default define(class Deduction {
18
19
  return this.context;
19
20
  }
20
21
 
21
- getNode(node) {
22
- return this.node;
23
- }
24
-
25
22
  getString() {
26
23
  return this.string;
27
24
  }
28
25
 
26
+ getNode() {
27
+ return this.node;
28
+ }
29
+
29
30
  getStatement() {
30
31
  return this.statement;
31
32
  }
@@ -141,21 +142,7 @@ export default define(class Deduction {
141
142
 
142
143
  context = temporaryContext; ///
143
144
 
144
- const deduction = new Deduction(context, node, string, statement);
145
-
146
- return deduction;
147
- }
148
-
149
- static fromDeductionNode(deductionNode, context) {
150
- const { Statement } = ontology,
151
- node = deductionNode, ///
152
- string = context.nodeAsString(node),
153
- statement = Statement.fromDeductionNode(deductionNode, context),
154
- temporaryContext = null;
155
-
156
- context = temporaryContext; ///
157
-
158
- const deduction = new Deduction(context, node, string, statement);
145
+ const deduction = new Deduction(context, string, statement);
159
146
 
160
147
  return deduction;
161
148
  }
@@ -2,10 +2,9 @@
2
2
 
3
3
  import { arrayUtilities } from "necessary";
4
4
 
5
- import ontology from "../ontology";
5
+ import assignAssignments from "../process/assign";
6
6
 
7
- import { define } from "../ontology";
8
- import { assignAssignments } from "../utilities/assignments";
7
+ import { define } from "../elements";
9
8
 
10
9
  const { last } = arrayUtilities;
11
10
 
@@ -51,34 +50,5 @@ export default define(class Derivation {
51
50
  }
52
51
 
53
52
  static name = "Derivation";
54
-
55
- static fromDerivationNode(derivationNode, context) {
56
- const stepsOrSubproofs = stepsOrSubproofsFromDerivationNode(derivationNode, context),
57
- derivation = new Derivation(stepsOrSubproofs);
58
-
59
- return derivation;
60
- }
61
53
  });
62
54
 
63
- function stepsOrSubproofsFromDerivationNode(derivationNode, context) {
64
- const { Step, Subproof } = ontology,
65
- stepOrSubproofNodes = derivationNode.getStepOrSubproofNodes(),
66
- stepsOrSubproofs = stepOrSubproofNodes.map((stepOrSubproofNode) => {
67
- let stepOrSubproof;
68
-
69
- const step = Step.fromStepOrSubproofNode(stepOrSubproofNode, context),
70
- subproof = Subproof.fromStepOrSubproofNode(stepOrSubproofNode, context);
71
-
72
- if (false) {
73
- ///
74
- } else if (step !== null) {
75
- stepOrSubproof = step; ///
76
- } else if (subproof !== null) {
77
- stepOrSubproof = subproof; ///
78
- }
79
-
80
- return stepOrSubproof;
81
- });
82
-
83
- return stepsOrSubproofs;
84
- }