HOME

TheInfoList



OR:

Epigram is a
functional programming In computer science, functional programming is a programming paradigm where programs are constructed by applying and composing functions. It is a declarative programming paradigm in which function definitions are trees of expressions tha ...
language with
dependent type In computer science and logic, a dependent type is a type whose definition depends on a value. It is an overlapping feature of type theory and type systems. In intuitionistic type theory, dependent types are used to encode logic's quantifier ...
s, and the
integrated development environment An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools ...
(IDE) usually packaged with the language. Epigram's
type system In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a type to every "term" (a word, phrase, or other set of symbols). Usually the terms are various constructs of a computer progra ...
is strong enough to express program specifications. The goal is to support a smooth transition from ordinary programming to integrated programs and proofs whose correctness can be checked and certified by the
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs tha ...
. Epigram exploits the ''
Curry–Howard correspondence In programming language theory and proof theory, the Curry–Howard correspondence (also known as the Curry–Howard isomorphism or equivalence, or the proofs-as-programs and propositions- or formulae-as-types interpretation) is the direct rela ...
'', also termed the ''propositions as types principle'', and is based on
intuitionistic type theory Intuitionistic type theory (also known as constructive type theory, or Martin-Löf type theory) is a type theory and an alternative foundation of mathematics. Intuitionistic type theory was created by Per Martin-Löf, a Swedish mathematician an ...
. The Epigram prototype was implemented by
Conor McBride Conor McBride (born 18 February 1973) is a Reader in the department of Computer and Information Sciences at the University of Strathclyde. In 1999, he completed a Doctor of Philosophy (Ph.D.) in ''Dependently Typed Functional Programs and thei ...
based on joint work with James McKinna. Its development is continued by the Epigram group in
Nottingham Nottingham ( , locally ) is a city and unitary authority area in Nottinghamshire, East Midlands, England. It is located north-west of London, south-east of Sheffield and north-east of Birmingham. Nottingham has links to the legend of Robi ...
,
Durham Durham most commonly refers to: *Durham, England, a cathedral city and the county town of County Durham *County Durham, an English county * Durham County, North Carolina, a county in North Carolina, United States *Durham, North Carolina, a city in N ...
,
St Andrews St Andrews ( la, S. Andrea(s); sco, Saunt Aundraes; gd, Cill Rìmhinn) is a town on the east coast of Fife in Scotland, southeast of Dundee and northeast of Edinburgh. St Andrews had a recorded population of 16,800 , making it Fife's fourt ...
, and
Royal Holloway, University of London Royal Holloway, University of London (RHUL), formally incorporated as Royal Holloway and Bedford New College, is a public research university and a constituent college of the federal University of London. It has six schools, 21 academic depa ...
in the
United Kingdom The United Kingdom of Great Britain and Northern Ireland, commonly known as the United Kingdom (UK) or Britain, is a country in Europe, off the north-western coast of the continental mainland. It comprises England, Scotland, Wales and ...
(UK). The current experimental implementation of the Epigram system is freely available together with a user manual, a tutorial and some background material. The system has been used under
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, whi ...
,
Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for se ...
, and
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and la ...
. It is currently unmaintained, and version 2, which was intended to implement Observational Type Theory, was never officially released but exists in
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, cont ...
.


Syntax

Epigram uses a two-dimensional,
natural deduction In logic and proof theory, natural deduction is a kind of proof calculus in which logical reasoning is expressed by inference rules closely related to the "natural" way of reasoning. This contrasts with Hilbert-style systems, which instead use ax ...
style syntax, with versions in
LaTeX Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well. In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosperms ...
and
ASCII ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
. Here are some examples from ''The Epigram Tutorial'':


Examples


The natural numbers

The following declaration defines the
natural numbers In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called '' cardinal ...
: The declaration says that Nat is a type with kind * (i.e., it is a simple type) and two constructors: zero and suc. The constructor suc takes a single Nat argument and returns a Nat. This is equivalent to the
Haskell Haskell () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lan ...
declaration "data Nat = Zero , Suc Nat". In LaTeX, the code is displayed as: :\underline \; \left(\frac\right) \; \underline \; \left(\frac\right) \; ; \; \left(\frac\right) The horizontal-line notation can be read as "assuming (what is on the top) is true, we can infer that (what is on the bottom) is true." For example, "assuming n is of type Nat, then suc n is of type Nat." If nothing is on the top, then the bottom statement is always true: "zero is of type Nat (in all cases)."


Recursion on naturals

:\mathsf : \begin \forall P : \mathsf \rightarrow \star \Rightarrow P\ \mathsf \rightarrow \\ (\forall n : \mathsf \Rightarrow P\ n \rightarrow P\ (\mathsf\ n)) \rightarrow\\ \forall n : \mathsf \Rightarrow P\ n \end :\mathsf\ P\ mz\ ms\ \mathsf \equiv mz :\mathsf\ P\ mz\ ms\ (\mathsf\ n) \equiv ms\ n\ (NatInd\ P\ mz\ ms\ n) ...And in ASCII:


Addition

: \mathsf\ x\ y \Leftarrow \underline\ x\ \ ...And in ASCII:


Dependent types

Epigram is essentially a
typed lambda calculus A typed lambda calculus is a typed formalism that uses the lambda-symbol (\lambda) to denote anonymous function abstraction. In this context, types are usually objects of a syntactic nature that are assigned to lambda terms; the exact nature of a ...
with
generalized algebraic data type In functional programming, a generalized algebraic data type (GADT, also first-class phantom type, guarded recursive datatype, or equality-qualified type) is a generalization of parametric algebraic data types. Overview In a GADT, the product co ...
extensions, except for two extensions. First, types are first-class entities, of type \star; types are arbitrary expressions of type \star, and type equivalence is defined in terms of the types' normal forms. Second, it has a dependent function type; instead of P \rightarrow Q, \forall x : P \Rightarrow Q, where x is bound in Q to the value that the function's argument (of type P) eventually takes. Full dependent types, as implemented in Epigram, are a powerful abstraction. (Unlike in Dependent ML, the value(s) depended upon may be of any valid type.) A sample of the new formal specification capabilities dependent types bring may be found in ''The Epigram Tutorial''.


See also

* ALF, a proof assistant among the predecessors of Epigram.


Further reading

* * * * * *


External links

* * *
EPSRC
on ALF, lego and related; archived version from 2006


References

{{Reflist Academic programming languages Functional languages Dependently typed languages Proof assistants Discontinued programming languages