translator module

exception translator.AnswerAssertionError[source]

Bases: PuzzleGenerationError

Raised when answer assertion validation fails

exception translator.NoSolutionError[source]

Bases: PuzzleGenerationError

Raised when Z3 solver cannot find any solution to the constraints

exception translator.PuzzleGenerationError[source]

Bases: Exception

Base exception for puzzle generation errors

exception translator.RandomGenerationError[source]

Bases: PuzzleGenerationError

Raised when random number/option generation fails after multiple attempts

exception translator.TooManySolutionsError[source]

Bases: PuzzleGenerationError

Raised when the number of solutions exceeds the maximum allowed

translator.ext(s)[source]

在s前后加空格以适应f” “ “环境

translator.init_program()[source]
translator.parse_config_file(config_file)[source]
translator.process(puzzle_template, mode)[source]
translator.process_conditions(Dict: dict)[source]
translator.process_custom_operator(Dict: dict)[source]
translator.process_defined_symbols(sym: str, template: dict)[source]
translator.process_dynamic_conditions(sym: str, template: dict)[source]
translator.process_multiple_derived_symbols(sym: str, templates: str)[source]
translator.process_multiple_query(q: str, qconfig: str, cnt: int)[source]
translator.process_optimize(Dict: dict)[source]
translator.process_post_generation(Dict: dict, calc_solution=True)[source]
translator.process_query(Dict: dict)[source]
translator.process_single_derived_symbols(sym: str, template: str)[source]
translator.process_single_query(q: str, qconfig: str, cnt: int)[source]
translator.process_static_conditions(sym: str, template: dict)[source]
translator.process_symbols(Dict: dict)[source]
translator.process_vars(Dict: dict)[source]
translator.process_with_config(puzzle_spec_path, output_path, config_file)[source]
translator.repeat_process(puzzle_spec_path, output_path, new_puzzles_num=100, mode='-t')[source]
translator.resolve_rand(domain_str: str, isint: bool)[source]
translator.translator(spec: dict)[source]