Output Formats#
C2PO can emit multiple output formats, but they are produced in two different ways:
CLI mode (
python3 c2po.py --spec ...): writes the assembled R2U2 binary (--output), and optionally bounds (--write-bounds).REPL/script mode (
--interactive/--script): writes the other representations using REPL commands such aswrite_c2po,write_prefix,write_mltl, andwrite_pickle.
Format |
How to Generate |
Reason to use |
|---|---|---|
R2U2 Binary |
CLI |
Run R2U2 over specification |
REPL/script |
Validate the specification post-compilation or debugging |
|
REPL/script |
Validate the specification post-compilation or debugging. Some operators have multiple arities, so |
|
REPL/script |
Convert C2PO files to MLTL-STD files |
|
REPL/script |
Compare program properties like memory requirements across different C2PO calls |
Example script snippet:
parse_c2po spec.c2po
compile out/spec.bin
write_c2po out/spec.c2po
write_prefix out/spec.prefix
write_mltl out/spec.mltl
write_pickle out/spec.pickle