2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
4
;; MODULE : drd-test.scm
5
;; DESCRIPTION : examples of logical programs
6
;; COPYRIGHT : (C) 2003 Joris van der Hoeven
8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10
;; This software falls under the GNU general public license and comes WITHOUT
11
;; ANY WARRANTY WHATSOEVER. See the file $TEXMACS_PATH/LICENSE for details.
12
;; If you don't have this file, write to the Free Software Foundation, Inc.,
13
;; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
17
(texmacs-module (kernel drd drd-test)
18
(:use (kernel drd drd-rules) (kernel drd drd-query)))
20
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
22
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27
((daughter% Geeske Opa))
28
((daughter% Jekke Opa))
29
((child% 'x 'y) (sun% 'x 'y))
30
((child% 'x 'y) (daughter% 'x 'y))
31
((descends% 'x 'y) (child% 'x 'y))
32
((descends% 'x 'z) (child% 'x 'y) (descends% 'y 'z)))
34
;; (??? (child% 'x Opa))
35
;; (??? (descends% 'x 'y))
36
;; (??? (descends% 'x 'y) (daughter% Joleen Opa))
38
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39
;; Addional assumptions <-> creating modules
40
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
43
(assume family%) ; added to constraints for all rules below
46
((daughter% Geeske Opa))
47
((daughter% Jekke Opa))
48
((child% 'x 'y) (sun% 'x 'y))
49
((child% 'x 'y) (daughter% 'x 'y))
50
((descends% 'x 'y) (child% 'x 'y))
51
((descends% 'x 'z) (child% 'x 'y) (descends% 'y 'z)))
53
;; (??? (child% 'x Opa))
54
;; (??? (child% 'x Opa) family%)