50 likes | 68 Views
Verify, translate & solve logic programs using SAT solver, SSA form, propositional formulas. Explore Latin square problems in SAT formulas.
E N D
1. Verify the following program using SAT solver 1. Translate the program into a SSA form 2. Create a Boolean formula from the SSA representation 3. Completely translate arithmetic and equality into propositional formula 4. Translate the formula A into CNF form 5. Run Minisat on A_CNF and capture the result (see the class homepage to find relevant information) and interpret the result /* Assume that x and y are 2 bit unsigned integers */ /* Also assume that x+y <= 3 */ void f(unsigned int y) { unsigned int x=1; x=x+y; if (x==2) x+=1; else x=2; assert(x ==2); } Intro. to Logic CS402
2. A Latin square is an n × n table filled with n different symbols in such a way that each symbol occurs exactly once in each row and exactly once in each column. Here is an example for the 3x3 table. • Encode a 3x3 Latin square problem in a SAT formula using the following variable names and explain your encoding scheme • Make a Latin square solver like Sudoku solver using minisat2 • Translate your SAT encoding into DIMACS CNF formula • For example, if TA adds the 3 clauses “x111 /\ x212 /\ x313” (i.e., (1, 2, 3) as the first row) into your formula, minisat2 should make a model • “x122/\ x223 /\ x321/\ x133/\ x231 /\x332” • Or “x132/\ x233 /\ x331/\ x123/\ x221 /\x322” x213 x113 x313 x212 x112 x312 x211 x111 x311 x322 x221 x121 x321 x332 x231 x131 x331 Intro. to Logic CS402
3.Show validity and satisfiability of the following propositional formulas using both - Truth table - Semantic tableau Intro. to Logic CS402
4. Show that semantic tableau method is sound and complete. I.e. prove that A is satisfiable if and only if a semantic tableau tree of A is open. In other words, prove Theorem 2.49 (read 34-38 pg carefully) Intro. to Logic CS402