Programming Computable Functions: Difference between revisions
Jerryobject (talk | contribs) WP:LEADSENTENCE MOS:BOLDSYNonym: adds, clarify. Small WP:COPYEDITs WP:EoS: clarify, WP:TERSE. WP:LINKs: adds, needless WP:PIPEs > WP:NOPIPEs, update-standardizes, WP:RED delink until article exists. WP:REFerence WP:CITation parameters: respaces, cut whitespace characters to standardize, aid work via small screens, update-standardize-conform, reorders, adds, fills. Adds: MOS:COMMENT, WP:CATEGORY. |
Jerryobject (talk | contribs) Adds: Template:Infobox programming language, parameters, fills, WP:LINKs. WP:REFerence WP:CITation parameters: update-standardize-conform, add, fill. |
||
Line 1: | Line 1: | ||
{{Short description|A typed functional language}} |
{{Short description|A typed functional language}} |
||
{{Infobox programming language |
|||
| name = Programming Computable Functions |
|||
| screenshot = <!-- Filename --> |
|||
| screenshot caption = |
|||
| sampleCode = |
|||
| paradigm = [[Functional programming|functional]] |
|||
| family = |
|||
| designers = [[Dana Scott]],<br/>[[Robin Milner]],<br/>[[Gordon Plotkin]] |
|||
| released = {{Start date and age|1977|12}} |
|||
| latest release version = Full Abstraction |
|||
| latest release date = {{Start date and age|2000}} |
|||
| typing = |
|||
| memory management = |
|||
| scope = |
|||
| programming language = |
|||
| discontinued = Yes |
|||
| platform = |
|||
| operating system = |
|||
| license = |
|||
| file ext = |
|||
| file format = <!-- or: | file formats = --> |
|||
| website = <!-- {{URL|www.example.com}} --> |
|||
| implementations = |
|||
| dialects = |
|||
| influenced by = |
|||
| influenced = |
|||
}} |
|||
In [[computer science]], '''Programming Computable Functions''' ('''PCF'''), or '''Programming with Computable Functions''', or '''Programming language for Computable Functions''', is a [[programming language]] which is [[Type system|typed]] and based on [[functional programming]], introduced by [[Gordon Plotkin]] in 1977,<ref name="Plotkin 1977"/> based on prior unpublished material by [[Dana Scott]].{{Efn|"PCF is a programming language for computable functions, based on LCF, Scott’s logic of computable functions."{{r|name=Plotkin 1977}} ''Programming Computable Functions'' is used by {{harv|Mitchell|1996}}.}} 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 (programming language)|ML]] or [[Haskell]]. |
In [[computer science]], '''Programming Computable Functions''' ('''PCF'''), or '''Programming with Computable Functions''', or '''Programming language for Computable Functions''', is a [[programming language]] which is [[Type system|typed]] and based on [[functional programming]], introduced by [[Gordon Plotkin]] in 1977,<ref name="Plotkin 1977"/> based on prior unpublished material by [[Dana Scott]].{{Efn|"PCF is a programming language for computable functions, based on LCF, Scott’s logic of computable functions."{{r|name=Plotkin 1977}} ''Programming Computable Functions'' is used by {{harv|Mitchell|1996}}.}} 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 (programming language)|ML]] or [[Haskell]]. |
||
Line 5: | Line 32: | ||
==Syntax== |
==Syntax== |
||
The '' |
The ''[[data type]]s'' of PCF are inductively defined as |
||
* '''nat''' is a type |
* '''nat''' is a type |
||
* For types ''σ'' and ''τ'', there is a type ''σ'' → ''τ'' |
* For types ''σ'' and ''τ'', there is a type ''σ'' → ''τ'' |
||
Line 57: | Line 84: | ||
|first1=Gordon D. |
|first1=Gordon D. |
||
|author1-link=Gordon Plotkin |
|author1-link=Gordon Plotkin |
||
| |
|date=December 1977 |
||
|title=LCF considered as a programming language |
|title=LCF considered as a programming language |
||
|journal=Theoretical Computer Science |
|journal=Theoretical Computer Science |
||
Line 71: | Line 98: | ||
|first1=Robin |
|first1=Robin |
||
|author1-link=Robin Milner |
|author1-link=Robin Milner |
||
| |
|date=February 1977 |
||
|title=Fully abstract models of typed λ-calculi |
|title=Fully abstract models of typed λ-calculi |
||
|journal=Theoretical Computer Science |
|journal=Theoretical Computer Science |
||
|volume=4 |
|volume=4 |
||
|issue=1 |
|||
|pages=1–22 |
|pages=1–22 |
||
|doi=10.1016/0304-3975(77)90053-6 |url=https://www.pure.ed.ac.uk/ws/files/15112912/1_s2.0_0304397577900536_main.pdf |
|doi=10.1016/0304-3975(77)90053-6 |url=https://www.pure.ed.ac.uk/ws/files/15112912/1_s2.0_0304397577900536_main.pdf |
Revision as of 08:58, 21 April 2025
Paradigm | functional |
---|---|
Designed by | Dana Scott, Robin Milner, Gordon Plotkin |
First appeared | December 1977 |
Final release | Full Abstraction
/ 2000 |
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
The data types of PCF are inductively defined as
- nat is a type
- For types σ and τ, there is a 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:
- (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.
- (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 is interpreted as the product
- Terms in context 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
- ^ "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
- ^ a b Plotkin, Gordon D. (December 1977). "LCF considered as a programming language" (PDF). Theoretical Computer Science. 5 (3): 223–255. doi:10.1016/0304-3975(77)90044-5.
- ^ Milner, Robin (February 1977). "Fully abstract models of typed λ-calculi" (PDF). Theoretical Computer Science. 4 (1): 1–22. doi:10.1016/0304-3975(77)90053-6. hdl:20.500.11820/731c88c6-cdb1-4ea0-945e-f39d85de11f1.
- ^ Ong, C.-H. L. (1995). "Correspondence between Operational and Denotational Semantics: The Full Abstraction Problem for PCF". In Abramsky, S.; Gabbay, D.; Maibau, T. S. E. (eds.). Handbook of Logic in Computer Science. Oxford University Press. pp. 269–356. Archived from the original on 2006-01-07. Retrieved 2006-01-19.
- ^ a b Hyland, J. M. E.; Ong, C.-H. L. (2000). "On Full Abstraction for PCF". Information and Computation. 163 (2): 285–408. doi:10.1006/inco.2000.2917.
- ^ Abramsky, S.; Jagadeesan, R.; Malacaria, P. (2000). "Full Abstraction for PCF". Information and Computation. 163 (2): 409–470. doi:10.1006/inco.2000.2930.
- ^ O'Hearn, P. W.; Riecke, J. G. (1995). "Kripke Logical Relations and PCF". Information and Computation. 120 (1): 107–116. doi:10.1006/inco.1995.1103.
- ^ Loader, R. (2001). "Finitary PCF is not decidable". Theoretical Computer Science. 266 (1–2): 341–364. doi:10.1016/S0304-3975(00)00194-8.
- Scott, Dana S. (1969). "A type-theoretic alternative to CUCH, ISWIM, OWHY" (PDF). Unpublished Manuscript. Appeared as Scott, Dana S. (1993). "A type-theoretic alternative to CUCH, ISWIM, OWHY". Theoretical Computer Science. 121: 411–440. doi:10.1016/0304-3975(93)90095-b.
- Mitchell, John C. (1996). "The Language PCF". Foundations for Programming Languages. MIT Press. ISBN 9780262133210.