You can edit almost every page by Creating an account. Otherwise, see the FAQ.

Epilog (programming language)

From EverybodyWiki Bios & Wiki

Script error: No such module "Draft topics". Script error: No such module "AfC topic".

Epilog[1] (also known as Dynamic Prolog) is a knowledge representation language based on Dynamic Logic Programming. Epilog is similar to Functional Programming languages (like Lisp) and Logic Programming languages (like Datalog and Prolog) in that it allows its users to define functions and relations. However, it differs from such languages in that it also allows users to define operations (as transformations on datasets). The upshot is a declarative approach to formalizing knowledge about dynamic worlds that is conceptually simple yet computationally practical. In its ability to represent dynamic information, Epilog is closely related to Transaction Logic and Logic Production Systems (LPS)[2][3].

Dynamic Logic Programming[edit]

Datasets. The theory of Dynamic Logic Programming (DLP) begins with the concept of a dataset. A dataset is a collection of facts about some aspect of the world expressed in the form of ground atomic sentences (i.e. simple sentences with no variables).

For example, one can represent a state of the Blocks World with a dataset like the one shown below. Block a is on block b; block b is on block c; and block d is on block e. Blocks a and d are clear. Blocks c and e are resting on the table.


Datasets can be used by themselves to encode information. They can also be used in combination with logic programs to form more complex information systems (similar to deductive databases, except with function symbols).

Relations. In Epilog, new relations are defined as views of datasets by writing rules in a syntax similar to that of Prolog. For example, the following rules define the above relation in terms of the on relation. A block X is above a block Z if X is on Z or if X is on Y and Y is above Z.

above(X,Z) :- on(X,Z)
above(X,Z) :- on(X,Y) & above(Y,Z)

Functions. Epilog also provides its users with the ability to define evaluable functions. For example, the following rule defines the volume of a block to be the product of its width and its height and its depth.

volume(B) := times(width(B),height(B),depth(B))

Operations. Operations are defined as transformations on datasets. For example, the stack operation can be defined as shown below. If one stacks a block X on Y and if both X and Y are clear of other blocks and X in on the table, then afterward block X is on block Y, X is no longer on the table, and Y is no longer clear.

stack(X,Y) ::
clear(X) & clear(Y) & table(Y)
==> on(X,Y) & ~table(X) & ~clear(Y)

In Epilog, all of the results of an operation are computed before any changes are made. This differs from most production systems and various implementations of assert and retract in Prolog (where changes are computed and executed one at a time).

A formal specification of the syntax and semantics of Epilog can be found in[4] and[5]. The semantics is strictly declarative, i.e. it is defined without reference to a particular interpreter for that language. That said,[5] also provides details of practical interpreter for the language.


EpilogJS[6] is a collection of Javascript subroutines and variables developed to support processing of Epilog datasets and rulesets. It includes an interpreter, an optimizer, and a rudimentary compiler.

Sierra[7] is a browser-based interactive development environment (IDE) for Epilog. It allows users to view and edit datasets, relation definitions, function definitions, and operation definitions. It provides a variety of tools for manually querying and modifying datasets, and it automatically updates visual displays of datasets in spreadsheet-like fashion in accordance with the user's rules. It also provides tools for analyzing datasets and rule sets, tools for tracing program execution, and tools for saving and loading files.


Epilog has been used as the basis for research in a number of areas related to logic programming, viz. unification theory[8], the representation of aggregates[9], data integration[10][11], database reformulation[12], paraconsistent reasoning[13], logic program completion[14], and Communication Theory[15].

Epilog has also been used in development projects in various application areas, e.g. Enterprise Management, Financial Services[16], Software Configuration Management[17], Security Policies[18], System Management[19], Computational Law[20][21], Computable Contracts[22][23][24], and General Game Playing[25].

Epilog is used as a language for teaching Logic Programming. It is the basis for a textbook on Logic Programming[5] and a corresponding website[26]. It is also used in teaching Computational Law[27][28]


Epilog began life at Stanford University in the late 1970s as a language called MRS (for metalevel representation system). The key feature of the language was its support for representing metaknowledge without modal operators (an idea inspired by John McCarthy's work on circumscription). The first interpreter was implemented in Lisp.

In the late 1980s, the AI research community (as part of the DARPA Knowledge Sharing initiative) began investigating the possibility of a standard language for the interchange of knowledge between computer systems. This led to two variants - Description Logic and Knowledge Interchange Format (better known as KIF). MRS was adopted as an initial version of KIF because of its support for the representation of metalevel information. KIF eventually went on to become a draft ANSI standard and formed the basis for another language, called Common Logic.

While KIF was useful as an interchange format for knowledge, many users found it less than ideal as an authoring language for knowledge systems. In response to this need, in the late 1990s, the Logic group at Stanford created a simplified variant. This version was similar to pure Prolog except with purely declarative semantics rather than semantics based on SLD-resolution. The new language was called Epilog in acknowledgement to its similarity to Prolog.

In the mid 2000s, Epilog began to be used to represent knowledge about dynamics in enterprise management, computational law, computable contracts, and general game playing. In order to support these applications, Epilog was expanded to include operation definitions as well as view definitions and function definitions.

As part of the transition from MRS to Epilog, the Logic Group at Stanford developed an interpreter for Epilog, called EpilogJS, and a compatible interactive development environment, called Sierra, along with various analysis and optimization tools. This time the software was written in JavaScript to facilitate the use of Epilog in web browsers.


  2. Kowalski, R. A. et al.: Combining Logic Programming and Imperative Programming in LPS, in Warren, D., Dahl, V., Eiter, T., Her- menegildo, M., Kowalski, R. and Rossi, F. (eds.) Prolog - The Next 50 Years. LNCS, vol. 13900. Springer (2023).
  3. Kowalski, R. A. et al.: Logic Production Systems.
  4. Genesereth, M.: Dynamic Logic Programming. In: Warren, D., Dahl, V., Eiter, T., Hermenegildo, M., Kowalski, R. and Rossi, F. (eds.) Prolog - The Next 50 Years. LNCS, vol. 13900. Springer (2023).
  5. 5.0 5.1 5.2 Genesereth, Michael; Chaudhri, Vinay K.: Introduction to logic programming, (2020).
  6. "EpilogJS User Guide".
  7. "Introductory Tour of Sierra".
  8. T. Kutsia: Pattern Unification with Sequence Variables and Flexible Arity Symbols, Electronic Notes in Theoretical Computer Science Volume 66, Issue 5, December 2002, Pages 52-69.
  9. Mohapatra, A.: Aggregates in Datalog, Ph.D. Thesis, Stanford University.
  10. Dimopoulos, Y. and Kakas, A.: Information Integration and Computational Logic,
  11. Adham mohsin saeed: Data Integration in Multi-sources Information Systems, ISSN (e): 2250 – 3005 || Vol, 05 || Issue, 01 || January – 2015 || International Journal of Computational Engineering Research (IJCER).
  12. M. Genesereth and A. Mohapatra, "Practical Reformulation of Deductive Databases," 2019 IEEE Second International Conference on Artificial Intelligence and Knowledge Engineering (AIKE), 2019, pp. 65-72.
  13. Kassoff, M., Genesereth, M.: Paraconsistent inference from data using existential Ω-entailment, International Journal of Semantic Computing, Vol. 05, No. 03, pp. 257-269 (2011) Special Issue: Managing and Reasoning in the Presence of Inconsistency.
  14. Hinrichs, T., Genesereth, M.: "Injecting the How into the What: Investigating a Finite Classical Logic", Proceedings of the 11th International Conference on Principles of Knowledge Representation and Reasoning, 2008.
  15. W. Davies, P. Edwards: The Communication of Inductive Inferences. Department of Computing Science, Kings College, University of Aberdeen.;jsessionid=1F6E0878AC7FA023BDC284EDC932A211?sequence=1
  16. Chaudhri, V.: Computable Contracts in the Financial Services Industry.
  17. T. Hinrichs et al.: Using Object-Oriented Management for Automated Configuration Generation, in Utility Computing: 15th IFIP/IEEE International Workshop on Distributed Computing, 2004.
  18. Hinrichs, T.: System and a method for automatically detecting security vulnerabilities in client-server applications.
  19. Sow Kum Wong: An adaptive agent architecture for the design of complex decision support system with applications to power system protection, Victoria University, 1996.
  20. Genesereth, M.: "What is Computational Law?", Complaw Corner, Codex: The Stanford Center for Legal Informatics, 2021.
  21. Megan Ma. L’histoire du codex(t) juridique : écrire le droit en code. Droit. Institut d’études politiques de paris - Sciences Po, 2021.
  22. Genesereth, M.: Contract Definition Language, Computable Contracts Session of the 2021 FutureLaw Conference.
  23. Doulcet, P-L.: Standardization of Insurance Product Representation.
  24. Claudia Morelli: Computable contracts. Altalex, 2021.
  25. Genesereth, M., Love, N., & Pell, B. (2005). General Game Playing: Overview of the AAAI Competition. AI Magazine, 26(2), 62.
  27. Barczentewicz, M.: Teaching Technology to (Future) Lawyers.

This article "Epilog (programming language)" is from Wikipedia. The list of its authors can be seen in its historical and/or the page Edithistory:Epilog (programming language). Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.