Download presentation
Presentation is loading. Please wait.
1
Backtracking and Theorem Proving Lecture 23 CS 312
2
Schedule 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.
3
Objectives Draw proofs as trees. Apply backtracking to automated theorem proving.
4
Parts 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
5
Kinds of Proofs Forward proof: start from axioms and build facts using inference rules. Axiom Fact
6
Kinds of Proofs Backward proof: start from what you want to prove and rewrite back to axioms. Axiom Fact
7
Backward proofs as trees. New Theorem Intermediate facts Axioms
8
A Logic Axioms: 1. a = a 2. a + 0 = a 3. 0 + a = a 4. (a+b)+c = a+(b+c) 5. a + -a = 0 6. a implies a x = x y+x = y+x x = x x+y = x+y x+0 x 0+x x (x+y)+z x+(y+z) x + -x 0 -x + x 0 Rewrite Rules: 1 2 3 4 5 6 7
9
A Backward Proof a+b = a+c implies b = c (a+b)+-a = (a+c)+-a implies b = c Rule 1 with x/(a+b) and y/-a a+(b+-a) = (a+c)+-a implies b = c Rule 5 with x/a, y/b and z/-a a+(b+-a) = a+(c+-a) implies b = c Rule 5 with x/a, y/c and z/-a
10
A Backward Proof a+b = a+c implies b = c (a+b)+-a = (a+c)+-a implies b = c Rule 1 with x/(a+b) and y/-a a+(b+-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 Rule 5 with x/a, y/b and z/cBacktrack
11
A Backward Proof a+b = a+c implies b = c (a+b)+-a = (a+c)+-a implies b = c Rule 1 with x/(a+b) and y/-a (a+b)+-a = a+(c+-a) implies b = c Rule 5 with x/a, y/c and z/-a a+(b+-a) = a+(c+-a) implies b = c Rule 5 with x/a, y/b and z/c
12
A Backward Proof a+b = a+c implies b = c -a+(a+b) = -a+(a+c) implies b = c Rule 2 with x/(a+b) and y/-a (-a+a)+b = -a+(a+c) implies b = c Rule 5 with x/-a, y/a and z/b 0+b = (-a+a)+c) implies b = c Rule 7 with x/a.
13
1.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. 2.Define optimality and explain why optimality is important for dynamic programming. 3.Compare and contrast dynamic programming and greedy algorithms. 4.Identify components, biconnected components and articulation points in graphs
14
1.Determine the order in which nodes are traversed in pre, post and inorder searches. 2.Compare and contrast BFS, DFS and D-search (p325, #4,5) 3.Understand the role of bounding functions in backtracking problems and design bounding functions for simple problems 4.Compare and contrast dynamic programming and backtracking solutions to problems. 5.Compute worst-case bounds on backtracking algorithms (p368, 1)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.