exercises on calculus and deduction systems
play

Exercises on -calculus and Deduction Systems Akim Demaille - PowerPoint PPT Presentation

Exercises on -calculus and Deduction Systems Akim Demaille akim@lrde.epita.fr EPITA cole Pour lInformatique et les Techniques Avances June 10, 2016 Exercises on -calculus and Deduction Systems 1 -calculus Deduction Systems 2


  1. Exercises on λ -calculus and Deduction Systems Akim Demaille akim@lrde.epita.fr EPITA — École Pour l’Informatique et les Techniques Avancées June 10, 2016

  2. Exercises on λ -calculus and Deduction Systems 1 λ -calculus Deduction Systems 2 A. Demaille Exercises on λ -calculus and Deduction Systems 2 / 27

  3. λ -calculus 1 λ -calculus Untyped λ -calculus Simply Typed λ -calculus 2 Deduction Systems A. Demaille Exercises on λ -calculus and Deduction Systems 3 / 27

  4. Untyped λ -calculus 1 λ -calculus Untyped λ -calculus Simply Typed λ -calculus 2 Deduction Systems A. Demaille Exercises on λ -calculus and Deduction Systems 4 / 27

  5. Substitutions [ λ z · zz / x ] λ y · xy ≡ A. Demaille Exercises on λ -calculus and Deduction Systems 5 / 27

  6. Substitutions [ λ z · zz / x ] λ y · xy λ y · ( λ z · zz ) y ≡ [ yy / z ]( λ xy · zy ) ≡ A. Demaille Exercises on λ -calculus and Deduction Systems 5 / 27

  7. Substitutions [ λ z · zz / x ] λ y · xy λ y · ( λ z · zz ) y ≡ [ yy / z ]( λ xy · zy ) ≡ λ xu · yyu A. Demaille Exercises on λ -calculus and Deduction Systems 5 / 27

  8. β -Reductions ( λ x · xyx ) λ z · z → A. Demaille Exercises on λ -calculus and Deduction Systems 6 / 27

  9. β -Reductions ( λ x · xyx ) λ z · z ( λ z · z ) y ( λ z · z ) → ( λ x · x )(( λ y · y ) x ) → A. Demaille Exercises on λ -calculus and Deduction Systems 6 / 27

  10. β -Reductions ( λ x · xyx ) λ z · z ( λ z · z ) y ( λ z · z ) → ( λ x · x )(( λ y · y ) x ) → ( λ x · x )( x ) ( λ x · x )(( λ y · y ) x ) → A. Demaille Exercises on λ -calculus and Deduction Systems 6 / 27

  11. β -Reductions ( λ x · xyx ) λ z · z ( λ z · z ) y ( λ z · z ) → ( λ x · x )(( λ y · y ) x ) → ( λ x · x )( x ) ( λ x · x )(( λ y · y ) x ) (( λ y · y ) x ) → ∗ ( λ x · x )(( λ y · y ) x ) → A. Demaille Exercises on λ -calculus and Deduction Systems 6 / 27

  12. β -Reductions ( λ x · xyx ) λ z · z ( λ z · z ) y ( λ z · z ) → ( λ x · x )(( λ y · y ) x ) → ( λ x · x )( x ) ( λ x · x )(( λ y · y ) x ) (( λ y · y ) x ) → ∗ ( λ x · x )(( λ y · y ) x ) → x ∗ ( λ x · xx )(( λ x · xx ) y ) → A. Demaille Exercises on λ -calculus and Deduction Systems 6 / 27

  13. β -Reductions ( λ x · xyx ) λ z · z ( λ z · z ) y ( λ z · z ) → ( λ x · x )(( λ y · y ) x ) → ( λ x · x )( x ) ( λ x · x )(( λ y · y ) x ) (( λ y · y ) x ) → ∗ ( λ x · x )(( λ y · y ) x ) → x ∗ ( λ x · xx )(( λ x · xx ) y ) → yy ( yy ) ∗ ( λ x · xx )(( λ x · x ) y ) → A. Demaille Exercises on λ -calculus and Deduction Systems 6 / 27

  14. β -Reductions ( λ x · xyx ) λ z · z ( λ z · z ) y ( λ z · z ) → ( λ x · x )(( λ y · y ) x ) → ( λ x · x )( x ) ( λ x · x )(( λ y · y ) x ) (( λ y · y ) x ) → ∗ ( λ x · x )(( λ y · y ) x ) → x ∗ ( λ x · xx )(( λ x · xx ) y ) → yy ( yy ) ∗ ( λ x · xx )(( λ x · x ) y ) → yy ∗ ( λ x · x )(( λ x · xx ) y ) → A. Demaille Exercises on λ -calculus and Deduction Systems 6 / 27

  15. β -Reductions ( λ x · xyx ) λ z · z ( λ z · z ) y ( λ z · z ) → ( λ x · x )(( λ y · y ) x ) → ( λ x · x )( x ) ( λ x · x )(( λ y · y ) x ) (( λ y · y ) x ) → ∗ ( λ x · x )(( λ y · y ) x ) → x ∗ ( λ x · xx )(( λ x · xx ) y ) → yy ( yy ) ∗ ( λ x · xx )(( λ x · x ) y ) → yy ∗ ( λ x · x )(( λ x · xx ) y ) → yy A. Demaille Exercises on λ -calculus and Deduction Systems 6 / 27

  16. Simply Typed λ -calculus 1 λ -calculus Untyped λ -calculus Simply Typed λ -calculus 2 Deduction Systems A. Demaille Exercises on λ -calculus and Deduction Systems 7 / 27

  17. Simply Typed λ -calculus Type derivations are trees built from the following nodes. M : σ → τ N : σ MN : τ A. Demaille Exercises on λ -calculus and Deduction Systems 8 / 27

  18. Simply Typed λ -calculus Type derivations are trees built from the following nodes. x : σ · M : σ → τ N : σ · · M : τ MN : τ A. Demaille Exercises on λ -calculus and Deduction Systems 8 / 27

  19. Simply Typed λ -calculus Type derivations are trees built from the following nodes. [ x : σ ] · M : σ → τ N : σ · · M : τ MN : τ λ x · M : σ → τ A. Demaille Exercises on λ -calculus and Deduction Systems 8 / 27

  20. Type Statements Type λ fx · f ( fx ) A. Demaille Exercises on λ -calculus and Deduction Systems 9 / 27

  21. Type Statements Type λ fx · f ( fx ) ⊢ λ fx · f ( fx ) : ( σ → σ ) → σ → σ A. Demaille Exercises on λ -calculus and Deduction Systems 9 / 27

  22. Type Statements Type λ fx · f ( fx ) ⊢ λ fx · f ( fx ) : ( σ → σ ) → σ → σ [ f : σ → σ ] ( 2 ) [ x : σ ] ( 1 ) [ f : σ → σ ] ( 2 ) fx : σ f ( fx ) : σ ( 1 ) λ x · f ( fx ) : σ → σ ( 2 ) λ fx · f ( fx ) : ( σ → σ ) → σ → σ A. Demaille Exercises on λ -calculus and Deduction Systems 9 / 27

  23. Type Statements Type λ xy · x A. Demaille Exercises on λ -calculus and Deduction Systems 10 / 27

  24. Type Statements Type λ xy · x ⊢ λ xy · x : σ → τ → σ A. Demaille Exercises on λ -calculus and Deduction Systems 10 / 27

  25. Type Statements Type λ xy · x ⊢ λ xy · x : σ → τ → σ [ x : σ ] ( 1 ) λ y · x : τ → σ ( 1 ) λ xy · x : σ → τ → σ A. Demaille Exercises on λ -calculus and Deduction Systems 10 / 27

  26. Deduction Systems 1 λ -calculus 2 Deduction Systems Natural Deduction Sequent Calculus A. Demaille Exercises on λ -calculus and Deduction Systems 11 / 27

  27. Natural Deduction 1 λ -calculus 2 Deduction Systems Natural Deduction Sequent Calculus A. Demaille Exercises on λ -calculus and Deduction Systems 12 / 27

  28. Intuitionistic Natural Deduction [ A ] · · A A ⇒ B ⊥ · ¬ A := A ⇒ ⊥ ⇒E ⊥E B B A ⇒I A ⇒ B A B A ∧ B A ∧ B ∧I ∧ l E ∧ r E A ∧ B A B [ A ] [ B ] · · A B · · · · ∨ l I ∨ r I A ∨ B C C A ∨ B A ∨ B ∨E C A. Demaille Exercises on λ -calculus and Deduction Systems 13 / 27

  29. Prove A ∧ B ⇒ B ∧ A A. Demaille Exercises on λ -calculus and Deduction Systems 14 / 27

  30. Prove A ∧ B ⇒ B ∧ A [ A ∧ B ] 1 [ A ∧ B ] 1 ∧ r E ∧ l E B A ∧I B ∧ A ⇒I 1 A ∧ B ⇒ B ∧ A A. Demaille Exercises on λ -calculus and Deduction Systems 14 / 27

  31. Prove A ∧ ( B ∨ C ) ⊢ ( A ∧ B ) ∨ ( A ∧ C ) A. Demaille Exercises on λ -calculus and Deduction Systems 15 / 27

  32. Prove A ∧ ( B ∨ C ) ⊢ ( A ∧ B ) ∨ ( A ∧ C ) A ∧ ( B ∨ C ) A ∧ ( B ∨ C ) ∧ l E ∧ l E [ B ] 1 [ C ] 1 A A ∧I ∧I A ∧ ( B ∨ C ) A ∧ B A ∧ C ∧ r E ∨ l I ∨ r I B ∨ C ( A ∧ B ) ∨ ( A ∧ C ) ( A ∧ B ) ∨ ( A ∧ C ) ∨E 1 ( A ∧ B ) ∨ ( A ∧ C ) A. Demaille Exercises on λ -calculus and Deduction Systems 15 / 27

  33. Prove ( A ⇒ A ) ⇒ A ⇒ A (LOFO-2005) Remember, ⇒ is right-associative. A. Demaille Exercises on λ -calculus and Deduction Systems 16 / 27

  34. Prove ( A ⇒ A ) ⇒ A ⇒ A (LOFO-2005) Remember, ⇒ is right-associative. [ A ] 2 [ A ⇒ A ] 1 ⇒E A ⇒I 2 A ⇒ A ⇒I 1 ( A ⇒ A ) ⇒ A ⇒ A A. Demaille Exercises on λ -calculus and Deduction Systems 16 / 27

  35. Prove ( A ⇒ A ) ⇒ A ⇒ A (LOFO-2005) Remember, ⇒ is right-associative. [ A ] 2 [ A ⇒ A ] 1 [ A ] 1 ⇒E A ⇒I 1 ⇒I 2 A ⇒ A A ⇒ A ⇒I ⇒I 1 ( A ⇒ A ) ⇒ A ⇒ A ( A ⇒ A ) ⇒ A ⇒ A A. Demaille Exercises on λ -calculus and Deduction Systems 16 / 27

  36. Prove ( A ⇒ A ) ⇒ A ⇒ A (LOFO-2005) Remember, ⇒ is right-associative. [ A ] 2 [ A ⇒ A ] 1 [ A ] 1 ⇒E A ⇒I 1 ⇒I 2 A ⇒ A A ⇒ A ⇒I ⇒I 1 ( A ⇒ A ) ⇒ A ⇒ A ( A ⇒ A ) ⇒ A ⇒ A [ A ⇒ A ] 1 ⇒I 1 ( A ⇒ A ) ⇒ A ⇒ A A. Demaille Exercises on λ -calculus and Deduction Systems 16 / 27

  37. Prove A ⇒ B , B ⇒ C ⊢ A ⇒ ( B ∧ C ) (LOFO-2005) A. Demaille Exercises on λ -calculus and Deduction Systems 17 / 27

  38. Prove A ⇒ B , B ⇒ C ⊢ A ⇒ ( B ∧ C ) (LOFO-2005) [ A ] 1 A ⇒ B ⇒E [ A ] 1 A ⇒ B B B ⇒ C ⇒E ⇒E B C ∧I B ∧ C ⇒I 1 A ⇒ ( B ∧ C ) A. Demaille Exercises on λ -calculus and Deduction Systems 17 / 27

  39. Prove A ∨ B , ¬ B ⊢ A (Intuitionistic) (LOFO-2005) A. Demaille Exercises on λ -calculus and Deduction Systems 18 / 27

  40. Prove A ∨ B , ¬ B ⊢ A (Intuitionistic) (LOFO-2005) Recall that ¬ B := B ⇒ ⊥ . A. Demaille Exercises on λ -calculus and Deduction Systems 18 / 27

  41. Prove A ∨ B , ¬ B ⊢ A (Intuitionistic) (LOFO-2005) Recall that ¬ B := B ⇒ ⊥ . [ B ] 1 B ⇒ ⊥ ⇒E ⊥ ⊥E [ A ] 1 A ∨ B A ∨E 1 A A. Demaille Exercises on λ -calculus and Deduction Systems 18 / 27

  42. Sequent Calculus 1 λ -calculus 2 Deduction Systems Natural Deduction Sequent Calculus A. Demaille Exercises on λ -calculus and Deduction Systems 19 / 27

Recommend


More recommend