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
@@ -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 {
@@ -105,13 +106,21 @@ export default define(class Hypothesis 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);
@@ -122,9 +131,10 @@ export default define(class Hypothesis extends Element {
122
131
 
123
132
  unserialise((json, context) => {
124
133
  instantiate((context) => {
125
- const { string, breakPoint } = json,
134
+ const { string } = json,
126
135
  hypothesisNode = instantiateHypothesis(string, context),
127
136
  node = hypothesisNode, ///
137
+ breakPoint = breakPointFromJSON(json),
128
138
  statement = statementFromHypothesisNode(hypothesisNode, context);
129
139
 
130
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) {
@@ -244,21 +245,30 @@ export default define(class Judgement extends Element {
244
245
  static name = "Judgement";
245
246
 
246
247
  toJSON() {
247
- const string = this.getString(),
248
- breakPoint = this.getBreakPoint(),
249
- json = {
250
- string,
251
- breakPoint
252
- };
248
+ const string = this.getString();
249
+
250
+ let breakPoint;
251
+
252
+ breakPoint = this.getBreakPoint();
253
+
254
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
255
+
256
+ breakPoint = breakPointJSON; ///
257
+
258
+ const json = {
259
+ string,
260
+ breakPoint
261
+ };
253
262
 
254
263
  return json;
255
264
  }
256
265
 
257
266
  static fromJSON(json, context) {
258
267
  return instantiate((context) => {
259
- const { string, breakPoint } = json,
268
+ const { string } = json,
260
269
  judgementNode = instantiateJudgement(string, context),
261
270
  node = judgementNode, ///
271
+ breakPoint = breakPointFromJSON(json),
262
272
  frame = frameFromJudgementNode(judgementNode, context),
263
273
  assumption = assumptionFromJudgementNode(judgementNode, context);
264
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
 
@@ -128,13 +129,21 @@ export default define(class Label extends Element {
128
129
  const context = this.getContext();
129
130
 
130
131
  return serialise((context) => {
131
- const string = this.getString(),
132
- breakPoint = this.getBreakPoint(),
133
- json = {
134
- context,
135
- string,
136
- breakPoint
137
- };
132
+ const string = this.getString();
133
+
134
+ let breakPoint;
135
+
136
+ breakPoint = this.getBreakPoint();
137
+
138
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
139
+
140
+ breakPoint = breakPointJSON; ///
141
+
142
+ const json = {
143
+ context,
144
+ string,
145
+ breakPoint
146
+ };
138
147
 
139
148
  return json;
140
149
  }, context);
@@ -147,9 +156,10 @@ export default define(class Label extends Element {
147
156
 
148
157
  unserialise((json, context) => {
149
158
  instantiate((context) => {
150
- const { string, breakPoint } = json,
159
+ const { string } = json,
151
160
  labelNode = instantiateLabel(string, context),
152
161
  node = labelNode, ///
162
+ breakPoint = breakPointFromJSON(json),
153
163
  metavariable = metavariableFromLabelNode(labelNode, context);
154
164
 
155
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) {
@@ -37,12 +38,20 @@ export default define(class MetaType extends Element {
37
38
  static name = "MetaType";
38
39
 
39
40
  toJSON() {
40
- const string = this.getString(),
41
- breakPoint = this.getBreakPoint(),
42
- json = {
43
- string,
44
- breakPoint
45
- };
41
+ const string = this.getString();
42
+
43
+ let breakPoint;
44
+
45
+ breakPoint = this.getBreakPoint();
46
+
47
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
48
+
49
+ breakPoint = breakPointJSON; ///
50
+
51
+ const json = {
52
+ string,
53
+ breakPoint
54
+ };
46
55
 
47
56
  return json;
48
57
  }
@@ -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 {
@@ -615,13 +616,21 @@ export default define(class Metavariable extends Element {
615
616
  toJSON() {
616
617
  const metaTypeJSON = metaTypeToMetaTypeJSON(this.metaType),
617
618
  metaType = metaTypeJSON, ///
618
- string = this.getString(),
619
- breakPoint = this.getBreakPoint(),
620
- json = {
621
- string,
622
- breakPoint,
623
- metaType
624
- };
619
+ string = this.getString();
620
+
621
+ let breakPoint;
622
+
623
+ breakPoint = this.getBreakPoint();
624
+
625
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
626
+
627
+ breakPoint = breakPointJSON; ///
628
+
629
+ const json = {
630
+ string,
631
+ breakPoint,
632
+ metaType
633
+ };
625
634
 
626
635
  return json;
627
636
  }
@@ -630,9 +639,10 @@ export default define(class Metavariable extends Element {
630
639
 
631
640
  static fromJSON(json, context) {
632
641
  return instantiate((context) => {
633
- const { string, breakPoint } = json,
642
+ const { string } = json,
634
643
  metavariableNode = instantiateMetavariable(string, context),
635
644
  node = metavariableNode, ///
645
+ breakPoint = breakPointFromJSON(json),
636
646
  name = nameFromMetavariableNode(metavariableNode, context),
637
647
  term = termFromMetavariableNode(metavariableNode, context),
638
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) {
@@ -52,21 +53,30 @@ export default define(class Parameter extends Element {
52
53
  static name = "Parameter";
53
54
 
54
55
  toJSON() {
55
- const string = this.getString(),
56
- breakPoint = this.getBreakPoint(),
57
- json = {
58
- string,
59
- breakPoint
60
- };
56
+ const string = this.getString();
57
+
58
+ let breakPoint;
59
+
60
+ breakPoint = this.getBreakPoint();
61
+
62
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
63
+
64
+ breakPoint = breakPointJSON; ///
65
+
66
+ const json = {
67
+ string,
68
+ breakPoint
69
+ };
61
70
 
62
71
  return json;
63
72
  }
64
73
 
65
74
  static fromJSON(json, context) {
66
75
  return instantiate((context) => {
67
- const { string, breakPoint } = json,
76
+ const { string } = json,
68
77
  parameterNode = instantiateParameter(string, context),
69
78
  node = parameterNode, ///
79
+ breakPoint = breakPointFromJSON(json),
70
80
  name = nameFromParaneterNode(parameterNode, context),
71
81
  identifier = identifierFromParameterNode(parameterNode, context);
72
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;
@@ -121,21 +122,30 @@ export default define(class ProcedureCall extends Element {
121
122
  static name = "ProcedureCall";
122
123
 
123
124
  toJSON() {
124
- const string = this.getString(),
125
- breakPoint = this.getBreakPoint(),
126
- json = {
127
- string,
128
- breakPoint
129
- };
125
+ const string = this.getString();
126
+
127
+ let breakPoint;
128
+
129
+ breakPoint = this.getBreakPoint();
130
+
131
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
132
+
133
+ breakPoint = breakPointJSON; ///
134
+
135
+ const json = {
136
+ string,
137
+ breakPoint
138
+ };
130
139
 
131
140
  return json;
132
141
  }
133
142
 
134
143
  static fromJSON(json, context) {
135
144
  return instantiate((context) => {
136
- const { string, breakPoint } = json,
145
+ const { string } = json,
137
146
  procedureCallNode = instantiateProcedureCall(string, context),
138
147
  node = procedureCallNode, ///
148
+ breakPoint = breakPointFromJSON(json),
139
149
  parameters = parametersFromProcedureCallNode(json, context),
140
150
  procedureReference = procedureReferenceFromProcedureCallNode(json, context);
141
151
 
@@ -6,6 +6,7 @@ import { define } from "../elements";
6
6
  import { instantiate } from "../utilities/context";
7
7
  import { instantiateProcedureReference } from "../process/instantiate";
8
8
  import { nameFromProcedureReferenceNode } from "../utilities/element";
9
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
9
10
 
10
11
  export default define(class ProcedureReference extends Element {
11
12
  constructor(context, string, node, breakPoint, name) {
@@ -34,21 +35,30 @@ export default define(class ProcedureReference extends Element {
34
35
  static name = "ProcedureReference";
35
36
 
36
37
  toJSON() {
37
- const string = this.getString(),
38
- breakPoint = this.getBreakPoint(),
39
- json = {
40
- string,
41
- breakPoint
42
- };
38
+ const string = this.getString();
39
+
40
+ let breakPoint;
41
+
42
+ breakPoint = this.getBreakPoint();
43
+
44
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
45
+
46
+ breakPoint = breakPointJSON; ///
47
+
48
+ const json = {
49
+ string,
50
+ breakPoint
51
+ };
43
52
 
44
53
  return json;
45
54
  }
46
55
 
47
56
  static fromJSON(json, context) {
48
57
  return instantiate((context) => {
49
- const { string, breakPoint } = json,
58
+ const { string } = json,
50
59
  procedureReferenceNode = instantiateProcedureReference(string, context),
51
60
  node = procedureReferenceNode, ///
61
+ breakPoint = breakPointFromJSON(json),
52
62
  name = nameFromProcedureReferenceNode(procedureReferenceNode, context);
53
63
 
54
64
  context = null;
@@ -5,6 +5,7 @@ import ProofAssertion from "../proofAssertion";
5
5
  import { define } from "../../elements";
6
6
  import { instantiatePremise } from "../../process/instantiate";
7
7
  import { procedureCallFromPremiseNode } from "../../utilities/element";
8
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../../utilities/breakPoint";
8
9
  import { join, declare, attempt, reconcile, serialise, unserialise, instantiate } from "../../utilities/context";
9
10
 
10
11
  export default define(class Premise extends ProofAssertion {
@@ -287,13 +288,21 @@ export default define(class Premise extends ProofAssertion {
287
288
  const context = this.getContext();
288
289
 
289
290
  return serialise((context) => {
290
- const string = this.getString(),
291
- breakPoint = this.getBreakPoint(),
292
- json = {
293
- context,
294
- string,
295
- breakPoint
296
- };
291
+ const string = this.getString();
292
+
293
+ let breakPoint;
294
+
295
+ breakPoint = this.getBreakPoint();
296
+
297
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
298
+
299
+ breakPoint = breakPointJSON; ///
300
+
301
+ const json = {
302
+ context,
303
+ string,
304
+ breakPoint
305
+ };
297
306
 
298
307
  return json;
299
308
  }, context);
@@ -306,9 +315,10 @@ export default define(class Premise extends ProofAssertion {
306
315
 
307
316
  unserialise((json, context) => {
308
317
  instantiate((context) => {
309
- const { string, breakPoint } = json,
318
+ const { string } = json,
310
319
  premiseNode = instantiatePremise(string, context),
311
320
  node = premiseNode, ///
321
+ breakPoint = breakPointFromJSON(json),
312
322
  statement = statementFromPremiseNode(premiseNode, context),
313
323
  procedureCall = procedureCallFromPremiseNode(premiseNode, context);
314
324
 
@@ -5,6 +5,7 @@ import ProofAssertion from "../proofAssertion";
5
5
  import { define } from "../../elements";
6
6
  import { instantiateSupposition} from "../../process/instantiate";
7
7
  import { procedureCallFromSuppositionNode } from "../../utilities/element";
8
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../../utilities/breakPoint";
8
9
  import { join, declare, attempt, reconcile, serialise, unserialise, instantiate } from "../../utilities/context";
9
10
 
10
11
  export default define(class Supposition extends ProofAssertion {
@@ -310,13 +311,21 @@ export default define(class Supposition extends ProofAssertion {
310
311
  const context = this.getContext();
311
312
 
312
313
  return serialise((context) => {
313
- const string = this.getString(),
314
- breakPoint = this.getBreakPoint(),
315
- json = {
316
- context,
317
- string,
318
- breakPoint
319
- };
314
+ const string = this.getString();
315
+
316
+ let breakPoint;
317
+
318
+ breakPoint = this.getBreakPoint();
319
+
320
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
321
+
322
+ breakPoint = breakPointJSON; ///
323
+
324
+ const json = {
325
+ context,
326
+ string,
327
+ breakPoint
328
+ };
320
329
 
321
330
  return json;
322
331
  }, context);
@@ -329,9 +338,10 @@ export default define(class Supposition extends ProofAssertion {
329
338
 
330
339
  unserialise((json, context) => {
331
340
  instantiate((context) => {
332
- const { string, breakPoint } = json,
341
+ const { string } = json,
333
342
  suppositionNode = instantiateSupposition(string, context),
334
343
  node = suppositionNode, ///
344
+ breakPoint = breakPointFromJSON(json),
335
345
  statement = statementFromSuppositionNode(suppositionNode, context),
336
346
  procedureCall = procedureCallFromSuppositionNode(suppositionNode, context);
337
347
 
@@ -7,6 +7,7 @@ import { instantiate } from "../utilities/context";
7
7
  import { instantiateProperty } from "../process/instantiate";
8
8
  import { nameFromPropertyNode } from "../utilities/element";
9
9
  import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
10
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
10
11
 
11
12
  export default define(class Property extends Element {
12
13
  constructor(context, string, node, breakPoint, name, type) {
@@ -217,9 +218,17 @@ export default define(class Property extends Element {
217
218
 
218
219
  toJSON() {
219
220
  const typeJSON = typeToTypeJSON(this.type),
220
- string = this.getString(),
221
- breakPoint = this.getBreakPoint(),
222
- type = typeJSON, ///
221
+ string = this.getString();
222
+
223
+ let breakPoint;
224
+
225
+ breakPoint = this.getBreakPoint();
226
+
227
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
228
+
229
+ breakPoint = breakPointJSON; ///
230
+
231
+ const type = typeJSON, ///
223
232
  json = {
224
233
  string,
225
234
  breakPoint,
@@ -233,9 +242,10 @@ export default define(class Property extends Element {
233
242
 
234
243
  static fromJSON(json, context) {
235
244
  return instantiate((context) => {
236
- const { string, breakPoint } = json,
245
+ const { string } = json,
237
246
  propertyNode = instantiateProperty(string, context),
238
247
  node = propertyNode, ///
248
+ breakPoint = breakPointFromJSON(json),
239
249
  name = nameFromPropertyNode(propertyNode, context),
240
250
  type = typeFromJSON(json, context);
241
251
 
@@ -6,6 +6,7 @@ import { define } from "../elements";
6
6
  import { instantiate } from "../utilities/context";
7
7
  import { instantiatePropertyRelation } from "../process/instantiate";
8
8
  import { propertyFromPropertyRelationNode } from "../utilities/element";
9
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
9
10
 
10
11
  export default define(class PropertyRelation extends Element {
11
12
  constructor(context, string, node, breakPoint, term, property) {
@@ -148,21 +149,30 @@ export default define(class PropertyRelation extends Element {
148
149
  static name = "PropertyRelation";
149
150
 
150
151
  toJSON() {
151
- const string = this.getString(),
152
- breakPoint = this.getBreakPoint(),
153
- json = {
154
- string,
155
- breakPoint
156
- };
152
+ const string = this.getString();
153
+
154
+ let breakPoint;
155
+
156
+ breakPoint = this.getBreakPoint();
157
+
158
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
159
+
160
+ breakPoint = breakPointJSON; ///
161
+
162
+ const json = {
163
+ string,
164
+ breakPoint
165
+ };
157
166
 
158
167
  return json;
159
168
  }
160
169
 
161
170
  static fromJSON(json, context) {
162
171
  return instantiate((context) => {
163
- const { string, breakPoint } = json,
172
+ const { string } = json,
164
173
  propertyRelationNode = instantiatePropertyRelation(string, context),
165
174
  node = propertyRelationNode, ///
175
+ breakPoint = breakPointFromJSON(json),
166
176
  term = termFromPropertyRelationNode(propertyRelationNode, context),
167
177
  property = propertyFromPropertyRelationNode(propertyRelationNode, context);
168
178
 
@@ -5,6 +5,7 @@ import { Element } from "occam-languages";
5
5
  import { define } from "../elements";
6
6
  import { instantiateReference } from "../process/instantiate";
7
7
  import { REFERENCE_META_TYPE_NAME } from "../metaTypeNames";
8
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
8
9
  import { join, ablate, attempt, serialise, reconcile, unserialise, instantiate } from "../utilities/context";
9
10
  import { referenceFromReferenceNode, metavariableFromReferenceNode, topLevelMetaAssertionFromReferenceNode } from "../utilities/element";
10
11
 
@@ -293,13 +294,21 @@ export default define(class Reference extends Element {
293
294
  const context = this.getContext();
294
295
 
295
296
  return serialise((context) => {
296
- const string = this.getString(),
297
- breakPoint = this.getBreakPoint(),
298
- json = {
299
- context,
300
- string,
301
- breakPoint
302
- };
297
+ const string = this.getString();
298
+
299
+ let breakPoint;
300
+
301
+ breakPoint = this.getBreakPoint();
302
+
303
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
304
+
305
+ breakPoint = breakPointJSON; ///
306
+
307
+ const json = {
308
+ context,
309
+ string,
310
+ breakPoint
311
+ };
303
312
 
304
313
  return json;
305
314
  }, context);
@@ -312,9 +321,10 @@ export default define(class Reference extends Element {
312
321
 
313
322
  unserialise((json, context) => {
314
323
  instantiate((context) => {
315
- const { string, breakPoint } = json,
324
+ const { string } = json,
316
325
  referenceNode = instantiateReference(string, context),
317
326
  node = referenceNode, ///
327
+ breakPoint = breakPointFromJSON(json),
318
328
  metavariable = metavariableFromReferenceNode(referenceNode, context),
319
329
  topLevelMetaAssertion = topLevelMetaAssertionFromReferenceNode(referenceNode, context);
320
330
 
@@ -5,6 +5,7 @@ import { Element, asynchronousUtilities } from "occam-languages";
5
5
 
6
6
  import { define } from "../elements";
7
7
  import { enclose } from "../utilities/context";
8
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
8
9
  import { labelsFromJSON, premisesFromJSON, conclusionFromJSON, labelsToLabelsJSON, premisesToPremisesJSON, conclusionToConclusionJSON } from "../utilities/json";
9
10
 
10
11
  const { reverse } = arrayUtilities,
@@ -316,9 +317,17 @@ export default define(class Rule extends Element {
316
317
  const labelsJSON = labelsToLabelsJSON(this.labels),
317
318
  premisesJSON = premisesToPremisesJSON(this.premises),
318
319
  conclusionJSON = conclusionToConclusionJSON(this.conclusion),
319
- string = this.getString(),
320
- breakPoint = this.getBreakPoint(),
321
- labels = labelsJSON, ///
320
+ string = this.getString();
321
+
322
+ let breakPoint;
323
+
324
+ breakPoint = this.getBreakPoint();
325
+
326
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
327
+
328
+ breakPoint = breakPointJSON; ///
329
+
330
+ const labels = labelsJSON, ///
322
331
  premises = premisesJSON, ///
323
332
  conclusion = conclusionJSON, ///
324
333
  json = {
@@ -335,9 +344,10 @@ export default define(class Rule extends Element {
335
344
  static name = "Rule";
336
345
 
337
346
  static fromJSON(json, context) {
338
- const { string, breakPoint } = json,
347
+ const { string } = json,
339
348
  node = null,
340
349
  proof = null,
350
+ breakPoint = breakPointFromJSON(json),
341
351
  labels = labelsFromJSON(json, context),
342
352
  premises = premisesFromJSON(json, context),
343
353
  conclusion = conclusionFromJSON(json, context),