ArticleslgStudy

mathematics

Programming Computable Functions

Programming Computable Functions is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Programming Computable Functions rather than just read about it. In short: In computer science, Programming Computable Functions (PCF), or Programming with Computable Functions, or Programming language for Computable Functions, is a programming language which is typed and based on functional programming, introduced by Gordon Plotkin in 1977, based on prior unpublished material by Dana Scott. It can be considered as an extended version of the typed lambda calculus, or a simplified version o…

Key takeaways

  • Programming Computable Functions belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Programming Computable Functions to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Programming Computable Functions from memory before moving on to harder problems.

Reference excerpt

In computer science, Programming Computable Functions (PCF), or Programming with Computable Functions, or Programming language for Computable Functions, is a programming language which is typed and based on functional programming, introduced by Gordon Plotkin in 1977, based on prior unpublished material by Dana Scott. It can be considered as an extended version of the typed lambda calculus, or a simplified version of modern typed functional languages such as ML or Haskell. A fully abstract model for PCF was first given by Robin Milner. However, since Milner's model was essentially based on the syntax of PCF it was considered less than satisfactory. The first two fully abstract models not employing syntax were formulated during the 1990s. These models are based on game semantics and Kripke logical relations. For a time it was felt that neither of these models was completely satisfactory, since they were not effectively presentable. However, Ralph Loader demonstrated that no effectively presentable fully abstract model could exist, since the question of program equivalence in the finitary fragment of PCF is not decidable.

Syntax The data types of PCF are inductively defined as

nat is a type For types σ and τ, there is a function type σ → τ A context is a list of pairs x : σ, where x is a variable name and σ is a type, such that no variable name is duplicated. One then defines typing judgments of terms-in-context in the usual way for the following syntactical constructs:

Variables (if x : σ is part of a context Γ, then Γ ⊢ x : σ) Application (of a term of type σ → τ to a term of type σ) λ-abstraction The Y fixed point combinator (making terms of type σ out of terms of type σ → σ) The successor (succ) and predecessor (pred) operations on nat and the constant 0 The conditional if with the typing rule:

Γ ⊢ t : nat , Γ ⊢ s 0 : σ , Γ ⊢ s 1 : σ Γ ⊢ if ( t , s 0 , s 1 ) : σ {\displaystyle {\frac {\Gamma \;\vdash \;t\;:{\textbf {nat}},\quad \quad \Gamma \;\vdash \;s_{0}\;:\sigma ,\quad \quad \Gamma \;\vdash \;s_{1}\;:\sigma }{\Gamma \;\vdash \;{\textbf {if}}(t,s_{0},s_{1})\;:\sigma }}}

(nats will be interpreted as booleans here with a convention like zero denoting truth, and any other number denoting falsity)

Semantics

Denotational semantics A relatively straightforward semantics for the language is the Scott model. In this model,

Types are interpreted as certain domains.

[ [ nat ] ] := N ⊥ {\displaystyle [\![{\textbf {nat}}]\!]:=\mathbb {N} _{\bot }} (the natural numbers with a bottom element adjoined, with the flat ordering)

[ [ σ → τ ] ] {\displaystyle [\![\sigma \to \tau \,]\!]} is interpreted as the domain of Scott-continuous functions from [ [ σ ] ] {\displaystyle [\![\sigma ]\!]\,} to [ [ τ ] ] {\displaystyle [\![\tau ]\!]\,} , with the pointwise ordering. A context x 1 : σ 1 , … , x n : σ n {\displaystyle x_{1}:\sigma _{1},\;\dots ,\;x_{n}:\sigma _{n}} is interpreted as the product [ [ σ 1 ] ] × … × [ [ σ n ] ] {\displaystyle [\![\sigma _{1}]\!]\times \;\dots \;\times [\![\sigma _{n}]\!]}

Terms in context Γ ⊢ x : σ {\displaystyle \Gamma \;\vdash \;x\;:\;\sigma } are interpreted as continuous functions [ [ Γ ] ] → [ [ σ ] ] {\displaystyle [\![\Gamma ]\!]\;\to \;[\![\sigma ]\!]}

Variable terms are interpreted as projections Lambda abstraction and application are interpreted by making use of the cartesian closed structure of the category of domains and continuous functions Y is interpreted by taking the least fixed point of the argument This model is not fully abstract for PCF; but it is fully abstract for the language obtained by adding a parallel or operator to PCF.

Notes

References

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Programming Computable Functions

Start with the simplest possible case. Write down what Programming Computable Functions claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Programming Computable Functions before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Programming Computable Functions ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Programming Computable Functions

In research
Programming Computable Functions appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Programming Computable Functions in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Programming Computable Functions is common in secondary-school and first-year university syllabi. It links to neighbouring topics Academic programming languages, Educational programming languages, Functional languages, so understanding it makes those chapters shorter.
In everyday life
Look for Programming Computable Functions outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Programming Computable Functions in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Programming Computable Functions means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Programming Computable Functions out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Programming Computable Functions in simple terms?

In computer science, Programming Computable Functions (PCF), or Programming with Computable Functions, or Programming language for Computable Functions, is a programming language which is typed and based on functional programming, introduced by Gordon Plotkin in 1977, based on prior unpublished mat…

Why does Programming Computable Functions matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Programming Computable Functions?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Programming Computable Functions.

Tags

  • Academic programming languages
  • Educational programming languages
  • Functional languages
  • Programming language theory
  • Programming languages created in 1977

Keep exploring