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

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

View Full Document Right Arrow Icon
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.
Background image of page 1

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

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

Page1 / 5

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

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online