PRESS (Format and Feature Conversion)

PRESS, as in printing-press, is short for Printing and Representation Exchange Software Suite. wtk-press is a tool for changing the format of the IR or to remove unwanted features from the IR. Press can convert between the text and binary formats of the IR, or it can replace @switch directives with a multiplexer. The multiplexer is composed with @for loops, and a @function(check_case, …​.), which does have to exponentiate by p-1 when using arithmetic gates.

Command-Line Modes

wtk-press uses a <mode> <input-file> [ <output-file> ] format on its command line. Available modes are as follows. Text parsing is always done with IRRegular.

b2b

Binary to binary

b2mux

Binary to binary, with multiplex converter (if necessary)

b2t

Binary to text

t2b

Text to binary

t2mux

Text to text, with multiplex converter (if necessary)

t2t

Text to text

It also has some more testing oriented modes, which convert to nothing. Essentially they are for testing and profiling the parsers.

a2n

ANTLR to nothing

b2n

Binary to nothing

t2n

Text (IRRegular) to nothing

Example invocations

To convert from a text file to a binary file, or reverse.

wtk-press t2b relation_file.rel bin_relation_file.rel
wtk-press b2t bin_relation_file.rel > relation_file_copy.rel

To remove the @switch features.

wtk-press t2mux relation_file.rel relation_file_mux.rel
wtk-press b2mux bin_relation_file.rel bin_relation_file_mux.rel