Prolog - The Solar System.

LA home
Logic
 Prolog
  Introduction
  Examples

Prolog is excellent for queries on relational data (as in the Mathematical sense of a "relation"), e.g.

orbits(mercury, sun).  {facts}
orbits(venus,   sun).
orbits(earth,   sun).
orbits(mars,    sun).

orbits(moon, earth).

orbits(phobos, mars).
orbits(deimos, mars).

planet(P)    <= orbits(P, sun).     {rules}
satellite(S) <= orbits(S, P) and planet(P).

? satellite(S).   {query}


window on the wide world:

Linux
free op. sys.
OpenOffice
free office suite,
ver 3.1+

The GIMP
~ free photoshop
Firefox
web browser
FlashBlock
like it says!

Computer Science Education Week, USA, week of 7 Dec. 2009

© L. Allison   http://www.allisons.org/ll/   (or as otherwise indicated),
Faculty of Information Technology (Clayton), Monash University, Australia 3800 (6/'05 was School of Computer Science and Software Engineering, Fac. Info. Tech., Monash University,
was Department of Computer Science, Fac. Comp. & Info. Tech., '89 was Department of Computer Science, Fac. Sci., '68-'71 was Department of Information Science, Fac. Sci.)
Created with "vi (Linux + Solaris)",  charset=iso-8859-1,  fetched Wednesday, 25-Nov-2009 05:19:33 EST.