output¶
Output utilities.
atom_str(name: str, arity: int) -> str
¶
Get the string representation of an atom with the given predicate name and arity.
For arity 0 this is just the name, otherwise it is name(X0,...,X{arity-1}).
build_cx_program(generate: str, left: list[AST], public_reduct: list[AST], difference: str, constraint: str, forward: bool = True) -> str
¶
Build the CX program as a string from the components.
build_cx_program_gc(generate: str, left: list[AST], public_reduct: list[AST], difference: str, constraint: str, forward: bool = True) -> tuple[str, str]
¶
Build the guess and check CX program as a string for the components.
program_to_str(prog: list[AST], newline: bool = False) -> str
¶
Turn a program into its string representation.
save_cx_program_gc_to_file(cx_program_guess: str | None, cx_program_check: str | None, out_dir: str, forward: bool = True) -> None
¶
Save the guess and check CX program to the output directory.
save_cx_program_to_file(cx_program: str | None, out_dir: str, forward: bool = True, postfix: str | None = None) -> None
¶
Save the CX program to the output directory.
variable_names(arity: int) -> list[str]
¶
Get the list of variable names X0, ..., X{arity-1} for the given arity.