Logic Programming
The Basics Temur Kutsia
Research Institute for Symbolic Computation Johannes Kepler University Linz, Austria kutsia@risc.jku.at
1 / 44
Contents
Basics of PROLOG Facts Questions Variables Conjunction Rules
2 / 44
Logic Programming The Basics Temur Kutsia Research Institute for - - PDF document
Logic Programming The Basics Temur Kutsia Research Institute for Symbolic Computation Johannes Kepler University Linz, Austria kutsia@risc.jku.at 1 / 44 Contents Basics of P ROLOG Facts Questions Variables Conjunction Rules 2 / 44 P
1 / 44
2 / 44
3 / 44
4 / 44
5 / 44
6 / 44
7 / 44
8 / 44
9 / 44
10 / 44
11 / 44
12 / 44
13 / 44
◮ a particular lump of gold, or ◮ the chemical element Gold having atomic number 79.
◮ that particular lump of gold, named gold, is valuable, or ◮ the chemical element Gold, named gold, is valuable.
14 / 44
15 / 44
16 / 44
17 / 44
◮ If mary is interpreted as a person called Mary, and book is
◮ ?- owns(mary, book). means: Does Mary own the
18 / 44
19 / 44
20 / 44
21 / 44
22 / 44
23 / 44
24 / 44
25 / 44
26 / 44
27 / 44
28 / 44
29 / 44
30 / 44
31 / 44
32 / 44
33 / 44
34 / 44
◮ likes(john, alfred). ◮ likes(john, bertrand). ◮ likes(john, charles). ◮ likes(john, david). ◮ etc.
35 / 44
36 / 44
37 / 44
38 / 44
39 / 44
40 / 44
41 / 44
42 / 44
43 / 44
44 / 44