Programming Computable Functions

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
Programming Computable Functions
Paradigmfunctional
Designed byDana Scott,
Robin Milner,
Gordon Plotkin
First appearedDecember 1977; 48 years ago (1977-12)
Final release
Full Abstraction / 15 December 2000; 25 years ago (2000-12-15)
Website{{#property:P856}}

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,[1] based on prior unpublished material by Dana Scott.[a] 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.[2] However, since Milner's model was essentially based on the syntax of PCF it was considered less than satisfactory.[3] The first two fully abstract models not employing syntax were formulated during the 1990s. These models are based on game semantics[4][5] and Kripke logical relations.[6] 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.[7]

Syntax

[edit | edit source]

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:𝐧𝐚𝐭,Γs0:σ,Γs1:σΓ𝐢𝐟(t,s0,s1):σ
(nats will be interpreted as booleans here with a convention like zero denoting truth, and any other number denoting falsity)

Semantics

[edit | edit source]

Denotational semantics

[edit | edit source]

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

  • Types are interpreted as certain domains.
    • [[𝐧𝐚𝐭]]:= (the natural numbers with a bottom element adjoined, with the flat ordering)
    • [[στ]] is interpreted as the domain of Scott-continuous functions from [[σ]] to [[τ]], with the pointwise ordering.
  • A context x1:σ1,,xn:σn is interpreted as the product [[σ1]]××[[σn]]
  • Terms in context Γx:σ are interpreted as continuous functions [[Γ]][[σ]]
    • 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.[4]: 293 

Notes

[edit | edit source]
  1. ^ "PCF is a programming language for computable functions, based on LCF, Scott’s logic of computable functions."[1] Programming Computable Functions is used by (Mitchell 1996).

References

[edit | edit source]
  1. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  4. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  6. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value). Appeared as Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  • Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
[edit | edit source]