Logic Flashcards
What does logic deal with?
Whether statements are true or false + chains of reasoning which enable us to decide this. Work with boolean + truth tables + de Morgan’s laws.
What are the symbols for and, or not?
and = ^. Or = v. Not = ¬.
What is the opposite of A^B?
¬A v ¬B. We find opposite by negating variable + swapping and/or symbols.
When is A ⇒ B false?
When A is true and B is false.
What is the contrapositive of A ⇒ B?
¬B ⇒ ¬A. They mean the same thing.
If you chain logical deductions together, how do you know when it’s always true?
If the truth table is true in every scenario.
What is forward chaining?
Search from initial conditions to goal. Start with what we know. Could end up with lots of intermediate deductions that aren’t needed for final answer.
What is backward chaining?
From goal back to initial conditions. Start with what we want to know. Can end up with lots of questions which we don’t need an answer to.
What is propositional logic?
Logic used when something must be proved/disproved (proposition)
What is predicate logic?
When we need to find out more about unknown variable before we can prove/disprove it. It tells you something about the subject and so is a Boolean function applied to 1 or more variables.
What happens when you add values to a predicate?
It becomes a proposition.
What is the domain/universe of discourse?
Set of values which can be assigned to predicate variable.
What are the quantifiers?
For all (∀) or there exists (∃) to indicate num of values for which predicate is true. For all shows all values are true. There exists shows at least one (possibly all) values are true for predicate. E.g. ∀x∈D .P(x) (for all possible values of x in domain D, P(x) is true.
What is a counterexample?
With for all, there must be at least 1case where p(x) is false so ¬( ∀x∈D.P(x)) = ∃x∈D.¬P(x) AND ¬( ∃x∈D .P(x) ) = ∀x∈D.¬P(x). You flip rule + negate predicate. Domain not affected.
How do you prove ‘there exists’?
You just need 1 example.