You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To serialise a `goto_modelt` instance `gm` to a stream `ostr` call the function `write_goto_binary`, e.g. `write_goto_binary(ostr, gm)`.
394
+
To serialise a `::goto_modelt` instance `gm` to a stream `ostr` call the
395
+
function `::write_goto_binary`, e.g. `write_goto_binary(ostr, gm)`.
395
396
396
-
The content of the written stream will have this strucutre:
397
+
The content of the written stream will have this structure:
397
398
- The header:
398
399
- A magic number: byte `0x7f` followed by 3 characters `GBF`.
399
-
- A version number written in the 7-bit encoding. Currently, only version `4` is supported.
400
+
- A version number written in the 7-bit encoding (see [number serialisation](\ref irep-serialization-numbers)). Currently, only version `4` is supported.
400
401
- The symbol table:
401
402
- The number of symbols in the table in the 7-bit encoding.
402
403
- The array of individual symbols in the table. Each written symbol `s` has this structure:
403
-
- The `irept` instance `s.type`.
404
-
- The `irept` instance `s.value`.
405
-
- The `irept` instance `s.location`.
404
+
- The `::irept` instance `s.type`.
405
+
- The `::irept` instance `s.value`.
406
+
- The `::irept` instance `s.location`.
406
407
- The string `s.name`.
407
408
- The string `s.module`.
408
409
- The string `s.base_name`.
409
410
- The string `s.mode`.
410
411
- The string `s.pretty_name`.
411
412
- The number `0` in the 7-bit encoding.
412
-
- The flags word in the 7-bit encoding. The bits in the flags word correspond to the following `bool` fields (from the most significant bit):
413
+
- The flags word in the 7-bit encoding. The bits in the flags word correspond to the following `Boolean` fields (from the most significant bit):
413
414
-`s.is_weak`
414
415
-`s.is_type`
415
416
-`s.is_property`
@@ -429,33 +430,33 @@ The content of the written stream will have this strucutre:
429
430
-`s.is_volatile`
430
431
- The functions with bodies, i.e. those missing a body are skipped.
431
432
- The number of functions with bodies in the 7-bit encoding.
432
-
- The array of individual function with bodies. Each written function has this structure:
433
+
- The array of individual functions with bodies. Each written function has this structure:
433
434
- The string with the name of the function.
434
435
- The number of instructions in the body of the function in the 7-bit encoding.
435
-
- The array of individual instruction in function's body. Each written instruction `I` has this structure:
436
-
- The `irept` instance `I.code`, i.e. data of the instruction, like arguments.
436
+
- The array of individual instructions in function's body. Each written instruction `I` has this structure:
437
+
- The `::irept` instance `I.code`, i.e. data of the instruction, like arguments.
437
438
- The string `I.function`, i.e. the name of the function this instruction belongs to.
438
-
- The `irept` instance `I.source_location`, i.e. the reference to the original source code (file, line).
439
+
- The `::irept` instance `I.source_location`, i.e. the reference to the original source code (file, line).
439
440
- The word in the 7-bit encoding `I.type`, i.e. the op-code of the instruction.
440
-
- The `irept` instance `I.guard`.
441
+
- The `::irept` instance `I.guard`.
441
442
- The empty string (representing former `I.event`).
442
443
- The word in the 7-bit encoding `I.target_number`, i.e. the jump target to this instruction from other instructions.
443
444
- The word in the 7-bit encoding `I.targets.size()`, i.e. the count of jump targets from this instruction.
444
445
- The array of individual jump targets from this instruction, each written as a word in the 7-bit encoding.
445
446
- The word in the 7-bit encoding `I.labels.size()`.
446
447
- The array of individual labels, each written as a word in the 7-bit encoding.
447
448
448
-
An important propery of the serialisation is that each serialised `irept`
449
+
An important propery of the serialisation is that each serialised `::irept`
449
450
instance occurs in the stream exactly once. Namely, in the position of
450
-
its first serialisation query. All other such queries save only hash
451
-
code (i.e. reference) of the `irept` instance.
451
+
its first serialisation query. All other such queries save only a hash
452
+
code (i.e. reference) of the `::irept` instance.
452
453
453
-
The similar strategy is used for serialisation of string constants
454
-
shared amongst `irept` instances. Such a string is fully saved only in
455
-
the first serialisation query of an `irept` instance it appears in and
456
-
all other queries only save its integer has code.
454
+
A similar strategy is used for serialisation of string constants
455
+
shared amongst `::irept` instances. Such a string is fully saved only in
456
+
the first serialisation query of an `::irept` instance it appears in and
457
+
all other queries only save its integer hash code.
457
458
458
-
Details about serialisation of `irept` instances, strings, and words in
459
+
Details about serialisation of `::irept` instances, strings, and words in
459
460
7-bit encoding can be found [here](\ref irep-serialization).
0 commit comments