Question: Let G be a graph over 3 2 nodes ( namely , node 0 , cdots, node 3 1 ) . For all 0 i
Let be a graph over nodes namely node cdots, node For all there is
an edge from node to node iff or is the modular
operator in C; eg A node is even if is an even number. A node is prime if
is a prime number. In particular, we define even as the set cdots, and prime as the
set We use to denote the set of all edges in
graded on correctness and clarity. If you use explicit graph search such as DFS you receive
coding in Python Every finite set can be coded as a BDD Please write a Python program
to decide whether the following is true:
StatementA for each node in prime there is a node in even such that can reach
in a positive even number of steps.
Your code shall implement the following steps.
step Obtain BDDs EVEN,PRIME for the finite sets evenprime respectively.
Pay attention to the use of BDD variables in your BDDs Your code shall also verify the following
test cases:
is true;
is false;
EVEN is true;
EVEN is false;
PRIME is true;
PRIME is false.
step Compute BDD for the set @ from BDD Herein, encodes the set of
node pairs such that one can reach the other in two steps. Your code shall also verify the following
test cases:
is true;
is false.
step Compute the transitive closure RRstar of Herein, RRstar encodes the set of
all node pairs such that one can reach the other in a positive even number of steps.
step Here comes the most difficult part. We first StatementA formally:
AAu.EEv.star
There are two quantifiers in StatementA: one is "for each", and the other is "there is First,
from what you have learned from mathdiscrete math "for each" can be expressed through
"there is Second, "there is can be implemented using existential quantifier elimination method
smoothing As a result, the entire StatementA is a BDD without free variables and hence
it is either true or false. Return the truth value.
Many students find methods BDDcompose and BDDsmoothing are quite useful in the pack
age. Please do in Python and Pyeda
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
