Question

In: Computer Science

Consider the following definitions given to you for Boolean logic: not = λx.((x false) true) true...

Consider the following definitions given to you for Boolean logic:

not = λx.((x false) true)
true = λx.λy.x
false = λx.λy.y

Show that not (not true) evaluates to true. Your steps must use proper substitutions and each step must be accompanied with a brief explanation (e.g., "replacing the bound x with false", etc.).

You can use "L" for the lambda symbol in your answer.

Solutions

Expert Solution

not = λx.((x false) true)
true = λx.λy.x
false = λx.λy.y

Lambda calculus
(Lx . + x 1) means that function of x that adds x to 1

not (not true) = true

true is select first
false is select second

Boolean Logic:

There is no “True” or “False” in lambda calculus. There isn’t even a 1 or 0.

Instead:

T is represented by: λx.λy.x
F is represented by: λx.λy.y

First, we can define an “if” function λbtf that returns t if b is True and f if b is False

IF is equivalent to: λb.λt.λf.b t f

Using IF, we can define the basic boolean logic operators:
a AND b is equivalent to: λab.IF a b F

a OR b is equivalent to: λab.IF a T b

NOT a is equivalent to: λa.IF a F T

so, as per the definition of not a mentioned above,

not true is equivalent to: λtrue.IF true false true --> So it returns false
not (not true) is equivalent to not (false) as we have already proved not true = false
not false is equivalent to: λfalse.IF false false true -> So it returns true

Hence not (not true) evaluates to true


Related Solutions

Determine the value, true or false, of each of the following Boolean expressions, assuming that the...
Determine the value, true or false, of each of the following Boolean expressions, assuming that the value of the variable count is 0 and the value of the variable limit is 10. Give your answer as one of the values true or false. a. (count == 0) && (limit < 20) b. count == 0 && limit < 20 c. (limit > 20) || (count < 5) d. !(count == 12) e. (count == 1) && (x < y) f....
Overview and objective: Basic logic In this homework, you will exercise your understanding of boolean logic...
Overview and objective: Basic logic In this homework, you will exercise your understanding of boolean logic and the gates and circuits that embody it. A thorough understanding of boolean logic is extremely useful for almost all programming tasks and necessary to correctly implement complex systems. Additionally, greater familiarity with boolean logic should improve one’s ability to think critically in general as it forms the basis for all human reasoning. Technical Description and Instructions: 1. Consider the logical expression ( !x...
Digital Logic Design Lab Prove the following Boolean Algebra theorems and properties by constructing Logic Circuits...
Digital Logic Design Lab Prove the following Boolean Algebra theorems and properties by constructing Logic Circuits for each theorem/properties using our educational simulation software: Q1-a) The Distributive Property:     a + ( b . c ) = ( a + b ) . ( a + c ) Q1-b) The Distributive Property:     a . ( b + c ) = ( a . b ) + ( a . c )
The following statements are, given certain assumptions, either true, false, or partly true and partly false....
The following statements are, given certain assumptions, either true, false, or partly true and partly false. State which is the case and give your reasons. It is the accuracy of your reasons that principally determines your grade. 1. (5 points) Under Smith’s natural progress of opulence, the liberty of the towns causes the liberty and development of the country.
Consider the boundary value problem X ′′ +λX=0 , X ′ (0)=0 , X′(π)=0 . Find...
Consider the boundary value problem X ′′ +λX=0 , X ′ (0)=0 , X′(π)=0 . Find all real values of λ for which there is a non-trivial solution of the problem and find the corresponding solution.
Consider the Sturm-Liouville problem X′′(x) + λX(x) = 0 subject toX′(0) = 0, X(l) = 0....
Consider the Sturm-Liouville problem X′′(x) + λX(x) = 0 subject toX′(0) = 0, X(l) = 0. Are the boundary conditions symmetric? Do these boundary conditions yield negative eigenvalues? Determine the eigenvalues and eigenfunctions, Xn(x). (It is enough in some cases to provide the equation that determines the eigenvalues rather than an explicit formula.) Are the eigenfunctions orthogonal?
3.a Draw the logic diagram for the following Boolean expression. The diagram should correspond exactly to...
3.a Draw the logic diagram for the following Boolean expression. The diagram should correspond exactly to the equation (do not simplify). Assume that the complements of the inputs are available. ? = ?′?(? + ?) + ??′(? + ?) + ?′?(? + ?) + ??′(? + ?) b. Simplify the Boolean expression in (a) using a Karnaugh Map, then draw the corresponding two-level logic diagram as a sum of products implementation.
Which of the following statements are true and which are false. In general, at a given...
Which of the following statements are true and which are false. In general, at a given temperature, the reaction quotient (Q) is a constant. 1 mol of H2O(g) and 1 mol of CO(g) are placed in a vessel and 1 mol of H2(g) and 1 mol of CO2(g) are placed in another of equal volume. At equilibrium, at 350°C, the amounts of H2O(g) in the two vessels are equivalent. Amounts of all reactants and products corresponding to an exact equilibrium...
public boolean isPrime(int num){ // return true if the number is prime, false otherwise } public...
public boolean isPrime(int num){ // return true if the number is prime, false otherwise } public boolean isOdd(int num){ // return true if the number is odd, false otherwise } public String reverseMyString(String input){ // using a loop, reverse a string // i.e. input = "hello", reversed answer: "olleh" // i.e. input = "bye", reversed answer: "eyb" } public int pow(int base, int power){ // using for loop, calculate base raised to power // i.e. base = 2, power =...
True/false questions T          F           A hazard or glitch in digital logic is a fault in the...
True/false questions T          F           A hazard or glitch in digital logic is a fault in the logic system due to a change at the input. T          F           A circuit with a hazard isn't a problem if the output values are allowed to settle to a steady state before being sampled. T          F           The cause of hazards is the timing delay of different components in the circuit. T          F           Adding delay can remove hazards, if one has good control of propagation...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT