HOME

TheInfoList



OR:

HiLog is a programming
logic Logic is the study of correct reasoning. It includes both formal and informal logic. Formal logic is the study of deductively valid inferences or logical truths. It examines how conclusions follow from premises based on the structure o ...
with higher-order syntax, which allows arbitrary terms to appear in predicate and function positions. However, the
model theory In mathematical logic, model theory is the study of the relationship between theory (mathematical logic), formal theories (a collection of Sentence (mathematical logic), sentences in a formal language expressing statements about a Structure (mat ...
of HiLog is first-order. Although syntactically HiLog strictly extends
first order logic First-order logic, also called predicate logic, predicate calculus, or quantificational logic, is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quantified variables over ...
, HiLog can be embedded into this logic. HiLog was first described in 1989. It was later extended in the direction of
many-sorted logic Many-sorted logic can reflect formally our intention not to handle the universe as a homogeneous collection of objects, but to partition it in a way that is similar to types in typeful programming. Both functional and assertive " parts of speech ...
. The XSB system parses HiLog syntax, but the integration of HiLog into XSB is only partial. In particular, HiLog is not integrated with the XSB module system. A full implementation of HiLog is available in the
Flora-2 Flora-2 is an open source semantic rule-based system for knowledge representation and reasoning. The language of the system is derived from F-logic, HiLog, W. Chen, M. Kifer and D.S. Warren (1993)''HiLog: A Foundation for Higher-Order Logic Program ...
system. It has been shown that HiLog can be embedded into
first-order logic First-order logic, also called predicate logic, predicate calculus, or quantificational logic, is a collection of formal systems used in mathematics, philosophy, linguistics, and computer science. First-order logic uses quantified variables over ...
through a fairly simple transformation. For instance, p(X)(Y,Z(V)(W)) gets embedded as the following first-order term: apply(p(X),Y,apply(apply(Z,V),W)). The Framework for Logic-Based Dialects (RIF-FLD) of the Rule Interchange Format (RIF) is largely based on the ideas underlying HiLog and
F-logic F-logic (Frame logic) is a knowledge representation and ontology language. It combines the advantages of conceptual modeling with Object-oriented programming, object-oriented, Frame (artificial intelligence), frame-based languages, and offers a Decl ...
.


Examples

In all the examples below, capitalized symbols denote variables and the comma denotes
logical conjunction In logic, mathematics and linguistics, ''and'' (\wedge) is the Truth function, truth-functional operator of conjunction or logical conjunction. The logical connective of this operator is typically represented as \wedge or \& or K (prefix) or ...
, as in most
logic programming Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applyin ...
languages. The first and the second examples show that variables can appear in predicate positions. Predicates can even be complex terms, such as closure(P) or maplist(F) below. The third example shows that variables can also appear in place of atomic formulas, while the fourth example illustrates the use of variables in place of function symbols. The first example defines a generic
transitive closure In mathematics, the transitive closure of a homogeneous binary relation on a set (mathematics), set is the smallest Relation (mathematics), relation on that contains and is Transitive relation, transitive. For finite sets, "smallest" can be ...
operator, which can be applied to an arbitrary binary predicate. The second example is similar. It defines a
LISP Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation. Originally specified in the late 1950s, ...
-like mapping operator, which applies to an arbitrary binary predicate. The third example shows that the
Prolog Prolog is a logic programming language that has its origins in artificial intelligence, automated theorem proving, and computational linguistics. Prolog has its roots in first-order logic, a formal logic. Unlike many other programming language ...
meta-predicate call/1 can be expressed in HiLog in a natural way and without the use of extra-logical features. The last example defines a predicate that traverses arbitrary binary trees represented as first-order terms. closure(P)(X,Y) <- P(X,Y). closure(P)(X,Y) <- P(X,Z), closure(P)(Z,Y). maplist(F)([],[]). maplist(F)([X, R],[Y, Z]) <- F(X,Y), maplist(F)(R,Z). call(X) <- X. traverse(X(L,R)) <- traverse(L), traverse(R).


References


Further reading

* * {{cite journal , last1=Bruijn , first1=Jos , last2=Heymans , first2=Stijn , date=January 2008 , title=On the relationship between description logic-based and F-logic-based ontologies , journal= Fundamenta Informaticae , volume=82 , issue=3 , pages=213–236 , url=https://content.iospress.com/articles/fundamenta-informaticae/fi82-3-02 Logic programming languages Declarative programming languages Knowledge representation