gsat - GSAT Tracing GSAT is a `greedy local search...

This preview shows pages 1–3. Sign up to view the full content.

Sheet1 Page 1 GSAT Tracing ---- ------- GSAT is a `greedy local search' procedure for satisfying propositional formulae in CNF form. You have been asked to code the GSAT algorithm, and as a first step, you are to code a variation of the core of this algorithm and output a trace of its execution. A propositional formula is a formula containing boolean variables and the operators AND, OR, and NOT. A propo- sitional formula is in `conjunctive normal form', or CNF, if it has the syntax: CNF-formula ::= clause { AND clause }* clause ::= ( literal { OR literal }* ) literal ::= variable | NOT variable Thus if v1, v2, v3, ... are boolean variables, an exam- ple is ( v1 OR NOT v3 ) AND ( NOT v4 OR v5 OR v2 ) As a shorthand we will write such formula with the following modifications: A. We will omit OR's and AND's. B. We will omit v's, representing variables by integers. C. We will replace NOT's by -'s, negating the integer representing a variable that is to be NOT'ed. We will omit space between the `-' and its following integer. Thus the above example becomes: ( 1 -3 ) ( -4 5 2 ) ( The goal of the GSAT algorithm is to find an assignment of values (true or false) to variables so that the given input CNF formula is satisfied (evaluates to true by the rules of boolean algebra). The core of the GSAT algorithm is: 1. Assign values (true or false) to all the variables randomly. 2. If all clauses are satisfied (so the formula is satisfied), stop.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Sheet1 Page 2 3. For each variable i, compute the number of clauses N[i] that will be satisfied if just the value of variable i is changed.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern