Logtalk: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 78: Line 78:


==Applications==
==Applications==
Logtalk has been used to process [[ISO 10303-21|STEP]] data models used to exchange [[product manufacturing information]].<ref>{{cite doi|10.1007/11799573}}</ref>{{full citation needed}}{{failed verification}} It has also been used to implement a reasoning system that allows preference reasoning and [[constraint solving]].<ref>{{ cite encyclopedia | encyclopedia = Logic Programming and Nonmonotonic Reasoning | series = Lecture Notes in Computer Science | year = 2009 | volume= 5753 | pages = 535-541 | doi = 10.1007/978-3-642-04238-6_54 | title = Gorgias-C: Extending Argumentation with Constraint Solving | author1 = Victor Noël | author2 = Antonis Kakas }}</ref>
Logtalk has been used to process [[ISO 10303-21|STEP]] data models used to exchange [[product manufacturing information]].<ref>{{cite doi|10.1007/11799573}}</ref>{{full citation needed}}{{failed verification}} It has also been used to implement a reasoning system that allows preference reasoning and [[constraint solving]].<ref>{{ cite conference | conference = Logic Programming and Nonmonotonic Reasoning | series = Lecture Notes in Computer Science | year = 2009 | volume= 5753 | pages = 535-541 | urlftp://ftp.irit.fr/IRIT/SMAC/DOCUMENTS/PUBLIS/lpnmr-09_noel-kakas.pdf | title = Gorgias-C: Extending Argumentation with Constraint Solving | author1 = Victor Noël | author2 = Antonis Kakas }}</ref>


==See also==
==See also==

Revision as of 14:45, 24 December 2014

Logtalk
ParadigmLogic programming
Designed byPaulo Moura
First appeared1998
Stable release
2.44.1 / May 28, 2012 (2012-05-28)
Preview release
3.00.0 Release Candidate 6 / November 19, 2014 (2014-11-19)
OSCross-platform
LicenseArtistic License 2.0 (2.x) / GNU GPL v3 (3.x)
Websitelogtalk.org
Influenced by
Prolog, Smalltalk, Objective-C; logic programming, object-oriented programming, prototype-based programming

Logtalk is an object-oriented logic programming language that extends and leverages the Prolog language with a feature set suitable for programming in the large.[1] It provides support for encapsulation and data hiding, separation of concerns and enhanced code reuse.[1] Logtalk uses standard Prolog syntax with the addition of a few operators and directives.

Logtalk is distributed under an open source license and can run using a Prolog implementation (compliant with official and de facto standards)[citation needed] as the back-end compiler.

Features

Logtalk aims to bring together the advantages of object-oriented programming and logic programming.[1] Object-orientation emphasizes developing discrete, reusable units of software, while logic programming emphasizes representing the knowledge of each object in a declarative way.

As an object-oriented programming language, Logtalk's major features include support for both classes (with optional metaclasses) and prototypes, parametric objects,[2] protocols (interfaces), categories (mixins, aspects, hot patching), multiple inheritance, public/protected/private inheritance, event-driven programming, high-level multi-threading programming,[3] reflection, and automatic generation of documentation.

For Prolog programmers, Logtalk provides wide portability, featuring predicate namespaces (supporting both static and dynamic objects), public/protected/private object predicates, coinductive predicates, separation between interface and implementation, simple and intuitive meta-predicate semantics, lambda expressions, definite clause grammars, term-expansion mechanism, and conditional compilation. It also provides a module system based on de facto standard core module functionality (internally, modules are compiled as prototypes).

Examples

Logtalk's syntax is based on Prolog:

?- write('Hello world'), nl.
Hello world
true.

Defining an object:

:- object(my_first_object).

    :- initialization((write('Hello world'), nl)).

    :- public(p1/0).
    p1 :- write('This is a public predicate'), nl.

    :- private(p2/0).
    p2 :- write('This is a private predicate'), nl.

:- end_object.

Using the object, assuming is saved in a my_first_object.lgt file:

?- logtalk_load(my_first_object).
Hello world
true.

?- my_first_object::p1.
This is a public predicate
true.

Trying to access the private predicate gives an error:

?- my_first_object::p2.
ERROR: error(permission_error(access, private_predicate, p2), my_first_object::p2, user)

Prolog back-end compatibility

As of October 2011, supported back-end Prolog compilers include B-Prolog, CxProlog, ECLiPSe, GNU Prolog, LeanProlog, Qu-Prolog, SICStus Prolog, SWI-Prolog, XSB, and YAP Prolog.[4] Logtalk allows seamless[according to whom?] use of most back-end Prolog compiler libraries from within object and categories.

Developer tools

Logtalk features on-line help, a documenting tool (that can generate PDF and HTML files), an entity diagram generator tool, a built-in debugger (based on an extended version of the traditional Procedure Box model found on most Prolog compilers), a unit test framework with code coverage analysis, and is also compatible with selected back-end Prolog profilers and graphical tracers.[5]

Applications

Logtalk has been used to process STEP data models used to exchange product manufacturing information.[6][full citation needed][failed verification] It has also been used to implement a reasoning system that allows preference reasoning and constraint solving.[7]

See also

References

  1. ^ a b c Paulo Moura (2003). Logtalk: Design of an Object-Oriented Logic Programming Language. PhD thesis. Universidade da Beira Interior
  2. ^ Attention: This template ({{cite doi}}) is deprecated. To cite the publication identified by doi:10.1007/978-3-642-20589-7_4, please use {{cite journal}} (if it was published in a bona fide academic journal, otherwise {{cite report}} with |doi=10.1007/978-3-642-20589-7_4 instead.
  3. ^ Attention: This template ({{cite doi}}) is deprecated. To cite the publication identified by doi:10.1007/978-3-540-77442-6, please use {{cite journal}} (if it was published in a bona fide academic journal, otherwise {{cite report}} with |doi=10.1007/978-3-540-77442-6 instead.
  4. ^ "Logtalk compatibility". Logtalk.org. 2013-02-10. Retrieved 2013-08-19.
  5. ^ / (2013-02-12). "Developer Tools 路 LogtalkDotOrg/logtalk3 Wiki 路 GitHub". Github.com. Retrieved 2013-08-19. {{cite web}}: |author= has numeric name (help)
  6. ^ Attention: This template ({{cite doi}}) is deprecated. To cite the publication identified by doi:10.1007/11799573, please use {{cite journal}} (if it was published in a bona fide academic journal, otherwise {{cite report}} with |doi=10.1007/11799573 instead.
  7. ^ Victor Noël; Antonis Kakas (2009). Gorgias-C: Extending Argumentation with Constraint Solving. Logic Programming and Nonmonotonic Reasoning. Lecture Notes in Computer Science. Vol. 5753. pp. 535–541. {{cite conference}}: Text "urlftp://ftp.irit.fr/IRIT/SMAC/DOCUMENTS/PUBLIS/lpnmr-09_noel-kakas.pdf" ignored (help)

External links

  • Official website
  • Logtalking blog
  • From Plain Prolog to Logtalk Objects: Effective Code Encapsulation and Reuse (Invited Talk). Paulo Moura. Proceedings of the 25th International Conference on Logic Programming (ICLP), July 2009. LNCS 5649. Springer-Verlag Berlin Heidelberg". (Slides)