Appendix D. File Formats

D.1. Bytecode file format

The LogiQL bytecode format is loosely based on the Java bytecode format:

  • Magic String: A sequence of 4 hexadecimal numbers (4 bytes) which serves as an identifying string. This sequence is "logiql" (0d a7 a1 09).
  • Version Number: 4 bytes, used to specify a bytecode file format version number.
  • Summary size: 4 bytes, interpreted as an integer containing the number of bytes used by the summary message following it.
  • Summary: A protocol buffer message of type CompilationUnitSummary, containing a succinct description of the predicates declared in this compilation unit.
  • Code size: 4 bytes, interpreted as an integer containing the number of bytes used by the code message following it.
  • Code: A protocol buffer message of type CompilationUnit, containing all the logic code in LB0 (Protocol Buffer) format for the block.

D.2. Summary file format

The summary file format is similar to the bytecode file format:

  • Magic String: A sequence of 4 hexadecimal numbers (4 bytes) which serves as an identifying string. This sequence is "database" (da 7a ba 5e).
  • Version Number: 4 bytes, used to specify a summary file format version number.
  • Project name size: 4 bytes, used to specify the length of the project name field.
  • Project name: A UTF-8 encoded string with the length specified by the previous field.
  • Summary message size: 4 bytes, interpreted as an integer depicting the number of bytes used by the project summary message following it.
  • Summary message: A protocol buffer message of type ProjectSummary, containing a graph of dependencies within this project.