Catching Conflicts Before They Go Live: Solver-Verified Compilation of Natural-Language Smart-Home Policies
Authors/Creators
Description
Smart-home platforms increasingly let people write automation policies in plain English, which a large language model (LLM) compiles into a rule language. Validation then happens one rule at a time: the output is well-formed, typed, and above a confidence threshold. Per-rule validation cannot see a rule that contradicts itself, a modify that a block always overrides, two modifiers that disagree about the same moment, or a safety property that no rule actually guarantees. We formalize the rule language of DeviceWeave and show that, because every condition constrains one context field, the set of contexts a rule matches is a finite union of axis-aligned boxes. Satisfiability, shadowing, conflict, redundancy and invariant coverage are then decidable exactly by interval arithmetic, with a concrete witness context for every finding (Theorems 1 and 2) and a polynomial bound for fixed numbers of fields and of atoms per rule (Proposition 1). On 1,000 random rule sets, the checker’s findings match an independent Z3 encoding exactly, and all 1,353 conflict and invariant witnesses reproduce their finding when replayed through the production evaluator. The checker runs 14–39× faster than Z3, and it now gates policy authoring in our DeviceWeave deployment. We also release a 380-rule benchmark that scores compiled rules by semantic equivalence rather than by string match. Compiled faithfully, all 20 of its self-contradictory rules pass the per-rule validator; only the set-level analysis rejects them.
Files
4_deviceweave-policy-checker.pdf
Additional details
Related works
- Is supplemented by
- Software: https://github.com/rajatarun/DeviceWeave/commit/3cf36b81 (URL)