Theorem Proving - PowerPoint PPT Presentation

1 / 18
About This Presentation
Title:

Theorem Proving

Description:

by Resolution/Factorization (set-based search) and Model Elimination (AND-tree based search) ... thus, we produce the clause (6) by resolution: ... – PowerPoint PPT presentation

Number of Views:33
Avg rating:3.0/5.0
Slides: 19
Provided by: Pil85
Category:

less

Transcript and Presenter's Notes

Title: Theorem Proving


1
Theorem Proving
  • by Resolution/Factorization (set-based search)
    and Model Elimination (AND-tree based search)

2
Idea
  • given a set of clauses, we want to verify whether
    they are consistent (i.e. there are no
    contradictions of facts)
  • imagine you are searching whether a fact Q can be
    inferred from the facts in a database
  • you would ask Q? of the database
  • if we represent a database as a set of clauses,
    then we would add a clause Q into the database
    and look for contradictions

3
Idea 2
  • If we find a contradiction
  • means that Q contradicts with something
  • i.e. the database infers Q
  • i.e. Q? is true
  • If we get stuck without getting a contradiction
  • means that we could not infer Q from the database
  • i.e. Q? is false

4
How to?
  • We looked at two methods to do theorem proving
  • by Resolution/Factorization
  • set-based search method
  • by Model Elimination
  • AND-tree-based search method

5
Inference Rules
  • Resolution
  • CvP, DvR ? s(CvD) where
  • s mgu(P,R)
  • Factorization
  • CvPvR ? s(CvP) where
  • s mgu(P,R)

6
TP by Res/Fact Idea
  • We start with a set of clauses
  • need to look in those clauses for a contradiction
    (i.e. P and P)
  • to do this, we may need to use resolution and
    factorization inference rules in order to process
    clauses to produce new inferred clauses

7
Important things to know
  • use proper unification technique for unifying
    terms in clauses
  • do not keep the mgus between resolution/factorizat
    ion steps of the algorithm (you can use different
    substitutions for same variables at each step)
  • remember that variables in different clauses are
    disjunct (i.e. variable in one clause can be
    renamed to another variable as long as this is
    consistent in the entire clause)
  • you should keep all the clauses in the system and
    add to it (i.e. do not delete clauses since you
    might have to use them more than once)
  • one contradiction of facts is enough to prove the
    consequence (i.e. concluding the empty clause (?))

8
which clause to choose?
  • The way our control was defined, we would get an
    fwert value for each pair of clauses as follows
  • if ACvPvR (i.e. can use factorization)
  • fwert 0
  • if ACvP,DvR (i.e. can use resolution)
  • fwert CDPR
  • C and P as defined in the notes
  • if there are ties for several pairs, we would
    select between them using the ordering on the
    literals as defined in the notes

9
Example 1
  • 1. P(x,y) v P(y,x)
  • 2. P(f(x),g(y)) v R(y)
  • 3. P(g(x),f(x))
  • 4. R(x) v Q(x,b)
  • 5. Q(a,x)
  • Suppose s0 1,2,3,4,5 (set of clauses)

10
Example 1 (cont)
  • first thing we choose the clauses to use
  • factorization does not apply, so we order the
    pairs of clauses in terms of fwert value
  • this gives us the pair (4,5)
  • we unify the Q terms with x1\a, x2\b where x1
    are the xs from (4) and x2 are the xs from (5)
  • thus, we produce the clause (6) by resolution
  • 6. R(a) note that this is R(x1) from (4) with
    the mgu applied
  • s1 s0 U R(a)

11
Example 1 (cont)
  • next step, we will choose clauses (2,6) and unify
    the P terms them with ya
  • we produce (7) by resolution
  • 7. P(f(x),g(a))
  • s2 s1 U P(f(x),g(a))

12
Example 1 (cont)
  • Next we will choose the pair (1,7) since (3,7)
    will not unify
  • we unify the P terms with x1\f(x2), y\g(a)
    where x1 are the xs from (1) and x2 are the xs
    from (7) we get (8)
  • 8. P(g(a),f(x))
  • s3s2 U P(g(a),f(x))

13
Example 1 (cont)
  • Now, the next pair we will choose is (3,8) with P
    terms unified with x1\a with x1 the xs from (3)
  • now, we have P(g(a),f(a)) and P(g(a),f(a))
    (after application of mgu) thus, a contradiction
  • s4 s3 U ?
  • and we are done!

14
Example 2
  • 1. P(x) v R(y)
  • 2. R(f(a,b))
  • 3. P(g(a,b))
  • Using model elimination

15
Example 2 (cont)
  • we start with a node with an empty terms list and
    choose what to add to it
  • first we choose to use clause 1 and end up with a
    tree
  • (1)
  • / P(x)vR(y) \
  • P(x) R(y)

16
Example 2 (cont)
  • we choose to left on the leftmost leaf first
  • next we have to choose something that will
    contradict the last term in our list in at least
    one of the children
  • then we can process the deepest child to yes
  • (1)
  • / P(x)vR(y) \
  • (2)P(x) R(y)
  • P(g(a,b))
  • (3)P(g(a,b)), P(g(a,b))
  • Yes x\g(a,b)

17
Example 2 (cont)
  • now we choose the only leaf (4) to process
  • then its child (5) to yes
  • (1)
  • / P(x)vR(y) \
  • (2)P(x) (4)R(y)
  • P(g(a,b)) R(f(a,b))
  • (3)P(g(a,b)), (5) R(f(a,b),
    P(g(a,b)) R(f(a,b)
  • Yes x\g(a,b) Yes y\f(a,b)
  • so, we have processed all the leaves

18
Example 2 (cont)
  • Question is, are we done?
  • We have to verify that our substitutions for all
    leaves are compatible, which is true for our
    example
  • Otherwise, we would need to backtrack
  • We could also backtrack if there are no possible
    ways of processing a leaf to yes
  • Eventually if backtracking doesnt help or we run
    into infinite loops, the instance fails
Write a Comment
User Comments (0)
About PowerShow.com