Function main

Source
pub(crate) fn main() -> Result<(), Box<dyn Error>>
Expand description

Executes the main asynchronous function for processing string synthesis problems using a command-line interface.

First, it parses command-line arguments to configure logging levels and debug settings. If the --sig flag is specified, it reads and parses a synthesis problem from the input file and prints the function signature. If the input file ends with .smt2, it handles an expression checking problem by parsing it, evaluating its expression in the context of provided examples, and comparing the result with expected outputs, printing the correctness count.

For other input files, it reads and parses a programming-by-example problem, creating a context-free grammar configuration from the synthesized function. Optional configurations are applied through an external file, and context enrichment is based on example detection. If constant extraction is enabled, constants from examples are added to grammar rules. The configuration is logged, and examples are optionally shown. The function adjusts for deduction settings and either solves the synthesis problem using top-blocked search without ite or sets up multi-threaded search loops to find solutions, outputting the derived function. Finally, it ensures threads complete gracefully before exiting.