Title: Backtracking and Theorem Proving
1Backtracking and Theorem Proving
2Schedule
- Monday Hamiltonian cycles and extracting the
solution. - Wednesday review for midterm
- Midterm in testing center starting Wed at noon,
going Thursday, Friday and Saturday. Ends Monday
at noon. - Friday no class.
3Objectives
- Draw proofs as trees.
- Apply backtracking to automated theorem proving.
4Parts of a Logic
- Axioms things you know are true without a
proof. - Inference rules how to build new true facts from
old true facts - forward proof
- Rewrite rules how to change one statement into
another statement. - backward proof
5Kinds of Proofs
- Forward proof start from axioms and build facts
using inference rules.
Axiom
Axiom
Fact
Fact
Fact
Fact
Fact
Fact
6Kinds of Proofs
- Backward proof start from what you want to
prove and rewrite back to axioms.
Axiom
Axiom
Fact
Fact
Fact
7Backward proofs as trees.
New Theorem
Intermediate facts
Axioms
8A Logic
Rewrite Rules
Axioms 1. a a 2. a 0 a 3. 0 a a 4.
(ab)c a(bc) 5. a -a 0 6. a implies a
1
5
2
6
3
7
4
9A Backward Proof
ab ac implies b c
Rule 1 with x/(ab) and y/-a
(ab)-a (ac)-a implies b c
Rule 5 with x/a, y/b and z/-a
a(b-a) (ac)-a implies b c
Rule 5 with x/a, y/c and z/-a
a(b-a) a(c-a) implies b c
10A Backward Proof
ab ac implies b c
Rule 1 with x/(ab) and y/-a
(ab)-a (ac)-a implies b c
Rule 5 with x/a, y/b and z/c
Backtrack
a(b-a) (ac)-a implies b c
Rule 5 with x/a, y/b and z/c
Backtrack
a(b-a) a(c-a) implies b c
11A Backward Proof
ab ac implies b c
Rule 1 with x/(ab) and y/-a
(ab)-a (ac)-a implies b c
Rule 5 with x/a, y/c and z/-a
(ab)-a a(c-a) implies b c
Rule 5 with x/a, y/b and z/c
a(b-a) a(c-a) implies b c
12A Backward Proof
ab ac implies b c
Rule 2 with x/(ab) and y/-a
-a(ab) -a(ac) implies b c
Rule 5 with x/-a, y/a and z/b
(-aa)b -a(ac) implies b c
Rule 7 with x/a.
0b (-aa)c) implies b c
13- Apply the following algorithms to small examples
dynamic programming knapsack problem, string
editing, backtracking algorithm for graph
coloring, backtracking algorithm for the knapsack
problem and all pairs shortest paths. - Define optimality and explain why optimality is
important for dynamic programming. - Compare and contrast dynamic programming and
greedy algorithms. - Identify components, biconnected components and
articulation points in graphs
14- Determine the order in which nodes are traversed
in pre, post and inorder searches. - Compare and contrast BFS, DFS and D-search (p325,
4,5) - Understand the role of bounding functions in
backtracking problems and design bounding
functions for simple problems - Compare and contrast dynamic programming and
backtracking solutions to problems. - Compute worst-case bounds on backtracking
algorithms (p368, 1)