Jump to content
Wikipedia The Free Encyclopedia

λProlog

From Wikipedia, the free encyclopedia
Computer programming language
λProlog
Paradigm Logic programming
Designed by Dale Miller and Gopalan Nadathur
First appeared1987[1]
Typing discipline strongly typed
License GNU General Public License v3
Websitewww.lix.polytechnique.fr/Labo/Dale.Miller/lProlog/
Major implementations
Teyjus, ELPI
Influenced by
Prolog
Influenced
Makam

λProlog, also written lambda Prolog, is a logic programming language featuring polymorphic typing, modular programming, and higher-order programming. These extensions to Prolog are derived from the higher-order hereditary Harrop formulas used to justify the foundations of λProlog. Higher-order quantification, simply typed λ-terms, and higher-order unification gives λProlog the basic supports needed to capture the λ-tree syntax approach to higher-order abstract syntax , an approach to representing syntax that maps object-level bindings to programming language bindings. Programmers in λProlog need not deal with bound variable names: instead various declarative devices are available to deal with binder scopes and their instantiations.

History

[edit ]

Since 1986, λProlog has received numerous implementations. As of 2023, the language and its implementations are still actively being developed.

The Abella theorem prover has been designed to provide an interactive environment for proving theorems about the declarative core of λProlog.

Programming in λProlog

[edit ]

Two unique features of λProlog include implications and universal quantification. Implication is used for local scoping of predicate definitions while universal quantification is used for local scoping of variables, as in the following implementation of reverse depending on an auxiliary rev predicate:

reverseLK:-pirev \
(revnilK&
(piH\piT\piS\rev(H::T)S:-revT(H::S)))
=>revLnil.
?-reverse[1,2,3]L.
Success:
L=3::2::1::nil

A common use of these scoping constructs is to simulate scope often seen in an inference-rule presentation of a logic. For example, proof search (and proof checking) in natural deduction may be encoded as follows:

pvPfP:-hypPfP.
pv(andIP1P2)(andAB):-pvP1A,pvP2B.
pv(impIP)(impAB):-pip \(hyppA)=>(pv(Pp)B).
pv(andE1P)A:-sigmaB \hypP(andAB).
pv(andE2P)B:-sigmaA \hypP(andAB).
pv(impEP1P2)B:-sigmaA \hypP1(impAB),pvP2A.
?-pip q r \pv(Pfpqr)(impp(imp(andqr)(and(andpq)r))).
Success:
Pf=W1\W2\W3\impI(W4\impI(W5\andI(andIW4(andE1W5))(andE2W5)))

See also

[edit ]

References

[edit ]
  1. ^ "FAQ: What implementations of lambda Prolog are available?". www.lix.polytechnique.fr. Retrieved 2019年12月16日.

Tutorials and texts

[edit ]
[edit ]

Implementations

[edit ]


Stub icon

This programming-language-related article is a stub. You can help Wikipedia by expanding it.

  1. ^ Nadathur, Gopalan; Dustin Mitchell (1999). System Description: Teyjus - A Compiler and Abstract Machine Based Implementation of lambda Prolog. LNAI. Vol. 1632. pp. 287–291. doi:10.1007/3-540-48660-7_25. ISBN 978-3-540-66222-8. {{cite book}}: |journal= ignored (help)

AltStyle によって変換されたページ (->オリジナル) /