Randomized Congruence Closure - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

Randomized Congruence Closure

Description:

Theory of equality with uninterpreted functions and linear arithmetic. Shostak's algorithm ... Applicability is not limited to linear arithmetic ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 12
Provided by: ambujt
Category:

less

Transcript and Presenter's Notes

Title: Randomized Congruence Closure


1
Randomized Congruence Closure
  • CS263 Project Presentation
  • Ambuj Tewari

2
Outline
  • Theory of equality with uninterpreted functions
    and linear arithmetic
  • Shostaks algorithm
  • Randomized approach
  • Running Time Comparisons

3
Theory of Equality
  • A theory consists of
  • Function and predicate symbols
  • A set of inference rules
  • For example,
  • f, g, h, (uninterpreted functions symbols)
  • Rules (T ranges over sets of equalities)

(congruence)
4
Theory of Equality with Arithmetic
  • Example,
  • To add linear arithmetic, we need
  • Canonizer
  • Solver
  • More rules

5
Theory of Equality with Arithmetic
  • Example,
  • Note that there is no multiplication except with
    constants (hence linear)
  • We need a decision procedure to decide statements
    of the form

6
Shostaks Algorithm
  • Provides a decision procedure for theory of
    equality combined with canonizable and solvable
    theories
  • Uses canonizing function s and solver solve as
    black-boxes
  • Applicability is not limited to linear arithmetic
  • Shostaks algorithm is essentially a clever
    combination of congruence closure and gaussian
    elimination with back substitution
  • Discovered in 84
  • Cyrluk et. al. 96 fixed some bugs
  • Ruess and Shankar 01 claim to give formal
    proofs of correctness (soundcomplete) and
    termination

7
Randomized Approach
  • A set of equalities T, describes a subspace S(T)
    in an n-dimensional world (n number of
    variables)
  • Key idea is to represent a subspace by a set of
    random points in that subspace
  • To test if T ab, test whether the random
    points in S(T) satisfy ab (small probability of
    error)
  • A line is parametrized by one variable
  • A plane that doesnt contain it will have at
    most one intersection with it
  • Probability that all d points happen to be the
    bad point (1/d)t

bad point
8
Randomized Approach
  • Gulwani and Necula 02 define an operation
    adjust(S,e)
  • S contains a certain number, say m, of points
    drawn randomly from S(T)
  • adjust returns m-1 points in S(T e0)
  • If there were no uninterpreted functions then one
    adjust would suffice while processing a new
    equation
  • After processing an equation if we find that, say
    xy, then we have to adjust for f(x)f(y) also
  • Since we lose one point after each adjust, the
    probability of error is less than
    where r
  • of random points, a of adjusts

9
Running Time Comparisons
  • Shostak implementation was mine not very
    optimized (now have access to a
    commercial-quality implementation)
  • Randomized implementation (provided by Sumit
    Gulwani) highly optimized random numbers
    precomputed
  • Both implementations computed over the field
    Z4093
  • Time spent in parsing input not included
  • Couldnt find commercial benchmarks
  • Test cases were randomly generated by a program
    may not reflect what is encountered in real world

10
No uninterpreted functions
11
With uninterpreted functions
  • 10 variables
  • 5 uninterpreted functions with arity up to 3
  • 20 equations
  • Up to 2 levels of nesting of function symbols
Write a Comment
User Comments (0)
About PowerShow.com