Do Extraterrestrials Use Functional Programming? .“Do Extraterrestrials Use...

download Do Extraterrestrials Use Functional Programming? .“Do Extraterrestrials Use Functional Programming?â€‌

of 158

  • date post

    05-Jan-2019
  • Category

    Documents

  • view

    214
  • download

    0

Embed Size (px)

Transcript of Do Extraterrestrials Use Functional Programming? .“Do Extraterrestrials Use...

Manuel M T ChakravartyUniversity of New South Wales

Do ExtraterrestrialsUse Functional Programming?

mchakravarty

TacticalGraceTacticalGrace

Thursday, 16 May 13

Straight to next slide

[15min Question (); 20min Methodology; 15min Application]

Part 1The Question

Thursday, 16 May 13

This talk will be in three parts.(1) Discussing essence of functional programming. What makes FP tick?(2) How do FP principles influence software dev? Will propose a dev methodology for FP.(3) Look at concrete dev project, where we applied this methodology. Let's start with The Question

Do ExtraterrestrialsUse Functional Programming?

Thursday, 16 May 13

* To visit us, they need to be on an advanced technological level with a deep understanding of science.* They won't speak one of humanity's languages, though. So, how do we establish a common basis?

Thursday, 16 May 13

* How to communicate?* Common idea: universal principles may help establish a basis universal constants or universal laws.

Thursday, 16 May 13

* How to communicate?* Common idea: universal principles may help establish a basis universal constants or universal laws.

?

Thursday, 16 May 13

* How to communicate?* Common idea: universal principles may help establish a basis universal constants or universal laws.

?E = mc2

Thursday, 16 May 13

* How to communicate?* Common idea: universal principles may help establish a basis universal constants or universal laws.

Thursday, 16 May 13

* Computer languages? Agree on a common language of computation?* In 1936, Alonzo Church introduced the lambda calculus: * Serve as a common language? Like a computational Esperanto?* Also other calculi/machines. Famous: Turing machines. Which would aliens pick? Let's look: how are they related

Alonzo Church

M, N x | x.M | M N

Thursday, 16 May 13

* Computer languages? Agree on a common language of computation?* In 1936, Alonzo Church introduced the lambda calculus: * Serve as a common language? Like a computational Esperanto?* Also other calculi/machines. Famous: Turing machines. Which would aliens pick? Let's look: how are they related

Alonzo Church

M, N x | x.M | M NM, N x | x.M | M N

Thursday, 16 May 13

* Computer languages? Agree on a common language of computation?* In 1936, Alonzo Church introduced the lambda calculus: * Serve as a common language? Like a computational Esperanto?* Also other calculi/machines. Famous: Turing machines. Which would aliens pick? Let's look: how are they related

Alonzo Church

M, N x | x.M | M NM, N x | x.M | M NM, N x | x.M | M N

Thursday, 16 May 13

* Computer languages? Agree on a common language of computation?* In 1936, Alonzo Church introduced the lambda calculus: * Serve as a common language? Like a computational Esperanto?* Also other calculi/machines. Famous: Turing machines. Which would aliens pick? Let's look: how are they related

Alonzo Church

M, N x | x.M | M NM, N x | x.M | M NM, N x | x.M | M NM, N x | x.M | M N

Thursday, 16 May 13

* Computer languages? Agree on a common language of computation?* In 1936, Alonzo Church introduced the lambda calculus: * Serve as a common language? Like a computational Esperanto?* Also other calculi/machines. Famous: Turing machines. Which would aliens pick? Let's look: how are they related

Alonzo Church

M, N x | x.M | M NM, N x | x.M | M NM, N x | x.M | M NM, N x | x.M | M NM, N x | x.M | M N

Thursday, 16 May 13

* Computer languages? Agree on a common language of computation?* In 1936, Alonzo Church introduced the lambda calculus: * Serve as a common language? Like a computational Esperanto?* Also other calculi/machines. Famous: Turing machines. Which would aliens pick? Let's look: how are they related

Alonzo Church

M, N x | x.M | M N

Alan Turing

Thursday, 16 May 13

* Computer languages? Agree on a common language of computation?* In 1936, Alonzo Church introduced the lambda calculus: * Serve as a common language? Like a computational Esperanto?* Also other calculi/machines. Famous: Turing machines. Which would aliens pick? Let's look: how are they related

Alonzo ChurchAlan Turing

M, N x | x.M | M N

Thursday, 16 May 13

* The lambda calculus and Turing machines have the same origin.* Beginning 20th century: group of famous mathematicians interested in formalising foundation of mathematics. This led to an important question

M, N x | x.M | M N

Lambda Calculus Turing Machine

Thursday, 16 May 13

* The lambda calculus and Turing machines have the same origin.* Beginning 20th century: group of famous mathematicians interested in formalising foundation of mathematics. This led to an important question

M, N x | x.M | M N

Lambda Calculus Turing Machine

By-product of a study of the foundation and expressive power

of mathematics.

Thursday, 16 May 13

* The lambda calculus and Turing machines have the same origin.* Beginning 20th century: group of famous mathematicians interested in formalising foundation of mathematics. This led to an important question

David Hilbert

Thursday, 16 May 13

* Challenge posed by David Hilbert, 1928: the Entscheidungsproblem (decision problem)* Church & Turing, 1936, no solution, using lambda calculus & Turing machines. So what is the Entscheidungsproblem

Is there a solution to the Entscheidungsproblem?

David Hilbert

Thursday, 16 May 13

* Challenge posed by David Hilbert, 1928: the Entscheidungsproblem (decision problem)* Church & Turing, 1936, no solution, using lambda calculus & Turing machines. So what is the Entscheidungsproblem

Is there a solution to the Entscheidungsproblem?

David Hilbert

No!

No!

Thursday, 16 May 13

* Challenge posed by David Hilbert, 1928: the Entscheidungsproblem (decision problem)* Church & Turing, 1936, no solution, using lambda calculus & Turing machines. So what is the Entscheidungsproblem

Is there an algorithm to decide whether a given statement is provable from a set of axioms using the rules of first-order

logic?

Thursday, 16 May 13

* In other words: Given a world & a set of fixed rules in the world, check whether the world has a particular property. In turn, leads to the question

How do you prove that an algorithm does not exist?

Thursday, 16 May 13

* Because we cannot solve the challenge, doesn't mean it is unsolvable?* Need systematic way to rigorously prove that a solution is impossible. Church & Turing proceeded as follows

Thursday, 16 May 13

* 1936, the concept of an algorithm remained to be formally defined

(1) Define a universal language or abstract machine.

(2) Show that the desired algorithm cannot be expressed in the language.

Thursday, 16 May 13

* 1936, the concept of an algorithm remained to be formally defined

Define a universal language or abstract machine.

Thursday, 16 May 13

* Two steps * Church & Turing used: (1) lambda term, (2) Turing machine* Hypothesis: universal ie, any algorithmically computable function can be expressed They showed

Define a universal language or abstract machine.

Lambda Calculus Turing Machine

M, N x | x.M | M N

Thursday, 16 May 13

* Two steps * Church & Turing used: (1) lambda term, (2) Turing machine* Hypothesis: universal ie, any algorithmically computable function can be expressed They showed

Lambda Calculus Turing Machine

M, N x | x.M | M N

Universal language

Thursday, 16 May 13

* Two steps * Church & Turing used: (1) lambda term, (2) Turing machine* Hypothesis: universal ie, any algorithmically computable function can be expressed They showed

Lambda Calculus Turing Machine

M, N x | x.M | M N

Universal language

Church-Tu

ring thesis

Thursday, 16 May 13

* Two steps * Church & Turing used: (1) lambda term, (2) Turing machine* Hypothesis: universal ie, any algorithmically computable function can be expressed They showed

Lambda Calculus Turing Machine

M, N x | x.M | M N

Computational Power

=

Thursday, 16 May 13

* Any program expressible in one is expressible in the other. However,

Turing MachineLambda Calculus

M, N x | x.M | M N

Generality

Thursday, 16 May 13

* Lambda calculus: embodies concept of (functional) *abstraction** Functional abstraction is only one embodiment of an underlying more general concept. This is important, as

Turing Machine

Lambda Calculus

M, N x | x.M | M N

Generality

Thursday, 16 May 13

* Lambda calculus: embodies concept of (functional) *abstraction** Functional abstraction is only one embodiment of an underlying more general concept. This is important, as

Generality increases if a discovery is independently

made in a variety of contexts.

Thursday, 16 May 13

Read the statement.* If a concept transcends one application, its generality increases. This is the case for the lambda calculus

Simply typed lambda calculus

Thursday, 16 May 13

* Firstly, lambda calculus (no polytypes) Mathematicians Haskell Curry & William Howard discovered: it is structurally equivalent to

Simply typed lambda calculus

Lambda calculus with monotypes

Thursday, 16 M