Question: you need to use python 3 code and resolution method for below information Satisfiability for 2 - CNF will be your task for HW #
you need to use python code and resolution method for below information
Satisfiability for CNF will be your task for
HW #
The easy version is to check satisfiability
using resolution method
The full task is to check satisfiability and, if
the answer is yes to return one of the
satisfying assignments. It is important to keep in mind that the
input is given in humanreadable form, as
a string representing the formula. Conjunction, disjunction, negation, and
implication, are, resp., ~
Literals: x or ~x where x is an arbitrary
letter.
Clauses:
or
where
and are literals.
The CNF is a conjunction of clauses. First, one needs to translate the input into
a machinedigestable form this is called
parsing of the input
Grammar for CNFs:
CNF :: Clause CNF Clause
Clause ::Lit LitLit Lit
Lit :: Var ~Var use python
The program in Python should implement
two functions:
issatisfiable, which takes a CNF and
answers True or False, depending on
whether it is satisfiable.
satassignment, which takes a CNF and
returns a satisfying assignment as an
associative array:
x: True, y: False, z: True
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
