occam-verify-cli 1.0.937 → 1.0.939

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 (87) hide show
  1. package/lib/element/assertion/contained.js +3 -2
  2. package/lib/element/assertion/defined.js +3 -2
  3. package/lib/element/assertion/property.js +3 -2
  4. package/lib/element/assertion/signature.js +3 -2
  5. package/lib/element/assertion/subproof.js +3 -2
  6. package/lib/element/assertion/type.js +4 -3
  7. package/lib/element/assertion.js +3 -2
  8. package/lib/element/assumption/metaLevel.js +4 -3
  9. package/lib/element/assumption.js +5 -4
  10. package/lib/element/combinator.js +4 -3
  11. package/lib/element/conclusion.js +4 -3
  12. package/lib/element/constructor.js +5 -4
  13. package/lib/element/deduction.js +4 -3
  14. package/lib/element/equality.js +4 -3
  15. package/lib/element/frame.js +4 -3
  16. package/lib/element/hypothesis.js +4 -3
  17. package/lib/element/judgement.js +4 -3
  18. package/lib/element/label.js +4 -3
  19. package/lib/element/metaType.js +3 -2
  20. package/lib/element/metavariable.js +5 -4
  21. package/lib/element/parameter.js +4 -3
  22. package/lib/element/procedureCall.js +4 -3
  23. package/lib/element/procedureReference.js +4 -3
  24. package/lib/element/proofAssertion/premise.js +4 -3
  25. package/lib/element/proofAssertion/supposition.js +4 -3
  26. package/lib/element/property.js +4 -3
  27. package/lib/element/propertyRelation.js +4 -3
  28. package/lib/element/reference.js +4 -3
  29. package/lib/element/rule.js +4 -3
  30. package/lib/element/signature.js +5 -5
  31. package/lib/element/statement.js +5 -4
  32. package/lib/element/substitution/frame.js +4 -3
  33. package/lib/element/substitution/reference.js +4 -3
  34. package/lib/element/substitution/statement.js +4 -3
  35. package/lib/element/substitution/term.js +4 -3
  36. package/lib/element/substitution.js +3 -2
  37. package/lib/element/term.js +4 -3
  38. package/lib/element/topLevelAssertion.js +3 -2
  39. package/lib/element/topLevelMetaAssertion.js +3 -2
  40. package/lib/element/type.js +9 -3
  41. package/lib/element/typePrefix.js +4 -3
  42. package/lib/element/variable.js +4 -3
  43. package/lib/utilities/breakPoint.js +38 -0
  44. package/package.json +1 -1
  45. package/src/element/assertion/contained.js +3 -1
  46. package/src/element/assertion/defined.js +3 -1
  47. package/src/element/assertion/property.js +3 -1
  48. package/src/element/assertion/signature.js +3 -1
  49. package/src/element/assertion/subproof.js +5 -3
  50. package/src/element/assertion/type.js +4 -2
  51. package/src/element/assertion.js +3 -1
  52. package/src/element/assumption/metaLevel.js +4 -2
  53. package/src/element/assumption.js +5 -3
  54. package/src/element/combinator.js +4 -2
  55. package/src/element/conclusion.js +4 -2
  56. package/src/element/constructor.js +5 -3
  57. package/src/element/deduction.js +4 -2
  58. package/src/element/equality.js +4 -2
  59. package/src/element/frame.js +4 -2
  60. package/src/element/hypothesis.js +4 -2
  61. package/src/element/judgement.js +4 -2
  62. package/src/element/label.js +4 -2
  63. package/src/element/metaType.js +2 -1
  64. package/src/element/metavariable.js +5 -3
  65. package/src/element/parameter.js +4 -2
  66. package/src/element/procedureCall.js +4 -2
  67. package/src/element/procedureReference.js +4 -2
  68. package/src/element/proofAssertion/premise.js +4 -2
  69. package/src/element/proofAssertion/supposition.js +4 -2
  70. package/src/element/property.js +4 -2
  71. package/src/element/propertyRelation.js +4 -2
  72. package/src/element/reference.js +4 -2
  73. package/src/element/rule.js +4 -2
  74. package/src/element/signature.js +4 -3
  75. package/src/element/statement.js +6 -4
  76. package/src/element/substitution/frame.js +3 -1
  77. package/src/element/substitution/reference.js +3 -1
  78. package/src/element/substitution/statement.js +3 -1
  79. package/src/element/substitution/term.js +3 -1
  80. package/src/element/substitution.js +2 -1
  81. package/src/element/term.js +4 -2
  82. package/src/element/topLevelAssertion.js +2 -1
  83. package/src/element/topLevelMetaAssertion.js +2 -1
  84. package/src/element/type.js +17 -7
  85. package/src/element/typePrefix.js +4 -2
  86. package/src/element/variable.js +4 -2
  87. package/src/utilities/breakPoint.js +29 -0
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ function _export(target, all) {
6
+ for(var name in all)Object.defineProperty(target, name, {
7
+ enumerable: true,
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
+ });
10
+ }
11
+ _export(exports, {
12
+ get breakPointFromJSON () {
13
+ return breakPointFromJSON;
14
+ },
15
+ get breakPointToBreakPointJSON () {
16
+ return breakPointToBreakPointJSON;
17
+ }
18
+ });
19
+ const _occamlanguages = require("occam-languages");
20
+ function breakPointFromJSON(json) {
21
+ let breakPoint;
22
+ ({ breakPoint } = json);
23
+ if (breakPoint !== null) {
24
+ const breakPointJSON = breakPoint; ///
25
+ json = breakPointJSON; ///
26
+ breakPoint = _occamlanguages.BreakPoint.fromJSON(json); ///
27
+ }
28
+ return breakPoint;
29
+ }
30
+ function breakPointToBreakPointJSON(breakPoint) {
31
+ let breakPointJSON = null;
32
+ if (breakPointJSON !== null) {
33
+ breakPointJSON = breakPoint.toJSON();
34
+ }
35
+ return breakPointJSON;
36
+ }
37
+
38
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvYnJlYWtQb2ludC5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IHsgQnJlYWtQb2ludCB9IGZyb20gXCJvY2NhbS1sYW5ndWFnZXNcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGJyZWFrUG9pbnRGcm9tSlNPTihqc29uKSB7XG4gIGxldCBicmVha1BvaW50O1xuXG4gICh7IGJyZWFrUG9pbnQgfSA9IGpzb24pO1xuXG4gIGlmIChicmVha1BvaW50ICE9PSBudWxsKSB7XG4gICAgY29uc3QgYnJlYWtQb2ludEpTT04gPSBicmVha1BvaW50OyAgLy8vXG5cbiAgICBqc29uID0gYnJlYWtQb2ludEpTT047ICAvLy9cblxuICAgIGJyZWFrUG9pbnQgPSBCcmVha1BvaW50LmZyb21KU09OKGpzb24pOyAgLy8vXG4gIH1cblxuICByZXR1cm4gYnJlYWtQb2ludDtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGJyZWFrUG9pbnRUb0JyZWFrUG9pbnRKU09OKGJyZWFrUG9pbnQpIHtcbiAgbGV0IGJyZWFrUG9pbnRKU09OID0gbnVsbDtcblxuICBpZiAoYnJlYWtQb2ludEpTT04gIT09IG51bGwpIHtcbiAgICBicmVha1BvaW50SlNPTiA9IGJyZWFrUG9pbnQudG9KU09OKCk7XG4gIH1cblxuICByZXR1cm4gYnJlYWtQb2ludEpTT047XG59XG4iXSwibmFtZXMiOlsiYnJlYWtQb2ludEZyb21KU09OIiwiYnJlYWtQb2ludFRvQnJlYWtQb2ludEpTT04iLCJqc29uIiwiYnJlYWtQb2ludCIsImJyZWFrUG9pbnRKU09OIiwiQnJlYWtQb2ludCIsImZyb21KU09OIiwidG9KU09OIl0sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7UUFJZ0JBO2VBQUFBOztRQWdCQUM7ZUFBQUE7OztnQ0FsQlc7QUFFcEIsU0FBU0QsbUJBQW1CRSxJQUFJO0lBQ3JDLElBQUlDO0lBRUgsQ0FBQSxFQUFFQSxVQUFVLEVBQUUsR0FBR0QsSUFBRztJQUVyQixJQUFJQyxlQUFlLE1BQU07UUFDdkIsTUFBTUMsaUJBQWlCRCxZQUFhLEdBQUc7UUFFdkNELE9BQU9FLGdCQUFpQixHQUFHO1FBRTNCRCxhQUFhRSwwQkFBVSxDQUFDQyxRQUFRLENBQUNKLE9BQVEsR0FBRztJQUM5QztJQUVBLE9BQU9DO0FBQ1Q7QUFFTyxTQUFTRiwyQkFBMkJFLFVBQVU7SUFDbkQsSUFBSUMsaUJBQWlCO0lBRXJCLElBQUlBLG1CQUFtQixNQUFNO1FBQzNCQSxpQkFBaUJELFdBQVdJLE1BQU07SUFDcEM7SUFFQSxPQUFPSDtBQUNUIn0=
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "occam-verify-cli",
3
3
  "author": "James Smith",
4
- "version": "1.0.937",
4
+ "version": "1.0.939",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/occam-verify-cli",
7
7
  "description": "Occam's Verifier",
@@ -4,6 +4,7 @@ import Assertion from "../assertion";
4
4
 
5
5
  import { define } from "../../elements";
6
6
  import { instantiate } from "../../utilities/context";
7
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
7
8
  import { instantiateContainedAssertion } from "../../process/instantiate";
8
9
  import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions, statementFromStatementAndSubstitutions } from "../../utilities/substitutions";
9
10
  import { termFromContainedAssertionNode,
@@ -253,9 +254,10 @@ export default define(class ContainedAssertion extends Assertion {
253
254
 
254
255
  if (this.name === name) {
255
256
  instantiate((context) => {
256
- const { string, breakPoint } = json,
257
+ const { string } = json,
257
258
  containedAssertionNode = instantiateContainedAssertion(string, context),
258
259
  node = containedAssertionNode, ///
260
+ breakPoint = breakPointFromJSON(json),
259
261
  term = termFromContainedAssertionNode(containedAssertionNode, context),
260
262
  frame = frameFromContainedAssertionNode(containedAssertionNode, context),
261
263
  negated = negatedFromContainedAssertionNode(containedAssertionNode, context),
@@ -4,6 +4,7 @@ import Assertion from "../assertion";
4
4
 
5
5
  import { define } from "../../elements";
6
6
  import { instantiate } from "../../utilities/context";
7
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
7
8
  import { instantiateDefinedAssertion } from "../../process/instantiate";
8
9
  import { separateGroundedTermsAndDefinedVariables } from "../../utilities/equivalences";
9
10
  import { termFromTermAndSubstitutions, frameFromFrameAndSubstitutions } from "../../utilities/substitutions";
@@ -221,9 +222,10 @@ export default define(class DefinedAssertion extends Assertion {
221
222
 
222
223
  if (this.name === name) {
223
224
  instantiate((context) => {
224
- const { string, breakPoint } = json,
225
+ const { string } = json,
225
226
  definedAssertionNode = instantiateDefinedAssertion(string, context),
226
227
  node = definedAssertionNode, ///
228
+ breakPoint = breakPointFromJSON(json),
227
229
  term = termFromJDefinedAssertionNode(definedAssertionNode, context),
228
230
  frame = frameFromJDefinedAssertionNode(definedAssertionNode, context),
229
231
  negated = negatedFromJDefinedAssertionNode(definedAssertionNode, context);
@@ -4,6 +4,7 @@ import Assertion from "../assertion";
4
4
 
5
5
  import { define } from "../../elements";
6
6
  import { instantiate } from "../../utilities/context";
7
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
7
8
  import { instantiatePropertyAssertion } from "../../process/instantiate";
8
9
  import { variableAssignmentFromPrepertyAssertion } from "../../process/assign";
9
10
  import { termFromPropertyAssertionNode, propertyAssertionFromStatementNode, propertyRelationFromPropertyAssertionNode } from "../../utilities/element";
@@ -226,9 +227,10 @@ export default define(class PropertyAssertion extends Assertion {
226
227
 
227
228
  if (this.name === name) {
228
229
  instantiate((context) => {
229
- const { string, breakPoint } = json,
230
+ const { string } = json,
230
231
  propertyAssertionNode = instantiatePropertyAssertion(string, context),
231
232
  node = propertyAssertionNode, ///
233
+ breakPoint = breakPointFromJSON(json),
232
234
  term = termFromPropertyAssertionNode(propertyAssertionNode, context),
233
235
  propertyRelation = propertyRelationFromPropertyAssertionNode(propertyAssertionNode, context);
234
236
 
@@ -4,6 +4,7 @@ import Assertion from "../assertion";
4
4
 
5
5
  import { define } from "../../elements";
6
6
  import { join, reconcile, instantiate } from "../../utilities/context";
7
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
7
8
  import { instantiateSignatureAssertion } from "../../process/instantiate";
8
9
  import { signatureFromSignatureAssertionNode, referenceFromSignatureAssertionNode, signatureAssertionFromStatementNode } from "../../utilities/element";
9
10
 
@@ -211,9 +212,10 @@ export default define(class SignatureAssertion extends Assertion {
211
212
 
212
213
  if (this.name === name) {
213
214
  instantiate((context) => {
214
- const { string, breakPoint } = json,
215
+ const { string } = json,
215
216
  definedAssertionNode = instantiateSignatureAssertion(string, context),
216
217
  node = definedAssertionNode, ///
218
+ breakPoint = breakPointFromJSON(json),
217
219
  signature = signatureFromSignatureAssertionNode(definedAssertionNode, context),
218
220
  reference = referenceFromSignatureAssertionNode(definedAssertionNode, context);
219
221
 
@@ -7,6 +7,7 @@ import Assertion from "../assertion";
7
7
  import { define } from "../../elements";
8
8
  import { reconcile } from "../../utilities/context";
9
9
  import { join, descend, instantiate } from "../../utilities/context";
10
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
10
11
  import { instantiateSubproofAssertion } from "../../process/instantiate";
11
12
  import { subproofAssertionFromStatementNode } from "../../utilities/element";
12
13
 
@@ -300,10 +301,11 @@ export default define(class SubproofAssertion extends Assertion {
300
301
 
301
302
  if (this.name === name) {
302
303
  instantiate((context) => {
303
- const { string, breakPoint } = json,
304
+ const { string } = json,
304
305
  subproofAssertionNode = instantiateSubproofAssertion(string, context),
305
- statements = statementsFromSubproofAssertionNode(subproofAssertionNode, context),
306
- node = subproofAssertionNode; ///
306
+ node = subproofAssertionNode, ///
307
+ breakPoint = breakPointFromJSON(json),
308
+ statements = statementsFromSubproofAssertionNode(subproofAssertionNode, context);
307
309
 
308
310
  context = null;
309
311
 
@@ -8,6 +8,7 @@ import { instantiateTypeAssertion } from "../../process/instantiate";
8
8
  import { typeFromJSON, typeToTypeJSON } from "../../utilities/json";
9
9
  import { termFromTermAndSubstitutions } from "../../utilities/substitutions";
10
10
  import { variableAssignmentFromTypeAssertion } from "../../process/assign";
11
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../../utilities/breakPoint";
11
12
  import { termFromTypeAssertionNode, typeAssertionFromStatementNode } from "../../utilities/element";
12
13
 
13
14
  export default define(class TypeAssertion extends Assertion {
@@ -226,7 +227,7 @@ export default define(class TypeAssertion extends Assertion {
226
227
 
227
228
  breakPoint = this.getBreakPoint();
228
229
 
229
- const breakPointJSON = breakPoint.toJSON();
230
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
230
231
 
231
232
  breakPoint = breakPointJSON; ///
232
233
 
@@ -250,8 +251,9 @@ export default define(class TypeAssertion extends Assertion {
250
251
 
251
252
  if (this.name === name) {
252
253
  instantiate((context) => {
253
- const { string, breakPoint } = json,
254
+ const { string } = json,
254
255
  typeAssertionNode = instantiateTypeAssertion(string, context),
256
+ breakPoint = breakPointFromJSON(json),
255
257
  term = termFromTypeAssertionNode(typeAssertionNode, context),
256
258
  type = typeFromJSON(json, context),
257
259
  node = typeAssertionNode; ///
@@ -2,6 +2,8 @@
2
2
 
3
3
  import { Element } from "occam-languages";
4
4
 
5
+ import { breakPointToBreakPointJSON } from "../utilities/breakPoint";
6
+
5
7
  export default class Assertion extends Element {
6
8
  getName() {
7
9
  const { name } = this.constructor;
@@ -48,7 +50,7 @@ export default class Assertion extends Element {
48
50
 
49
51
  breakPoint = this.getBreakPoint();
50
52
 
51
- const breakPointJSON = breakPoint.toJSON();
53
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
52
54
 
53
55
  breakPoint = breakPointJSON; ///
54
56
 
@@ -6,6 +6,7 @@ import { define } from "../../elements";
6
6
  import { unifyStatement } from "../../process/unify";
7
7
  import { stripBracketsFromStatement } from "../../utilities/brackets";
8
8
  import { instantiateMetaLevelAssumption } from "../../process/instantiate";
9
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../../utilities/breakPoint";
9
10
  import { metaLevelAssumptionFromMetaLevelAssumptionNode } from "../../utilities/element";
10
11
  import { metaLevelAssumptionStringFromReferenceAndStatement } from "../../utilities/string";
11
12
  import { join, ablate, attempt, descend, reconcile, serialise, unserialise, instantiate } from "../../utilities/context";
@@ -291,7 +292,7 @@ export default define(class MetaLevelAssumption extends Element {
291
292
 
292
293
  breakPoint = this.getBreakPoint();
293
294
 
294
- const breakPointJSON = breakPoint.toJSON();
295
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
295
296
 
296
297
  breakPoint = breakPointJSON; ///
297
298
 
@@ -312,9 +313,10 @@ export default define(class MetaLevelAssumption extends Element {
312
313
 
313
314
  unserialise((json, context) => {
314
315
  instantiate((context) => {
315
- const { string, breakPoint } = json,
316
+ const { string } = json,
316
317
  metaLevelAssumptionNode = instantiateMetaLevelAssumption(string, context),
317
318
  node = metaLevelAssumptionNode, ///
319
+ breakPoint = breakPointFromJSON(json),
318
320
  reference = referenceFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context),
319
321
  statement = statementFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context);
320
322
 
@@ -3,8 +3,9 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
- import {instantiate, reconcile} from "../utilities/context";
7
6
  import { instantiateAssumption } from "../process/instantiate";
7
+ import { reconcile, instantiate } from "../utilities/context";
8
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
8
9
 
9
10
  export default define(class Assumption extends Element {
10
11
  constructor(context, string, node, breakPoint, reference, statement) {
@@ -253,7 +254,7 @@ export default define(class Assumption extends Element {
253
254
 
254
255
  breakPoint = this.getBreakPoint();
255
256
 
256
- const breakPointJSON = breakPoint.toJSON();
257
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
257
258
 
258
259
  breakPoint = breakPointJSON; ///
259
260
 
@@ -267,9 +268,10 @@ export default define(class Assumption extends Element {
267
268
 
268
269
  static fromJSON(json, context) {
269
270
  return instantiate((context) => {
270
- const { string, breakPoint } = json,
271
+ const { string } = json,
271
272
  assumptionNode = instantiateAssumption(string, context),
272
273
  node = assumptionNode, ///
274
+ breakPoint = breakPointFromJSON(json),
273
275
  reference = referenceFromAssumptionNode(assumptionNode, context),
274
276
  statement = statementFromAssumptionNode(assumptionNode, context),
275
277
  assumption = new Assumption(context, string, node, breakPoint, reference, statement);
@@ -8,6 +8,7 @@ import { statementFromCombinatorNode } from "../utilities/element";
8
8
  import { unifyStatementWithCombinator } from "../process/unify";
9
9
  import { validateStatementAsCombinator } from "../process/validate";
10
10
  import { attempt, serialise, unserialise, instantiate } from "../utilities/context";
11
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
11
12
 
12
13
  export default define(class Combinator extends Element {
13
14
  constructor(context, string, node, breakPoint, statement) {
@@ -111,7 +112,7 @@ export default define(class Combinator extends Element {
111
112
 
112
113
  breakPoint = this.getBreakPoint();
113
114
 
114
- const breakPointJSON = breakPoint.toJSON();
115
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
115
116
 
116
117
  breakPoint = breakPointJSON; ///
117
118
 
@@ -132,9 +133,10 @@ export default define(class Combinator extends Element {
132
133
 
133
134
  unserialise((json, context) => {
134
135
  instantiate((context) => {
135
- const { string, breakPoint } = json,
136
+ const { string } = json,
136
137
  combinatorNode = instantiateCombinator(string, context),
137
138
  node = combinatorNode, ///
139
+ breakPoint = breakPointFromJSON(json),
138
140
  statement = statementFromCombinatorNode(combinatorNode, context);
139
141
 
140
142
  combinator = new Combinator(context, string, node, breakPoint, statement);
@@ -4,6 +4,7 @@ import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
6
  import { instantiateConclusion } from "../process/instantiate";
7
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
7
8
  import { declare, attempt, descend, serialise, unserialise, instantiate } from "../utilities/context";
8
9
 
9
10
  export default define(class Conclusion extends Element {
@@ -140,7 +141,7 @@ export default define(class Conclusion extends Element {
140
141
 
141
142
  breakPoint = this.getBreakPoint();
142
143
 
143
- const breakPointJSON = breakPoint.toJSON();
144
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
144
145
 
145
146
  breakPoint = breakPointJSON; ///
146
147
 
@@ -161,9 +162,10 @@ export default define(class Conclusion extends Element {
161
162
 
162
163
  unserialise((json, context) => {
163
164
  instantiate((context) => {
164
- const { string, breakPoint } = json,
165
+ const { string } = json,
165
166
  conclusionNode = instantiateConclusion(string, context),
166
167
  node = conclusionNode, ///
168
+ breakPoint = breakPointFromJSON(json),
167
169
  statement = statementFromConclusionNode(conclusionNode, context);
168
170
 
169
171
  conclusion = new Conclusion(context, string, node, breakPoint, statement);
@@ -3,13 +3,14 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
+ import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
6
7
  import { instantiateConstructor } from "../process/instantiate";
7
8
  import { termFromConstructorNode } from "../utilities/element";
8
9
  import { unifyTermWithConstructor } from "../process/unify";
9
10
  import { validateTermAsConstructor } from "../process/validate";
10
- import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
11
11
  import { provisionallyStringFromProvisional } from "../utilities/string";
12
12
  import { attempt, serialise, unserialise, instantiate } from "../utilities/context";
13
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
13
14
 
14
15
  export default define(class Constructor extends Element {
15
16
  constructor(context, string, node, breakPoint, term, type) {
@@ -160,7 +161,7 @@ export default define(class Constructor extends Element {
160
161
 
161
162
  breakPoint = this.getBreakPoint();
162
163
 
163
- const breakPointJSON = breakPoint.toJSON();
164
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
164
165
 
165
166
  breakPoint = breakPointJSON; ///
166
167
 
@@ -183,9 +184,10 @@ export default define(class Constructor extends Element {
183
184
 
184
185
  unserialise((json, context) => {
185
186
  instantiate((context) => {
186
- const { string, breakPoint } = json,
187
+ const { string } = json,
187
188
  constructorNode = instantiateConstructor(string, context),
188
189
  node = constructorNode, ///
190
+ breakPoint = breakPointFromJSON(json),
189
191
  term = termFromConstructorNode(constructorNode, context),
190
192
  type = typeFromJSON(json, context);
191
193
 
@@ -4,6 +4,7 @@ import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
6
  import { instantiateDeduction } from "../process/instantiate";
7
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
7
8
  import { declare, attempt, descend, serialise, unserialise, instantiate } from "../utilities/context";
8
9
 
9
10
  export default define(class Deduction extends Element {
@@ -140,7 +141,7 @@ export default define(class Deduction extends Element {
140
141
 
141
142
  breakPoint = this.getBreakPoint();
142
143
 
143
- const breakPointJSON = breakPoint.toJSON();
144
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
144
145
 
145
146
  breakPoint = breakPointJSON; ///
146
147
 
@@ -161,9 +162,10 @@ export default define(class Deduction extends Element {
161
162
 
162
163
  unserialise((json, context) => {
163
164
  instantiate((context) => {
164
- const { string, breakPoint } = json,
165
+ const { string } = json,
165
166
  deductionNode = instantiateDeduction(string, context),
166
167
  node = deductionNode, ///
168
+ breakPoint = breakPointFromJSON(json),
167
169
  statement = statementFromDeductionNode(deductionNode, context);
168
170
 
169
171
  deduction = new Deduction(context, string, node, breakPoint, statement);
@@ -7,6 +7,7 @@ import { equateTerms } from "../process/equate";
7
7
  import { instantiate } from "../utilities/context";
8
8
  import { instantiateEquality } from "../process/instantiate";
9
9
  import { equalityFromStatementNode } from "../utilities/element";
10
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
10
11
  import { equalityAssignmentFromEquality, leftVariableAssignmentFromEquality, rightVariableAssignmentFromEquality } from "../process/assign";
11
12
 
12
13
  export default define(class Equality extends Element {
@@ -270,7 +271,7 @@ export default define(class Equality extends Element {
270
271
 
271
272
  breakPoint = this.getBreakPoint();
272
273
 
273
- const breakPointJSON = breakPoint.toJSON();
274
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
274
275
 
275
276
  breakPoint = breakPointJSON; ///
276
277
 
@@ -286,9 +287,10 @@ export default define(class Equality extends Element {
286
287
 
287
288
  static fromJSON(json, context) {
288
289
  return instantiate((context) => {
289
- const { string, breakPoint } = json,
290
+ const { string } = json,
290
291
  equalityNode = instantiateEquality(string, context),
291
292
  node = equalityNode, ///
293
+ breakPoint = breakPointFromJSON(json),
292
294
  leftTerm = leftTermFromEqualityNode(equalityNode, context),
293
295
  rightTerm = rightTermFromEqualityNode(equalityNode, context);
294
296
 
@@ -7,6 +7,7 @@ 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";
10
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
10
11
 
11
12
  export default define(class Frame extends Element {
12
13
  constructor(context, string, node, breakPoint, assumptions, metavariable) {
@@ -311,7 +312,7 @@ export default define(class Frame extends Element {
311
312
 
312
313
  breakPoint = this.getBreakPoint();
313
314
 
314
- const breakPointJSON = breakPoint.toJSON();
315
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
315
316
 
316
317
  breakPoint = breakPointJSON; ///
317
318
 
@@ -327,9 +328,10 @@ export default define(class Frame extends Element {
327
328
 
328
329
  static fromJSON(json, context) {
329
330
  return instantiate((context) => {
330
- const { string, breakPoint } = json,
331
+ const { string } = json,
331
332
  frameNode = instantiateFrame(string, context),
332
333
  node = frameNode, ///
334
+ breakPoint = breakPointFromJSON(json),
333
335
  assumptions = assumptionsFromFrameNode(frameNode, context),
334
336
  metavariable = metavariableFromFrameNode(frameNode, context);
335
337
 
@@ -5,6 +5,7 @@ import { Element } from "occam-languages";
5
5
  import { define } from "../elements";
6
6
  import { instantiateHypothesis } from "../process/instantiate";
7
7
  import { statementFromHypothesisNode } from "../utilities/element";
8
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
8
9
  import { declare, attempt, serialise, unserialise, instantiate } from "../utilities/context";
9
10
 
10
11
  export default define(class Hypothesis extends Element {
@@ -111,7 +112,7 @@ export default define(class Hypothesis extends Element {
111
112
 
112
113
  breakPoint = this.getBreakPoint();
113
114
 
114
- const breakPointJSON = breakPoint.toJSON();
115
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
115
116
 
116
117
  breakPoint = breakPointJSON; ///
117
118
 
@@ -130,9 +131,10 @@ export default define(class Hypothesis extends Element {
130
131
 
131
132
  unserialise((json, context) => {
132
133
  instantiate((context) => {
133
- const { string, breakPoint } = json,
134
+ const { string } = json,
134
135
  hypothesisNode = instantiateHypothesis(string, context),
135
136
  node = hypothesisNode, ///
137
+ breakPoint = breakPointFromJSON(json),
136
138
  statement = statementFromHypothesisNode(hypothesisNode, context);
137
139
 
138
140
  hypothesis = new Hypothesis(context, string, node, breakPoint, statement);
@@ -7,6 +7,7 @@ import { instantiateJudgement } from "../process/instantiate";
7
7
  import { reconcile, instantiate } from "../utilities/context";
8
8
  import { judgementFromStatementNode } from "../utilities/element";
9
9
  import { judgementAssignmentFromJudgement } from "../process/assign";
10
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
10
11
 
11
12
  export default define(class Judgement extends Element {
12
13
  constructor(context, string, node, breakPoint, frame, assumption) {
@@ -250,7 +251,7 @@ export default define(class Judgement extends Element {
250
251
 
251
252
  breakPoint = this.getBreakPoint();
252
253
 
253
- const breakPointJSON = breakPoint.toJSON();
254
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
254
255
 
255
256
  breakPoint = breakPointJSON; ///
256
257
 
@@ -264,9 +265,10 @@ export default define(class Judgement extends Element {
264
265
 
265
266
  static fromJSON(json, context) {
266
267
  return instantiate((context) => {
267
- const { string, breakPoint } = json,
268
+ const { string } = json,
268
269
  judgementNode = instantiateJudgement(string, context),
269
270
  node = judgementNode, ///
271
+ breakPoint = breakPointFromJSON(json),
270
272
  frame = frameFromJudgementNode(judgementNode, context),
271
273
  assumption = assumptionFromJudgementNode(judgementNode, context);
272
274
 
@@ -4,6 +4,7 @@ import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
6
  import { instantiateLabel } from "../process/instantiate";
7
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
7
8
  import { labelFromLabelNode, metavariableFromLabelNode } from "../utilities/element";
8
9
  import { ablate, attempt, serialise, unserialise, instantiate } from "../utilities/context";
9
10
 
@@ -134,7 +135,7 @@ export default define(class Label extends Element {
134
135
 
135
136
  breakPoint = this.getBreakPoint();
136
137
 
137
- const breakPointJSON = breakPoint.toJSON();
138
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
138
139
 
139
140
  breakPoint = breakPointJSON; ///
140
141
 
@@ -155,9 +156,10 @@ export default define(class Label extends Element {
155
156
 
156
157
  unserialise((json, context) => {
157
158
  instantiate((context) => {
158
- const { string, breakPoint } = json,
159
+ const { string } = json,
159
160
  labelNode = instantiateLabel(string, context),
160
161
  node = labelNode, ///
162
+ breakPoint = breakPointFromJSON(json),
161
163
  metavariable = metavariableFromLabelNode(labelNode, context);
162
164
 
163
165
  label = new Label(context, string, node, breakPoint, metavariable);
@@ -3,6 +3,7 @@
3
3
  import { Element } from "occam-languages";
4
4
 
5
5
  import { define } from "../elements";
6
+ import { breakPointToBreakPointJSON } from "../utilities/breakPoint";
6
7
 
7
8
  export default define(class MetaType extends Element {
8
9
  constructor(context, string, node, breakPoint, name) {
@@ -43,7 +44,7 @@ export default define(class MetaType extends Element {
43
44
 
44
45
  breakPoint = this.getBreakPoint();
45
46
 
46
- const breakPointJSON = breakPoint.toJSON();
47
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
47
48
 
48
49
  breakPoint = breakPointJSON; ///
49
50
 
@@ -5,11 +5,12 @@ import { Element } from "occam-languages";
5
5
  import elements from "../elements";
6
6
 
7
7
  import { define } from "../elements";
8
- import { instantiate } from "../utilities/context";
9
8
  import { EMPTY_STRING } from "../constants";
9
+ import { instantiate } from "../utilities/context";
10
10
  import { instantiateMetavariable } from "../process/instantiate";
11
11
  import { metaTypeFromJSON, metaTypeToMetaTypeJSON } from "../utilities/json";
12
12
  import { unifyMetavariable, unifyMetavariableIntrinsically } from "../process/unify";
13
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
13
14
  import { nameFromMetavariableNode, termFromMetavariableNode, typeFromMetavariableNode, metavariableFromStatementNode } from "../utilities/element";
14
15
 
15
16
  export default define(class Metavariable extends Element {
@@ -621,7 +622,7 @@ export default define(class Metavariable extends Element {
621
622
 
622
623
  breakPoint = this.getBreakPoint();
623
624
 
624
- const breakPointJSON = breakPoint.toJSON();
625
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
625
626
 
626
627
  breakPoint = breakPointJSON; ///
627
628
 
@@ -638,9 +639,10 @@ export default define(class Metavariable extends Element {
638
639
 
639
640
  static fromJSON(json, context) {
640
641
  return instantiate((context) => {
641
- const { string, breakPoint } = json,
642
+ const { string } = json,
642
643
  metavariableNode = instantiateMetavariable(string, context),
643
644
  node = metavariableNode, ///
645
+ breakPoint = breakPointFromJSON(json),
644
646
  name = nameFromMetavariableNode(metavariableNode, context),
645
647
  term = termFromMetavariableNode(metavariableNode, context),
646
648
  type = typeFromMetavariableNode(metavariableNode, context),
@@ -6,6 +6,7 @@ import { define } from "../elements";
6
6
  import { instantiate } from "../utilities/context";
7
7
  import { instantiateParameter } from "../process/instantiate";
8
8
  import { nameFromParaneterNode, identifierFromParameterNode } from "../utilities/element";
9
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
9
10
 
10
11
  export default define(class Parameter extends Element {
11
12
  constructor(context, string, node, breakPoint, name, identifier) {
@@ -58,7 +59,7 @@ export default define(class Parameter extends Element {
58
59
 
59
60
  breakPoint = this.getBreakPoint();
60
61
 
61
- const breakPointJSON = breakPoint.toJSON();
62
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
62
63
 
63
64
  breakPoint = breakPointJSON; ///
64
65
 
@@ -72,9 +73,10 @@ export default define(class Parameter extends Element {
72
73
 
73
74
  static fromJSON(json, context) {
74
75
  return instantiate((context) => {
75
- const { string, breakPoint } = json,
76
+ const { string } = json,
76
77
  parameterNode = instantiateParameter(string, context),
77
78
  node = parameterNode, ///
79
+ breakPoint = breakPointFromJSON(json),
78
80
  name = nameFromParaneterNode(parameterNode, context),
79
81
  identifier = identifierFromParameterNode(parameterNode, context);
80
82
 
@@ -6,6 +6,7 @@ import { termsUtilities } from "occam-furtle";
6
6
  import { define } from "../elements";
7
7
  import { instantiate, evaluate } from "../utilities/context";
8
8
  import { instantiateProcedureCall } from "../process/instantiate";
9
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
9
10
  import { parametersFromProcedureCallNode, procedureReferenceFromProcedureCallNode } from "../utilities/element";
10
11
 
11
12
  const { termsFromPrimitives } = termsUtilities;
@@ -127,7 +128,7 @@ export default define(class ProcedureCall extends Element {
127
128
 
128
129
  breakPoint = this.getBreakPoint();
129
130
 
130
- const breakPointJSON = breakPoint.toJSON();
131
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
131
132
 
132
133
  breakPoint = breakPointJSON; ///
133
134
 
@@ -141,9 +142,10 @@ export default define(class ProcedureCall extends Element {
141
142
 
142
143
  static fromJSON(json, context) {
143
144
  return instantiate((context) => {
144
- const { string, breakPoint } = json,
145
+ const { string } = json,
145
146
  procedureCallNode = instantiateProcedureCall(string, context),
146
147
  node = procedureCallNode, ///
148
+ breakPoint = breakPointFromJSON(json),
147
149
  parameters = parametersFromProcedureCallNode(json, context),
148
150
  procedureReference = procedureReferenceFromProcedureCallNode(json, context);
149
151