Question: programming language: Haskell Question 2: Three-Valued Logic (8.0 marks) Three-valued logic is a type of many-valued logic that is defined for three distinct truth values
programming language: Haskell

Question 2: "Three-Valued Logic" (8.0 marks) Three-valued logic is a type of many-valued logic that is defined for three distinct truth values True, False, and Unknown. This system is of particular interest in the field of database administration as it facilitates logical calculations between the standard (i.e binary) truth values and the NULL value that is frequently stored in an attribute. For the second exercise of this assignment you are required to define an enumerated algebraic data type (and some support functions) to be used to represent three-valued logic. You MUST do some very basic research on three-valued logic before attempting this question. If you do not, then you will not know how the operators are expected to "behave" In a separate file (i.e, separate from your submission for the first exercise) that you have named using the convention specified above and commented with your name and student number, you will need to complete the following tasks: a) Define an enumerated algebraic data type to reflect the different possible values. I strongly recommend that you do not attempt to overload keywords like true and false; instead you should use troo, falz, and unknown (or something to that effect) b) Write functions ternaryNOT, ternaryAND, and ternaryOR, defined for your enumerated type. Use the minimum number of patterns required- do not replicate entire truth tables or you will be penalized. Question 2: "Three-Valued Logic" (8.0 marks) Three-valued logic is a type of many-valued logic that is defined for three distinct truth values True, False, and Unknown. This system is of particular interest in the field of database administration as it facilitates logical calculations between the standard (i.e binary) truth values and the NULL value that is frequently stored in an attribute. For the second exercise of this assignment you are required to define an enumerated algebraic data type (and some support functions) to be used to represent three-valued logic. You MUST do some very basic research on three-valued logic before attempting this question. If you do not, then you will not know how the operators are expected to "behave" In a separate file (i.e, separate from your submission for the first exercise) that you have named using the convention specified above and commented with your name and student number, you will need to complete the following tasks: a) Define an enumerated algebraic data type to reflect the different possible values. I strongly recommend that you do not attempt to overload keywords like true and false; instead you should use troo, falz, and unknown (or something to that effect) b) Write functions ternaryNOT, ternaryAND, and ternaryOR, defined for your enumerated type. Use the minimum number of patterns required- do not replicate entire truth tables or you will be penalized
Step by Step Solution
There are 3 Steps involved in it
To implement threevalued logic in Haskell youll define an enumerated data type and implement logical ... View full answer
Get step-by-step solutions from verified subject matter experts
