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
@@ -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) {
@@ -40,7 +41,7 @@ export default define(class ProcedureReference extends Element {
40
41
 
41
42
  breakPoint = this.getBreakPoint();
42
43
 
43
- const breakPointJSON = breakPoint.toJSON();
44
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
44
45
 
45
46
  breakPoint = breakPointJSON; ///
46
47
 
@@ -54,9 +55,10 @@ export default define(class ProcedureReference extends Element {
54
55
 
55
56
  static fromJSON(json, context) {
56
57
  return instantiate((context) => {
57
- const { string, breakPoint } = json,
58
+ const { string } = json,
58
59
  procedureReferenceNode = instantiateProcedureReference(string, context),
59
60
  node = procedureReferenceNode, ///
61
+ breakPoint = breakPointFromJSON(json),
60
62
  name = nameFromProcedureReferenceNode(procedureReferenceNode, context);
61
63
 
62
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 {
@@ -293,7 +294,7 @@ export default define(class Premise extends ProofAssertion {
293
294
 
294
295
  breakPoint = this.getBreakPoint();
295
296
 
296
- const breakPointJSON = breakPoint.toJSON();
297
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
297
298
 
298
299
  breakPoint = breakPointJSON; ///
299
300
 
@@ -314,9 +315,10 @@ export default define(class Premise extends ProofAssertion {
314
315
 
315
316
  unserialise((json, context) => {
316
317
  instantiate((context) => {
317
- const { string, breakPoint } = json,
318
+ const { string } = json,
318
319
  premiseNode = instantiatePremise(string, context),
319
320
  node = premiseNode, ///
321
+ breakPoint = breakPointFromJSON(json),
320
322
  statement = statementFromPremiseNode(premiseNode, context),
321
323
  procedureCall = procedureCallFromPremiseNode(premiseNode, context);
322
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 {
@@ -316,7 +317,7 @@ export default define(class Supposition extends ProofAssertion {
316
317
 
317
318
  breakPoint = this.getBreakPoint();
318
319
 
319
- const breakPointJSON = breakPoint.toJSON();
320
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
320
321
 
321
322
  breakPoint = breakPointJSON; ///
322
323
 
@@ -337,9 +338,10 @@ export default define(class Supposition extends ProofAssertion {
337
338
 
338
339
  unserialise((json, context) => {
339
340
  instantiate((context) => {
340
- const { string, breakPoint } = json,
341
+ const { string } = json,
341
342
  suppositionNode = instantiateSupposition(string, context),
342
343
  node = suppositionNode, ///
344
+ breakPoint = breakPointFromJSON(json),
343
345
  statement = statementFromSuppositionNode(suppositionNode, context),
344
346
  procedureCall = procedureCallFromSuppositionNode(suppositionNode, context);
345
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) {
@@ -223,7 +224,7 @@ export default define(class Property extends Element {
223
224
 
224
225
  breakPoint = this.getBreakPoint();
225
226
 
226
- const breakPointJSON = breakPoint.toJSON();
227
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
227
228
 
228
229
  breakPoint = breakPointJSON; ///
229
230
 
@@ -241,9 +242,10 @@ export default define(class Property extends Element {
241
242
 
242
243
  static fromJSON(json, context) {
243
244
  return instantiate((context) => {
244
- const { string, breakPoint } = json,
245
+ const { string } = json,
245
246
  propertyNode = instantiateProperty(string, context),
246
247
  node = propertyNode, ///
248
+ breakPoint = breakPointFromJSON(json),
247
249
  name = nameFromPropertyNode(propertyNode, context),
248
250
  type = typeFromJSON(json, context);
249
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) {
@@ -154,7 +155,7 @@ export default define(class PropertyRelation extends Element {
154
155
 
155
156
  breakPoint = this.getBreakPoint();
156
157
 
157
- const breakPointJSON = breakPoint.toJSON();
158
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
158
159
 
159
160
  breakPoint = breakPointJSON; ///
160
161
 
@@ -168,9 +169,10 @@ export default define(class PropertyRelation extends Element {
168
169
 
169
170
  static fromJSON(json, context) {
170
171
  return instantiate((context) => {
171
- const { string, breakPoint } = json,
172
+ const { string } = json,
172
173
  propertyRelationNode = instantiatePropertyRelation(string, context),
173
174
  node = propertyRelationNode, ///
175
+ breakPoint = breakPointFromJSON(json),
174
176
  term = termFromPropertyRelationNode(propertyRelationNode, context),
175
177
  property = propertyFromPropertyRelationNode(propertyRelationNode, context);
176
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
 
@@ -299,7 +300,7 @@ export default define(class Reference extends Element {
299
300
 
300
301
  breakPoint = this.getBreakPoint();
301
302
 
302
- const breakPointJSON = breakPoint.toJSON();
303
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
303
304
 
304
305
  breakPoint = breakPointJSON; ///
305
306
 
@@ -320,9 +321,10 @@ export default define(class Reference extends Element {
320
321
 
321
322
  unserialise((json, context) => {
322
323
  instantiate((context) => {
323
- const { string, breakPoint } = json,
324
+ const { string } = json,
324
325
  referenceNode = instantiateReference(string, context),
325
326
  node = referenceNode, ///
327
+ breakPoint = breakPointFromJSON(json),
326
328
  metavariable = metavariableFromReferenceNode(referenceNode, context),
327
329
  topLevelMetaAssertion = topLevelMetaAssertionFromReferenceNode(referenceNode, context);
328
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,
@@ -322,7 +323,7 @@ export default define(class Rule extends Element {
322
323
 
323
324
  breakPoint = this.getBreakPoint();
324
325
 
325
- const breakPointJSON = breakPoint.toJSON();
326
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
326
327
 
327
328
  breakPoint = breakPointJSON; ///
328
329
 
@@ -343,9 +344,10 @@ export default define(class Rule extends Element {
343
344
  static name = "Rule";
344
345
 
345
346
  static fromJSON(json, context) {
346
- const { string, breakPoint } = json,
347
+ const { string } = json,
347
348
  node = null,
348
349
  proof = null,
350
+ breakPoint = breakPointFromJSON(json),
349
351
  labels = labelsFromJSON(json, context),
350
352
  premises = premisesFromJSON(json, context),
351
353
  conclusion = conclusionFromJSON(json, context),
@@ -4,8 +4,8 @@ import { Element } from "occam-languages";
4
4
  import { arrayUtilities } from "necessary";
5
5
 
6
6
  import { define } from "../elements";
7
- import { instantiateSignature } from "../process/instantiate";
8
7
  import { signatureFromSignatureNode } from "../utilities/element";
8
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
9
9
  import { join, ablate, attempt, reconcile, serialise, unserialise, instantiate } from "../utilities/context";
10
10
 
11
11
  const { match } = arrayUtilities;
@@ -239,7 +239,7 @@ export default define(class Signature extends Element {
239
239
 
240
240
  breakPoint = this.getBreakPoint();
241
241
 
242
- const breakPointJSON = breakPoint.toJSON();
242
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
243
243
 
244
244
  breakPoint = breakPointJSON; ///
245
245
 
@@ -258,9 +258,10 @@ export default define(class Signature extends Element {
258
258
 
259
259
  unserialise((json, context) => {
260
260
  instantiate((context) => {
261
- const { string, breakPoint } = json,
261
+ const { string } = json,
262
262
  signatureNode = instantiateSignature(string, context),
263
263
  node = signatureNode, ///
264
+ breakPoint = breakPointFromJSON(json),
264
265
  terms = termsFromSignatureNode(signatureNode, context);
265
266
 
266
267
  signature = new Signature(context, string, node, breakPoint, terms);
@@ -5,8 +5,9 @@ import { Element } from "occam-languages";
5
5
  import { define } from "../elements";
6
6
  import { unifyStatement } from "../process/unify";
7
7
  import { validateStatements } from "../utilities/validation";
8
- import { instantiateStatement } from "../process/instantiate";
9
8
  import { reconcile, instantiate } from "../utilities/context";
9
+ import { instantiateStatement } from "../process/instantiate";
10
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
10
11
 
11
12
  export default define(class Statement extends Element {
12
13
  getStatementNode() {
@@ -399,7 +400,7 @@ export default define(class Statement extends Element {
399
400
 
400
401
  breakPoint = this.getBreakPoint();
401
402
 
402
- const breakPointJSON = breakPoint.toJSON();
403
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
403
404
 
404
405
  breakPoint = breakPointJSON; ///
405
406
 
@@ -413,9 +414,10 @@ export default define(class Statement extends Element {
413
414
 
414
415
  static fromJSON(json, context) {
415
416
  return instantiate((context) => {
416
- const { string, breakPoint } = json,
417
+ const { string } = json,
417
418
  statementNode = instantiateStatement(string, context),
418
- node = statementNode; ///
419
+ node = statementNode, ///
420
+ breakPoint = breakPointFromJSON(json);
419
421
 
420
422
  context = null;
421
423
 
@@ -3,6 +3,7 @@
3
3
  import Substitution from "../substitution";
4
4
 
5
5
  import { define } from "../../elements";
6
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
6
7
  import { instantiateFrameSubstitution } from "../../process/instantiate";
7
8
  import { frameSubstitutionFromFrameSubstitutionNode } from "../../utilities/element";
8
9
  import { frameSubstitutionStringFromFrameAndMetavariable } from "../../utilities/string";
@@ -195,7 +196,7 @@ export default define(class FrameSubstitution extends Substitution {
195
196
  const context = specificContext; ///
196
197
 
197
198
  instantiate((context) => {
198
- const { string, breakPoint } = json,
199
+ const { string } = json,
199
200
  specificContext = context, ///
200
201
  contexts = [
201
202
  generalContext,
@@ -203,6 +204,7 @@ export default define(class FrameSubstitution extends Substitution {
203
204
  ],
204
205
  frameSubstitutionNode = instantiateFrameSubstitution(string, context),
205
206
  node = frameSubstitutionNode, ///
207
+ breakPoint = breakPointFromJSON(json),
206
208
  targetFrame = targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
207
209
  replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context);
208
210
 
@@ -3,6 +3,7 @@
3
3
  import Substitution from "../substitution";
4
4
 
5
5
  import { define } from "../../elements";
6
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
6
7
  import { instantiateReferenceSubstitution } from "../../process/instantiate";
7
8
  import { referenceSubstitutionFromReferenceSubstitutionNode } from "../../utilities/element";
8
9
  import { referenceSubstitutionStringFromReferenceAndMetavariable } from "../../utilities/string";
@@ -200,7 +201,7 @@ export default define(class ReferenceSubstitution extends Substitution {
200
201
  const context = specificContext; ///
201
202
 
202
203
  instantiate((context) => {
203
- const { string, breakPoint } = json,
204
+ const { string } = json,
204
205
  specificContext = context, ///
205
206
  contexts = [
206
207
  generalContext,
@@ -208,6 +209,7 @@ export default define(class ReferenceSubstitution extends Substitution {
208
209
  ],
209
210
  referenceSubstitutionNode = instantiateReferenceSubstitution(string, context),
210
211
  node = referenceSubstitutionNode, ///
212
+ breakPoint = breakPointFromJSON(json),
211
213
  targetReference = targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
212
214
  replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context);
213
215
 
@@ -5,6 +5,7 @@ import Substitution from "../substitution";
5
5
  import { define } from "../../elements";
6
6
  import { unifySubstitution } from "../../process/unify";
7
7
  import { stripBracketsFromStatement } from "../../utilities/brackets";
8
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
8
9
  import { instantiateStatementSubstitution } from "../../process/instantiate";
9
10
  import { statementSubstitutionFromStatementSubstitutionNode } from "../../utilities/element";
10
11
  import { join, ablates, manifest, attempts, descend, reconcile, instantiate, unserialises } from "../../utilities/context";
@@ -360,7 +361,7 @@ export default define(class StatementSubstitution extends Substitution {
360
361
  const context = specificContext; ///
361
362
 
362
363
  instantiate((context) => {
363
- const { string, breakPoint } = json,
364
+ const { string } = json,
364
365
  specificContext = context, ///
365
366
  contexts = [
366
367
  generalContext,
@@ -368,6 +369,7 @@ export default define(class StatementSubstitution extends Substitution {
368
369
  ],
369
370
  statementSubstitutionNode = instantiateStatementSubstitution(string, context),
370
371
  node = statementSubstitutionNode, ///
372
+ breakPoint = breakPointFromJSON(json),
371
373
  resolved = resolvedFromStatementSubstitutionNode(statementSubstitutionNode, context),
372
374
  substitution = substitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext),
373
375
  targetStatement = targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
@@ -4,6 +4,7 @@ import Substitution from "../substitution";
4
4
 
5
5
  import { define } from "../../elements";
6
6
  import { stripBracketsFromTerm } from "../../utilities/brackets";
7
+ import { breakPointFromJSON } from "../../utilities/breakPoint";
7
8
  import { instantiateTermSubstitution } from "../../process/instantiate";
8
9
  import { termSubstitutionFromTermSubstitutionNode } from "../../utilities/element";
9
10
  import { termSubstitutionStringFromTermAndVariable } from "../../utilities/string";
@@ -204,7 +205,7 @@ export default define(class TermSubstitution extends Substitution {
204
205
  const context = specificContext; ///
205
206
 
206
207
  instantiate((context) => {
207
- const { string, breakPoint } = json,
208
+ const { string } = json,
208
209
  specificContext = context, ///
209
210
  contexts = [
210
211
  generalContext,
@@ -212,6 +213,7 @@ export default define(class TermSubstitution extends Substitution {
212
213
  ],
213
214
  termSubstitutionNode = instantiateTermSubstitution(string, context),
214
215
  node = termSubstitutionNode, ///
216
+ breakPoint = breakPointFromJSON(json),
215
217
  targetTerm = targetTermFromTermSubstitutionNode(termSubstitutionNode, context),
216
218
  replacementTerm = replacementTermFromTermSubstitutionNode(termSubstitutionNode, context);
217
219
 
@@ -4,6 +4,7 @@ import { arrayUtilities } from "necessary";
4
4
 
5
5
  import { serialises } from "../utilities/context";
6
6
  import { primitiveUtilities } from "occam-furtle";
7
+ import { breakPointToBreakPointJSON } from "../utilities/breakPoint";
7
8
 
8
9
  const { first, second } = arrayUtilities,
9
10
  { primitiveFromNode } =primitiveUtilities;
@@ -249,7 +250,7 @@ export default class Substitution extends Element {
249
250
 
250
251
  breakPoint = this.getBreakPoint();
251
252
 
252
- const breakPointJSON = breakPoint.toJSON();
253
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
253
254
 
254
255
  breakPoint = breakPointJSON; ///
255
256
 
@@ -9,6 +9,7 @@ import { validateTerms } from "../utilities/validation";
9
9
  import { instantiateTerm } from "../process/instantiate";
10
10
  import { variablesFromTerm } from "../utilities/equivalence";
11
11
  import { unifyTermIntrinsically } from "../process/unify";
12
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
12
13
  import { typeFromJSON, typeToTypeJSON, provisionalFromJSON, provisionalToProvisionalJSON } from "../utilities/json";
13
14
 
14
15
  const { filter } = arrayUtilities;
@@ -294,7 +295,7 @@ export default define(class Term extends Element {
294
295
 
295
296
  breakPoint = this.getBreakPoint();
296
297
 
297
- const breakPointJSON = breakPoint.toJSON();
298
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
298
299
 
299
300
  breakPoint = breakPointJSON; ///
300
301
 
@@ -314,9 +315,10 @@ export default define(class Term extends Element {
314
315
 
315
316
  static fromJSON(json, context) {
316
317
  return instantiate((context) => {
317
- const { string, breakPoint } = json,
318
+ const { string } = json,
318
319
  termNode = instantiateTerm(string, context),
319
320
  node = termNode, ///
321
+ breakPoint = breakPointFromJSON(json),
320
322
  type = typeFromJSON(json, context),
321
323
  provisional = provisionalFromJSON(json, context);
322
324
 
@@ -4,6 +4,7 @@ import { arrayUtilities } from "necessary";
4
4
  import { Element, asynchronousUtilities } from "occam-languages";
5
5
 
6
6
  import { enclose } from "../utilities/context";
7
+ import { breakPointToBreakPointJSON } from "../utilities/breakPoint";
7
8
  import { topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction } from "../utilities/string";
8
9
  import { labelsFromJSON,
9
10
  deductionFromJSON,
@@ -359,7 +360,7 @@ export default class TopLevelAssertion extends Element {
359
360
 
360
361
  breakPoint = this.getBreakPoint();
361
362
 
362
- const breakPointJSON = breakPoint.toJSON();
363
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
363
364
 
364
365
  breakPoint = breakPointJSON; ///
365
366
 
@@ -3,6 +3,7 @@
3
3
  import { Element, asynchronousUtilities } from "occam-languages";
4
4
 
5
5
  import { enclose } from "../utilities/context";
6
+ import { breakPointToBreakPointJSON } from "../utilities/breakPoint";
6
7
  import { topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction } from "../utilities/string";
7
8
  import { labelFromJSON,
8
9
  labelToLabelJSON,
@@ -239,7 +240,7 @@ export default class TopLevelMetaAssertion extends Element {
239
240
 
240
241
  breakPoint = this.getBreakPoint();
241
242
 
242
- const breakPointJSON = breakPoint.toJSON();
243
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
243
244
 
244
245
  breakPoint = breakPointJSON; ///
245
246
 
@@ -8,6 +8,7 @@ import { instantiate } from "../utilities/context";
8
8
  import { instantiateType } from "../process/instantiate";
9
9
  import { nameFromTypeNode } from "../utilities/element";
10
10
  import { baseTypeFromNothing } from "../utilities/type";
11
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
11
12
  import { propertiesFromJSON,
12
13
  prefixNameFromJSON,
13
14
  superTypesFromJSON,
@@ -297,12 +298,20 @@ export default define(class Type extends Element {
297
298
  }
298
299
 
299
300
  toJSON(abridged = false) {
300
- const string = this.getString(),
301
- breakPoint = this.getBreakPoint(),
302
- json = {
303
- string,
304
- breakPoint
305
- };
301
+ const string = this.getString();
302
+
303
+ let breakPoint;
304
+
305
+ breakPoint = this.getBreakPoint();
306
+
307
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
308
+
309
+ breakPoint = breakPointJSON; ///
310
+
311
+ const json = {
312
+ string,
313
+ breakPoint
314
+ };
306
315
 
307
316
  if (!abridged) {
308
317
  const prefixNameJSON = prefixnameToPrevixNameJSON(this.prefixName),
@@ -329,9 +338,10 @@ export default define(class Type extends Element {
329
338
 
330
339
  static fromJSON(json, context) {
331
340
  return instantiate((context) => {
332
- const { string, breakPoint } = json,
341
+ const { string } = json,
333
342
  typeNode = instantiateType(string, context),
334
343
  node = typeNode, ///
344
+ breakPoint = breakPointFromJSON(json),
335
345
  name = nameFromTypeNode(typeNode, context),
336
346
  prefixName = prefixNameFromJSON(json, context),
337
347
  superTypes = superTypesFromJSON(json, context),
@@ -6,6 +6,7 @@ import { define } from "../elements";
6
6
  import { instantiate } from "../utilities/context";
7
7
  import { instantiateTypePrefix } from "../process/instantiate";
8
8
  import { nameFromTypePrefixNode } from "../utilities/element";
9
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
9
10
 
10
11
  export default define(class TypePrefix extends Element {
11
12
  constructor(context, string, node, breakPoint, name) {
@@ -82,7 +83,7 @@ export default define(class TypePrefix extends Element {
82
83
 
83
84
  breakPoint = this.getBreakPoint();
84
85
 
85
- const breakPointJSON = breakPoint.toJSON();
86
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
86
87
 
87
88
  breakPoint = breakPointJSON; ///
88
89
 
@@ -96,9 +97,10 @@ export default define(class TypePrefix extends Element {
96
97
 
97
98
  static fromJSON(json, context) {
98
99
  return instantiate((context) => {
99
- const { string, breakPoint } = json,
100
+ const { string } = json,
100
101
  typePrefixNode = instantiateTypePrefix(string, context),
101
102
  node = typePrefixNode, ///
103
+ breakPoint = breakPointFromJSON(json),
102
104
  name = nameFromTypePrefixNode(typePrefixNode, context);
103
105
 
104
106
  context = null; ///
@@ -9,6 +9,7 @@ import { instantiate } from "../utilities/context";
9
9
  import { instantiateVariable } from "../process/instantiate";
10
10
  import { provisionallyStringFromProvisional } from "../utilities/string";
11
11
  import { variableFromTermNode, identifierFromVariableNode } from "../utilities/element";
12
+ import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
12
13
  import { typeFromJSON, typeToTypeJSON, provisionalFromJSON, provisionalToProvisionalJSON } from "../utilities/json";
13
14
 
14
15
  export default define(class Variable extends Element {
@@ -213,7 +214,7 @@ export default define(class Variable extends Element {
213
214
 
214
215
  breakPoint = this.getBreakPoint();
215
216
 
216
- const breakPointJSON = breakPoint.toJSON();
217
+ const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
217
218
 
218
219
  breakPoint = breakPointJSON; ///
219
220
 
@@ -233,9 +234,10 @@ export default define(class Variable extends Element {
233
234
 
234
235
  static fromJSON(json, context) {
235
236
  return instantiate((context) => {
236
- const { string, breakPoint } = json,
237
+ const { string } = json,
237
238
  variableNode = instantiateVariable(string, context),
238
239
  node = variableNode, ///
240
+ breakPoint = breakPointFromJSON(json),
239
241
  type = typeFromJSON(json, context),
240
242
  identifier = identifierFromVariableNode(variableNode, context),
241
243
  provisional = provisionalFromJSON(json, context);
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ import { BreakPoint } from "occam-languages";
4
+
5
+ export function breakPointFromJSON(json) {
6
+ let breakPoint;
7
+
8
+ ({ breakPoint } = json);
9
+
10
+ if (breakPoint !== null) {
11
+ const breakPointJSON = breakPoint; ///
12
+
13
+ json = breakPointJSON; ///
14
+
15
+ breakPoint = BreakPoint.fromJSON(json); ///
16
+ }
17
+
18
+ return breakPoint;
19
+ }
20
+
21
+ export function breakPointToBreakPointJSON(breakPoint) {
22
+ let breakPointJSON = null;
23
+
24
+ if (breakPointJSON !== null) {
25
+ breakPointJSON = breakPoint.toJSON();
26
+ }
27
+
28
+ return breakPointJSON;
29
+ }