Logic and Sql

# Logic and Sql - Logic and SQL Propositions and Predicates...

This preview shows pages 1–11. Sign up to view the full content.

Logic and SQL

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Propositions and Predicates Proposition A statement that evaluates unconditionally to TRUE or FALSE Predicate A truth valued function A function that when invoked or “instantiated” returns a truth value (TRUE or FALSE) Every Proposition is a Predicate The reverse is not true
Simple and Compound Simple Single Logical Predicate or Proposition - No Logical Connectives or Operators Compound Multiple Logical Predicates or Propositions - Connected by Logical Connectives or Operators

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Truth Tables p NOT p T F F T p q p and q p or q p implies q p equiv q T T T T T T
Monadic and Dyadic Monadic Has one parameter or argument Dyadic Has two parameters or arguments A monadic Predicate has one argument A dyadic Predicate has two arguments These terms do not have to do with the number of connectives used Just the number of parameters or arguments

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Implies Implies is sometimes thought of as: IF p then q Do not confuse this with natural language or what you think of in programming p implies q is often stated as IF p Then q where p is considered to be an antecedent and q is a consequent The arguments around a logical connective are context independent In Logic the antecedent and consequent are context independent truth values
Examples IF (Mars has two moons) then (Venus is between Earth and Mercury) p = (Mars has two moons) is TRUE q = (Venus is between Earth and Mercury) is TRUE From the truth table p implies q is true BUT, one has nothing to do with the other

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
AND “I was seriously disappointed and I voted for a change in leadership” “I voted for a change in leadership and I was seriously disappointed” p and q Clearly not the same meaning Context Dependent vs Context Independent
Logic and Natural Language (Computer Language Sometimes) Logic and Language are not the same thing Logic Connectives are Formally Defined Causes “understanding” issues IF (Jupiter is a star) THEN (Mars has two moons) is TRUE By the Truth Tables - But Jupiter is certainly not a star IF p THEN q is Logically Equivalent to: NOT(p) or q

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
A Database Example A constraint All RED parts must be stored in London
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 35

Logic and Sql - Logic and SQL Propositions and Predicates...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online