What is soundness?
What is completeness?
What is a tautology?
What is consistency?
What is a sequent?
P1, P2, …, Pn ⊢ P
- using assumptions P1 -> Pn we can prove P.
- ⊢ is syntactic entailment
What is ⊢?
What is an assumption rule?
From {P}, we can prove P. This does not mean P -> P
What is and ∧ introduction?
What is Modus Ponens?
What is → introduction?
What is ¬ Negation?
What is False (⊥)?
What is True (⊤)?
What is Law of Excluded Middle?
What is Semantic Entailment?
What is enumerability?
What is decidability?
Define the theorem for type soundness.
If ⊢ e : τ and e →* e′ and e′ cannot step further, then e′ is a value and ⊢ e′ : τ.
Progress + Preservation = Type Soundness.
This guarantees: Well‑typed programs don’t go wrong.
In other words, typing rules are a safety net: if the type checker accepts a program, it won’t crash due to type errors at runtime.
Define the preservation lemma.
If ⊢ e: τ and e → e′ then ⊢ e′: τ .
What is →*?
→ is one step, →* is zero or more steps
Every expression has type. How do we write this in haskell?
expression :: type
State the property of subject reduction and explain why it’s a key correctness property for type systems.
Subject reduction (type preservation) means that if a term is well‑typed and it evaluates to another term, the resulting term has the same type. This ensures types remain consistent during execution and is a key part of type soundness, guaranteeing that well‑typed programs don’t produce type errors at runtime.
Describe how a type checker for a dependently typed language uses the conversion rule.
Idea: Types can depend on terms, so equality up to computation matters.
Rule: If Γ⊢𝑡:𝑇 and 𝑇≡𝑇′ (definitional equality via β/η/δ-reduction), then
Γ⊢𝑡:𝑇′.
Use: The checker normalizes or compares types for convertibility to accept terms when their types reduce to the same canonical form.
Reduce the following terms to normal form using beta reduction. Show the reduction steps for each.
(i) (λx.x)(yz)
(ii) (λx.xy)(λz.z)
(iii) (λx.λy.xy)
(iv) (λx.λy.yx)
(i)
(𝜆𝑥. 𝑥)(𝑦𝑧)
Step: Apply β: substitute
𝑥:=𝑦𝑧.
Result:
𝑦𝑧.(𝜆𝑥. 𝑥)(𝑦𝑧) →𝛽 𝑦𝑧
(ii)
(𝜆𝑥. 𝑥𝑦)(𝜆𝑧. 𝑧)
Step 1: Apply β: substitute
𝑥:=𝜆𝑧. 𝑧.
Step 2: No more redexes (free 𝑦).
Result:
(𝜆𝑧. 𝑧) 𝑦.(𝜆𝑥. 𝑥𝑦)(𝜆𝑧. 𝑧) →𝛽 (𝜆𝑧. 𝑧) 𝑦
(iii)
(𝜆𝑥. 𝜆𝑦. 𝑥𝑦)
Observation: Already an abstraction; no application.
Result:
𝜆𝑥. 𝜆𝑦. 𝑥𝑦 (normal form).
(iv)
(𝜆𝑥. 𝜆𝑦. 𝑦𝑥)
Observation: Already an abstraction; no application.
Result:
𝜆𝑥. 𝜆𝑦. 𝑦𝑥 (normal form).