77.1k views
4 votes
(a) Show how to use (the Boolean formula satisfiability program) satisfiable num (and substitute) to find a satisfying assignment that minimizes the number of variables set to TRUE. Write the pseudo-code. HINT: eurtottesebtsumselbairavynamwohenimretedtsrif. HINT for hint: sdrawkcabtidaer. (b) How fast is your algorithm? Justify.

User Tim Babych
by
5.6k points

1 Answer

3 votes

Answer:

Check the explanation

Step-by-step explanation:

(a)

# We need to try all options(TRUE/FALSE) of all the Variables

# to find the correct arrangement.

permutations <- permutate(0,1,n) [Find all permutions O(2^n)]

for permutation in permutations:

for X in variables:

if(permutation[i] == 1)

substitute(H,X,true)

else

substitute(H,X,false)

if(satisfiable(H)) return permutation

increment i

User Pavel Stepanov
by
5.6k points