1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3
;; Knuth's Generalization of McCarthy's 91 Function.
4
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
8
;; Formally state McCarthy's definition for the 91 function in
11
;; M(x) <== if x > 100 then x - 10
14
;; Use the following proposed measure:
16
;; measure(x) <== if x > 100 then 0
19
;; Observe ACL2's resistance to accepting this definition.
20
;; Carefully note the non-trivial part of the measure conjecture.
21
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23
;; Submit the following to a newly started ACL2:
25
(in-package "ACL2") ; in order to certify this book
36
;; Fails -- Study the measure conjecture.
37
(declare (xargs :measure (measure x)))
43
;;Some output from ACL2:
45
;; The non-trivial part of the measure conjecture is
48
;; (AND (E0-ORDINALP (MEASURE X))
49
;; (IMPLIES (<= X 100)
50
;; (E0-ORD-< (MEASURE (+ X 11))
52
;; (IMPLIES (<= X 100)
53
;; (E0-ORD-< (MEASURE (M (+ X 11)))
55
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
59
;; Formally state the following definition in ACL2:
61
;; M(x) <== if x > 100 then x - 10
64
;; Observe that ACL2 accepts this definition. Next, formally state
65
;; and prove, in ACL2, that the next equation holds for all
68
;; M(x) = if x > 100 then x - 10
70
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
72
;; Submit the following to a newly started ACL2: