A logic program is a set of logical rules or clauses. Logic programs are employed to answer queries using the resolution inference rule. For example, consider the following logic program:
grandparent(X,Y) :- parent(X,Z), parent(Z,Y). parent(X,Y) :- father(X,Y). parent(X,Y) :- mother(X,Y). father(charles, william). mother(diana, william). father(philip, charles). mother(elizabeth, charles). father(john, diana). mother(frances, diana).
Using resolution we obtain the following answers to the query :-grandparent(X,Y):
X = philip, Y = william ; X = john, Y = william ; X = elizabeth, Y = william ; X = frances, Y = william.
Cross-References
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer Science+Business Media New York
About this entry
Cite this entry
(2017). Logic Program. In: Sammut, C., Webb, G.I. (eds) Encyclopedia of Machine Learning and Data Mining. Springer, Boston, MA. https://doi.org/10.1007/978-1-4899-7687-1_490
Download citation
DOI: https://doi.org/10.1007/978-1-4899-7687-1_490
Published:
Publisher Name: Springer, Boston, MA
Print ISBN: 978-1-4899-7685-7
Online ISBN: 978-1-4899-7687-1
eBook Packages: Computer ScienceReference Module Computer Science and Engineering