Congruence Closure with Free Variables (Work in Progress) Haniel - - PowerPoint PPT Presentation

congruence closure with free variables work in progress
SMART_READER_LITE
LIVE PREVIEW

Congruence Closure with Free Variables (Work in Progress) Haniel - - PowerPoint PPT Presentation

Congruence Closure with Free Variables (Work in Progress) Haniel Barbosa , Pascal Fontaine INRIA Nancy VeriDis Universit e de Lorraine UFRN 20150803 Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 1


slide-1
SLIDE 1

Congruence Closure with Free Variables (Work in Progress) Haniel Barbosa, Pascal Fontaine

INRIA Nancy – VeriDis Universit´ e de Lorraine UFRN

2015–08–03

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 1 / 11

slide-2
SLIDE 2

Outline

  • SMT solving
  • Congruence Closure with Free Variables
  • Extensions and next tasks

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 2 / 11

slide-3
SLIDE 3

SMT solving

First-order logic modulo theories: ϕ = f(c) ≈ a ∨ c ≈ d, f(a) ≈ b, f(b) ≈ f(a), ∀x1, x2. f(x1) ≈ a ∨ f(x2) ≈ b

  • Haniel Barbosa (INRIA)

Congruence Closure with Free Variables QUANTIFY 2015 3 / 11

slide-4
SLIDE 4

SMT solving

First-order logic modulo theories: ϕ = f(c) ≈ a ∨ c ≈ d, f(a) ≈ b, f(b) ≈ f(a), ∀x1, x2. f(x1) ≈ a ∨ f(x2) ≈ b

  • Through SAT solving one may obtain that L ∪ Q |

= ϕ, for L = {f(c) ≈ a, f(a) ≈ b, f(b) ≈ f(a)} Q = {∀x1, x2. (f(x1) ≈ a ∨ f(x2) ≈ b)}

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 3 / 11

slide-5
SLIDE 5

SMT solving

First-order logic modulo theories: ϕ = f(c) ≈ a ∨ c ≈ d, f(a) ≈ b, f(b) ≈ f(a), ∀x1, x2. f(x1) ≈ a ∨ f(x2) ≈ b

  • Through SAT solving one may obtain that L ∪ Q |

= ϕ, for L = {f(c) ≈ a, f(a) ≈ b, f(b) ≈ f(a)} Q = {∀x1, x2. (f(x1) ≈ a ∨ f(x2) ≈ b)} Through ground reasoning, L is shown satisfiable. What about Q?

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 3 / 11

slide-6
SLIDE 6

SMT solving

How to handle quantified formulas in the SMT context? FOL with equality is semi-decidable, but considering theories frequently leads to undecidability. Reasoning through incomplete techniques relying on decidable fragments — instantiation.

fl

fi

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 4 / 11

slide-7
SLIDE 7

SMT solving

How to handle quantified formulas in the SMT context? FOL with equality is semi-decidable, but considering theories frequently leads to undecidability. Reasoning through incomplete techniques relying on decidable fragments — instantiation.

SMT formula

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 4 / 11

slide-8
SLIDE 8

SMT solving

How to handle quantified formulas in the SMT context? FOL with equality is semi-decidable, but considering theories frequently leads to undecidability. Reasoning through incomplete techniques relying on decidable fragments — instantiation.

SMT formula

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Model

Instantiation module

Instance

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 4 / 11

slide-9
SLIDE 9

SMT solving

How to handle quantified formulas in the SMT context? FOL with equality is semi-decidable, but considering theories frequently leads to undecidability. Reasoning through incomplete techniques relying on decidable fragments — instantiation.

SMT formula

SMT solver

SAT solver

Boolean Model

Theory reasoner

Conflict clause

Quantifier-free SMT solver

Model

Instantiation module

Instance

Model UNSAT (proof/core)

With too many instances available, their selection becomes crucial.

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 4 / 11

slide-10
SLIDE 10

Ground conflicting instances generation

Context (ground model)

Given a formula ϕ and a theory T , SMT solver derives, if any, groundly T -satisfiable sets of literals L and Q s.t. L ∪ Q | = ϕ. L is a set of ground literals. Q is a set of quantified formulas.

Ground conflicting instances

[Reynolds et al., 2014]

Derive, for some ∀x.ψ ∈ Q, ground substitutions σ s.t. L | = ¬ψσ. As instances ∀x.ψ → ψσ refute L ∪ Q, their addition to ϕ require the derivation of a new ground model, if any.

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 5 / 11

slide-11
SLIDE 11

Congruence Closure with Free Variables

Finding ground conflicting instances is equivalent to solving a non-simultaneous E-unification problem (NP-complete).

[Tiwari et al., 2000]

It has also been shown to be amenable to the use of congruence closure procedures. Algorithm CCFV: extends congruence closure decision procedure, being able to perform unification on free variables.

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 6 / 11

slide-12
SLIDE 12

CCFV

Finding substitutions

It computes, if any, a sequence of substitutions σ0, . . . , σk such that, for ¬ψ = l1 ∧ · · · ∧ lk, σ0 = ∅; σi−1 ⊆ σi and L | = liσi which guarantees that L | = ¬ψσk.

Unification

Adapts the recursive descent E-unification algorithm in [Baader et al., 2001].

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 7 / 11

slide-13
SLIDE 13

Example

ϕ = f(c) ≈ a ∨ c ≈ d, f(a) ≈ b, f(b) ≈ f(a), ∀x1, x2. f(x1) ≈ a ∨ f(x2) ≈ b

  • L

= {f(c) ≈ a, f(a) ≈ b, f(b) ≈ f(a)}

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 8 / 11

slide-14
SLIDE 14

Example

ϕ = f(c) ≈ a ∨ c ≈ d, f(a) ≈ b, f(b) ≈ f(a), ∀x1, x2. f(x1) ≈ a ∨ f(x2) ≈ b

  • L

= {f(c) ≈ a, f(a) ≈ b, f(b) ≈ f(a)} ¬ψ = (f(x1) ≈ a ∧ f(x2) ≈ b)

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 8 / 11

slide-15
SLIDE 15

Example

ϕ = f(c) ≈ a ∨ c ≈ d, f(a) ≈ b, f(b) ≈ f(a), ∀x1, x2. f(x1) ≈ a ∨ f(x2) ≈ b

  • L

= {f(c) ≈ a, f(a) ≈ b, f(b) ≈ f(a)} ¬ψ = (f(x1) ≈ a ∧ f(x2) ≈ b)

1 Evaluates f(x1) ≈ a:

since f(c) ∈ [a], unifies f(x1), f(c). leads to the substitution σ1 = {x1 → c}, such that L | = (f(x1) ≈ a)σ1.

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 8 / 11

slide-16
SLIDE 16

Example

ϕ = f(c) ≈ a ∨ c ≈ d, f(a) ≈ b, f(b) ≈ f(a), ∀x1, x2. f(x1) ≈ a ∨ f(x2) ≈ b

  • L

= {f(c) ≈ a, f(a) ≈ b, f(b) ≈ f(a)} ¬ψ = (f(x1) ≈ a ∧ f(x2) ≈ b)

1 Evaluates f(x1) ≈ a:

since f(c) ∈ [a], unifies f(x1), f(c). leads to the substitution σ1 = {x1 → c}, such that L | = (f(x1) ≈ a)σ1.

2 Evaluates f(x2) ≈ b:

since f(a) ∈ [b], if the pair f(x2), f(b) is unifiable then the resulting σ is conflicting. leads to the substitution σ2 = {x1 → c, x2 → b} such that L | = (f(x2) ≈ b)σ2.

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 8 / 11

slide-17
SLIDE 17

Example

ϕ = f(c) ≈ a ∨ c ≈ d, f(a) ≈ b, f(b) ≈ f(a), ∀x1, x2. f(x1) ≈ a ∨ f(x2) ≈ b

  • L

= {f(c) ≈ a, f(a) ≈ b, f(b) ≈ f(a)} ¬ψ = (f(x1) ≈ a ∧ f(x2) ≈ b)

1 Evaluates f(x1) ≈ a:

since f(c) ∈ [a], unifies f(x1), f(c). leads to the substitution σ1 = {x1 → c}, such that L | = (f(x1) ≈ a)σ1.

2 Evaluates f(x2) ≈ b:

since f(a) ∈ [b], if the pair f(x2), f(b) is unifiable then the resulting σ is conflicting. leads to the substitution σ2 = {x1 → c, x2 → b} such that L | = (f(x2) ≈ b)σ2.

CCFV returns σ = {x1 → c, x2 → b}, which is a ground conflicting substitution, since L ∧ ψσ is groundly unsatisfiable.

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 8 / 11

slide-18
SLIDE 18

Algorithm

proc CCFV(L, ψ) C ← {s ≈ t | s ≈ t ∈ L}; D ← {s ≈ t | s ≈ t ∈ L}; ∆x ← ∅

// Init

foreach l ∈ ¬ψ do if not(Handle(C, D, ∆x, l)) then ∆x ← ∆x ∪ {{x → sel(x) | x ∈ x}} if ∅ ∈ ∆x then return ∅

// No σ s.t. L | = ¬ψσ

Reset(C, D, ¬ψ)

// Backtracking

return {x → sel(x) | x ∈ x}

// L | = ¬ψσ

proc Handle(C, D, ∆x, l) match l : u ≈ v : if C ∪ D | = u ≈ v then return ⊥

// Checks consistency

C ← C ∪ {u ≈ v}

// Updates C ∪ D

u ≈ v : ... Λ ← (Unify δ l) \C ∆x

// L | = lσ, for every σ ∈ Λ

if Λ = ∅ then let σ ∈ Λ in C ← C ∪

x∈dom(σ){x ≈ xσ}

return ⊤ return ⊥

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 9 / 11

slide-19
SLIDE 19

Extensions

CCFV only works in very restricted scenarios.

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 10 / 11

slide-20
SLIDE 20

Extensions

CCFV only works in very restricted scenarios. Basis for broader procedures.

E-matching MBQI

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 10 / 11

slide-21
SLIDE 21

Extensions

CCFV only works in very restricted scenarios. Basis for broader procedures.

E-matching MBQI Simultaneous (Bounded) Rigid E-Unification

[Backeman et al., 2015]

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 10 / 11

slide-22
SLIDE 22

Extensions

CCFV only works in very restricted scenarios. Basis for broader procedures.

E-matching MBQI Simultaneous (Bounded) Rigid E-Unification

[Backeman et al., 2015]

Saturation based procedures

(Inst-Gen-Eq, Hierarchic Superposition, ...)

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 10 / 11

slide-23
SLIDE 23

Next tasks

Continue implementation. Integrating extensions into general framework. Handling arithmetic reasoning together with conflict driven instantiation.

More details in the paper: http://www.loria.fr/∼hbarbosa/quantify2015.pdf

Haniel Barbosa (INRIA) Congruence Closure with Free Variables QUANTIFY 2015 11 / 11