Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Prolog
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Extensions == Various implementations have been developed from Prolog to extend logic programming abilities in many directions. These include [[type system|types]], modes, [[constraint logic programming]] (CLP), [[Object-oriented programming|object-oriented]] logic programming (OOLP), concurrency, [[linear logic]] (LLP), functional and [[higher-order logic]] programming abilities, plus interoperability with [[knowledge base]]s: === Types === Prolog is an untyped language. Attempts to introduce and extend Prolog with types began in the 1980s,<ref>{{Cite journal |doi=10.1016/0004-3702(84)90017-1 |last1=Mycroft |first1=A. |last2=O'Keefe |first2=R. A. |title=A polymorphic type system for prolog |journal=[[Artificial Intelligence (journal)|Artificial Intelligence]] |volume=23 |issue=3 |page=295 |year=1984}}</ref><ref>{{cite book |author=Pfenning, Frank |title=Types in logic programming |publisher=MIT Press |location=Cambridge, Massachusetts |year=1992 |isbn=978-0-262-16131-2}}</ref> and continue {{as of|2008|lc=y}}.<ref>{{Cite book |last1=Schrijvers |first1=Tom |last2=Santos Costa |first2=Vitor |last3=Wielemaker |first3=Jan |last4=Demoen |first4=Bart |year=2008 |chapter=Towards Typed Prolog |editor1=María García de la Banda |editor1-link=María García de la Banda|editor2=Enrico Pontelli |title=Logic programming: 24th international conference, ICLP 2008, Udine, Italy, December 9-13, 2008: proceedings |series=Lecture Notes in Computer Science |volume=5366 |pages=693–697 |doi=10.1007/978-3-540-89982-2_59 |isbn=978-3-540-89982-2 |chapter-url=https://lirias.kuleuven.be/handle/123456789/197561}}</ref> Type information is useful not only for [[type safety]] but also for reasoning about Prolog programs.<ref name="cite doi|10.1007/BF01213601">{{Cite journal |doi=10.1007/BF01213601 |last1=Apt |first1=K. R. |last2=Marchiori |first2=E. |title=Reasoning about Prolog programs: From modes through types to assertions |journal=Formal Aspects of Computing |volume=6 |issue=S1 |page=743 |year=1994 |url=http://www.cwi.nl/~apt/am.ps |citeseerx=10.1.1.57.395 |s2cid=12235465}}</ref> === Modes === {| style="float: right;" class="wikitable" border="1" |- ! Mode specifier ! Interpretation |- | <code>+</code> | <code>nonvar</code> on entry |- | <code>-</code> | <code>var</code> on entry |- | <code>?</code> | Not specified |} The syntax of Prolog does not specify which arguments of a predicate are inputs and which are outputs.<ref name="craft">{{cite book |author=O'Keefe, Richard A. |title=The craft of Prolog |publisher=MIT Press |location=Cambridge, Massachusetts |year=1990 |isbn=978-0-262-15039-2}}</ref> However, this information is significant and it is recommended that it be included in the comments.<ref>{{cite arXiv |title=Coding guidelines for Prolog |date=2010 |eprint=0911.2899 |last1=Covington |first1=Michael |last2=Bagnara |first2=Roberto |last3=O'Keefe |first3=Richard |last4=Wielemaker |first4=Jan |last5=Price |first5=Simon |display-authors=2 |class=cs.PL}}</ref> Modes provide valuable information when reasoning about Prolog programs<ref name="cite doi|10.1007/BF01213601"/> and can also be used to accelerate execution.<ref>{{Cite book |doi=10.1007/BFb0014976 |last1=Roy |first1=P. |last2=Demoen |first2=B. |isbn=978-3-540-17611-4 |last3=Willems |first3=Y. D. |chapter=Improving the execution speed of compiled Prolog with modes, clause selection, and determinism |title=Tapsoft '87 |series=Lecture Notes in Computer Science |volume=250 |pages=[https://archive.org/details/tapsoft87proceed0000inte/page/111 111] |year=1987 |chapter-url=https://archive.org/details/tapsoft87proceed0000inte/page/111}}</ref> === Constraints === [[Constraint logic programming]] extends Prolog to include concepts from [[constraint satisfaction]].<ref>{{Cite journal |last=Jaffar |first=J. |year=1994 |title=Constraint logic programming: a survey |journal=The Journal of Logic Programming |volume=19–20 |pages=503–581 |doi=10.1016/0743-1066(94)90033-7 |doi-access=free}}</ref><ref> {{cite journal |first=Alain |last=Colmerauer |year=1987 |title=Opening the Prolog III Universe |journal=Byte |volume=August }}</ref> A constraint logic program allows constraints in the body of clauses, such as: <code>A(X,Y) :- X+Y>0.</code> It is suited to large-scale [[combinatorial optimisation]] problems<ref>{{Cite book |last=Wallace |first=M. |year=2002 |chapter=Constraint Logic Programming |isbn=978-3-540-45628-5 |title=Computational Logic: Logic Programming and Beyond |series=Lecture Notes in Computer Science |volume=2407 |pages=512–556 |doi=10.1007/3-540-45628-7_19}}</ref> and is thus useful for applications in industrial settings, such as automated time-tabling and [[production scheduling]]. Most Prolog systems ship with at least one constraint solver for finite domains, and often also with solvers for other domains like [[rational number]]s. === Object-orientation === [[Flora-2]] is an object-oriented knowledge representation and reasoning system based on [[F-logic]] and incorporates [[HiLog]], [[Transaction logic]], and [[defeasible reasoning]]. [[Logtalk]] is an object-oriented logic programming language that can use most Prolog implementations as a back-end compiler. As a multi-paradigm language, it includes support for both prototypes and classes. [[Oblog]] is a small, portable, object-oriented extension to Prolog by Margaret McDougall of EdCAAD, University of Edinburgh. [[Objlog]] was a frame-based language combining objects and Prolog II from CNRS, Marseille, France. [[Prolog++]] was developed by [[Logic Programming Associates]] and first released in 1989 for MS-DOS PCs. Support for other platforms was added, and a second version was released in 1995. A book about Prolog++ by Chris Moss was published by Addison-Wesley in 1994. [[Visual Prolog]] is a multi-paradigm language with interfaces, classes, implementations and object expressions. === Graphics === Prolog systems that provide a [[graphics library]] are [[SWI-Prolog]],<ref>{{Cite web |url=https://www.swi-prolog.org/packages/xpce/ |title=XPCE: the SWI-Prolog native GUI library |website=swi-prolog.org}}</ref> [[Visual Prolog]], [[Logic Programming Associates|WIN-PROLOG]], and [[B-Prolog]]. === Concurrency === Prolog-MPI is an open-source [[SWI-Prolog]] extension for [[distributed computing]] over the [[Message Passing Interface]].<ref>{{cite web|url=http://apps.lumii.lv/prolog-mpi/ |title=prolog-mpi |publisher=Apps.lumii.lv |access-date=2010-09-16}}</ref> Also there are various concurrent Prolog programming languages.<ref>Ehud Shapiro. ''The family of concurrent logic programming languages'' [[ACM Computing Surveys]]. September 1989.</ref> === Web programming === Some Prolog implementations, notably [[Visual Prolog]], [[SWI-Prolog]] and [[Ciao (programming language)|Ciao]], support [[server-side]] [[web programming]] with support for web protocols, [[HTML]] and [[XML]].<ref>{{Cite journal |journal=Theory and Practice of Logic Programming |volume=8 |year=2008 |doi=10.1017/S1471068407003237 |title=SWI-Prolog and the web |first3=L. |first1=J. |last2=Huang |first2=Z. |last1=Wielemaker |last3=Van Der Meij |issue=3 |page=363 |s2cid=5404048 |url=https://pure.uva.nl/ws/files/4221287/58604_285112.pdf}}</ref> There are also extensions to support [[semantic web]] formats such as [[Resource Description Framework]] (RDF) and [[Web Ontology Language]] (OWL).<ref> {{citation |last1=Wielemaker |first1=Jan |last2=Hildebrand |first2=Michiel |last3=van Ossenbruggen |first3=Jacco |year=2007 |title=Using {Prolog} as the fundament for applications on the semantic web |periodical=Proceedings of the 2nd Workshop on Applications of Logic Programming and to the Web, Semantic Web and Semantic Web Services |publisher=CEUR-WS.org |series=CEUR Workshop Proceedings |volume=287 |pages=84–98 |location=Porto, Portugal |editor1-last=Heymans |editor1-first=S. |editor2-last=Polleres |editor2-first=A. |editor3-last=Ruckhaus |editor3-first=E. |editor4-last=Pearse |editor4-first=D. |editor5-last=Gupta |editor5-first=G. |url=http://ftp.informatik.rwth-aachen.de/Publications/CEUR-WS/Vol-287/paper_1.pdf }}</ref><ref>[http://ceur-ws.org/Vol-529/owled2009_submission_43.pdf Processing OWL2 Ontologies using Thea: An Application of Logic Programming]. Vangelis Vassiliadis, Jan Wielemaker and Chris Mungall. Proceedings of the 5th International Workshop on OWL: Experiences and Directions (OWLED 2009), Chantilly, VA, United States, October 23–24, 2009</ref> Prolog has also been suggested as a [[client-side]] language.<ref>{{Cite journal |last1=Loke |first1=S. W. |last2=Davison |first2=A. |title=Secure Prolog-based mobile code |journal=Theory and Practice of Logic Programming |volume=1 |issue=3 |page=321 |year=2001 |doi=10.1017/S1471068401001211 |citeseerx=10.1.1.58.6610 |arxiv=cs/0406012 |s2cid=11754347}}</ref> In addition, Visual Prolog supports [[JSON-RPC]] and [[Websockets]]. === Adobe Flash === [http://sites.google.com/site/cedarprolog/ Cedar] {{Webarchive|url=https://web.archive.org/web/20101019074143/http://sites.google.com/site/cedarprolog/ |date=2010-10-19}} is a free and basic Prolog interpreter. From version 4 and above Cedar has a FCA (Flash Cedar App) support. This provides a new platform to programming in Prolog through [[ActionScript]]. === Other === * [[F-logic]] extends Prolog with frames/objects for [[knowledge representation]]. * [[Transaction logic]] extends Prolog with a logical theory of state-changing update operators. It has both a model-theoretic and procedural semantics. * [[OW Prolog]] has been created in order to answer Prolog's lack of graphics and interface.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)