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

congruence closure with free variables
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Congruence Closure with Free Variables

Haniel Barbosa1 Pascal Fontaine1 Andrew Reynolds2

1University of Lorraine, CNRS, Inria, LORIA, Nancy, France 2University of Iowa, Iowa City, U.S.A.

SMT 2017 2017–07–22, Heidelberg, Germany

Congruence Closure with Free Variables (CCFV) 1 / 18

slide-2
SLIDE 2

SMT solvers are successfully used in a variety of applications, including many verification tools

Formal Methods Program Analysis Automatic Testing Program Synthesis

Logics

Picture credit: Vijay Ganesh Congruence Closure with Free Variables (CCFV) 2 / 18

slide-3
SLIDE 3

SMT solvers are successfully used in a variety of applications, including many verification tools

Formal Methods Program Analysis Automatic Testing Program Synthesis

SAT Solvers

Picture credit: Vijay Ganesh Congruence Closure with Free Variables (CCFV) 2 / 18

slide-4
SLIDE 4

SMT solvers are successfully used in a variety of applications, including many verification tools

Formal Methods Program Analysis Automatic Testing Program Synthesis

SMT Solvers

Picture credit: Vijay Ganesh Congruence Closure with Free Variables (CCFV) 2 / 18

slide-5
SLIDE 5

SMT solvers are successfully used in a variety of applications, including many verification tools

Formal Methods Program Analysis Automatic Testing Program Synthesis

SMT Solvers with Quantifjers

Picture credit: Vijay Ganesh Congruence Closure with Free Variables (CCFV) 2 / 18

slide-6
SLIDE 6

Quantifiers in SMT solvers

Quantifiers primarily handled with heuristic instantiation

Congruence Closure with Free Variables (CCFV) 3 / 18

slide-7
SLIDE 7

Quantifiers in SMT solvers

Quantifiers primarily handled with heuristic instantiation ⊖ Too many instances swamp solver

Congruence Closure with Free Variables (CCFV) 3 / 18

slide-8
SLIDE 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

slide-9
SLIDE 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 102 ground each applications for f, g, h leads to up to 106 instantiations

Congruence Closure with Free Variables (CCFV) 3 / 18

slide-10
SLIDE 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 102 ground each applications for f, g, h leads to up to 106 instantiations

Congruence Closure with Free Variables (CCFV) 3 / 18

slide-11
SLIDE 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 102 ground each applications for f, g, h leads to up to 106 instantiations ◮ Derive instantiations that refute ground model

Congruence Closure with Free Variables (CCFV) 3 / 18

slide-12
SLIDE 12

Problem statement

SMT formula

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

⊲ 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

slide-13
SLIDE 13

Problem statement

SMT formula

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Model

Instantiation module

Instance

Model UNSAT (proof/core)

⊲ 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

slide-14
SLIDE 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

slide-15
SLIDE 15

Heuristic instantiation

Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances E Instantiation module Easily gets out of hand!

Congruence Closure with Free Variables (CCFV) 5 / 18

slide-16
SLIDE 16

Heuristic instantiation

Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances E Instantiation module Easily gets out of hand!

Congruence Closure with Free Variables (CCFV) 5 / 18

slide-17
SLIDE 17

Heuristic instantiation

Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances E Instantiation module Easily gets out of hand!

Congruence Closure with Free Variables (CCFV) 5 / 18

slide-18
SLIDE 18

Heuristic instantiation

Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances E Instantiation module Easily gets out of hand!

Congruence Closure with Free Variables (CCFV) 5 / 18

slide-19
SLIDE 19

Heuristic instantiation

Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances E Instantiation module Easily gets out of hand!

Congruence Closure with Free Variables (CCFV) 5 / 18

slide-20
SLIDE 20

Heuristic instantiation

Pattern-matching of terms from Q into terms of E No consistency check of E ∪ Q ⊖ Fast, but too many instances E Instantiation module Easily gets out of hand!

Congruence Closure with Free Variables (CCFV) 5 / 18

slide-21
SLIDE 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

slide-22
SLIDE 22

Goal-oriented instantiation

Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated E Goal-oriented instantiation module ∀¯ x.ψ → ψσ ∀¯ x.ψ → ψσ E ∧ ψσ | = ⊥ UNSAT!

Congruence Closure with Free Variables (CCFV) 6 / 18

slide-23
SLIDE 23

Goal-oriented instantiation

Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated E Goal-oriented instantiation module ∀¯ x.ψ → ψσ ∀¯ x.ψ → ψσ E ∧ ψσ | = ⊥ UNSAT!

Congruence Closure with Free Variables (CCFV) 6 / 18

slide-24
SLIDE 24

Goal-oriented instantiation

Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated E Goal-oriented instantiation module ∀¯ x.ψ → ψσ ∀¯ x.ψ → ψσ E ∧ ψσ | = ⊥ UNSAT!

Congruence Closure with Free Variables (CCFV) 6 / 18

slide-25
SLIDE 25

Goal-oriented instantiation

Check consistency of E ∪ Q ⊕ Only instances refuting the current model are generated E Goal-oriented instantiation module ∀¯ x.ψ → ψσ ∀¯ x.ψ → ψσ E ∧ ψσ | = ⊥ UNSAT!

Congruence Closure with Free Variables (CCFV) 6 / 18

slide-26
SLIDE 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

slide-27
SLIDE 27

Let’s look deeper into the problem

E | = ¬ψσ, for some ∀¯

  • x. ψ ∈ Q

Congruence Closure with Free Variables (CCFV) 8 / 18

slide-28
SLIDE 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

slide-29
SLIDE 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

slide-30
SLIDE 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

slide-31
SLIDE 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

slide-32
SLIDE 32

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 ◮ h(y) ≃ g(z): y ≃ c ∧ z ≃ b

Congruence Closure with Free Variables (CCFV) 8 / 18

slide-33
SLIDE 33

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 ◮ h(y) ≃ g(z): y ≃ c ∧ z ≃ b σ = {x → b, y → c, z → b}

Congruence Closure with Free Variables (CCFV) 8 / 18

slide-34
SLIDE 34

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 ◮ h(y) ≃ g(z): y ≃ c ∧ z ≃ b σ = {x → b, y → c, z → b}

  • r

σ = {x → a, y → c, z → b}

Congruence Closure with Free Variables (CCFV) 8 / 18

slide-35
SLIDE 35

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 ◮ h(y) ≃ g(z): y ≃ c ∧ z ≃ b σ = {x → b, y → c, z → b}

  • r

σ = {x → a, y → c, z → b}

Congruence Closure with Free Variables (CCFV) 8 / 18

slide-36
SLIDE 36

E-ground (dis)unification

Given conjunctive sets of equality literals E and L, with E ground, finding a substitution σ s.t. E | = Lσ

Congruence Closure with Free Variables (CCFV) 9 / 18

slide-37
SLIDE 37

E-ground (dis)unification

Given conjunctive sets of equality literals E and L, with E ground, finding a substitution σ s.t. E | = Lσ ⊲ Variant of classic (non-simultaneous) rigid E-unification

Congruence Closure with Free Variables (CCFV) 9 / 18

slide-38
SLIDE 38

E-ground (dis)unification

Given conjunctive sets of equality literals E and L, with E ground, finding a substitution σ s.t. E | = Lσ ⊲ Variant of classic (non-simultaneous) rigid E-unification ⊲ NP-complete NP: Solutions can be restricted to ground terms in E ∪ L NP-hard: reduction of 3-SAT

Congruence Closure with Free Variables (CCFV) 9 / 18

slide-39
SLIDE 39

Congruence Closure with Free Variables (CCFV)

CCFV is a sound, complete and terminating calculus for solving E-ground (dis)unification

Congruence Closure with Free Variables (CCFV) 10 / 18

slide-40
SLIDE 40

Congruence Closure with Free Variables (CCFV)

CCFV is a sound, complete and terminating calculus for solving E-ground (dis)unification ⊕ Goal-oriented ⊕ (More) Efficient

Congruence Closure with Free Variables (CCFV) 10 / 18

slide-41
SLIDE 41

Congruence Closure with Free Variables (CCFV)

CCFV is a sound, complete and terminating calculus for solving E-ground (dis)unification ⊕ Goal-oriented ⊕ (More) Efficient ⊖ Ad-hoc Versatile framework, recasting many instantiation techniques as a CCFV problem ⊖ Incomplete Finds all conflicting instances of a quantified formula

Congruence Closure with Free Variables (CCFV) 10 / 18

slide-42
SLIDE 42

Existing techniques as special cases

⊲ Conflict-based instantiation [RTM14] ⊕ CCFV provides formal guarantees and more clear extensions ⊲ E-matching based heuristic instantiation [DNS05; MB07] ⊕ CCFV allows to easily discard instances already entailed by E ⊲ Model-based instantiation [GM09; RTG+13] ⊕ No need for a secondary ground SMT solver ⊕ No need to guess solutions

Congruence Closure with Free Variables (CCFV) 11 / 18

slide-43
SLIDE 43

Towards a theory solver for instantiation

⊲ Model generation ⊲ Conflict set generation ⊲ Propagation ⊲ Incrementality

SMT formula SMT solver SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Model

Instantiation module

Instance

Model UNSAT (proof/core)

Congruence Closure with Free Variables

Congruence Closure with Free Variables (CCFV) 12 / 18

slide-44
SLIDE 44

Finding solutions σ for E | = Lσ

⊲ Search for solutions as a series of AND-OR constraints depending on the entailment of conditions of literals in L

Congruence Closure with Free Variables (CCFV) 13 / 18

slide-45
SLIDE 45

Finding solutions σ for E | = Lσ

⊲ Search for solutions as a series of AND-OR constraints depending on the entailment of conditions of literals in L ⊲ Congruence closure as a core element ◮ All terms inferred equal are kept in the same class ◮ Constraints to be entailed are normalized according to partial solutions

Congruence Closure with Free Variables (CCFV) 13 / 18

slide-46
SLIDE 46

Finding solutions σ for E | = Lσ

⊲ Search for solutions as a series of AND-OR constraints depending on the entailment of conditions of literals in L ⊲ Congruence closure as a core element ◮ All terms inferred equal are kept in the same class ◮ Constraints to be entailed are normalized according to partial solutions ⊲ Different possibilities for building solutions are handled with branching and backtracking

Congruence Closure with Free Variables (CCFV) 13 / 18

slide-47
SLIDE 47

E | = Lσ f(a) ≃ f(b) ∧ g(b) ≃ h(c) | = (f(x) ≃ f(z) ∧ h(y) ≃ g(z)) σ

Congruence Closure with Free Variables (CCFV) 14 / 18

slide-48
SLIDE 48

E | = Lσ f(a) ≃ f(b) ∧ g(b) ≃ h(c) | = (f(x) ≃ f(z) ∧ h(y) ≃ g(z)) σ

f(x) ≃ f(z) ∧ h(y) ≃ g(z) y ≃ c ∧ z ≃ b ∧ f(x) ≃ f(z) z ≃ b ∧ f(x) ≃ f(z) f(x) ≃ f(b) x ≃ a ⊤

x ≃ a, y ≃ c, z ≃ b

x ≃ b ⊤

x ≃ b, y ≃ c, z ≃ b y ≃ c, z ≃ b y ≃ c ∅

Congruence Closure with Free Variables (CCFV) 14 / 18

slide-49
SLIDE 49

E | = Lσ f(a) ≃ f(b) ∧ g(b) ≃ h(c) | = (f(x) ≃ f(z) ∧ h(y) ≃ g(z)) σ

f(x) ≃ f(z) ∧ h(y) ≃ g(z) y ≃ c ∧ z ≃ b ∧ f(x) ≃ f(z) z ≃ b ∧ f(x) ≃ f(z) f(x) ≃ f(b) x ≃ a ⊤

x ≃ a, y ≃ c, z ≃ b

x ≃ b ⊤

x ≃ b, y ≃ c, z ≃ b y ≃ c, z ≃ b y ≃ c ∅

Congruence Closure with Free Variables (CCFV) 14 / 18

slide-50
SLIDE 50

E | = Lσ f(a) ≃ f(b) ∧ g(b) ≃ h(c) | = (f(x) ≃ f(z) ∧ h(y) ≃ g(z)) σ

f(x) ≃ f(z) ∧ h(y) ≃ g(z) y ≃ c ∧ z ≃ b ∧ f(x) ≃ f(z) z ≃ b ∧ f(x) ≃ f(z) f(x) ≃ f(b) x ≃ a ⊤

x ≃ a, y ≃ c, z ≃ b

x ≃ b ⊤

x ≃ b, y ≃ c, z ≃ b y ≃ c, z ≃ b y ≃ c ∅

Congruence Closure with Free Variables (CCFV) 14 / 18

slide-51
SLIDE 51

E | = Lσ f(a) ≃ f(b) ∧ g(b) ≃ h(c) | = (f(x) ≃ f(z) ∧ h(y) ≃ g(z)) σ

f(x) ≃ f(z) ∧ h(y) ≃ g(z) y ≃ c ∧ z ≃ b ∧ f(x) ≃ f(z) z ≃ b ∧ f(x) ≃ f(z) f(x) ≃ f(b) x ≃ a ⊤

x ≃ a, y ≃ c, z ≃ b

x ≃ b ⊤

x ≃ b, y ≃ c, z ≃ b y ≃ c, z ≃ b y ≃ c ∅

Congruence Closure with Free Variables (CCFV) 14 / 18

slide-52
SLIDE 52

E | = Lσ f(a) ≃ f(b) ∧ g(b) ≃ h(c) | = (f(x) ≃ f(z) ∧ h(y) ≃ g(z)) σ

f(x) ≃ f(z) ∧ h(y) ≃ g(z) y ≃ c ∧ z ≃ b ∧ f(x) ≃ f(z) z ≃ b ∧ f(x) ≃ f(z) f(x) ≃ f(b) x ≃ a ⊤

x ≃ a, y ≃ c, z ≃ b

x ≃ b ⊤

x ≃ b, y ≃ c, z ≃ b y ≃ c, z ≃ b y ≃ c ∅

Congruence Closure with Free Variables (CCFV) 14 / 18

slide-53
SLIDE 53

E | = Lσ f(a) ≃ f(b) ∧ g(b) ≃ h(c) | = (f(x) ≃ f(z) ∧ h(y) ≃ g(z)) σ

f(x) ≃ f(z) ∧ h(y) ≃ g(z) y ≃ c ∧ z ≃ b ∧ f(x) ≃ f(z) z ≃ b ∧ f(x) ≃ f(z) f(x) ≃ f(b) x ≃ a ⊤

x ≃ a, y ≃ c, z ≃ b

x ≃ b ⊤

x ≃ b, y ≃ c, z ≃ b y ≃ c, z ≃ b y ≃ c ∅

Congruence Closure with Free Variables (CCFV) 14 / 18

slide-54
SLIDE 54

Implementation

⊲ Model minimisation

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Model Model'

Instantiation module

Instance

Congruence Closure with Free Variables (CCFV) 15 / 18

slide-55
SLIDE 55

Implementation

⊲ Model minimisation

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Model Model'

Instantiation module

Instance

⊲ Top symbol indexing of E-graph from ground congruence closure E | = f(x)σ ≃ t only if [t] contains some f(t′)

Congruence Closure with Free Variables (CCFV) 15 / 18

slide-56
SLIDE 56

Implementation

⊲ Model minimisation

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Model Model'

Instantiation module

Instance

⊲ Top symbol indexing of E-graph from ground congruence closure E | = f(x)σ ≃ t only if [t] contains some f(t′) f →    f([t1], . . . , [tn]) . . . f([t′

1], . . . , [t′ n])

Congruence Closure with Free Variables (CCFV) 15 / 18

slide-57
SLIDE 57

Implementation

⊲ Model minimisation

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Model Model'

Instantiation module

Instance

⊲ Top symbol indexing of E-graph from ground congruence closure E | = f(x)σ ≃ t only if [t] contains some f(t′) f →    f([t1], . . . , [tn]) . . . f([t′

1], . . . , [t′ n])

◮ Bitsets for fast checking if a symbol has applications in a congruence class

Congruence Closure with Free Variables (CCFV) 15 / 18

slide-58
SLIDE 58

Implementation

⊲ Selection strategies E | = f(x, y) ≃ h(z) ∧ x ≃ t ∧ C

Congruence Closure with Free Variables (CCFV) 16 / 18

slide-59
SLIDE 59

Implementation

⊲ Selection strategies E | = f(x, y) ≃ h(z) ∧ x ≃ t ∧ C

Congruence Closure with Free Variables (CCFV) 16 / 18

slide-60
SLIDE 60

Implementation

⊲ Selection strategies E | = f(x, y) ≃ h(z) ∧ x ≃ t ∧ C ⊲ Eagerly checking whether constraints can be discarded ◮ After assigning x to t, the remaining problem is normalized E | = f(t, y) ≃ h(z) ∧ C

Congruence Closure with Free Variables (CCFV) 16 / 18

slide-61
SLIDE 61

Implementation

⊲ Selection strategies E | = f(x, y) ≃ h(z) ∧ x ≃ t ∧ C ⊲ Eagerly checking whether constraints can be discarded ◮ After assigning x to t, the remaining problem is normalized E | = f(t, y) ≃ h(z) ∧ C ◮ E | = f(t, y)σ ≃ h(z)σ only if there is some f(t′, t′′) s.t. E | = t ≃ t′

Congruence Closure with Free Variables (CCFV) 16 / 18

slide-62
SLIDE 62

0.1 1 10 0.1 1 10 verit_tc verit Efficiency scatter plot 0.1 1 10 0.1 1 10 verit_tc verit Efficiency scatter plot 0.1 1 10 0.1 1 10 verit_tc verit Efficiency scatter plot 0.1 1 10 0.1 1 10 verit_tc verit Efficiency scatter plot 0.1 1 10 0.1 1 10 cvc_d cvc 0.1 1 10 0.1 1 10 cvc_d cvc 0.1 1 10 0.1 1 10 cvc_d cvc 0.1 1 10 0.1 1 10 cvc_d cvc

veriT: + 800 out of 1 785 unsolved problems CVC4:+ 200 out of 745 unsolved problems

* experiments in the “UF”, “UFLIA”, “UFLRA” and “UFIDL” categories of SMT-LIB, which have 10 495 benchmarks annotated as unsatisfiable, with 30s timeout. Congruence Closure with Free Variables (CCFV) 17 / 18

slide-63
SLIDE 63

Conclusions and future work

⊲ A unifying framework for quantified formulas with equality and uninterpreted functions ⊲ Lifting congruence closure to accommodate free variables ⊲ Efficient implementations in the SMT solvers CVC4 and veriT

Congruence Closure with Free Variables (CCFV) 18 / 18

slide-64
SLIDE 64

Conclusions and future work

⊲ A unifying framework for quantified formulas with equality and uninterpreted functions ⊲ Lifting congruence closure to accommodate free variables ⊲ Efficient implementations in the SMT solvers CVC4 and veriT

Challenges

⊲ Finding conflicting instances across multiple quantified formulas E | = ¬ψ1σ ∨ · · · ∨ ¬ψnσ, Q = {∀¯

  • x. ψ1, . . . , ∀¯
  • x. ψn}

⊲ Incrementality ⊲ Learning-based search for solutions ⊲ Beyond theory of equality ⊲ Handle variables in E

Congruence Closure with Free Variables (CCFV) 18 / 18

slide-65
SLIDE 65

Thank you

Congruence Closure with Free Variables (CCFV) 18 / 18

slide-66
SLIDE 66

References

David Detlefs, Greg Nelson, and James B. Saxe. “Simplify: A Theorem Prover for Program Checking”. In: J. ACM 52.3 (2005), pp. 365–473. Yeting Ge and Leonardo de Moura. “Complete Instantiation for Quantified Formulas in Satisfiabiliby Modulo Theories”. In: Computer Aided Verification (CAV). Ed. by Ahmed Bouajjani and Oded Maler.

  • Vol. 5643. Lecture Notes in Computer Science. Springer, 2009, pp. 306–320.

Leonardo de Moura and Nikolaj Bjørner. “Efficient E-Matching for SMT Solvers”. In: Proc. Conference on Automated Deduction (CADE). Ed. by Frank Pfenning.

  • Vol. 4603. Lecture Notes in Computer Science. Springer, 2007, pp. 183–198.

Andrew Reynolds, Cesare Tinelli, Amit Goel, Sava Krsti, Morgan Deters, and Clark Barrett. “Quantifier Instantiation Techniques for Finite Model Finding in SMT”. In: Proc. Conference on Automated Deduction (CADE). Ed. by Maria Paola Bonacina. Vol. 7898. Lecture Notes in Computer Science. Springer, 2013, pp. 377–391. Andrew Reynolds, Cesare Tinelli, and Leonardo Mendon¸ ca de Moura. “Finding conflicting instances of quantified formulas in SMT”. In: Formal Methods In Computer-Aided Design (FMCAD). IEEE, 2014, pp. 195–202.