Logic 1: Basics Flashcards

1
Q

List some examples of the important applications of logic in computer science…

A
  • Formal specifications;
  • Verifying code is correct instead of testing;
  • Programming languages (e.g. Prolog);
  • Databases (e.g. SQL).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Formal methods covers areas such as:

A
  • mathematical specification of software
  • specification of network protocols
  • proof of correctness of implementations
  • derivation of software from specifications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Most logics are extensions
or variations of the two classical logics. Name them…

A

Propositional logic and predicate logic (also called
first-order logic).

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

What is an atomic proposition?

A

A basic statement.

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

How can we build compound propositions?

A

By using atomic propositions.

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

What is a proposition formed by connecting two propositions with the word ‘and’ called?

A

A conjunction.

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

What is a proposition formed by connecting two propositions with the word ‘or’ called?

A

A disjunction.

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

In Propositional logic, do we interpret ‘or’ in (1) the inclusive sense: (meaning either. . . or . . . or both’), or in (2) the exclusive sense: (meaning ‘either . . . or . . . but not both’).

A

We always use ‘or’ in the inclusive sense (meaning either. . . or . . . or both’).

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

Besides (and) conjunction and (or) disjunction, we shall use two other logical connectives which
build a new proposition from two old ones. What are they?

A

Implication (‘if . . . then’), and bi-implication (if and only if’).

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

What is the order of precedence? (highest 1st)

A

Negation, conjunction, disjunction,
implication, bi-implication.

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

When using an implicaiton (if…then), is cause and effect relevant?

A

We must always assume the implication is being used in the
weaker sense; that is, with no attendant notion of cause and effect.

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

How is ‘not A’ abbreviated in propositional logic?

A

¬A

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

How is ‘A and B’ abbreviated in propositional logic?

A

A ∧ B

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

How is ‘A or B’ abbreviated in propositional logic?

A

A ∨ B

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

How is ‘If A then B’ abbreviated in propositional logic?

A

A → B

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

How is ‘A if and only if B’ abbreviated in propositional logic?

17
Q

How would the sentence ‘If he is honest, then I am the Pope’ be represented using abbreviated connectives?

A

‘He is honest → I am the Pope’.

18
Q

Besides
the propositional variables, it is convenient to include two special atomic propositions, referred to as constant propositions. What are they?

A

True and false.

19
Q

What are the two constant propositions?

A

True and false.

20
Q

What are true and false referred to in Propositional logic?

A

Constant propositions.

21
Q

When we translate an English sentence into a propositional logic formula (p → q), which part is the logical connective(s), and which is the propositional variable(s)?

A

the logical
connective is (→) and the propositional variables are (p, q).

22
Q

Translate the following english sentance into a propositional logic formula: ‘If you find a buyer for your house, then pigs will fly’.

23
Q

Why do we use propositional variables?

A

In order to state general properties of propositional variables efficiently, as we are not concerned with the
internal structure of the atomic propositions.

24
Q

What are the following rules that a string of propositional variables and connectives must conform to in order to be a valid propositional formula?

A
  • A propositional variable is a formula
  • true and false are formulae
  • If A is a formula, then so is (¬A)
  • If A and B are formulae, then so are (A ∧ B), (A ∨ B), (A → B) and (A ↔ B)
25
Which of the following formulas are valid: 1. ((p ↔ q) → r) 2. (→ r))
1
26
What are the two rules that allow us to omit/re-apply outermost brackets to/from a formula, whilst still allowing the formulas to be unambiguous.
1. order of precedence 2. right-associative
27
Restore the brackets to the following formula: p ∧ q → r → p
((p ∧ q) → (r → q))
28
In what situation would removing the brackets of a formula make it unreadable?
If applying the two rules used to restore brackets (order of presedence, right-associative) would create a formula different to the one you started with.