Add exercise 4.46

This commit is contained in:
Oliver Payne 2024-01-04 22:56:06 +00:00
parent a3b0a23812
commit 2caab6255f
1 changed files with 13 additions and 0 deletions

View File

@ -152,3 +152,16 @@
(article the)
(noun cat)))))))))
;; The professor lectures to the student, who is in the class with the cat
;; Exercise 4.46
;; If amb evaluated its arguments in any order other than
;; left-to-right, then the recursive maybe-extend rules would never
;; terminate, as the second argument is a recursive call to the
;; procedure. We rely on the recursion stopping at each decision
;; point.
;;
;; Also, since parse has side-effects (namely, it removes a word from
;; the input), it is important that we parse the different parts of
;; the sentence in the correct order.