logic Flashcards

1
Q

what is a BNF (Backus Naur Form) and terminal and non-terminal symbols?

A

BNF looks like this:
lhs ::= rhs₁ |. . .| rhsₙ
where the lhs is a non-terminal symbol (expands into a rhs) and each rhs is either a terminal or non-terminal symbol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what does arity and fixity of a terminal symbol mean?

A

arity: how many arguments thee symbol takes
fixity: where the symbol is placed in relation to the arguments. either prefix, infix or postfix meaning before, between and after the symbols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is a metavariable/ schematic variable?

A

a non-terminal symbol that can be used for general rules but represents an unknown value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is an axiom schemata?

A

a general rule that is accepted for all values of a schematic variable such as:
exp+0=exp. this rule with any value for exp is an axiom but as it is true for any exp, it is an axiom schemata

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what is the notation for substituting values into an equation?

A

(eq)[exp1\val1,exp2\val2,…]
example:
(exp+0=exp)[exp\1] outputs 1+0=1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

what is propositional logic?

A

a symbolic logic FORMAL LANGUAGE made of atomic propositions (true/ false propositions) and logical connectives(and, or, not, implication). syntax is
P ::= a | P ^P | P ∨P | P → P | ¬P with two special atoms (⊤,⊥)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is the scope of a connective and main connective of the formula?

A

scope of a connective: the connective and what it connects
main connective: the connective whose scope is the whole formula

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are the 8 (10) inference rules of constructive natural deduction for propositional logic?

A

check here
https://canvas.bham.ac.uk/courses/65481/files/13872848?wrap=1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is the notation for saying that assuming conditions, something is true?

A

condition1, condition2, … , ⊢ proven statement
example:
P, P→Q ⊢ Q

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is constructive/ intuitionistic and classical natural deduction?

A

both are proof theories that together with propositional logic (the formal language) make up a formal proof. they are both a collection of inference rules such as and-implication, negation-elimination etc. classical ND uses
double negation elimination (DNE): ¬¬A ⊢ A
law of excluded middle (LEM): ⊢ A∨¬A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

how do semantics work in propositional logic?

A

semantics means giving meaning to variables with the syntax φ(A) = T, φ(B) = F

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is conjunctive/ disjunctive normal form?

A

CNF: formulas in the form (P∨P∨…)^(P∨P∨…)^…
DNF: formulas in the form (P^P^…)∨(P^P^…)∨…
where P is a literal meaning an atom or a negation of an atom
every proposition can be expressed in either form rearranging using proven equivalences

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what does valid, unsatisfiable, satisfiable, falsifiable and provable mean?

A

A is valid if φ(A) = T for all possible valuations φ of atoms in A.
A is unsatisfiable if φ(A) = F for all possible valuations φ of atoms in A.
A is satisfiable if there exists a valuation φ on atomic propositions such that φ(A) = T.
A is falsifiable if there exists a valuation φ on atomic propositions such that φ(A) = F.
provable: a formula can be proven with the natural deduction system. written like ⊢A

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how would you write that a formula is provable/ valid given premises?

A

provable: P₁, P₂, … , Pₙ ⊢ C meaning that the conclusion is always T for
(semantically) valid: P₁, P₂, … , Pₙ ⊨ C meaning that if all the premises are true, the conclusion is too. can always be proven using truth tables
with no premises: ⊢A and ⊨B

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what does soundness and completeness of a deduction system w.r.t a semantics system mean?

A

soundness: if ⊢A then ⊨A (if a formula is provable, it is valid)
completeness: if ⊨A then ⊢A (if a formula is valid, it is provable)
natural deduction is both sound and complete w.r.t truth table semantics

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how do you turn a proposition into DNF or CNF?

A

put proposition into a truth table
DNF: string together with an OR the clauses that make up every row where the conclusion is T
CNF: do the same as DNF but where the rows are F and string together the negation of the clauses with AND. then rearrange the formula with De Morgan’s law.

17
Q

what does N and NP mean

A

N is the class of problems that are solvable in polynomial time
NP is the class of problems that can be verified in polynomial time
N⊆NP

18
Q

what is SAT?

A

SAT is CNF satisfiability which is in NP

19
Q

what is the DPLL algorithm that is used in most SAT solvers?

A

sets an atom to either T or F. if T, remove all clauses containing the atom and remove all instances of the negation of the atom from remaining clauses. if F, remove all clauses containing the negation of the atom and remove all instances of the atom from remaining clauses. keep doing this until all clauses are gone (solvable). if a clause remains that is empty, backtrack and change the value of the last atom. if all combinations are tried, it is unsolvable.

20
Q

what is the precedence and associativity of the propositional logic symbols?

A

precedence (most to least): ¬, ^, ∨, →
associativity: all are right associative i.e. A^B^C = A^(B^C)

21
Q

what is included in predicate logic?

A

a type of symbolic logic that includes predicate logic but also has:
a domain: a non-empty set of objects to reason about such as N
variables: such as x,y,z that represent yet unknown members of the domain
predicates: true/false statement about objects such as even may be p(x)
quantifiers: universal quantifier ∀x. (for all x in the domain), existential quantifier ∃x. (there exists an x such that). quantifiers have highest precedence
functions: f(x,y,…) that output another object in the domain such as adding them
constants: arity 0 functions that output one object such as ‘a’ may be 0

22
Q

what is the scope of a quantifier?

A

the scope is the range where the quantifier acts over which in the case of predicate logic is everything to the right of the quantifier

23
Q

what are the 4 additional rules of predicate logic involving the quantifiers?

A

check here
https://canvas.bham.ac.uk/courses/65481/pages/week-9-materials-3?module_item_id=2858488

24
Q

what is the notation for substituting variables in a proposition?

A

P[x\y] substitutes all occurrences of x in the proposition P with y

25
Q

how do we write a predicate (relation) and function of arity n on domain D in predicate logic?

A

Rₚ ⊆ Dⁿ
Ff ∈ Dⁿ→D

26
Q

what is an example of a signature, model and a variable valuation?

A

signature: «zero, succ, add>,<even, odd»
model assigns meaning (semantics):{<0>,<2>,<4>,…}<N,«0, <n>→n+1, <n,m>→n+m>,<{n|even},{n|odd}>>>
variable valuation: x₁ → d₁, x₂ → d₂,...</n>

27
Q

what is the notation for assigning meaning to terms and formulas w.r.t the domain D,
the model M and the variable valuation v?

A

[[t]]ᵥᴹ takes a term from the signature and outputs the respective term in the model or takes a variable and returns its meaning
⊨ M,v,P outputs the predicate with all terms given meaning

28
Q

how do you give meaning to each type of formula in predicate logic?
example: ⊨ M,v P→Q iff ⊨ M,v Q whenever ⊨ M,v P

A

check here page 15:
https://canvas.bham.ac.uk/courses/65481/pages/week-9-materials-3?module_item_id=2858488

29
Q

what does it mean for a formula in predicate logic to be:
true
satisfiable
valid

A

true: P is true in the model M if ⊨M P
satisfiable: P is satisfiable if there exists a model that makes P true
valid: P is valid if it is true for all models M

30
Q

what are the three rules that introduce a new hypothesis?

A

implication introduction, negation introduction, existential quantifier elimination