-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathExercise_4_65.rkt
More file actions
24 lines (20 loc) · 756 Bytes
/
Copy pathExercise_4_65.rkt
File metadata and controls
24 lines (20 loc) · 756 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#lang racket/base
(supervisor (Hacker Alyssa P) (Bitdiddle Ben)) ;; 1
(supervisor (Fect Cy D) (Bitdiddle Ben)) ;; 2
(supervisor (Tweakit Lem E) (Bitdiddle Ben)) ;; 3
(supervisor (Reasoner Louis) (Hacker Alyssa P))
(supervisor (Bitdiddle Ben) (Warbucks Oliver))
(supervisor (Scrooge Eben) (Warbucks Oliver))
(supervisor (Cratchet Robert) (Scrooge Eben)) ;; 4
(supervisor (Aull DeWitt) (Warbucks Oliver))
(rule (wheel ?person)
(and (supervisor ?middle-manager ?person)
(supervisor ?x ?middle-manager)))
(wheel ?who)
;;; Query results:
(wheel (Warbucks Oliver))
(wheel (Bitdiddle Ben))
(wheel (Warbucks Oliver))
(wheel (Warbucks Oliver))
(wheel (Warbucks Oliver))
;; database has four unique middle managers supervised by Oliver