congruence closure with free variables
play

Congruence Closure with Free Variables Haniel Pascal Andrew - PowerPoint PPT Presentation

Congruence Closure with Free Variables Haniel Pascal Andrew Barbosa 1 Fontaine 1 Reynolds 2 1 University of Lorraine, CNRS, Inria, LORIA, Nancy, France 2 University of Iowa, Iowa City, U.S.A. SMT 2017 20170722, Heidelberg, Germany


  1. Congruence Closure with Free Variables Haniel Pascal Andrew Barbosa 1 Fontaine 1 Reynolds 2 1 University of Lorraine, CNRS, Inria, LORIA, Nancy, France 2 University of Iowa, Iowa City, U.S.A. SMT 2017 2017–07–22, Heidelberg, Germany Congruence Closure with Free Variables (CCFV) 1 / 18

  2. SMT solvers are successfully used in a variety of applications, including many verification tools Program Formal Analysis Methods Logics Automatic Program Testing Synthesis Picture credit: Vijay Ganesh Congruence Closure with Free Variables (CCFV) 2 / 18

  3. SMT solvers are successfully used in a variety of applications, including many verification tools Program Formal Analysis Methods SAT Solvers Automatic Program Testing Synthesis Picture credit: Vijay Ganesh Congruence Closure with Free Variables (CCFV) 2 / 18

  4. SMT solvers are successfully used in a variety of applications, including many verification tools Program Formal Analysis Methods SMT Solvers Automatic Program Testing Synthesis Picture credit: Vijay Ganesh Congruence Closure with Free Variables (CCFV) 2 / 18

  5. SMT solvers are successfully used in a variety of applications, including many verification tools Program Formal Analysis Methods SMT Solvers with Quantifjers Automatic Program Testing Synthesis Picture credit: Vijay Ganesh Congruence Closure with Free Variables (CCFV) 2 / 18

  6. Quantifiers in SMT solvers Quantifiers primarily handled with heuristic instantiation Congruence Closure with Free Variables (CCFV) 3 / 18

  7. Quantifiers in SMT solvers Quantifiers primarily handled with heuristic instantiation ⊖ Too many instances swamp solver Congruence Closure with Free Variables (CCFV) 3 / 18

  8. Quantifiers in SMT solvers Quantifiers primarily handled with heuristic instantiation ⊖ Too many instances swamp solver Ex.: ∀ xyz. f ( x ) ≃ f ( z ) → h ( y ) ≃ g ( z ) ◮ Select patterns { f ( x ) , h ( y ) , f ( z ) } or { f ( x ) , h ( y ) , g ( z ) } Congruence Closure with Free Variables (CCFV) 3 / 18

  9. Quantifiers in SMT solvers Quantifiers primarily handled with heuristic instantiation ⊖ Too many instances swamp solver Ex.: ∀ xyz. f ( x ) ≃ f ( z ) → h ( y ) ≃ g ( z ) ◮ Select patterns { f ( x ) , h ( y ) , f ( z ) } or { f ( x ) , h ( y ) , g ( z ) } ◮ A ground model with 10 2 ground each applications for f, g, h leads to up to 10 6 instantiations Congruence Closure with Free Variables (CCFV) 3 / 18

  10. Quantifiers in SMT solvers Quantifiers primarily handled with heuristic instantiation ⊖ Too many instances swamp solver ⊖ Butterfly effect Ex.: ∀ xyz. f ( x ) ≃ f ( z ) → h ( y ) ≃ g ( z ) ◮ Select patterns { f ( x ) , h ( y ) , f ( z ) } or { f ( x ) , h ( y ) , g ( z ) } ◮ A ground model with 10 2 ground each applications for f, g, h leads to up to 10 6 instantiations Congruence Closure with Free Variables (CCFV) 3 / 18

  11. Quantifiers in SMT solvers Quantifiers primarily handled with heuristic instantiation Fast semantically guided instantiation techniques ⊖ Too many instances swamp solver Fewer, necessary instances ⊖ Butterfly effect Reduce dependency on heuristics Ex.: ∀ xyz. f ( x ) ≃ f ( z ) → h ( y ) ≃ g ( z ) ◮ Select patterns { f ( x ) , h ( y ) , f ( z ) } or { f ( x ) , h ( y ) , g ( z ) } ◮ A ground model with 10 2 ground each applications for f, g, h leads to up to 10 6 instantiations ◮ Derive instantiations that refute ground model Congruence Closure with Free Variables (CCFV) 3 / 18

  12. Problem statement SMT formula SMT solver Quanti fi er-free SMT solver Con fl ict clause Theory SAT solver reasoner Boolean Model ⊲ Quantifier-free solver enumerates models E ∪ Q ◮ E is a conjunctive set of ground literals ◮ Q is a conjunctive set of quantified clauses Congruence Closure with Free Variables (CCFV) 4 / 18

  13. Problem statement SMT formula SMT solver Quanti fi er-free SMT solver Instance Con fl ict clause Instantiation Theory module SAT solver reasoner Model Boolean Model UNSAT (proof/core) Model ⊲ Quantifier-free solver enumerates models E ∪ Q ◮ E is a conjunctive set of ground literals ◮ Q is a conjunctive set of quantified clauses ⊲ Instantiation module generates instances from Q and adds them to E Congruence Closure with Free Variables (CCFV) 4 / 18

  14. Heuristic instantiation Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances Congruence Closure with Free Variables (CCFV) 5 / 18

  15. Heuristic instantiation Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances Easily gets out of hand! Instantiation module E Congruence Closure with Free Variables (CCFV) 5 / 18

  16. Heuristic instantiation Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances Easily gets out of hand! Instantiation module E Congruence Closure with Free Variables (CCFV) 5 / 18

  17. Heuristic instantiation Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances Easily gets out of hand! Instantiation module E Congruence Closure with Free Variables (CCFV) 5 / 18

  18. Heuristic instantiation Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances Easily gets out of hand! Instantiation module E Congruence Closure with Free Variables (CCFV) 5 / 18

  19. Heuristic instantiation Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances Easily gets out of hand! Instantiation module E Congruence Closure with Free Variables (CCFV) 5 / 18

  20. Heuristic instantiation Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances Easily gets out of hand! Instantiation module E Congruence Closure with Free Variables (CCFV) 5 / 18

  21. Goal-oriented instantiation Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated Congruence Closure with Free Variables (CCFV) 6 / 18

  22. Goal-oriented instantiation Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated ∀ ¯ ∀ ¯ x.ψ → ψσ x.ψ → ψσ E ∧ ψσ | = ⊥ UNSAT! Goal-oriented instantiation module E Congruence Closure with Free Variables (CCFV) 6 / 18

  23. Goal-oriented instantiation Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated ∀ ¯ ∀ ¯ x.ψ → ψσ x.ψ → ψσ E ∧ ψσ | = ⊥ UNSAT! Goal-oriented instantiation module E Congruence Closure with Free Variables (CCFV) 6 / 18

  24. Goal-oriented instantiation Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated ∀ ¯ ∀ ¯ x.ψ → ψσ x.ψ → ψσ E ∧ ψσ | = ⊥ UNSAT! Goal-oriented instantiation module E Congruence Closure with Free Variables (CCFV) 6 / 18

  25. Goal-oriented instantiation Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated ∀ ¯ ∀ ¯ x.ψ → ψσ x.ψ → ψσ E ∧ ψσ | = ⊥ UNSAT! Goal-oriented instantiation module E Congruence Closure with Free Variables (CCFV) 6 / 18

  26. Previous work Conflict-based instantiation [RTM14] ⊲ Given a model E ∪ Q , for some ∀ ¯ x. ψ ∈ Q find σ s.t. E ∧ ψσ | = ⊥ ⊲ Add instance ∀ ¯ x. ψ → ψσ to quantifier-free solver Finding conflicting instances requires deriving σ s.t. E | = ¬ ψσ ⊕ Goal-oriented ⊕ Efficient ⊖ Ad-hoc ⊖ Incomplete Congruence Closure with Free Variables (CCFV) 7 / 18

  27. Let’s look deeper into the problem E | = ¬ ψσ , for some ∀ ¯ x. ψ ∈ Q Congruence Closure with Free Variables (CCFV) 8 / 18

  28. Let’s look deeper into the problem E | = ¬ ψσ , for some ∀ ¯ x. ψ ∈ Q E = { f ( a ) ≃ f ( b ) , g ( b ) �≃ h ( c ) } , Q = {∀ xyz. f ( x ) ≃ f ( z ) → h ( y ) ≃ g ( z ) } Congruence Closure with Free Variables (CCFV) 8 / 18

  29. Let’s look deeper into the problem E | = ¬ ψσ , for some ∀ ¯ x. ψ ∈ Q E = { f ( a ) ≃ f ( b ) , g ( b ) �≃ h ( c ) } , Q = {∀ xyz. f ( x ) ≃ f ( z ) → h ( y ) ≃ g ( z ) } f ( a ) ≃ f ( b ) ∧ g ( b ) �≃ h ( c ) | = ( f ( x ) ≃ f ( z ) ∧ h ( y ) �≃ g ( z )) σ Congruence Closure with Free Variables (CCFV) 8 / 18

  30. Let’s look deeper into the problem E | = ¬ ψσ , for some ∀ ¯ x. ψ ∈ Q E = { f ( a ) ≃ f ( b ) , g ( b ) �≃ h ( c ) } , Q = {∀ xyz. f ( x ) ≃ f ( z ) → h ( y ) ≃ g ( z ) } f ( a ) ≃ f ( b ) ∧ g ( b ) �≃ h ( c ) | = ( f ( x ) ≃ f ( z ) ∧ h ( y ) �≃ g ( z )) σ ⊲ Each literal in the right hand side delimits possible σ Congruence Closure with Free Variables (CCFV) 8 / 18

  31. Let’s look deeper into the problem E | = ¬ ψσ , for some ∀ ¯ x. ψ ∈ Q E = { f ( a ) ≃ f ( b ) , g ( b ) �≃ h ( c ) } , Q = {∀ xyz. f ( x ) ≃ f ( z ) → h ( y ) ≃ g ( z ) } f ( a ) ≃ f ( b ) ∧ g ( b ) �≃ h ( c ) | = ( f ( x ) ≃ f ( z ) ∧ h ( y ) �≃ g ( z )) σ ⊲ Each literal in the right hand side delimits possible σ ◮ f ( x ) ≃ f ( z ) : either x ≃ z or x ≃ a ∧ z ≃ b or x ≃ b ∧ z ≃ a Congruence Closure with Free Variables (CCFV) 8 / 18

Recommend


More recommend