Chapter 4, Metalinguistic Abstraction

Exercise 4.55


Using the query evaluator provided here.

Note that after loading the evaluator, we need to do two things:

  • First, Initialize databse by executing this on repl: (initialize-data-base microshaft-data-base)
  • Then, Start execute (query-driver-loop)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
;;; Query input:
(supervisor ?x (Bitdiddle Ben))

;;; Query results:
(supervisor (tweakit lem e) (bitdiddle ben))
(supervisor (fect cy d) (bitdiddle ben))
(supervisor (hacker alyssa p) (bitdiddle ben))

;;; Query input:
(job ?name (accounting . ?job))

;;; Query results:
(job (cratchet robert) (accounting scrivener))
(job (scrooge eben) (accounting chief accountant))

;;; Query input:
(address ?name (Slumerville . ?addr))

;;; Query results:
(address (aull dewitt) (slumerville (onion square) 5))
(address (reasoner louis) (slumerville (pine tree road) 80))
(address (bitdiddle ben) (slumerville (ridge road) 10))