occam-verify-cli 1.0.936 → 1.0.938

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 +9 -3
  7. package/lib/element/assertion.js +8 -2
  8. package/lib/element/assumption/metaLevel.js +9 -3
  9. package/lib/element/assumption.js +10 -4
  10. package/lib/element/combinator.js +9 -3
  11. package/lib/element/conclusion.js +9 -3
  12. package/lib/element/constructor.js +10 -4
  13. package/lib/element/deduction.js +9 -3
  14. package/lib/element/equality.js +9 -3
  15. package/lib/element/frame.js +9 -3
  16. package/lib/element/hypothesis.js +9 -3
  17. package/lib/element/judgement.js +9 -3
  18. package/lib/element/label.js +9 -3
  19. package/lib/element/metaType.js +8 -2
  20. package/lib/element/metavariable.js +10 -4
  21. package/lib/element/parameter.js +9 -3
  22. package/lib/element/procedureCall.js +9 -3
  23. package/lib/element/procedureReference.js +9 -3
  24. package/lib/element/proofAssertion/premise.js +9 -3
  25. package/lib/element/proofAssertion/supposition.js +9 -3
  26. package/lib/element/property.js +9 -3
  27. package/lib/element/propertyRelation.js +9 -3
  28. package/lib/element/reference.js +9 -3
  29. package/lib/element/rule.js +9 -3
  30. package/lib/element/signature.js +10 -5
  31. package/lib/element/statement.js +10 -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 +8 -2
  37. package/lib/element/term.js +9 -3
  38. package/lib/element/topLevelAssertion.js +8 -2
  39. package/lib/element/topLevelMetaAssertion.js +8 -2
  40. package/lib/element/type.js +9 -3
  41. package/lib/element/typePrefix.js +9 -3
  42. package/lib/element/variable.js +9 -3
  43. package/lib/utilities/breakPoint.js +38 -0
  44. package/package.json +4 -4
  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 +14 -4
  51. package/src/element/assertion.js +17 -7
  52. package/src/element/assumption/metaLevel.js +18 -8
  53. package/src/element/assumption.js +18 -8
  54. package/src/element/combinator.js +18 -8
  55. package/src/element/conclusion.js +18 -8
  56. package/src/element/constructor.js +15 -5
  57. package/src/element/deduction.js +18 -8
  58. package/src/element/equality.js +17 -7
  59. package/src/element/frame.js +17 -7
  60. package/src/element/hypothesis.js +18 -8
  61. package/src/element/judgement.js +17 -7
  62. package/src/element/label.js +18 -8
  63. package/src/element/metaType.js +15 -6
  64. package/src/element/metavariable.js +19 -9
  65. package/src/element/parameter.js +17 -7
  66. package/src/element/procedureCall.js +17 -7
  67. package/src/element/procedureReference.js +17 -7
  68. package/src/element/proofAssertion/premise.js +18 -8
  69. package/src/element/proofAssertion/supposition.js +18 -8
  70. package/src/element/property.js +14 -4
  71. package/src/element/propertyRelation.js +17 -7
  72. package/src/element/reference.js +18 -8
  73. package/src/element/rule.js +14 -4
  74. package/src/element/signature.js +18 -9
  75. package/src/element/statement.js +19 -9
  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 +17 -8
  81. package/src/element/term.js +14 -4
  82. package/src/element/topLevelAssertion.js +12 -3
  83. package/src/element/topLevelMetaAssertion.js +12 -3
  84. package/src/element/type.js +17 -7
  85. package/src/element/typePrefix.js +17 -7
  86. package/src/element/variable.js +14 -4
  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.936",
4
+ "version": "1.0.938",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/occam-verify-cli",
7
7
  "description": "Occam's Verifier",
@@ -12,12 +12,12 @@
12
12
  "dependencies": {
13
13
  "argumentative": "^2.0.47",
14
14
  "necessary": "^17.1.7",
15
- "occam-furtle": "^3.0.202",
15
+ "occam-furtle": "^3.0.203",
16
16
  "occam-grammars": "^1.3.524",
17
- "occam-languages": "^0.0.204",
17
+ "occam-languages": "^0.0.206",
18
18
  "occam-lexers": "^23.1.44",
19
19
  "occam-model": "^1.0.506",
20
- "occam-nominal": "^1.0.106",
20
+ "occam-nominal": "^1.0.107",
21
21
  "occam-parsers": "^23.1.50",
22
22
  "occam-server": "^7.0.7"
23
23
  },
@@ -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 {
@@ -220,9 +221,17 @@ export default define(class TypeAssertion extends Assertion {
220
221
  toJSON() {
221
222
  const typeJSON = typeToTypeJSON(this.type),
222
223
  name = this.getName(),
223
- string = this.getString(),
224
- breakPoint = this.getBreakPoint(),
225
- type = typeJSON,
224
+ string = this.getString();
225
+
226
+ let breakPoint;
227
+
228
+ breakPoint = this.getBreakPoint();
229
+
230
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
231
+
232
+ breakPoint = breakPointJSON; ///
233
+
234
+ const type = typeJSON,
226
235
  json = {
227
236
  name,
228
237
  string,
@@ -242,8 +251,9 @@ export default define(class TypeAssertion extends Assertion {
242
251
 
243
252
  if (this.name === name) {
244
253
  instantiate((context) => {
245
- const { string, breakPoint } = json,
254
+ const { string } = json,
246
255
  typeAssertionNode = instantiateTypeAssertion(string, context),
256
+ breakPoint = breakPointFromJSON(json),
247
257
  term = termFromTypeAssertionNode(typeAssertionNode, context),
248
258
  type = typeFromJSON(json, context),
249
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;
@@ -42,13 +44,21 @@ export default class Assertion extends Element {
42
44
 
43
45
  toJSON() {
44
46
  const name = this.getName(),
45
- string = this.getString(),
46
- breakPoint = this.getBreakPoint(),
47
- json = {
48
- name,
49
- string,
50
- breakPoint
51
- };
47
+ string = this.getString();
48
+
49
+ let breakPoint;
50
+
51
+ breakPoint = this.getBreakPoint();
52
+
53
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
54
+
55
+ breakPoint = breakPointJSON; ///
56
+
57
+ const json = {
58
+ name,
59
+ string,
60
+ breakPoint
61
+ };
52
62
 
53
63
  return json;
54
64
  }
@@ -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";
@@ -285,13 +286,21 @@ export default define(class MetaLevelAssumption extends Element {
285
286
  const context = this.getContext();
286
287
 
287
288
  return serialise((context) => {
288
- const string = this.getString(),
289
- breakPoint = this.getBreakPoint(),
290
- json = {
291
- context,
292
- string,
293
- breakPoint
294
- };
289
+ const string = this.getString();
290
+
291
+ let breakPoint;
292
+
293
+ breakPoint = this.getBreakPoint();
294
+
295
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
296
+
297
+ breakPoint = breakPointJSON; ///
298
+
299
+ const json = {
300
+ context,
301
+ string,
302
+ breakPoint
303
+ };
295
304
 
296
305
  return json;
297
306
  }, context);
@@ -304,9 +313,10 @@ export default define(class MetaLevelAssumption extends Element {
304
313
 
305
314
  unserialise((json, context) => {
306
315
  instantiate((context) => {
307
- const { string, breakPoint } = json,
316
+ const { string } = json,
308
317
  metaLevelAssumptionNode = instantiateMetaLevelAssumption(string, context),
309
318
  node = metaLevelAssumptionNode, ///
319
+ breakPoint = breakPointFromJSON(json),
310
320
  reference = referenceFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context),
311
321
  statement = statementFromMetaLevelAssumptionNode(metaLevelAssumptionNode, context);
312
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) {
@@ -247,21 +248,30 @@ export default define(class Assumption extends Element {
247
248
  static name = "Assumption";
248
249
 
249
250
  toJSON() {
250
- const string = this.getString(),
251
- breakPoint = this.getBreakPoint(),
252
- json = {
253
- string,
254
- breakPoint
255
- };
251
+ const string = this.getString();
252
+
253
+ let breakPoint;
254
+
255
+ breakPoint = this.getBreakPoint();
256
+
257
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
258
+
259
+ breakPoint = breakPointJSON; ///
260
+
261
+ const json = {
262
+ string,
263
+ breakPoint
264
+ };
256
265
 
257
266
  return json;
258
267
  }
259
268
 
260
269
  static fromJSON(json, context) {
261
270
  return instantiate((context) => {
262
- const { string, breakPoint } = json,
271
+ const { string } = json,
263
272
  assumptionNode = instantiateAssumption(string, context),
264
273
  node = assumptionNode, ///
274
+ breakPoint = breakPointFromJSON(json),
265
275
  reference = referenceFromAssumptionNode(assumptionNode, context),
266
276
  statement = statementFromAssumptionNode(assumptionNode, context),
267
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) {
@@ -105,13 +106,21 @@ export default define(class Combinator extends Element {
105
106
  const context = this.getContext();
106
107
 
107
108
  return serialise((context) => {
108
- const string = this.getString(),
109
- breakPoint = this.getBreakPoint(),
110
- json = {
111
- context,
112
- string,
113
- breakPoint
114
- };
109
+ const string = this.getString();
110
+
111
+ let breakPoint;
112
+
113
+ breakPoint = this.getBreakPoint();
114
+
115
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
116
+
117
+ breakPoint = breakPointJSON; ///
118
+
119
+ const json = {
120
+ context,
121
+ string,
122
+ breakPoint
123
+ };
115
124
 
116
125
  return json;
117
126
  }, context);
@@ -124,9 +133,10 @@ export default define(class Combinator extends Element {
124
133
 
125
134
  unserialise((json, context) => {
126
135
  instantiate((context) => {
127
- const { string, breakPoint } = json,
136
+ const { string } = json,
128
137
  combinatorNode = instantiateCombinator(string, context),
129
138
  node = combinatorNode, ///
139
+ breakPoint = breakPointFromJSON(json),
130
140
  statement = statementFromCombinatorNode(combinatorNode, context);
131
141
 
132
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 {
@@ -134,13 +135,21 @@ export default define(class Conclusion extends Element {
134
135
  const context = this.getContext();
135
136
 
136
137
  return serialise((context) => {
137
- const string = this.getString(),
138
- breakPoint = this.getBreakPoint(),
139
- json = {
140
- context,
141
- string,
142
- breakPoint
143
- };
138
+ const string = this.getString();
139
+
140
+ let breakPoint;
141
+
142
+ breakPoint = this.getBreakPoint();
143
+
144
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
145
+
146
+ breakPoint = breakPointJSON; ///
147
+
148
+ const json = {
149
+ context,
150
+ string,
151
+ breakPoint
152
+ };
144
153
 
145
154
  return json;
146
155
  }, context);
@@ -153,9 +162,10 @@ export default define(class Conclusion extends Element {
153
162
 
154
163
  unserialise((json, context) => {
155
164
  instantiate((context) => {
156
- const { string, breakPoint } = json,
165
+ const { string } = json,
157
166
  conclusionNode = instantiateConclusion(string, context),
158
167
  node = conclusionNode, ///
168
+ breakPoint = breakPointFromJSON(json),
159
169
  statement = statementFromConclusionNode(conclusionNode, context);
160
170
 
161
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) {
@@ -154,9 +155,17 @@ export default define(class Constructor extends Element {
154
155
  return serialise((context) => {
155
156
  const includeType = false,
156
157
  typeJSON = typeToTypeJSON(this.type),
157
- string = this.getString(includeType),
158
- breakPoint = this.getBreakPoint(),
159
- type = typeJSON, ///
158
+ string = this.getString(includeType);
159
+
160
+ let breakPoint;
161
+
162
+ breakPoint = this.getBreakPoint();
163
+
164
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
165
+
166
+ breakPoint = breakPointJSON; ///
167
+
168
+ const type = typeJSON, ///
160
169
  json = {
161
170
  context,
162
171
  string,
@@ -175,9 +184,10 @@ export default define(class Constructor extends Element {
175
184
 
176
185
  unserialise((json, context) => {
177
186
  instantiate((context) => {
178
- const { string, breakPoint } = json,
187
+ const { string } = json,
179
188
  constructorNode = instantiateConstructor(string, context),
180
189
  node = constructorNode, ///
190
+ breakPoint = breakPointFromJSON(json),
181
191
  term = termFromConstructorNode(constructorNode, context),
182
192
  type = typeFromJSON(json, context);
183
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 {
@@ -134,13 +135,21 @@ export default define(class Deduction extends Element {
134
135
  const context = this.getContext();
135
136
 
136
137
  return serialise((context) => {
137
- const string = this.getString(),
138
- breakPoint = this.getBreakPoint(),
139
- json = {
140
- context,
141
- string,
142
- breakPoint
143
- };
138
+ const string = this.getString();
139
+
140
+ let breakPoint;
141
+
142
+ breakPoint = this.getBreakPoint();
143
+
144
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
145
+
146
+ breakPoint = breakPointJSON; ///
147
+
148
+ const json = {
149
+ context,
150
+ string,
151
+ breakPoint
152
+ };
144
153
 
145
154
  return json;
146
155
  }, context);
@@ -153,9 +162,10 @@ export default define(class Deduction extends Element {
153
162
 
154
163
  unserialise((json, context) => {
155
164
  instantiate((context) => {
156
- const { string, breakPoint } = json,
165
+ const { string } = json,
157
166
  deductionNode = instantiateDeduction(string, context),
158
167
  node = deductionNode, ///
168
+ breakPoint = breakPointFromJSON(json),
159
169
  statement = statementFromDeductionNode(deductionNode, context);
160
170
 
161
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 {
@@ -264,12 +265,20 @@ export default define(class Equality extends Element {
264
265
  }
265
266
 
266
267
  toJSON() {
267
- const string = this.getString(),
268
- breakPoint = this.getBreakPoint(),
269
- json = {
270
- string,
271
- breakPoint
272
- };
268
+ const string = this.getString();
269
+
270
+ let breakPoint;
271
+
272
+ breakPoint = this.getBreakPoint();
273
+
274
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
275
+
276
+ breakPoint = breakPointJSON; ///
277
+
278
+ const json = {
279
+ string,
280
+ breakPoint
281
+ };
273
282
 
274
283
  return json;
275
284
  }
@@ -278,9 +287,10 @@ export default define(class Equality extends Element {
278
287
 
279
288
  static fromJSON(json, context) {
280
289
  return instantiate((context) => {
281
- const { string, breakPoint } = json,
290
+ const { string } = json,
282
291
  equalityNode = instantiateEquality(string, context),
283
292
  node = equalityNode, ///
293
+ breakPoint = breakPointFromJSON(json),
284
294
  leftTerm = leftTermFromEqualityNode(equalityNode, context),
285
295
  rightTerm = rightTermFromEqualityNode(equalityNode, context);
286
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) {
@@ -305,12 +306,20 @@ export default define(class Frame extends Element {
305
306
  }
306
307
 
307
308
  toJSON() {
308
- const string = this.getString(),
309
- breakPoint = this.getBreakPoint(),
310
- json = {
311
- string,
312
- breakPoint
313
- };
309
+ const string = this.getString();
310
+
311
+ let breakPoint;
312
+
313
+ breakPoint = this.getBreakPoint();
314
+
315
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
316
+
317
+ breakPoint = breakPointJSON; ///
318
+
319
+ const json = {
320
+ string,
321
+ breakPoint
322
+ };
314
323
 
315
324
  return json;
316
325
  }
@@ -319,9 +328,10 @@ export default define(class Frame extends Element {
319
328
 
320
329
  static fromJSON(json, context) {
321
330
  return instantiate((context) => {
322
- const { string, breakPoint } = json,
331
+ const { string } = json,
323
332
  frameNode = instantiateFrame(string, context),
324
333
  node = frameNode, ///
334
+ breakPoint = breakPointFromJSON(json),
325
335
  assumptions = assumptionsFromFrameNode(frameNode, context),
326
336
  metavariable = metavariableFromFrameNode(frameNode, context);
327
337