Abstract
Natural-language specifications are easy to write, but they are ambiguous and not directly machine-checkable. Expecto bridges this gap by extracting trustworthy formal specifications from natural-language intent. Its key idea is a top-down, modular specification synthesis algorithm: an LLM first decomposes a complex requirement into typed informal definitions, then Expecto refines each definition into formal DSL components. At every step, the system validates partial specifications with syntax/type checking and SMT-based consistency checking, treating unresolved informal definitions as uninterpreted functions. Across competitive-programming and real-world bug benchmarks, Expecto generates substantially more sound-and-complete specifications than monolithic LLM baselines.