Monadic and Dyadic Operators
Operators can be monadic or dyadic A monadic operator operates on a single simple statement. Other operators will all be dyadic operators because they operate on two simple statements. Any time you use an operator with a simple statement, even a monadic operator, you create a compound statement.
Compound Statements and Truth Function
All the compound statements we'll look at are called "truth-functional" compound statements. This means that the truth value of the entire statement is determined by the truth value of the individual simple statements that make it up and the function of the operator on those statements.
If you write computer programs, you can think of the simple statements as inputs and the operator as the function that accepts those inputs and does something with them. The output of the entire function is determined by the value of the inputs and the specific operation of the function. Consider this simple program written in pseudocode which will take a string value and change the value to all caps and then print it to the screen:
Function PrintCaps (string A)
{
A = AllCaps(A);
Print A
}
If we send in the value "pencil" to our function, it will print "PENCIL" to the screen. What's important here is that the output is determined both by the value we pass to the function and the operation that is done to that value by the function itself. In truth-functional logic, operators work on simple statements (the function) and determine an overall truth value for the compound statement based on the truth value of the simple statements (inputs) it operates on. This will become clearer as you learn each of the operators and how they are used to create truth-functional compound statements.
In the next few lessons, we'll learn some basic operators and how they function in constructing compound statements. Each operator will have symbol we use in constructing arguments and a specific form we'll need to use when constructing compound statements using those operators. For each operator, we'll describe the symbol, the name of the symbol, the parts of the compound statement that use the operator, and some examples.
The above knowledge was gained for free from EdX.
Microsoft: DEV262xLogic and Computational Thinking
No comments:
Post a Comment