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)`.
346
+
To serialise a `::goto_modelt` instance `gm` to a stream `ostr` call the
347
+
function `::write_goto_binary`, e.g. `write_goto_binary(ostr, gm)`.
347
348
348
-
The content of the written stream will have this strucutre:
349
+
The content of the written stream will have this structure:
349
350
- The header:
350
351
- A magic number: byte `0x7f` followed by 3 characters `GBF`.
351
-
- A version number written in the 7-bit encoding. Currently, only version `4` is supported.
352
+
- A version number written in the 7-bit encoding (see [number serialisation](\ref irep-serialization-numbers)). Currently, only version `4` is supported.
352
353
- The symbol table:
353
354
- The number of symbols in the table in the 7-bit encoding.
354
355
- The array of individual symbols in the table. Each written symbol `s` has this structure:
355
-
- The `irept` instance `s.type`.
356
-
- The `irept` instance `s.value`.
357
-
- The `irept` instance `s.location`.
356
+
- The `::irept` instance `s.type`.
357
+
- The `::irept` instance `s.value`.
358
+
- The `::irept` instance `s.location`.
358
359
- The string `s.name`.
359
360
- The string `s.module`.
360
361
- The string `s.base_name`.
361
362
- The string `s.mode`.
362
363
- The string `s.pretty_name`.
363
364
- The number `0` in the 7-bit encoding.
364
-
- 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):
365
+
- 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):
365
366
-`s.is_weak`
366
367
-`s.is_type`
367
368
-`s.is_property`
@@ -381,33 +382,33 @@ The content of the written stream will have this strucutre:
381
382
-`s.is_volatile`
382
383
- The functions with bodies, i.e. those missing a body are skipped.
383
384
- The number of functions with bodies in the 7-bit encoding.
384
-
- The array of individual function with bodies. Each written function has this structure:
385
+
- The array of individual functions with bodies. Each written function has this structure:
385
386
- The string with the name of the function.
386
387
- The number of instructions in the body of the function in the 7-bit encoding.
387
-
- The array of individual instruction in function's body. Each written instruction `I` has this structure:
388
-
- The `irept` instance `I.code`, i.e. data of the instruction, like arguments.
388
+
- The array of individual instructions in function's body. Each written instruction `I` has this structure:
389
+
- The `::irept` instance `I.code`, i.e. data of the instruction, like arguments.
389
390
- The string `I.function`, i.e. the name of the function this instruction belongs to.
390
-
- The `irept` instance `I.source_location`, i.e. the reference to the original source code (file, line).
391
+
- The `::irept` instance `I.source_location`, i.e. the reference to the original source code (file, line).
391
392
- The word in the 7-bit encoding `I.type`, i.e. the op-code of the instruction.
392
-
- The `irept` instance `I.guard`.
393
+
- The `::irept` instance `I.guard`.
393
394
- The empty string (representing former `I.event`).
394
395
- The word in the 7-bit encoding `I.target_number`, i.e. the jump target to this instruction from other instructions.
395
396
- The word in the 7-bit encoding `I.targets.size()`, i.e. the count of jump targets from this instruction.
396
397
- The array of individual jump targets from this instruction, each written as a word in the 7-bit encoding.
397
398
- The word in the 7-bit encoding `I.labels.size()`.
398
399
- The array of individual labels, each written as a word in the 7-bit encoding.
399
400
400
-
An important propery of the serialisation is that each serialised `irept`
401
+
An important propery of the serialisation is that each serialised `::irept`
401
402
instance occurs in the stream exactly once. Namely, in the position of
402
-
its first serialisation query. All other such queries save only hash
403
-
code (i.e. reference) of the `irept` instance.
403
+
its first serialisation query. All other such queries save only a hash
404
+
code (i.e. reference) of the `::irept` instance.
404
405
405
-
The similar strategy is used for serialisation of string constants
406
-
shared amongst `irept` instances. Such a string is fully saved only in
407
-
the first serialisation query of an `irept` instance it appears in and
408
-
all other queries only save its integer has code.
406
+
A similar strategy is used for serialisation of string constants
407
+
shared amongst `::irept` instances. Such a string is fully saved only in
408
+
the first serialisation query of an `::irept` instance it appears in and
409
+
all other queries only save its integer hash code.
409
410
410
-
Details about serialisation of `irept` instances, strings, and words in
411
+
Details about serialisation of `::irept` instances, strings, and words in
411
412
7-bit encoding can be found [here](\ref irep-serialization).
0 commit comments