Decision Procedures for Equality Logic 1 - PowerPoint PPT Presentation

About This Presentation
Title:

Decision Procedures for Equality Logic 1

Description:

Output: such that is valid iff UF is valid. 1. Assign indices to the UF-instances. ... FCE ) flatE is valid iff UF is valid. Validity check of ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 21
Provided by: wwwi2Info
Category:

less

Transcript and Presenter's Notes

Title: Decision Procedures for Equality Logic 1


1
Decision Procedures for Equality Logic 1
2
Equality logic
  • Def. An equality logic formula is defined by the
    following grammarformula formula formula
    formula atomatom term termterm
    identifier constantwhere the
    identifiers are variables over a single infinite
    domain like the reals or integers. Constants are
    elements from the same domain as identifiers.

3
Complexity
  • Equality logic and propositional logic are both
    NP-complete.
  • Thus they model the same decision problems.
  • Why to study both?- convenience of modeling-
    efficiency
  • Extensions different domains, Boolean variables

4
Basic assumptions and notations
  • Input formulas are in NNF
  • Input formulas are checked for satisfiability
  • Equality formula ?E

5
Removing constantsA simplification
  • Thm. Given an equality logic formula ?E, there is
    an algorithm that generates an equisatisfiable
    formula ?E' without constants, in polynomial
    time.
  • Algorithm Input An equality logic formula ?E
    with constants c1,...,cnOutput An equality
    logic formula ?E' such that ?E and ?E' are
    equisatisfiable and ?E' has no constants.

6
Removing constantsA simplification
  • 1. ?E' ?E2. In ?E', replace each constant
    ci, 1in, with a new variable Cci .3.
    For each pair of constants ci, cj such that
    1iltjn, add the constraint Cci ?Ccj to
    ?E' .
  • In the following we assume that the input
    equality formulas do not have constants.

7
Uninterpreted functions
  • Def. An equality logic formula with uninterpreted
    functions and uninterpreted predicates is defined
    by the following grammarformula formula
    formula formula (formula)
    atomatom term term
    predicate-symbol(list of terms)term
    identifier function-symbol(list of terms)?
  • Example F(x)F(G(x))
  • Congruence xG(x) ) F(x) F(G(x))

8
Usage of uninterpreted functions
  • Replacing functions by uninterpreted functions in
    a given formula is a common technique to make
    reasoning easier.
  • Makes the formula weaker ?UF ) ???
  • Ignore the semantics of the function, but
  • Functional congruence Instances of the same
    function return the same value for equal
    arguments.

9
From uninterpreted functions to equality logic
  • Two possible reductions- Ackermann's
    reduction- Bryant's reduction
  • Ackermann's reductionGiven an input formula
    ?UF, add explicit constraints for functional
    congruence and transform the formula to an
    equality logic formula ?? of the form
    ??????FCE ) flatEwhere FCE is a
    conjunction of functional-consistency
    constraints, and flatE is a flattening of ?UF.

10
  • Algoritm Ackermann's reductionInput ?UF with m
    instances of an uninterpreted function
    F Output ???such that ???is valid iff ?UF is
    valid1. Assign indices to the UF-instances.2.
    flatE T(?UF) where T replaces each Fi by a fresh
    fi3. FCE i1..m-1 ji1..m
    (T(arg(Fi)) T(arg(Fj))) ) fifj4. Return
    ??? FCE ) flatE

11
Ackermann's reductionExample
  • (x1 ? x2) _ (F(x1) F(x2)) _ (F(x1) ? F(x3))?
  • flatE (x1 ? x2) _ (f1 f2) _ (f1 ? f3))?
  • FCE (x1x2 ) f1f2) (x1x3 )
    f1f3) (x2x3 ) f2f3)
  • ??? FCE ) flatE

12
Ackermann's reduction validity vs. satisfiability
  • ??? FCE ) flatE?is valid iff ?UF is valid
  • Validity check of ?UF check ?? for validity or
    ???for unsatisfiability
  • What if we want to check satisfiability of ?UF?
  • Ackermann's reduction in the above form maintains
    validity, not satisfiability!
  • Solution check satisfiability of ??? FCE
    flatE

13
Bryant's reduction
  • Case expression Fi case x1xi f1
    x2xi
    f2
    ...
    true fiwhere xi is the argument
    arg(Fi) of Fi for all i
  • Semantics _j1,...,i (Fi fj (xjxi)
    k1,...,j-1 (xk ? xi))?

14
Bryant's reductionAlgorithm
  • Input An EUF formula ?UF with m instances of an
    uninterpreted function F
  • Output An EF formula ?? such that ?? is valid
    iff ?UF is valid
  • 1. Assign indices to the uninterpreted-function
    instances from subexpressions outwards.2.
    Return ?E T (?UF) where T replaces each
    Fi(arg(Fi)) by case T (arg(F1))
    T (arg(Fi)) f1
    ... T
    (arg(Fi-1)) T (arg(Fi)) fi-1
    true
    fi

15
Bryant's reduction Example
  • int power3_con (int in) int i, out
    out in for (i 0 i lt 2 i)
    out out in return out
  • int power3_con_new (int in) return ((in
    in) in)

16
Bryant's reduction Example
  • int power3_con (int in) int i, out
    out in for (i 0 i lt 2 i)
    out out in return out
  • int power3_con_new (int in) return (in
    in) in
  • ?? out0 in out1 out0 in out2 out1
    in
  • ?2 out0_new (in in) in
  • ??? ????) out2 out0_new

17
  • ? (out0 in out1 out0 in out2
    out1 in ??out0_new (in in) in)) out2
    out0_new
  • ?UF (out0 in out1 G(out0,in) out2
    G(out1,in) out0_new G(G(in,in),in))) out2
    out0_new

18
  • ?UF (out0 in out1 G(out0,in) out2
    G(out1,in) ?out0_new G(G(in,in),in)) ) out2
    out0_new
  • ?E (out0 in out1 G1 out2 G2
    ?????out0_new G4 ) out2 out0_newwith G1
    g1 G2 case out0out1 inin
    g1 true
    g2 G3 case
    out0in inin g1
    case out1in inin g2
    true g3

19
  • ?UF (out0 in out1 G(out0,in) out2
    G(out1,in) ?out0_new G(G(in,in),in)) ) out2
    out0_new
  • ?E (out0 in out1 G1 out2 G2
    ?????out0_new G4 ) out2 out0_newand
    with G4 case out0G3 inin g1
    case out1 G3 inin
    g2 case in G3
    inin g3
    true g4

20
EUF where are we now?
  • We introduced equality logic and uninterpreted
    functions
  • We showed how to eliminate constants
  • We used Ackermann's and Bryant's algorithms to
    reduce the validity question in equality logic
    with uninterpreted functions to validity
    questions in equality logic
  • Next Decision procedures for equality logic and
    uninterpreted functions
Write a Comment
User Comments (0)
About PowerShow.com