Logic

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

An argument is satisfiable iff....

it's possible to find an interpretation/model that makes the formula true

How to check for equivalence

truth table

Determine whether the following syllogistic argument is valid. 1. All A are B. 2. Not all B are C. --> 3. Not all A are C.

Let D = {1,2,3}. Let I(A) = {1}, I(B) = {1,2}, I(C) = {1,3}. Let M be the model (D,I). Then both premises are true in M but the conclusion is false in M. Thus the argument is invalid.

Two formulas are equivalent iff...

they define the same truth function

How to check for satisfiability

truth table

Not everything is such that it is a reptile, if it is an amphibian.

¬∀x(Ax→Rx)

Write out the predicate logical translation for: (a) "there are at least two objects with property P". (b) "there are at most two objects with property P"

φ1 =∃x1∃x2((x1 ̸=x2)∧P(x1)∧P(x2)). φ2 =∀x1∀x2∀x3((P(x1)∧P(x2)∧(x doesn't equal x2))→¬P(x3).

Write out the predicate logical translation for: "there are exactly two objects with property P"

φ1 ∧φ2.

Frogs are reptiles only if frogs are not amphibians.

∀x(Fx→Rx)→∀x(Fx→¬Ax)

Some reptiles live underwater and on the land, but they are not amphibians.

∃x((Rx∧(Ux∧Lx))∧¬Ax)

An implication p->q is equivalent to its _______ ( ____-> ___) but not its converse or inverse.

contrapositive, ~q->~p

For the language of propositional logic, the validity problem is _______—for any given formula φ, its validity can be decided by checking every valuation for the 2 proposition letters occurring in φ, of which there are only finitely many.

decidable

prenex normal form

(1) Eliminate all conditionals and biconditionals using p->q = p v ~q (2) Bring all quantifiers out using identities: ∀x(F(x)→∃yR(xy)) = ∀x∃y(F(x)→R(xy)) (3) Drive negations in using DeMorgan's: ~∀xF(x) = ∃x(~F(x)) ~∃xF(x) = ∀x(~F(x)) (3)

Resolution Proof

(1) Start w/ formula in CNF form (2) Apply rule "from clause (Cvx) and clause (Dv~x), derive clause (CvD) until a falsity F (or empty clause) is reached. (3) Last step should have one clause w/ just 1 variable and another with the negation of said variable *Used to find a contradiction in a formula and prove that a formula is a tautology by finding a contradiction in its negation

Local finiteness: there are exactly ____ equivalence classes of propositional formulas in L({p1, p2...pn})

2^n

How to convert to CNF

Construct a truth table, identify the rows where the truth assignments falsify the formula, conjunct the negation of its encoding to the CNF, and apply DeMorgan's Law: (pvqvr) ^ (~pvqvr) etc..

∀x(∃yL(x, y) → L(x, c)) x is a student, y is a course, and x loves y c= W12A

Every student who loves a course must love W12A

A system is complete if...

Everything that is true (and valid) can be proven.

How to check for validity using truth tables?

Look for row where premises and conclusion are true

A model is sound if...

You can't deduce a contradiction

Determine whether t is substitutable for x in the following cases. (a) φ = P(x) and t is any term. (b) φ = ∃xP(x) and t is any term. (c) φ = ∀yP(x) and t is any term without y a free variable. And if t contains y as a free variable? (d) φ = ∃y(P (y) ∧ ¬Q(x)) and t = f (y) for f a function symbol. What about when t = f(x)? (e) φ = ∀y(P(y) → ∀z(Q(z) ∧ P(x))) and t = f(z). What about when t = y?

(a) t is substitutable for x. (b) t is not substitutable for x bc x is bound. (c) t is substitutable for x when t doesn't have y as a free variable, since x isnt bound and theres no variable in t that gets bound by the y. If t does have y has a free variable then we cannot substitute t in for x since the y would be bound by the ∀y (d) t = f(y) is not substitutable for x since y would be come bound but t = f(x) is substitutable for x. (e) neither f(z) nor y are substitutable for x since y and z would become bound.

How do you prove the fact: every formula is equivalent to one in which the only connectives are ~ and ^?

1. Define a translation function T on formulas by recursion 2. Prove by induction that for every formula phi, T(phi) is equivalent to phi

Deterministic algorithm method

1. Enumerate every subset of {x1...xn} checking each subset in turn for______. 2. If you find one that satisfies your criteria, stop and answer yes. If you run through all the subsets and none does, stop and answer no

Non-deterministic algorithm

1. Guess a subset of {z1,...,zn} and check whether the numbers/elements in the subset satisfy your criteria 2. Count number of steps and add Ex: Adding the #s in the subset takes at most n steps, assuming adding two numbers counts as 1 step. Then computing 0.5(z1+...+zn) takes n+ 1 steps, one for each addition and one for the last multiplication. Finally, checking whether the sum of the subset is equal to 0.5(z1+...+zn) takes 1 step. So at worst, the non-deterministic algorithm takes n+ (n+ 1) + 1 = 2n+ 2 steps.

1. Define a model M for a syllogistic language consisting of a set of predicates Pred. For each of the proposition forms, describe the conditions for which a proposition φ of that form is true in a model M (which we write as M |= φ). 1. All A are B. 2. Some A are B. 3. No A are B. 4. Not all A are B.

A model is a non-empty set D and a function I that sends each predicate A∈Pred to a subset I(A) of D. Let M=(D,I) be a model. 1. M |= All A are B iff I(A)⊆I(B). 2. M |= Some A are B iff I(A)∩I(B)̸=∅. 3. M |= No A are B iff I(A)∩I(B)=∅. 4. M |= Not all A are B iff I(A)̸⊆I(B).

What is required for a syllogistic argument from premises {φ1, . . . , φn} to a conclusion ψ to be valid? Thus, how can you show an argument is invalid?

An argument from premises {φ1, . . . , φn} to the conclusion ψ is valid just in case for every model M such that M |= φ1,...,φn we have M |= ψ.

How to convert to DNF

Construct a truth table, identify the rows where the truth assignments satisfy the formula, and disjunct its encoding to a DNF: (p^q^r) V (~p^q^r) etc..

Give the definition of a formula in pure monadic predicate logic.

For each variable x and predicate P, P (x) is a formula. For each formula ψ and φ 1. ψ∨φ 2. ψ∧φ 3. ¬ψ 4. ψ → φ 5. ψ ↔ φ 6. ∀xψ 7. ∃xψ

Let our syllogistic language consist of the predicates Pred = {senior, 12A student, UC Berkeley student, Stanford student, undergraduate}. Consider a set of six individuals D = {x1, x2, x3, x4, x5, x6}. Give an extension I (i.e. a function that assigns to each predicate in Pred a subset of D) such that the following statements are true in the model M = (D, I): 1. All 12A students are UC Berkeley students. 2. Not all undergraduates are UC Berkeley students. 3. No undergraduate is a Stanford student. 4. Some seniors are 12A students. 5. Not all 12A students are seniors.

I(senior) = {x1, x2} I(12A student) = {x1, x3, x4} I(UC Berkeley student) = {x1, x2, x3, x4} I(Stanford student) = empty I(undergraduate) = {x1, x2, x3, x4, x5}

An argument is valid iff...

It is impossible for the premises to be true while the conclusion is false (PE: Does the argument make sense?)

A logic system is sound if...

It's impossible to prove something that's not true. Everything that can be proven is true (and valid).

An argument is sound iff...

It's logically valid and all it's premises are actually true.

For each of the following, specify an appropriate domain of discourse,specify a translation key, and translate into predicate logic. (a) Every person wants to be loved by all people who are loved by all people. (B) There is no largest number divisible by 10. (c) There is some cat who is liked by all dogs except the dogs that like no cats.

Let D be the set of people. Let L(x,y) mean x is loved by y. Let W(x,y) mean x wants to be loved by y. ∀x∀y(∀zL(z, y) → W (x, y)) Let D be the set of numbers. Let D(x, y) mean x is divisible by y. Let 10 be a constant standing for the number 10. Let R(x, y) mean x is larger than y. ¬∃x(D(x, 10) ∧ ∀z(D(z, 10) → R(x, z))) Let D be the set of cats and dogs. Let C(x) mean x is a cat and D(x) mean x is a dog. Let L(x, y) mean x likes y. ∃x(C(x) ∧ ∀y(D(y) → (L(y, x) ↔ ∃z(C(z) ∧ L(y, z)))))

Determine whether the following syllogistic argument is valid. 1. All A are B. 2. Not all A are C. -->3. Not all B are C.

Let M = (D,I) be a model that makes both premises true. So I(A) ⊆ I(B) and I(A) ̸⊆ I(C). Thus there's some x ∈ I(A) but x ∈/ I(C). Since I(A) ⊆ I(B), it follows that x ∈ I(B). And so I(B) ̸⊆ I(C) since x∈I(B) but x∈/I(C). --> M |= Not all B are C so the conclusion is true in every model that makes the premises true. Thus the argument is valid.

If φ and ψ are logically equivalent, does it follow that φ and ψ are both satisfiable? Explain.

No

If φ and ψ are both satisfiable, does it follows that φ and ψ are logically equivalent? Explain.

No. Example: φ:=p∨¬p and ψ:=p. A formula φ is satisfiable if there's a valuation V such that V^(φ) = 1. Let V(p) = 1. Then it follows V^(φ) = 1 and V^(ψ) = 1 so both are satisfiable. However, if V(p) = 0 then V^(φ)=1 and 0 =V^(ψ)

How do you prove the fact: it's not the case that every formula is equivalent to one in which the only connectives are ~,v,-> and ^?

Prove by induction that ~p is not equivalent to any formula in which the only connectives are ~,v,-> and ^

Checking validity w/ resolution

Run it on the conjunction of all premises, converted into CNF, in conjuncted together with the negation of the conclusion

Deterministic algorithm that's not polynomial-time explanation

There are 2^n subsets of {z1,...,zn} and hence at least 2^n steps for the algorithm to perform in the worst case that it has to check all subsets before outputting an answer. Since 2^n is not polynomial in n, the algorithm is not a polynomial-time algorithm.

Show how every formula of our language can be translated into an equivalent formula in which the only connective is ↓. (You do not need to give the full inductive proof. Just give the correct translation.)

We know that {¬, ∨} is a truth-functionally complete set of connectives from class, so it suffices to show how to translate formulas containing no connectives except ¬ and ∨ into equivalent formulas containing no connectives except ↓. We define our translation t recursively as follows: • t(p) = p; • t(¬φ) = t(φ) ↓ t(φ); • t(φ∨ψ)=(t(φ)↓t(ψ))↓(t(φ)↓t(ψ)).

If propositional formulas φ and ψ are both tautologies, does it follow that φ and ψ are logically equivalent? Explain.

Yes. Since φ and ψ are tautologies, V^(φ) = 1 and V^ (ψ) = 1 for all valuations V. Two formulas are logically equivalent if V^(φ) =V^(ψ) for all valuations V.

A set of logical connectives is functionally complete iff...

it can express all propositional connectives

A language is expressively complete iff...

it can express the subject matter of the intended formal system ( (in the form of formulas)

Propositional Logic Identities p->q = ____ p<->q = _____ ~(p^q) = ____ p^q = ____

p->q = ~p v q p<->q = (p->q)^(q->p) ~(p^q) = ~p v ~q p^q = ~(p->~q)

how to check for validity

truth table or valuation

For the language of monadic predicate logic with identity and at least two function symbols, the validity problem is _______.

undecidable

Fact: the set {~,^} is a truth-functionally complete set of connectives What are the other sets mentioned in class that are truth-functionally complete?

{~,v}, {~, ->}, sheffer stroke, nor

Sheffer Stroke (NAND)

~(A ^ B) = ~A v ~B Complete set of connectives


Ensembles d'études connexes

MOD 11 EVOLVE PRACTICE QUESTIONS: Chapter 36 Lower Respiratory Disorders

View Set

Anatomy and Physiology Questions

View Set

Health 1-Chapter 14: Immunity and Infection

View Set

CH 55: Assessment of Integumentary Function

View Set

Cellular Energetics APEX (question 15) respiratory material

View Set

CFP 102 Unit 4 Key Terms Life Insurance (Individual)—Part 2

View Set