Non-Idempotent Typing Operators, beyond the λ-calculus

Size: px
Start display at page:

Download "Non-Idempotent Typing Operators, beyond the λ-calculus"

Transcription

1 Non-Idempotent Typing Operators, beyond the λ-calculus Soutenance de thèse Pierre VIAL IRIF (Univ. Paris Diderot and CNRS) December 7, 2017 Non-idempotent typing operators P. Vial 0 1 /46

2 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") Non-idempotent typing operators P. Vial 1 Presentation 2 /46

3 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = 1 Non-idempotent typing operators P. Vial 1 Presentation 2 /46

4 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = 2 Non-idempotent typing operators P. Vial 1 Presentation 2 /46

5 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = 3 Non-idempotent typing operators P. Vial 1 Presentation 2 /46

6 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = 4 Non-idempotent typing operators P. Vial 1 Presentation 2 /46

7 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x =... Non-idempotent typing operators P. Vial 1 Presentation 2 /46

8 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = 100 Non-idempotent typing operators P. Vial 1 Presentation 2 /46

9 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x =... Non-idempotent typing operators P. Vial 1 Presentation 2 /46

10 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = Non-idempotent typing operators P. Vial 1 Presentation 2 /46

11 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = The core of this thesis Termination or productivity (via source codes) Paths to terminal states. For that, using types (data descriptors). Non-idempotent typing operators P. Vial 1 Presentation 2 /46

12 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = The core of this thesis Termination or productivity (via source codes) Paths to terminal states. For that, using types (data descriptors). Productivity: O. S. 2, 3, 5, 7,... (primes) Non-idempotent typing operators P. Vial 1 Presentation 2 /46

13 Certification and logic in computer science x = 1 while (x > 0): x = x + 1 transfer( $, calyon, my-account) print("i m rich now") x = The core of this thesis Termination or productivity (via source codes) Paths to terminal states. For that, using types (data descriptors). Productivity: O. S. 2, 3, 5, 7,... (primes) Backtracking: Classical logic. Non-idempotent typing operators P. Vial 1 Presentation 2 /46

14 Formal logic (valar morghulis) All men are mortal. Socrates is a man. Therefore, Socrates is mortal. on-idempotent typing operators P. Vial 1 Presentation 3 /46

15 Formal logic (valar morghulis) All men are mortal. Socrates is a man. Therefore, Socrates is mortal. All ringtus are delgo. Vinkri is a ringtu. Therefore, Vinkri is delgo. on-idempotent typing operators P. Vial 1 Presentation 3 /46

16 Formal logic (valar morghulis) All men are mortal. Socrates is a man. Therefore, Socrates is mortal. All ringtus are delgo. Vinkri is a ringtu. Therefore, Vinkri is delgo. on-idempotent typing operators P. Vial 1 Presentation 3 /46

17 Formal logic (valar morghulis) All men are mortal. Socrates is a man. Therefore, Socrates is mortal. All ringtus are delgo. Vinkri is a ringtu. Therefore, Vinkri is delgo. x, H (x) M (x) H (S) M (S) M (S) H (S) on-idempotent typing operators P. Vial 1 Presentation 3 /46

18 Formal logic (valar morghulis) All men are mortal. Socrates is a man. Therefore, Socrates is mortal. All ringtus are delgo. Vinkri is a ringtu. Therefore, Vinkri is delgo. x, H (x) M (x) H (S) M (S) M (S) H (S) on-idempotent typing operators P. Vial 1 Presentation 3 /46

19 Formal logic (valar morghulis) All men are mortal. Socrates is a man. Therefore, Socrates is mortal. All ringtus are delgo. Vinkri is a ringtu. Therefore, Vinkri is delgo. x, H (x) M (x) H (S) M (S) M (S) H (S) on-idempotent typing operators P. Vial 1 Presentation 3 /46

20 Formal logic (valar morghulis) All men are mortal. Socrates is a man. Therefore, Socrates is mortal. All ringtus are delgo. Vinkri is a ringtu. Therefore, Vinkri is delgo. x, H (x) M (x) H (S) M (S) M (S) H (S) on-idempotent typing operators P. Vial 1 Presentation 3 /46

21 Formal logic (valar morghulis) All men are mortal. Socrates is a man. Therefore, Socrates is mortal. All ringtus are delgo. Vinkri is a ringtu. Therefore, Vinkri is delgo. x, H (x) M (x) H (S) M (S) M (S) H (S) Formalization Reduce semantic (= meaning) to mechanical/grammatical/syntactic rules. on-idempotent typing operators P. Vial 1 Presentation 3 /46

22 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Non-idempotent typing operators P. Vial 1 Presentation 4 /46

23 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Gödel, 1931: unprovable statements Non-idempotent typing operators P. Vial 1 Presentation 4 /46

24 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Gödel, 1931: unprovable statements Provable True Non-idempotent typing operators P. Vial 1 Presentation 4 /46

25 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Gödel, 1931: unprovable statements Provable True primitive recursive functions (poor) Non-idempotent typing operators P. Vial 1 Presentation 4 /46

26 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Gödel, 1931: unprovable statements Provable True primitive recursive functions (poor) Can computation save mathematics? Non-idempotent typing operators P. Vial 1 Presentation 4 /46

27 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Gödel, 1931: unprovable statements primitive recursive functions (poor) Provable True Can computation save mathematics? What is an algo.? What is effectively computable? Non-idempotent typing operators P. Vial 1 Presentation 4 /46

28 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Gödel, 1931: unprovable statements primitive recursive functions (poor) Provable True Can computation save mathematics? What is an algo.? What is effectively computable? Turing machines (1936) TM are universal f effectively computable iff f implementable in a TM A prog. language L is Turing-complete if L has the same computational power as TMs. Non-idempotent typing operators P. Vial 1 Presentation 4 /46

29 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Non-idempotent typing operators P. Vial 1 Presentation 4 /46

30 Turing and computability Entscheidung (1928): given a symbolic statement, is there an algorithmic procedure to decide whether it is true or not? Theorem (Turing, 1936) The Entscheidungsproblem has a negative answer The halting problem is undecidable: there does not exist a general method deciding whether any program terminates or not. Non-idempotent typing operators P. Vial 1 Presentation 4 /46

31 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Non-idempotent typing operators P. Vial 1 Presentation 5 /46

32 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Example (implementing natural numbers) O : zero S : successor Thus: S O 1 S S O 2 S S S S S O 5. Non-idempotent typing operators P. Vial 1 Presentation 5 /46

33 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Example (implementing natural numbers) O : zero S : successor Thus: S O 1 S S O 2 S S S S S O 5. Addition n + O n (terminal case) n + S m S n + m (inductive case) Non-idempotent typing operators P. Vial 1 Presentation 5 /46

34 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Example (implementing natural numbers) O : zero S : successor Thus: S O 1 S S O 2 S S S S S O 5. Addition n + O n (terminal case) n + S m S n + m (inductive case) Non-idempotent typing operators P. Vial 1 Presentation 5 /46

35 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Example (implementing natural numbers) O : zero S : successor Thus: S O 1 S S O 2 S S S S S O 5. Addition n + O n (terminal case) n + S m S n + m (inductive case) S S S O + S S O S S S S O + S O S S S S S O + O S S S S S O Non-idempotent typing operators P. Vial 1 Presentation 5 /46

36 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Example (implementing natural numbers) O : zero S : successor Thus: S O 1 S S O 2 S S S S S O 5. Addition n + O n (terminal case) n + S m S n + m (inductive case) S S S O + S S O S S S S O + S O S S S S S O + O S S S S S O Non-idempotent typing operators P. Vial 1 Presentation 5 /46

37 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Example (implementing natural numbers) O : zero S : successor Thus: S O 1 S S O 2 S S S S S O 5. Addition n + O n (terminal case) n + S m S n + m (inductive case) S S S O + S S O S S S S O + S O S S S S S O + O S S S S S O Non-idempotent typing operators P. Vial 1 Presentation 5 /46

38 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Example (implementing natural numbers) O : zero S : successor Thus: S O 1 S S O 2 S S S S S O 5. Addition n + O n (terminal case) n + S m S n + m (inductive case) S S S O + S S O S S S S O + S O S S S S S O + O S S S S S O Non-idempotent typing operators P. Vial 1 Presentation 5 /46

39 Computation as rewriting The λ-calculus One primitive. Functional paradigm. Turing complete. Allows to emulate many rewriting systems e.g.: Example (implementing natural numbers) O : zero S : successor Thus: S O 1 S S O 2 S S S S S O 5. Addition n + O n (terminal case) n + S m S n + m (inductive case) S S S O + S S O S S S S O + S O S S S S S O + O S S S S S O Most structures (tabs, strings, pair of integers) can be implemented in this fashion or in the λ-calculus. Non-idempotent typing operators P. Vial 1 Presentation 5 /46

40 λ-calcul (Church, 1928) Term construction (inductive grammar) t t u x x Variable λx λx.t Abstraction t u Application Non-idempotent typing operators P. Vial 1 Presentation 6 /46

41 λ-calcul (Church, 1928) Term construction (inductive grammar) t t u x λx x y x Variable λx.t Abstraction t u Application x λy Example: x(λy.x y) Non-idempotent typing operators P. Vial 1 Presentation 6 /46

42 λ-calcul (Church, 1928) Term construction (inductive grammar) t t u x x Variable λx λx.t Abstraction t u Application Redex (reducible expression): computation via substitution producing a reduct Non-idempotent typing operators P. Vial 1 Presentation 6 /46

43 λ-calcul (Church, 1928) Redex: (λx.r)s Term construction (inductive grammar) t t u r x λx x Variable λx.t Abstraction t u Application λx s Redex (reducible expression): computation via substitution producing a reduct Non-idempotent typing operators P. Vial 1 Presentation 6 /46

44 λ-calcul (Church, 1928) Redex: (λx.r)s Term construction (inductive grammar) t t u x r x λx x x x Variable λx.t Abstraction t u Application λx s Redex (reducible expression): computation via substitution producing a reduct Non-idempotent typing operators P. Vial 1 Presentation 6 /46

45 λ-calcul (Church, 1928) Term construction (inductive grammar) t t u x r x λx x x x Variable λx.t Abstraction t u Application λx s Redex (reducible expression): computation via substitution producing a reduct Non-idempotent typing operators P. Vial 1 Presentation 6 /46

46 λ-calcul (Church, 1928) Reduct: r[s/x] Term construction (inductive grammar) t t u s s r s x x Variable λx λx.t Abstraction t u Application Redex (reducible expression): computation via substitution producing a reduct Non-idempotent typing operators P. Vial 1 Presentation 6 /46

47 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. on-idempotent typing operators P. Vial 1 Presentation 7 /46

48 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: autoapp(f) f(f) on-idempotent typing operators P. Vial 1 Presentation 7 /46

49 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: autoapp(f) f(f) on-idempotent typing operators P. Vial 1 Presentation 7 /46

50 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: Auto-autoapplication: autoapp(autoapp) autoapp(f) f(f) Non-idempotent typing operators P. Vial 1 Presentation 7 /46

51 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: Auto-autoapplication: autoapp(f) f(f) autoapp(autoapp) autoapp(autoapp) Non-idempotent typing operators P. Vial 1 Presentation 7 /46

52 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: Auto-autoapplication: autoapp(f) f(f) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) Non-idempotent typing operators P. Vial 1 Presentation 7 /46

53 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: Auto-autoapplication: autoapp(f) f(f) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) Non-idempotent typing operators P. Vial 1 Presentation 7 /46

54 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: Auto-autoapplication: autoapp(f) f(f) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) Non-idempotent typing operators P. Vial 1 Presentation 7 /46

55 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: Auto-autoapplication: Remember autoapp(f) f(f) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) Some programs that do not terminate are still meaningful: the streams. Keep on producing terminated values. Example: The program printing 2, 3, 5, 7, 11, (the list of primes). Non-idempotent typing operators P. Vial 1 Presentation 7 /46

56 Higher-order functions and their (possible) dangers Let app 2 (f, x) := f(f(x)). app 2 takes a function f as an argument. app 2 is a higher-order function. Autoapplication is defined by: Auto-autoapplication: Remember autoapp(f) f(f) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) autoapp(autoapp) Some programs that do not terminate are still meaningful: the streams. Keep on producing terminated values. Example: The program printing 2, 3, 5, 7, 11, (the list of primes). Contribution: characterizing productive streams. Non-idempotent typing operators P. Vial 1 Presentation 7 /46

57 Terminal states and execution/reduction strategies }{{} }{{} 17 Reducible (non-terminal) states Terminal state Non-idempotent typing operators P. Vial 1 Presentation 8 /46

58 Terminal states and execution/reduction strategies }{{} }{{} 17 Reducible (non-terminal) states Terminal state Let f(x) = x x x. What is the value of f(3 + 4)? on-idempotent typing operators P. Vial 1 Presentation 8 /46

59 Terminal states and execution/reduction strategies }{{} }{{} 17 Reducible (non-terminal) states Terminal state Let f(x) = x x x. What is the value of f(3 + 4)? Kim (smart) f(3 + 4) f(7) Lee (not so) f(3 + 4) (3 + 4) (3 + 4) (3 + 4) 7 (3 + 4) (3 + 4) 7 7 (3 + 4) Thurston (don t be Thurston) f(3 + 4) (3 + 4) (3 + 4) (3 + 4) 3 (3 + 4) (3 + 4) + 4 (3 + 4) (3 + 4) dozens of computation steps Non-idempotent typing operators P. Vial 1 Presentation 8 /46

60 Terminal states and execution/reduction strategies }{{} }{{} 17 Reducible (non-terminal) states Terminal state Non-idempotent typing operators P. Vial 1 Presentation 8 /46

61 Terminal states and execution/reduction strategies Non-idempotent typing operators P. Vial 1 Presentation 8 /46

62 Terminal states and execution/reduction strategies Initial state Terminal state Infinite path (keeps running, never reaches the terminal state) on-idempotent typing operators P. Vial 1 Presentation 8 /46

63 Terminal states and execution/reduction strategies Reduction strategy Initial state Terminal state Infinite path (keeps running, never reaches the terminal state) Reduction strategy Choice of a reduction path. Can be complete Must be certified. on-idempotent typing operators P. Vial 1 Presentation 8 /46

64 Types Principle Types = data descriptors, following a grammar. Types provide certifications of correction. Non-idempotent typing operators P. Vial 1 Presentation 9 /46

65 Types Principle Types = data descriptors, following a grammar. Types provide certifications of correction. Primitive types: 5: int (integer) Leopard : String (string of characters) Non-idempotent typing operators P. Vial 1 Presentation 9 /46

66 Types Principle Types = data descriptors, following a grammar. Types provide certifications of correction. Primitive types: 5: int (integer) Leopard : String (string of characters) Compound types: length : String int (function) Non-idempotent typing operators P. Vial 1 Presentation 9 /46

67 Types Principle Types = data descriptors, following a grammar. Types provide certifications of correction. Non-idempotent typing operators P. Vial 1 Presentation 9 /46

68 Types Principle Types = data descriptors, following a grammar. Types provide certifications of correction. Example Let toletters : int String be the program: toletters(2) = two toletters(10) = ten Non-idempotent typing operators P. Vial 1 Presentation 9 /46

69 Types Principle Types = data descriptors, following a grammar. Types provide certifications of correction. Example Let toletters : int String be the program: toletters(2) = two toletters(10) = ten toletters(5) toletters( Leopard ) Non-idempotent typing operators P. Vial 1 Presentation 9 /46

70 Types Principle Types = data descriptors, following a grammar. Types provide certifications of correction. Example Let toletters : int String be the program: toletters(2) = two toletters(10) = ten toletters(5) toletters( Leopard ) Correct! Returns five Incorrect! The arg. Leopard is not an int. Non-idempotent typing operators P. Vial 1 Presentation 9 /46

71 Types toletters(5) Correct! Returns five toletters( Leopard ) Incorrect! The arg. Leopard is not an int. Non-idempotent typing operators P. Vial 1 Presentation 9 /46

72 Types toletters : int String toletters(5) : String Typing certificate 5 : int toletters(5) Correct! Returns five toletters( Leopard ) Incorrect! The arg. Leopard is not an int. Non-idempotent typing operators P. Vial 1 Presentation 9 /46

73 Types toletters : int String toletters(5) : String 5 : int A B B A Typing certificate Proof toletters(5) Correct! Returns five toletters( Leopard ) Incorrect! The arg. Leopard is not an int. Non-idempotent typing operators P. Vial 1 Presentation 9 /46

74 Types int String String int A B B A Typing certificate Proof toletters(5) Correct! Returns five toletters( Leopard ) Incorrect! The arg. Leopard is not an int. Non-idempotent typing operators P. Vial 1 Presentation 9 /46

75 Types toletters : int String toletters(5) : String 5 : int A B B A Typing certificate Proof This analogy goes further! Non-idempotent typing operators P. Vial 1 Presentation 9 /46

76 Types int String String int A B B A Typing certificate Proof This analogy goes further! Curry-Howard correspondence! Non-idempotent typing operators P. Vial 1 Presentation 9 /46

77 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Logic Formula Proof Cut-Elimination Step Termination toletters : int String toletters(5) : String 5 : int A B B A Non-idempotent typing operators P. Vial 1 Presentation 10 /46

78 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Logic Formula Proof Cut-Elimination Step Termination Simple types Non-idempotent typing operators P. Vial 1 Presentation 10 /46

79 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Logic Formula Proof Cut-Elimination Step Termination Simple types Harness higher-order comput. in a limited way. Many progs. in terminal state not typable. Non-idempotent typing operators P. Vial 1 Presentation 10 /46

80 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Logic Formula Proof Cut-Elimination Step Termination Simple types Harness higher-order comput. in a limited way. Many progs. in terminal state not typable. extensions Polymorphic Types Intersection Types Non-idempotent typing operators P. Vial 1 Presentation 10 /46

81 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Logic Formula Proof Cut-Elimination Step Termination Simple types Harness higher-order comput. in a limited way. Many progs. in terminal state not typable. extensions Polymorphic Types Intersection Types Non-idempotent typing operators P. Vial 1 Presentation 10 /46

82 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Simple types Logic Formula Proof Cut-Elimination Step Termination λ-calculus Harness higher-order comput. in a limited way. Many progs. in terminal state not typable. extensions Polymorphic Types Intersection Types Non-idempotent typing operators P. Vial 1 Presentation 10 /46

83 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Simple types Logic Formula Proof Cut-Elimination Step Termination λ-calculus Harness higher-order comput. in a limited way. Many progs. in terminal state not typable. Does not capture classical logic extensions Polymorphic Types Intersection Types Non-idempotent typing operators P. Vial 1 Presentation 10 /46

84 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Simple types Logic Formula Proof Cut-Elimination Step Termination λ-calculus Harness higher-order comput. in a limited way. Many progs. in terminal state not typable. extensions Does not capture classical logic Get classical logic with call cc (Griffin, 90) Polymorphic Types Intersection Types Non-idempotent typing operators P. Vial 1 Presentation 10 /46

85 Curry-Howard (50s) Programming languages Type Simply Typed Program Reduction Step Termination Simple types Logic Formula Proof Cut-Elimination Step Termination λ-calculus Harness higher-order comput. in a limited way. Many progs. in terminal state not typable. extensions Does not capture classical logic Get classical logic with call cc (Griffin, 90) Polymorphic Types Intersection Types Contribution Non-idempotent typing operators P. Vial 1 Presentation 10 /46

86 Cut-Elimination (animation) A A A B B Number of occurrences: ψ A A Φ B Π A ψ : 1 Φ : 1 Π : 1 A B F Initial proof of F (using two lemmas) Goal: having a one-block proof Non-idempotent typing operators P. Vial 1 Presentation 11 /46

87 Cut-Elimination (animation) ψ ψ ψ B B ψ Φ ψ B Π ψ Number of occurrences: ψ : 6 Φ : 1 Π : 1 B F After one cut-elim. step (one lemma) Goal: having a one-block proof Non-idempotent typing operators P. Vial 1 Presentation 11 /46

88 Cut-Elimination (animation) ψ ψ ψ Φ ψ ψ Φ Π ψ ψ ψ Φ ψ ψ Number of occurrences: ψ : 10 Φ : 3 Π : 1 F Goal: having a one-block proof Non-idempotent typing operators P. Vial 1 Presentation 11 /46

89 Cut-Elimination (animation) ψ ψ ψ Φ ψ ψ Φ Π ψ ψ ψ Φ ψ ψ Number of occurrences: ψ : 10 Φ : 3 Π : 1 F After two cut-elim. steps Non-idempotent typing operators P. Vial 1 Presentation 11 /46

90 Cut-Elimination (animation) ψ ψ ψ Φ ψ ψ Φ Π ψ ψ ψ Φ ψ ψ Number of occurrences: ψ : 10 Φ : 3 Π : 1 F Theorem (Gentzen, 1936, Prawitz, 1965) The cut-elimination procedure terminates (and tells us a lot of things). Non-idempotent typing operators P. Vial 1 Presentation 11 /46

91 Intersections types (Coppo, Dezani, 1980) Goal Equivalences of the form the program t is typable iff it can reach a terminal state Idea: several certificates to a same subprogram. on-idempotent typing operators P. Vial 1 Presentation 12 /46

92 Intersections types (Coppo, Dezani, 1980) Goal Equivalences of the form the program t is typable iff it can reach a terminal state Idea: several certificates to a same subprogram. Proof: by the circular implications: t is typable t can reach a terminal state Some reduction strategy terminates on t on-idempotent typing operators P. Vial 1 Presentation 12 /46

93 Intersections types (Coppo, Dezani, 1980) Goal Equivalences of the form the program t is typable iff it can reach a terminal state Idea: several certificates to a same subprogram. Proof: by the circular implications: t is typable t can reach a terminal state Some reduction strategy terminates on t Intersection types Perhaps too expressive but certify reduction strategies! Non-idempotent typing operators P. Vial 1 Presentation 12 /46

94 Non-idempotency Computation causes duplication. Non-idempotent typing operators P. Vial 1 Presentation 13 /46

95 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. on-idempotent typing operators P. Vial 1 Presentation 13 /46

96 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. Initial certificate Initial state of the prog. Execution on-idempotent typing operators P. Vial 1 Presentation 13 /46

97 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. Initial certificate Initial state of the prog. Execution on-idempotent typing operators P. Vial 1 Presentation 13 /46

98 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. Initial certificate Initial state of the prog. Execution on-idempotent typing operators P. Vial 1 Presentation 13 /46

99 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. Initial certificate Initial state of the prog. Execution on-idempotent typing operators P. Vial 1 Presentation 13 /46

100 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. Initial certificate Initial state of the prog. STOP (cannot be reduced more) Execution on-idempotent typing operators P. Vial 1 Presentation 13 /46

101 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. Initial certificate Initial state of the prog. STOP (cannot be reduced more) Terminal state reached!! Execution on-idempotent typing operators P. Vial 1 Presentation 13 /46

102 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. on-idempotent typing operators P. Vial 1 Presentation 13 /46

103 Non-idempotency Computation causes duplication. Non-idempotent intersection types Disallow duplication for typing certificates. Possibly many certificates for a subprogram. Size of certificates decreases. Comparative (dis)advantages Insanely difficult to type a particular program. Whole type system easier to study! Easier proofs of termination! Easier proofs of characterization! Easier to certify a reduction strategy! on-idempotent typing operators P. Vial 1 Presentation 13 /46

104 Contents Gardner/de Caravalho s non-idempotent type system. Contribution 1: Quantitative types for the λµ-calculus (a classical calculus) Certificates of reduction strategies. Contribution 2: Positive answer to Klop s Problem. Certification of an infinitary reduction strategy. Introduction of a new type system: system S (standing for sequences). Contribution 3: Around the expressive power of unconstrained infinitary intersection types. Non-idempotent typing operators P. Vial 1 Presentation 14 /46

105 Plan 1 Presentation 2 Non-idempotent intersection types 3 Resources for Classical Logic 4 Infinite types and productive reduction 5 Infinite types and unproductive reduction 6 Conclusion on-idempotent typing operators P. Vial 2 Non-idempotent intersection types 15 /46

106 Head Normalization (λ) r x t 1 λx s t 1 head variable t q head redex t q λxp λxp Head Normal Form Head Reducible Term Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 16 /46

107 Head Normalization (λ) r x t 1 λx s t 1 head variable t q head redex t q λxp λxp Head Normal Form Head Reducible Term t is head normalizing (HN) if reduction path from t to a HNF. Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 16 /46

108 Head Normalization (λ) r x t 1 λx s t 1 head variable t q head redex t q λxp λxp Head Normal Form Head Reducible Term t is head normalizing (HN) if reduction path from t to a HNF. The head reduction strategy: reducing head redexes while it is possible. Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 16 /46

109 Head Normalization (λ) t is head normalizing (HN) if reduction path from t to a HNF. The head reduction strategy: reducing head redexes while it is possible. Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 16 /46

110 Head Normalization (λ) obvious the head reduction strategy terminates on t t is HN ( path from t to a HNF) true but not obvious t is head normalizing (HN) if reduction path from t to a HNF. The head reduction strategy: reducing head redexes while it is possible. Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 16 /46

111 Head Normalization (λ) obvious the head reduction strategy terminates on t t is HN ( path from t to a HNF) true but not obvious The head reduction strategy: reducing head redexes while it is possible. Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 16 /46

112 Head Normalization (λ) obvious the head reduction strategy terminates on t t is HN ( path from t to a HNF) true but not obvious Intersection types come to help! The head reduction strategy: reducing head redexes while it is possible. Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 16 /46

113 Subject Reduction and Subject Expansion A good intersection type system should enjoy: Subject Reduction (SR): Typing is stable under reduction. Subject Expansion (SE): Typing is stable under antireduction. SE is usually not verified by simple or polymorphic type systems on-idempotent typing operators P. Vial 2 Non-idempotent intersection types 17 /46

114 Subject Reduction and Subject Expansion A good intersection type system should enjoy: Subject Reduction (SR): Typing is stable under reduction. Subject Expansion (SE): Typing is stable under antireduction. SE is usually not verified by simple or polymorphic type systems typing the term. states + SE t is typable SR + extra arg. t can reach a terminal state Some reduction strategy terminates on t obvious on-idempotent typing operators P. Vial 2 Non-idempotent intersection types 17 /46

115 From Intersection Types to Quantitative Types Types are built by means of base types, arrow ( ) and intersection ( ). Associativity (A D) C A (D C) ACI Axioms = Commutativity A D D A Idempotence A A A on-idempotent typing operators P. Vial 2 Non-idempotent intersection types 18 /46

116 From Intersection Types to Quantitative Types Types are built by means of base types, arrow ( ) and intersection ( ). Associativity (A D) C A (D C) ACI Axioms = Commutativity A D D A Idempotence A A A Traditional Intersection Types Quantitative Types Coppo & Dezani 80 Gardner 94 - Kfoury 96 ACI (Idempotent) AC (Non-idempotent) Types are sets: A A C is {A, C} Types are multisets: A A C is [A, A, C] Qualitative properties Quantitative properties Remark (non-idem. case): [A, A, C] [A, C] i.e. A A C A C. [A, B] + [A] = [A, A, B] i.e. is multiset sum. on-idempotent typing operators P. Vial 2 Non-idempotent intersection types 18 /46

117 Types and Rules (System R 0 ) (Strict Types) τ, σ := o O I τ (Intersection Types) I := [σ i] i I Strict types syntax directed rules: x : [τ] x : τ ax Γ; x : [σ i] i I t : τ Γ λx.t : [σ i] i I τ abs Γ t : [σ i] i I τ (Γ i u : σ i) i I app Γ + i I Γ i t u : τ System R 0 Remark Relevant system (no weakening) In app-rule, pointwise multiset sum e.g., (x : [σ]; y : [τ]) + (x : [σ, τ]) = x : [σ, σ, τ]; y : [τ] Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 19 /46

118 Properties (R 0 ) Weighted Subject Reduction Reduction preserves types and environments, and head reduction strictly decreases the nodes of the deriv. tree. Subject Expansion Anti-reduction preserves types and environments. Theorem (de Carvalho) Let t be a λ-term. Then equivalence between: 1 t is typable (in R 0) 2 t is HN 3 the head reduction strategy terminates on t ( certification!) Bonus (quantitative information) If Π types t, then sizeπ bounds the number of steps of the head. red. strategy on t. on-idempotent typing operators P. Vial 2 Non-idempotent intersection types 20 /46

119 Head vs Weak and Strong Normalization Let t be a λ-term. Head normalization (HN): there is a path from t to a head normal form. Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 21 /46

120 Head vs Weak and Strong Normalization Let t be a λ-term. Head normalization (HN): there is a path from t to a head normal form. Weak normalization (WN): there is at least one path from t to normal form (NF). Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 21 /46

121 Head vs Weak and Strong Normalization Let t be a λ-term. Head normalization (HN): there is a path from t to a head normal form. Weak normalization (WN): there is at least one path from t to normal form (NF). Strong normalization (SN): there is no infinite path starting at t. on-idempotent typing operators P. Vial 2 Non-idempotent intersection types 21 /46

122 Head vs Weak and Strong Normalization Let t be a λ-term. Head normalization (HN): there is a path from t to a head normal form. Weak normalization (WN): there is at least one path from t to normal form (NF). Strong normalization (SN): there is no infinite path starting at t. Normalization SN WN HN. Nota Bene: y Ω HNF but not WN (λx.y)ω WN but not SN on-idempotent typing operators P. Vial 2 Non-idempotent intersection types 21 /46

123 Characterizing Weak and Strong Normalization HN System R 0 sz(π) bounds the number of any arg. can be left untyped head reduction steps WN System R 0 + unforgetfulness criterion non-erasable args must be typed sz(π) bounds the number of leftmost-outermost red. steps (and more) SN Modify system R 0 with choice operator all args must be typed sz(π) bounds the length of any reduction path Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 22 /46

124 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] ax x:[σ 1] x:σ 1 ax x:[σ 1] x:σ 1 ax x:[σ 2] x:σ 2 Π a 1 Π 2 Π b 1 Γ; x :[σ 1, σ 2, σ 1] r : τ abs Γ λx.r : [σ 1, σ 2, σ 1] τ a 1 s:σ 1 2 s:σ 2 Γ + a 1 + b (λx.r)s : τ b 1 s:σ 1 app Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

125 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] ax x:[σ 1] x:σ 1 ax x:[σ 1] x:σ 1 ax x:[σ 2] x:σ 2 Π a 1 Π 2 Π b 1 Γ; x :[σ 1, σ 2, σ 1] r : τ abs Γ λx.r : [σ 1, σ 2, σ 1] τ a 1 s:σ 1 2 s:σ 2 Γ + a 1 + b (λx.r)s : τ b 1 s:σ 1 app Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

126 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] ax x:[σ 1] x:σ 1 ax x:[σ 1] x:σ 1 ax x:[σ 2] x:σ 2 Π a 1 Π 2 Π b 1 Γ; x :[σ 1, σ 2, σ 1] r : τ abs Γ λx.r : [σ 1, σ 2, σ 1] τ a 1 s:σ 1 2 s:σ 2 Γ + a 1 + b (λx.r)s : τ b 1 s:σ 1 app Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

127 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] ax x:[σ 1] x:σ 1 ax x:[σ 1] x:σ 1 ax x:[σ 2] x:σ 2 Π a 1 Π 2 Π b 1 Γ; x :[σ 1, σ 2, σ 1] r : τ abs Γ λx.r : [σ 1, σ 2, σ 1] τ a 1 s:σ 1 2 s:σ 2 Γ + a 1 + b (λx.r)s : τ b 1 s:σ 1 app Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

128 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] ax x:[σ 1] x:σ 1 ax x:[σ 1] x:σ 1 By relevance and non-idempotence! ax x:[σ 2] x:σ 2 Π a 1 Π 2 Π b 1 Γ; x :[σ 1, σ 2, σ 1] r : τ abs Γ λx.r : [σ 1, σ 2, σ 1] τ a 1 s:σ 1 2 s:σ 2 Γ + a 1 + b (λx.r)s : τ b 1 s:σ 1 app Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

129 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] ax x:[σ 1] x:σ 1 ax x:[σ 1] x:σ 1 ax x:[σ 2] x:σ 2 Π a 1 Π 2 Π b 1 Γ; x :[σ 1, σ 2, σ 1] r : τ abs Γ λx.r : [σ 1, σ 2, σ 1] τ a 1 s:σ 1 2 s:σ 2 Γ + a 1 + b (λx.r)s : τ b 1 s:σ 1 app Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

130 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] ax x:[σ 1] x:σ 1 ax x:[σ 1] x:σ 1 ax x:[σ 2] x:σ 2 Π a 1 Π 2 Π b 1 Γ; x :[σ 1, σ 2, σ 1] r : τ abs Γ λx.r : [σ 1, σ 2, σ 1] τ a 1 s:σ 1 2 s:σ 2 Γ + a 1 + b (λx.r)s : τ b 1 s:σ 1 app Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

131 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] Π a 1 Π b 1 a 1 s:σ 1 Π 2 b 1 s:σ 1 2 s:σ 2 Γ + a 1 + b r[s/x] : τ Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

132 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] Π a 1 Π b 1 a 1 s:σ 1 Π 2 b 1 s:σ 1 Non-determinism of SR 2 s:σ 2 Γ + a 1 + b r[s/x] : τ Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

133 Subject reduction and expansion in R 0 From a typing of (λx.r)s... to a typing of r[s/x] Π b 1 Π a 1 b 1 s:σ 1 Π 2 a 1 s:σ 1 Non-determinism of SR 2 s:σ 2 Γ + a 1 + b r[s/x] : τ Non-idempotent typing operators P. Vial 2 Non-idempotent intersection types 23 /46

134 Plan 1 Presentation 2 Non-idempotent intersection types 3 Resources for Classical Logic 4 Infinite types and productive reduction 5 Infinite types and unproductive reduction 6 Conclusion on-idempotent typing operators P. Vial 3 Resources for Classical Logic 24 /46

135 The Lambda-Mu Calculus Intuit. logic + Peirce s Law ((A B) A) A gives classical logic. on-idempotent typing operators P. Vial 3 Resources for Classical Logic 25 /46

136 The Lambda-Mu Calculus Intuit. logic + Peirce s Law ((A B) A) A gives classical logic. Griffin 90: call cc and Felleisen s C-operator typable with Peirce s Law ((A B) A) A the Curry-Howard iso extends to classical logic on-idempotent typing operators P. Vial 3 Resources for Classical Logic 25 /46

137 The Lambda-Mu Calculus Intuit. logic + Peirce s Law ((A B) A) A gives classical logic. Griffin 90: call cc and Felleisen s C-operator typable with Peirce s Law ((A B) A) A the Curry-Howard iso extends to classical logic Parigot 92: λµ-calculus = computational interpretation of classical natural deduction (e.g., vs. λµ µ). on-idempotent typing operators P. Vial 3 Resources for Classical Logic 25 /46

138 The Lambda-Mu Calculus Intuit. logic + Peirce s Law ((A B) A) A gives classical logic. Griffin 90: call cc and Felleisen s C-operator typable with Peirce s Law ((A B) A) A the Curry-Howard iso extends to classical logic Parigot 92: λµ-calculus = computational interpretation of classical natural deduction (e.g., vs. λµ µ). Captures continuations on-idempotent typing operators P. Vial 3 Resources for Classical Logic 25 /46

139 The λµ-calculus Syntax: Variables x and names α (Objects) o ::= t c (Terms) t, u ::= x λx.t tu µα.c (Commands) c ::= [α]t Basic Meta-Operations: t[u/x] (subst.) c{u /α} replaces every occurrence of [α]v inside t by [α]v u. on-idempotent typing operators P. Vial 3 Resources for Classical Logic 26 /46

140 The λµ-calculus Syntax: Variables x and names α (Objects) o ::= t c (Terms) t, u ::= x λx.t tu µα.c (Commands) c ::= [α]t Basic Meta-Operations: t[u/x] (subst.) c{u /α} replaces every occurrence of [α]v inside t by [α]v u. Example: [α](x (µγ.[α]x)){u /α} = Non-idempotent typing operators P. Vial 3 Resources for Classical Logic 26 /46

141 The λµ-calculus Syntax: Variables x and names α (Objects) o ::= t c (Terms) t, u ::= x λx.t tu µα.c (Commands) c ::= [α]t Basic Meta-Operations: t[u/x] (subst.) c{u /α} replaces every occurrence of [α]v inside t by [α]v u. Example: [α](x (µγ.[α]x)){u /α} = Non-idempotent typing operators P. Vial 3 Resources for Classical Logic 26 /46

142 The λµ-calculus Syntax: Variables x and names α (Objects) o ::= t c (Terms) t, u ::= x λx.t tu µα.c (Commands) c ::= [α]t Basic Meta-Operations: t[u/x] (subst.) c{u /α} replaces every occurrence of [α]v inside t by [α]v u. Example: [α](x (µγ.[α]x)){u /α} = Non-idempotent typing operators P. Vial 3 Resources for Classical Logic 26 /46

143 The λµ-calculus Syntax: Variables x and names α (Objects) o ::= t c (Terms) t, u ::= x λx.t tu µα.c (Commands) c ::= [α]t Basic Meta-Operations: t[u/x] (subst.) c{u /α} replaces every occurrence of [α]v inside t by [α]v u. Example: [α](x (µγ.[α]x)){u /α} = [α](x (µγ.[α]x u))u Non-idempotent typing operators P. Vial 3 Resources for Classical Logic 26 /46

144 The λµ-calculus Syntax: Variables x and names α (Objects) o ::= t c (Terms) t, u ::= x λx.t tu µα.c (Commands) c ::= [α]t Basic Meta-Operations: t[u/x] (subst.) c{u /α} replaces every occurrence of [α]v inside t by [α]v u. Example: [α](x (µγ.[α]x)){u /α} = [α](x (µγ.[α]x u))u call cc := λy.µα.[α]y(λx.µβ.[α]x) Non-idempotent typing operators P. Vial 3 Resources for Classical Logic 26 /46

145 The λµ-calculus Syntax: Variables x and names α (Objects) o ::= t c (Terms) t, u ::= x λx.t tu µα.c (Commands) c ::= [α]t Basic Meta-Operations: t[u/x] (subst.) c{u /α} replaces every occurrence of [α]v inside t by [α]v u. Example: [α](x (µγ.[α]x)){u /α} = [α](x (µγ.[α]x u))u call cc := λy.µα.[α]y(λx.µβ.[α]x) : ((A B) A) A (simple typing) on-idempotent typing operators P. Vial 3 Resources for Classical Logic 26 /46

146 The λµ-calculus Syntax: Variables x and names α (Objects) o ::= t c (Terms) t, u ::= x λx.t tu µα.c (Commands) c ::= [α]t Basic Meta-Operations: t[u/x] (subst.) c{u /α} replaces every occurrence of [α]v inside t by [α]v u. Example: [α](x (µγ.[α]x)){u /α} = [α](x (µγ.[α]x u))u call cc := λy.µα.[α]y(λx.µβ.[α]x) : ((A B) A) A (simple typing) Operational Semantics: (λx.t)u β t[u/x] substitution (µα.c)u µ µα.c{u /α} replacement on-idempotent typing operators P. Vial 3 Resources for Classical Logic 26 /46

147 The Typing System Principles Extend non-idempotent types to classical logic. Problem 1: finding quantitative descriptors suitable to classical logic Problem 2: guaranteeing a decrease in measure (weighted s.r.) on-idempotent typing operators P. Vial 3 Resources for Classical Logic 27 /46

148 The Typing System Principles Extend non-idempotent types to classical logic. Problem 1: finding quantitative descriptors suitable to classical logic resort to non-idempotent union types (below right) Problem 2: guaranteeing a decrease in measure (weighted s.r.) Not obvious! The number of nodes does not work (see later). on-idempotent typing operators P. Vial 3 Resources for Classical Logic 27 /46

149 The Typing System Principles Extend non-idempotent types to classical logic. Problem 1: finding quantitative descriptors suitable to classical logic resort to non-idempotent union types (below right) Problem 2: guaranteeing a decrease in measure (weighted s.r.) Not obvious! The number of nodes does not work (see later). Intersection: I, J := [U k ] k K U, V =: σ k k K : Union on-idempotent typing operators P. Vial 3 Resources for Classical Logic 27 /46

150 The Typing System Principles Extend non-idempotent types to classical logic. Problem 1: finding quantitative descriptors suitable to classical logic resort to non-idempotent union types (below right) Problem 2: guaranteeing a decrease in measure (weighted s.r.) Not obvious! The number of nodes does not work (see later). Intersection: I, J := [U k ] k K U, V =: σ k k K : Union x : [U 1, U 2]; y : [V] t : U α : σ 1, σ 2, β : τ 1, τ 2, τ 3 on-idempotent typing operators P. Vial 3 Resources for Classical Logic 27 /46

151 The Typing System Principles Extend non-idempotent types to classical logic. Problem 1: finding quantitative descriptors suitable to classical logic resort to non-idempotent union types (below right) Problem 2: guaranteeing a decrease in measure (weighted s.r.) Not obvious! The number of nodes does not work (see later). Intersection: I, J := [U k ] k K U, V =: σ k k K : Union x : [U 1, U 2]; y : [V] t : U α : σ 1, σ 2, β : τ 1, τ 2, τ 3 A, C and non-i e.g., σ 1, σ 2 σ 1 = σ 1, σ 2, σ 1 on-idempotent typing operators P. Vial 3 Resources for Classical Logic 27 /46

152 Some Typing Rules (System H λµ ) Features Syntax-direction, relevance, multiplicative rules accumulation of typing information. app-rule based upon the admissible rule of ND: A 1 B 1... A k B k A 1... A k B 1... B k ( vs. A B B A ) Non-idempotent typing operators P. Vial 3 Resources for Classical Logic 28 /46

153 Some Typing Rules (System H λµ ) Features Syntax-direction, relevance, multiplicative rules accumulation of typing information. app-rule based upon the admissible rule of ND: A 1 B 1... A k B k A 1... A k B 1... B k ( vs. A B B A ) Two new rules (manipulation on the right-h.s.): Γ t : U Γ [α]t : # {α : U} save Γ c : # Γ µα.c : (α) \\ α restore on-idempotent typing operators P. Vial 3 Resources for Classical Logic 28 /46

154 Some Typing Rules (System H λµ ) Features Syntax-direction, relevance, multiplicative rules accumulation of typing information. app-rule based upon the admissible rule of ND: A 1 B 1... A k B k A 1... A k B 1... B k ( vs. A B B A ) Two new rules (manipulation on the right-h.s.): Γ t : U Γ [α]t : # {α : U} save Γ c : # Γ µα.c : (α) \\ α restore on-idempotent typing operators P. Vial 3 Resources for Classical Logic 28 /46

155 Some Typing Rules (System H λµ ) Features Syntax-direction, relevance, multiplicative rules accumulation of typing information. app-rule based upon the admissible rule of ND: A 1 B 1... A k B k A 1... A k B 1... B k ( vs. A B B A ) Two new rules (manipulation on the right-h.s.): Γ t : U Γ [α]t : # {α : U} save Γ c : # Γ µα.c : (α) \\ α restore on-idempotent typing operators P. Vial 3 Resources for Classical Logic 28 /46

156 Some Typing Rules (System H λµ ) Features Syntax-direction, relevance, multiplicative rules accumulation of typing information. app-rule based upon the admissible rule of ND: A 1 B 1... A k B k A 1... A k B 1... B k ( vs. A B B A ) Two new rules (manipulation on the right-h.s.): Γ t : U Γ [α]t : # {α : U} save Γ c : # Γ µα.c : (α) \\ α restore on-idempotent typing operators P. Vial 3 Resources for Classical Logic 28 /46

157 Some Typing Rules (System H λµ ) Features Syntax-direction, relevance, multiplicative rules accumulation of typing information. app-rule based upon the admissible rule of ND: A 1 B 1... A k B k A 1... A k B 1... B k ( vs. A B B A ) Two new rules (manipulation on the right-h.s.): Γ t : U Γ [α]t : # {α : U} save Γ c : # Γ µα.c : (α) \\ α restore where = choice operator. on-idempotent typing operators P. Vial 3 Resources for Classical Logic 28 /46

Categories, Proofs and Programs

Categories, Proofs and Programs Categories, Proofs and Programs Samson Abramsky and Nikos Tzevelekos Lecture 4: Curry-Howard Correspondence and Cartesian Closed Categories In A Nutshell Logic Computation 555555555555555555 5 Categories

More information

Command = Value Context. Hans-Dieter Hiep. 15th of June, /17

Command = Value Context. Hans-Dieter Hiep. 15th of June, /17 1/17 Command = Value Context Hans-Dieter Hiep 15th of June, 2018 2/17 Example Consider a total functional programming language. swap :: A B B A swap (a, b) = (b, a) paws :: A B B A paws a = a paws b =

More information

Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012

Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. Radboud University Nijmegen. March 5, 2012 1 λ Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky Radboud University Nijmegen March 5, 2012 2 reading Femke van Raamsdonk Logical Verification Course Notes Herman Geuvers Introduction to

More information

Call-by-value non-determinism in a linear logic type discipline

Call-by-value non-determinism in a linear logic type discipline Call-by-value non-determinism in a linear logic type discipline Alejandro Díaz-Caro? Giulio Manzonetto Université Paris-Ouest & INRIA LIPN, Université Paris 13 Michele Pagani LIPN, Université Paris 13

More information

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012

Decision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012 Decision Problems with TM s Look at following sets: Lecture 31: Halting Problem CSCI 81 Spring, 2012 Kim Bruce A TM = { M,w M is a TM and w L(M)} H TM = { M,w M is a TM which halts on input w} TOTAL TM

More information

Kleene realizability and negative translations

Kleene realizability and negative translations Q E I U G I C Kleene realizability and negative translations Alexandre Miquel O P. D E. L Ō A U D E L A R April 21th, IMERL Plan 1 Kleene realizability 2 Gödel-Gentzen negative translation 3 Lafont-Reus-Streicher

More information

Introduction to Intuitionistic Logic

Introduction to Intuitionistic Logic Introduction to Intuitionistic Logic August 31, 2016 We deal exclusively with propositional intuitionistic logic. The language is defined as follows. φ := p φ ψ φ ψ φ ψ φ := φ and φ ψ := (φ ψ) (ψ φ). A

More information

Decidability: Church-Turing Thesis

Decidability: Church-Turing Thesis Decidability: Church-Turing Thesis While there are a countably infinite number of languages that are described by TMs over some alphabet Σ, there are an uncountably infinite number that are not Are there

More information

Introduction to lambda calculus Part 2

Introduction to lambda calculus Part 2 Introduction to lambda calculus Part 2 Antti-Juhani Kaijanaho 2017-01-24... 1 Untyped lambda calculus 1.1 Syntax... x, y, z Var t, u Term t, u ::= x t u λx t... In this document, I will be using the following

More information

A call-by-name lambda-calculus machine

A call-by-name lambda-calculus machine A call-by-name lambda-calculus machine Jean-Louis Krivine University Paris VII, C.N.R.S. 2 place Jussieu 75251 Paris cedex 05 (krivine@pps.jussieu.fr) Introduction We present, in this paper, a particularly

More information

Komponenten- und Service-orientierte Softwarekonstruktion

Komponenten- und Service-orientierte Softwarekonstruktion Komponenten- und Service-orientierte Softwarekonstruktion Vorlesung 5: Combinatory Logic Synthesis Jakob Rehof LS XIV Software Engineering TU Dortmund Sommersemester 2015 SS 2015 J. Rehof (TU Dortmund)

More information

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications

NICTA Advanced Course. Theorem Proving Principles, Techniques, Applications NICTA Advanced Course Theorem Proving Principles, Techniques, Applications λ 1 CONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural

More information

Type Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth.

Type Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth. Type Systems Lecture 2 Oct. 27th, 2004 Sebastian Maneth http://lampwww.epfl.ch/teaching/typesystems/2004 Today 1. What is the Lambda Calculus? 2. Its Syntax and Semantics 3. Church Booleans and Church

More information

Constructive approach to relevant and affine term calculi

Constructive approach to relevant and affine term calculi Constructive approach to relevant and affine term calculi Jelena Ivetić, University of Novi Sad, Serbia Silvia Ghilezan,University of Novi Sad, Serbia Pierre Lescanne, University of Lyon, France Silvia

More information

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth Today 1. What is the Lambda Calculus? Type Systems 2. Its Syntax and Semantics 3. Church Booleans and Church Numerals 4. Lazy vs. Eager Evaluation (call-by-name vs. call-by-value) Lecture 2 Oct. 27th,

More information

COMP6463: λ-calculus

COMP6463: λ-calculus COMP6463: λ-calculus 1. Basics Michael Norrish Michael.Norrish@nicta.com.au Canberra Research Lab., NICTA Semester 2, 2015 Outline Introduction Lambda Calculus Terms Alpha Equivalence Substitution Dynamics

More information

Introduction to Turing Machines

Introduction to Turing Machines Introduction to Turing Machines Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. 12 November 2015 Outline 1 Turing Machines 2 Formal definitions 3 Computability

More information

Most General computer?

Most General computer? Turing Machines Most General computer? DFAs are simple model of computation. Accept only the regular languages. Is there a kind of computer that can accept any language, or compute any function? Recall

More information

Beyond First-Order Logic

Beyond First-Order Logic Beyond First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) Beyond First-Order Logic MFES 2008/09 1 / 37 FOL

More information

Models. Models of Computation, Turing Machines, and the Limits of Turing Computation. Effective Calculability. Motivation for Models of Computation

Models. Models of Computation, Turing Machines, and the Limits of Turing Computation. Effective Calculability. Motivation for Models of Computation Turing Computation /0/ Models of Computation, Turing Machines, and the Limits of Turing Computation Bruce MacLennan Models A model is a tool intended to address a class of questions about some domain of

More information

Informal Statement Calculus

Informal Statement Calculus FOUNDATIONS OF MATHEMATICS Branches of Logic 1. Theory of Computations (i.e. Recursion Theory). 2. Proof Theory. 3. Model Theory. 4. Set Theory. Informal Statement Calculus STATEMENTS AND CONNECTIVES Example

More information

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg

Type Theory and Constructive Mathematics. Type Theory and Constructive Mathematics Thierry Coquand. University of Gothenburg Type Theory and Constructive Mathematics Type Theory and Constructive Mathematics Thierry Coquand University of Gothenburg Content An introduction to Voevodsky s Univalent Foundations of Mathematics The

More information

3 Propositional Logic

3 Propositional Logic 3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists

More information

From pre-models to models

From pre-models to models From pre-models to models normalization by Heyting algebras Olivier HERMANT 18 Mars 2008 Deduction System : natural deduction (NJ) first-order logic: function and predicate symbols, logical connectors:,,,,

More information

V Honors Theory of Computation

V Honors Theory of Computation V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant

More information

Structuring Logic with Sequent Calculus

Structuring Logic with Sequent Calculus Structuring Logic with Sequent Calculus Alexis Saurin ENS Paris & École Polytechnique & CMI Seminar at IIT Delhi 17th September 2004 Outline of the talk Proofs via Natural Deduction LK Sequent Calculus

More information

cis32-ai lecture # 18 mon-3-apr-2006

cis32-ai lecture # 18 mon-3-apr-2006 cis32-ai lecture # 18 mon-3-apr-2006 today s topics: propositional logic cis32-spring2006-sklar-lec18 1 Introduction Weak (search-based) problem-solving does not scale to real problems. To succeed, problem

More information

Rules and derivations in an elementary logic course arxiv: v1 [cs.lo] 7 Jan 2016

Rules and derivations in an elementary logic course arxiv: v1 [cs.lo] 7 Jan 2016 Rules and derivations in an elementary logic course arxiv:160101483v1 [cslo] 7 Jan 2016 Gilles Dowek Inria, 23 avenue d Italie, CS 81321, 75214 Paris Cedex 13, France gillesdowek@inriafr When teaching

More information

Propositional and Predicate Logic. jean/gbooks/logic.html

Propositional and Predicate Logic.   jean/gbooks/logic.html CMSC 630 February 10, 2009 1 Propositional and Predicate Logic Sources J. Gallier. Logic for Computer Science, John Wiley and Sons, Hoboken NJ, 1986. 2003 revised edition available on line at http://www.cis.upenn.edu/

More information

Lecture 14 Rosser s Theorem, the length of proofs, Robinson s Arithmetic, and Church s theorem. Michael Beeson

Lecture 14 Rosser s Theorem, the length of proofs, Robinson s Arithmetic, and Church s theorem. Michael Beeson Lecture 14 Rosser s Theorem, the length of proofs, Robinson s Arithmetic, and Church s theorem Michael Beeson The hypotheses needed to prove incompleteness The question immediate arises whether the incompleteness

More information

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now CSC 438F/2404F Notes (S. Cook) Fall, 2008 Peano Arithmetic Goals Now 1) We will introduce a standard set of axioms for the language L A. The theory generated by these axioms is denoted PA and called Peano

More information

Turing Machines. Lecture 8

Turing Machines. Lecture 8 Turing Machines Lecture 8 1 Course Trajectory We will see algorithms, what can be done. But what cannot be done? 2 Computation Problem: To compute a function F that maps each input (a string) to an output

More information

On a computational interpretation of sequent calculus for modal logic S4

On a computational interpretation of sequent calculus for modal logic S4 On a computational interpretation of sequent calculus for modal logic S4 Yosuke Fukuda Graduate School of Informatics, Kyoto University Second Workshop on Mathematical Logic and Its Applications March

More information

Consequence Relations and Natural Deduction

Consequence Relations and Natural Deduction Consequence Relations and Natural Deduction Joshua D. Guttman Worcester Polytechnic Institute September 9, 2010 Contents 1 Consequence Relations 1 2 A Derivation System for Natural Deduction 3 3 Derivations

More information

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig First-Order Logic First-Order Theories Roopsha Samanta Partly based on slides by Aaron Bradley and Isil Dillig Roadmap Review: propositional logic Syntax and semantics of first-order logic (FOL) Semantic

More information

CS20a: Turing Machines (Oct 29, 2002)

CS20a: Turing Machines (Oct 29, 2002) CS20a: Turing Machines (Oct 29, 2002) So far: DFA = regular languages PDA = context-free languages Today: Computability 1 Church s thesis The computable functions are the same as the partial recursive

More information

Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ

Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ Completeness and Partial Soundness Results for Intersection & Union Typing for λµ µ Steffen van Bakel Department of Computing, Imperial College London, 180 Queen s Gate, London SW7 2BZ, UK Abstract This

More information

1. each λ-variable is a λρ-term, called atom or atomic term, 2. if M and N are λρ-term then (MN) is a λρ-term called application,

1. each λ-variable is a λρ-term, called atom or atomic term, 2. if M and N are λρ-term then (MN) is a λρ-term called application, Yuichi Komori Arato Cho λρ-calculus abstract. In [K02], one of the authors introduced the system λρ-calculus and stated without proof that the strong normalization theorem hold. We have discovered an elegant

More information

Lazy Strong Normalization

Lazy Strong Normalization Lazy Strong Normalization Luca Paolini 1,2 Dipartimento di Informatica Università di Torino (ITALIA) Elaine Pimentel 1,2 Departamento de Matemática Universidade Federal de Minas Gerais (BRASIL) Dipartimento

More information

Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic

Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic Evaluation Driven Proof-Search in Natural Deduction Calculi for Intuitionistic Propositional Logic Mauro Ferrari 1, Camillo Fiorentini 2 1 DiSTA, Univ. degli Studi dell Insubria, Varese, Italy 2 DI, Univ.

More information

Computability Theory. CS215, Lecture 6,

Computability Theory. CS215, Lecture 6, Computability Theory CS215, Lecture 6, 2000 1 The Birth of Turing Machines At the end of the 19th century, Gottlob Frege conjectured that mathematics could be built from fundamental logic In 1900 David

More information

CS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus

CS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus CS 4110 Programming Languages & Logics Lecture 16 Programming in the λ-calculus 30 September 2016 Review: Church Booleans 2 We can encode TRUE, FALSE, and IF, as: TRUE λx. λy. x FALSE λx. λy. y IF λb.

More information

Gödel s Incompleteness Theorem. Overview. Computability and Logic

Gödel s Incompleteness Theorem. Overview. Computability and Logic Gödel s Incompleteness Theorem Overview Computability and Logic Recap Remember what we set out to do in this course: Trying to find a systematic method (algorithm, procedure) which we can use to decide,

More information

Propositional Logic: Syntax

Propositional Logic: Syntax Logic Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about time (and programs) epistemic

More information

CSCI 490 problem set 6

CSCI 490 problem set 6 CSCI 490 problem set 6 Due Tuesday, March 1 Revision 1: compiled Tuesday 23 rd February, 2016 at 21:21 Rubric For full credit, your solutions should demonstrate a proficient understanding of the following

More information

Safety Analysis versus Type Inference

Safety Analysis versus Type Inference Information and Computation, 118(1):128 141, 1995. Safety Analysis versus Type Inference Jens Palsberg palsberg@daimi.aau.dk Michael I. Schwartzbach mis@daimi.aau.dk Computer Science Department, Aarhus

More information

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Harvard School of Engineering and Applied Sciences CS 152: Programming Languages Lecture 17 Tuesday, April 2, 2013 1 There is a strong connection between types in programming languages and propositions

More information

Relational Graph Models, Taylor Expansion and Extensionality

Relational Graph Models, Taylor Expansion and Extensionality Relational Graph Models, Taylor Expansion and Extensionality Domenico Ruoppolo Giulio Manzonetto Laboratoire d Informatique de Paris Nord Université Paris-Nord Paris 13 (France) MFPS XXX Ithaca, New York

More information

Logic. Propositional Logic: Syntax

Logic. Propositional Logic: Syntax Logic Propositional Logic: Syntax Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about

More information

Propositional Logic Language

Propositional Logic Language Propositional Logic Language A logic consists of: an alphabet A, a language L, i.e., a set of formulas, and a binary relation = between a set of formulas and a formula. An alphabet A consists of a finite

More information

Deriving natural deduction rules from truth tables (Extended version)

Deriving natural deduction rules from truth tables (Extended version) Deriving natural deduction rules from truth tables (Extended version) Herman Geuvers 1 and Tonny Hurkens 2 1 Radboud University & Technical University Eindhoven, The Netherlands herman@cs.ru.nl Abstract

More information

Part III Logic. Theorems. Based on lectures by T. E. Forster Notes taken by Dexter Chua. Lent 2017

Part III Logic. Theorems. Based on lectures by T. E. Forster Notes taken by Dexter Chua. Lent 2017 Part III Logic Theorems Based on lectures by T. E. Forster Notes taken by Dexter Chua Lent 2017 These notes are not endorsed by the lecturers, and I have modified them (often significantly) after lectures.

More information

Alonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms

Alonzo Church ( ) Lambda Calculus. λ-calculus : syntax. Grammar for terms : Inductive denition for λ-terms Alonzo Church (1903-1995) Lambda Calculus 2 λ-calculus : syntax Grammar for terms : t, u ::= x (variable) t u (application) λx.t (abstraction) Notation : Application is left-associative so that t 1 t 2...

More information

Grammatical resources: logic, structure and control

Grammatical resources: logic, structure and control Grammatical resources: logic, structure and control Michael Moortgat & Dick Oehrle 1 Grammatical composition.................................. 5 1.1 Grammar logic: the vocabulary.......................

More information

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska LECTURE 13 CHAPTER 4 TURING MACHINES 1. The definition of Turing machine 2. Computing with Turing machines 3. Extensions of Turing

More information

Silvia Ghilezan and Jelena Ivetić

Silvia Ghilezan and Jelena Ivetić PUBLICATIONS DE L INSTITUT MATHÉMATIQUE Nouvelle série, tome 82(96) (2007), 85 91 DOI 102298/PIM0796085G INTERSECTION TYPES FOR λ Gtz -CALCULUS Silvia Ghilezan and Jelena Ivetić Abstract. We introduce

More information

Introduction to λ-calculus

Introduction to λ-calculus p.1/65 Introduction to λ-calculus Ken-etsu FUJITA fujita@cs.gunma-u.ac.jp http://www.comp.cs.gunma-u.ac.jp/ fujita/ Department of Computer Science Gunma University :Church 32, 36, 40; Curry 34 1. Universal

More information

The duality of computation

The duality of computation The duality of computation (notes for the 3rd International Workshop on Higher-Order Rewriting) Hugo Herbelin LIX - INRIA-Futurs - PCRI Abstract. The work presented here is an extension of a previous work

More information

Programming Language Concepts: Lecture 16

Programming Language Concepts: Lecture 16 Programming Language Concepts: Lecture 16 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 16, 23 March 2009 λ-calculus:

More information

Typed Arithmetic Expressions

Typed Arithmetic Expressions Typed Arithmetic Expressions CS 550 Programming Languages Jeremy Johnson TAPL Chapters 3 and 5 1 Types and Safety Evaluation rules provide operational semantics for programming languages. The rules provide

More information

Turing Machine Recap

Turing Machine Recap Turing Machine Recap DFA with (infinite) tape. One move: read, write, move, change state. High-level Points Church-Turing thesis: TMs are the most general computing devices. So far no counter example Every

More information

What is logic, the topic of this course? There are at least two answers to that question.

What is logic, the topic of this course? There are at least two answers to that question. Applied Logic Lecture 1 CS 486 Spring 2005 Tuesday, January 25, 2005 What is Logic? What is logic, the topic of this course? There are at least two answers to that question. General logic: critical examination

More information

This is logically equivalent to the conjunction of the positive assertion Minimal Arithmetic and Representability

This is logically equivalent to the conjunction of the positive assertion Minimal Arithmetic and Representability 16.2. MINIMAL ARITHMETIC AND REPRESENTABILITY 207 If T is a consistent theory in the language of arithmetic, we say a set S is defined in T by D(x) if for all n, if n is in S, then D(n) is a theorem of

More information

Logic: The Big Picture

Logic: The Big Picture Logic: The Big Picture A typical logic is described in terms of syntax: what are the legitimate formulas semantics: under what circumstances is a formula true proof theory/ axiomatization: rules for proving

More information

Lecture notes on Turing machines

Lecture notes on Turing machines Lecture notes on Turing machines Ivano Ciardelli 1 Introduction Turing machines, introduced by Alan Turing in 1936, are one of the earliest and perhaps the best known model of computation. The importance

More information

Non deterministic classical logic: the λµ ++ -calculus

Non deterministic classical logic: the λµ ++ -calculus Paru dans : Mathematical Logic Quarterly, 48, pp. 357-366, 2002 Non deterministic classical logic: the λµ ++ -calculus Karim NOUR LAMA - Equipe de Logique, Université de Savoie 73376 Le Bourget du Lac

More information

Type Systems Winter Semester 2006

Type Systems Winter Semester 2006 Type Systems Winter Semester 2006 Week 7 November 29 November 29, 2006 - version 1.0 Plan PREVIOUSLY: 1. type safety as progress and preservation 2. typed arithmetic expressions 3. simply typed lambda

More information

Origin in Mathematical Logic

Origin in Mathematical Logic Lambda Calculus Origin in Mathematical Logic Foundation of mathematics was very much an issue in the early decades of 20th century. Cantor, Frege, Russel s Paradox, Principia Mathematica, NBG/ZF Origin

More information

Propositions as Types

Propositions as Types Propositions as Types Martin Pfeifhofer & Felix Schett May 25, 2016 Contents 1 Introduction 2 2 Content 3 2.1 Getting Started............................ 3 2.2 Effective Computability And The Various Definitions.......

More information

Decidable Subsets of CCS

Decidable Subsets of CCS Decidable Subsets of CCS based on the paper with the same title by Christensen, Hirshfeld and Moller from 1994 Sven Dziadek Abstract Process algebra is a very interesting framework for describing and analyzing

More information

Intersection Synchronous Logic

Intersection Synchronous Logic UnB 2007 p. 1/2 Intersection Synchronous Logic Elaine Gouvêa Pimentel Simona Ronchi della Rocca Luca Roversi UFMG/UNITO, 2007 UnB 2007 p. 2/2 Outline Motivation UnB 2007 p. 2/2 Outline Motivation Intuitionistic

More information

Handbook of Logic and Proof Techniques for Computer Science

Handbook of Logic and Proof Techniques for Computer Science Steven G. Krantz Handbook of Logic and Proof Techniques for Computer Science With 16 Figures BIRKHAUSER SPRINGER BOSTON * NEW YORK Preface xvii 1 Notation and First-Order Logic 1 1.1 The Use of Connectives

More information

What are the recursion theoretic properties of a set of axioms? Understanding a paper by William Craig Armando B. Matos

What are the recursion theoretic properties of a set of axioms? Understanding a paper by William Craig Armando B. Matos What are the recursion theoretic properties of a set of axioms? Understanding a paper by William Craig Armando B. Matos armandobcm@yahoo.com February 5, 2014 Abstract This note is for personal use. It

More information

Realisability methods of proof and semantics with application to expansion

Realisability methods of proof and semantics with application to expansion Realisability methods of proof and semantics with application to expansion First Year Examination Supervisors : Professor Fairouz Kamareddine and Doctor Joe B. Wells Student : Vincent Rahli ULTRA group,

More information

Static Program Analysis

Static Program Analysis Static Program Analysis Xiangyu Zhang The slides are compiled from Alex Aiken s Michael D. Ernst s Sorin Lerner s A Scary Outline Type-based analysis Data-flow analysis Abstract interpretation Theorem

More information

Consequence Relations and Natural Deduction

Consequence Relations and Natural Deduction Consequence Relations and Natural Deduction Joshua D Guttman Worcester Polytechnic Institute September 16, 2010 Contents 1 Consequence Relations 1 2 A Derivation System for Natural Deduction 3 3 Derivations

More information

The Calculus of Inductive Constructions

The Calculus of Inductive Constructions The Calculus of Inductive Constructions Hugo Herbelin 10th Oregon Programming Languages Summer School Eugene, Oregon, June 16-July 1, 2011 1 Outline - A bit of history, leading to the Calculus of Inductive

More information

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY

CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY CSE355 SUMMER 2018 LECTURES TURING MACHINES AND (UN)DECIDABILITY RYAN DOUGHERTY If we want to talk about a program running on a real computer, consider the following: when a program reads an instruction,

More information

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007 CSE 230: Winter 2007 Principles of Programming Languages Lecture 12: The λ-calculus Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2 Several evaluation

More information

Concrete Models for Classical Realizability

Concrete Models for Classical Realizability Concrete Models for Classical Realizability Jaap van Oosten (joint work with Tinxiang Zou) Department of Mathematics, Utrecht University Utrecht Workshop on Proof Theory, April 16, 2015 Classical Realizability

More information

Lambda Calculus. Andrés Sicard-Ramírez. Semester Universidad EAFIT

Lambda Calculus. Andrés Sicard-Ramírez. Semester Universidad EAFIT Lambda Calculus Andrés Sicard-Ramírez Universidad EAFIT Semester 2010-2 Bibliography Textbook: Hindley, J. R. and Seldin, J. (2008). Lambda-Calculus and Combinators. An Introduction. Cambridge University

More information

Realizing the axiom of dependent choice

Realizing the axiom of dependent choice Realizing the axiom of dependent choice Jean-Louis Krivine PPS Group, University Paris 7, CNRS krivine@pps.jussieu.fr Edinburgh, March 26, 2003 1 The extended Curry-Howard correspondence We want to get

More information

Proving Completeness for Nested Sequent Calculi 1

Proving Completeness for Nested Sequent Calculi 1 Proving Completeness for Nested Sequent Calculi 1 Melvin Fitting abstract. Proving the completeness of classical propositional logic by using maximal consistent sets is perhaps the most common method there

More information

CS 275 Automata and Formal Language Theory

CS 275 Automata and Formal Language Theory CS 275 Automata and Formal Language Theory Course Notes Part III: Limits of Computation Chapter III.1: Introduction Anton Setzer http://www.cs.swan.ac.uk/ csetzer/lectures/ automataformallanguage/current/index.html

More information

Računske interpretacije intuicionističke i klasične logike

Računske interpretacije intuicionističke i klasične logike Računske interpretacije intuicionističke i klasične logike Silvia Ghilezan Univerzitet u Novom Sadu Srbija Sustavi dokazivanja 2012 Dubrovnik, Hrvatska, 28.06.2012 S.Ghilezan () Računske interpretacije

More information

Cogito ergo sum non machina!

Cogito ergo sum non machina! Cogito ergo sum non machina! About Gödel s First Incompleteness Theorem and Turing machines. Ricardo Pereira Tassinari 1 Philosophy Department of State University of São Paulo - UNESP - Campus Marília

More information

Theory of Computation (IX) Yijia Chen Fudan University

Theory of Computation (IX) Yijia Chen Fudan University Theory of Computation (IX) Yijia Chen Fudan University Review The Definition of Algorithm Polynomials and their roots A polynomial is a sum of terms, where each term is a product of certain variables and

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

The Lambda Calculus. Stephen A. Edwards. Fall Columbia University

The Lambda Calculus. Stephen A. Edwards. Fall Columbia University The Lambda Calculus Stephen A. Edwards Columbia University Fall 2014 Lambda Expressions Function application written in prefix form. Add four and five is (+ 4 5) Evaluation: select a redex and evaluate

More information

Natural Deduction for Propositional Logic

Natural Deduction for Propositional Logic Natural Deduction for Propositional Logic Bow-Yaw Wang Institute of Information Science Academia Sinica, Taiwan September 10, 2018 Bow-Yaw Wang (Academia Sinica) Natural Deduction for Propositional Logic

More information

1.3. BASIC COMPUTER SCIENCE PREREQUISITES 15

1.3. BASIC COMPUTER SCIENCE PREREQUISITES 15 1.3. BASIC COMPUTER SCIENCE PREREQUISITES 15 For example, if L is reducible to L and L P then L P. A decision problem is NP-hard if every problem in NP is polynomial time reducible to it. A decision problem

More information

Lambda-Calculus (cont): Fixpoints, Naming. Lecture 10 CS 565 2/10/08

Lambda-Calculus (cont): Fixpoints, Naming. Lecture 10 CS 565 2/10/08 Lambda-Calculus (cont): Fixpoints, Naming Lecture 10 CS 565 2/10/08 Recursion and Divergence Consider the application: Ω ((λ x. (x x)) (λ x. (x x))) Ω evaluates to itself in one step. It has no normal

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

Subtyping and Intersection Types Revisited

Subtyping and Intersection Types Revisited Subtyping and Intersection Types Revisited Frank Pfenning Carnegie Mellon University International Conference on Functional Programming (ICFP 07) Freiburg, Germany, October 1-3, 2007 Joint work with Rowan

More information

Predicate Logic - Undecidability

Predicate Logic - Undecidability CS402, Spring 2016 Undecidable Problems Does the following program halts? (1) N : n, total, x, y, z (2) n GetUserInput() (3) total 3 (4) while true (5) for x 1 to total 2 (6) for y 1 to total x 1 (7) z

More information

On the Complexity of the Reflected Logic of Proofs

On the Complexity of the Reflected Logic of Proofs On the Complexity of the Reflected Logic of Proofs Nikolai V. Krupski Department of Math. Logic and the Theory of Algorithms, Faculty of Mechanics and Mathematics, Moscow State University, Moscow 119899,

More information

A Note on Turing Machine Design

A Note on Turing Machine Design CS103 Handout 17 Fall 2013 November 11, 2013 Problem Set 7 This problem explores Turing machines, nondeterministic computation, properties of the RE and R languages, and the limits of RE and R languages.

More information

Syllogistic Logic and its Extensions

Syllogistic Logic and its Extensions 1/31 Syllogistic Logic and its Extensions Larry Moss, Indiana University NASSLLI 2014 2/31 Logic and Language: Traditional Syllogisms All men are mortal. Socrates is a man. Socrates is mortal. Some men

More information

An introduction to classical realizability

An introduction to classical realizability Q E I U G I C An introduction to classical realizability Alexandre Miquel O P. D E. L Ō A U D E L A R January 27th, 2017 EJCIM 17 Lyon The Curry-Howard correspondence The dictionary: Proof theory Functional

More information

α-recursion Theory and Ordinal Computability

α-recursion Theory and Ordinal Computability α-recursion Theory and Ordinal Computability by Peter Koepke University of Bonn 1 3. 2. 2007 Abstract Motivated by a talk of S. D. Friedman at BIWOC we show that the α-recursive and α-recursively enumerable

More information