Question

Define grammar of a language to write boolean expritions. The language can recognize identifieres of boolean...

Define grammar of a language to write boolean expritions.

The language can recognize identifieres of boolean variables. It shoud recognize sympoles

of (&,|,~) respectivly (and/or/not).

Examples of valid expressions:

1- (~ x0 & ~ x1) | (x0' & ~ x1) )
2-  ~ (x0 & x1))
3- (x0 & y0) | (x1 & y1) | (x2 & y2)

Homework Answers

Answer #1

SOLUTION-

let set of terminals (booleam variables in this case eg x0,x1 etc)

Idea is to generate grammer which creates <and>, <or> between two non terminals and <not> a non terminal.

The grammer is:

in case of more terminals, just append them in the production rule.

IF YOU HAVE ANY DOUBT PLEASE COMMENT DOWN BELOW I WILL SOLVE IT FOR YOU:)
----------------PLEASE RATE THE ANSWER-----------THANK YOU!!!!!!!!----------

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write vectors in R2 as (x,y). Define the relation on R2 by writing (x1,y1) ∼ (x2,y2)...
Write vectors in R2 as (x,y). Define the relation on R2 by writing (x1,y1) ∼ (x2,y2) iff y1 − sin x1 = y2 − sin x2 . Prove that ∼ is an equivalence relation. Find the classes [(0, 0)], [(2, π/2)] and draw them on the plane. Describe the sets which are the equivalence classes for this relation.
Write a BNF grammar for a new language called 4040. It should include the following rules:...
Write a BNF grammar for a new language called 4040. It should include the following rules: Variable definitions should start with var. There must be only single space after var. Variable names should come after the var and single space. Variable names should start with a letter or underscore(_). Starting with a digit is not allowed. Variable names can have digits after the first letter. There can be multiple variable names separated by comma. Between variables, spaces are allowed. There...
Define a Q-sequence recursively as follows. B.   x, 4 − x is a Q-sequence for any...
Define a Q-sequence recursively as follows. B.   x, 4 − x is a Q-sequence for any real number x. R.   If x1, x2,   , xj and y1, y2,   , yk are Q-sequences, so is     x1 − 1, x2,   , xj, y1, y2,   , yk − 3. Use structural induction (i.e., induction on the recursive definition) to prove that the sum of the numbers in any Q-sequence is 4. Base Case: Any Q-sequence formed by the base case of the definition has sum x +...
4-bit signed numbers X = x3 x2 x1 x0 Y = y3 y2 y1 y0 need...
4-bit signed numbers X = x3 x2 x1 x0 Y = y3 y2 y1 y0 need a logic simulation to read signed numbers x3, and y3. if x3 and y3 are equal to 0, read the number as is. if x3 and y3 are equal to 1, take the 2's complement of number.
1. Let x ∼ Np(µ, Σ). (1) Find the distribution of xp conditional on x1, ....
1. Let x ∼ Np(µ, Σ). (1) Find the distribution of xp conditional on x1, . . . , xp−1. (2) Suppose Σ =(1 ρ ρ 1 )and let y1 = x1 + x2 and y2 = −x1 + x2. Determine the joint distribution of y1 and y2. (3) Suppose Σ =( σ11 σ12 σ21 σ22 )and define y1 and y2 as in part (2).Determine the joint distribution of y1 and y2. Determine the conditional distribution y2 given y1.
Write a complete C program that prompts the user for the coordinates of two 3- D...
Write a complete C program that prompts the user for the coordinates of two 3- D points ( x1 , y1 , z1 ) and ( x2 , y2 , z2 ) and displays the distance between them computed using the following formula: distance= square root of (x1-x2)2+(y1-y2)2+(z1-z2)2
N particles can move in plane (x,y). Write down coordinates and momenta of all particles forming...
N particles can move in plane (x,y). Write down coordinates and momenta of all particles forming the phase space and determine number of degrees of freedom s. (a) x1, px1, y1, py1, x2, px2, y2, py2,…, xN, pxN, yN, pyN , s=2N (b) x1, px1, x2, px2, …, xN, pxN , s=2N (c) y1, py1, y2, py2,…, yN, pyN , s=2N (d) x1, y1, x2, y2, …, xN, yN , s=2N and why you choose
1.suppose that Y1 and Y2 are independent random variables 2.suppose that Y1 and Y2each have a...
1.suppose that Y1 and Y2 are independent random variables 2.suppose that Y1 and Y2each have a mean of A and a variance of B 3.suppose X1 and X2 are related to Y1 and Y2 in the following way: X1=C/D x Y1 X2= CY1+DY2 4.suppose A, B, C, and D are constants What is the expected value of X1? What is the expected value of X2? What is the variance of X1?
1.suppose that Y1 and Y2 are independent random variables 2.suppose that Y1 and Y2each have a...
1.suppose that Y1 and Y2 are independent random variables 2.suppose that Y1 and Y2each have a mean of A and a variance of B 3.suppose X1 and X2 are related to Y1 and Y2 in the following way: X1=C/D x Y1 X2= CY1+CY2 4.suppose A, B, C, and D are constants What is the expected value of the expected value of X1 given X2{E [E (X1 | X2)]}? What is the expected value of the expected value of X2 given...
I am not sure what I am doing wrong in this coding. I keep getting this...
I am not sure what I am doing wrong in this coding. I keep getting this error. I tried to change it to Circle2D.java but it still comes an error: Compiler error: class Circle2D is public, should be declared in a file named Circle2D.java public class Circle2D { public class Exercise10_11 { public static void main(String[] args) {     Circle2D c1 = new Circle2D(2, 2, 5.5);     System.out.println("area: " + c1.getArea());     System.out.println("perimeter: " + c1.getPerimeter());     System.out.println("contains(3, 3): "...