Download presentation
Presentation is loading. Please wait.
Published byพินิจ ชินวัตร Modified over 5 years ago
1
HW #2. Due Apr 25 23:59 Do NOT forget to submit both a hardcopy solution to the HW box and a softcopy solution to TA
2
1. Verify the following program using SAT solver
1. Translate the program and the assertion into a SSA form 2. Create a proposition logic formula A from the SSA representation 3. Translate the formula A into CNF 4. 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
3
Make a Latin square solver like Sudoku solver using minisat2
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” x111 x211 x311 x121 x221 x321 x131 x231 x331 x112 x212 x312 x113 x213 x313 x322 x332 Intro. to Logic CS402
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.