PLG 1 Presentation
PLG 1 Presentation
PLG 1 Presentation
ICS 2304
PROGRAMMING PARADIGMS
ASSIGNMENT ONE
As another example we define a relation DIV over the natural numbers but instead of writing
< 𝑥, 𝑦 >∈ 𝐷𝐼𝑉 We simply write 𝑥 𝐷𝐼𝑉𝑦. the defining rules for 𝐷𝐼𝑉 are
𝑛 𝐷𝐼𝑉 𝑘
𝑛 𝐷𝐼𝑉 0 𝑛 𝐷𝐼𝑉 (𝑛+𝑘)
Assignment
1. Explain the rule definition above and explain why we have the first rule.
In this case we are required to prove that x DIV y also considered as our theorem P(x).
In mathematical induction, to prove that P(x) is true for every number, we first prove that
P(x) is true of 0, that is, P (0) (base form). We assume that P(x) is true for P (k)
(induction hypothesis) and prove that P(x) is true for P (k+1) (inductive case). Once we
complete both steps, we have then proved that P(x) is true for every natural number.
Like most proofs, logic proofs usually begin with premises --- statements that you're
allowed to assume. The conclusion is the statement that you need to prove. The idea is to
operate on the premises using rules of inference until you arrive at the conclusion. In the
empty set of premises and a conclusion x, while the latter has n DIV k as its set of
premises and n DIV (n+k) as its conclusion. Basically, if premises then conclusion, that
𝑃𝑅𝐸𝑀𝐼𝑆𝐸𝑆
is, 𝐶𝑂𝑁𝐶𝐿𝑈𝑆𝐼𝑂𝑁 . This explains the defining rules above.
3
𝑘€𝑁
0€𝑁 succ(k) € 𝑁
Key:
N – Natural numbers
succ(k) – Successor of k
The axiom, acts as a base from which further arguments may arise. It states that zero is a
The rule instance, has both a premise and a conclusion. The premise states that the
element k is a member of the set N followed by a conclusion stating that any successor of
k is also a member of the set N. This takes into consideration that if a premise is true then