Skip to content

Commit 342bab3

Browse files
committed
isolate an example of lambda lifting
1 parent 850a993 commit 342bab3

3 files changed

Lines changed: 71 additions & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
INCLUDES = $(HOLDIR)/examples/acl2/hol-to-acl2/src
2-
EXTRA_CLEANS = eval_poly.defhol ex1.defhol elim_lambda.defhol
2+
EXTRA_CLEANS = eval_poly.defhol ex1.defhol elim_lambda.defhol skolem.defhol
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#|
2+
Theorem: SKOLEM_THM
3+
4+
⊢ ∀P. (∀x. ∃y. P x y) ⇔ ∃f. ∀x. P x (f x)
5+
6+
Auxiliary definitions:
7+
8+
⊢ ∀P x y. Lam_0 P x y ⇔ P x y
9+
⊢ ∀P x. Lam_1 P x ⇔ $? (Lam_0 P x)
10+
⊢ ∀P f x. Lam_2 P f x ⇔ P x (f x)
11+
⊢ ∀P f. Lam_3 P f ⇔ $! (Lam_2 P f)
12+
13+
Lifted theorem:
14+
15+
⊢ ∀P. $! (Lam_1 P) ⇔ $? (Lam_3 P)
16+
|#
17+
18+
(defhol
19+
:fns ((lam_0 (:arrow* (:arrow* a b :bool) a b :bool)))
20+
:defs ((:forall ((p (:arrow* a b :bool)) (x a) (y b))
21+
(equal
22+
(hap* (lam_0 (typ (:arrow* (:arrow* a b :bool) a b :bool))) p x y)
23+
(hap* p x y)))))
24+
25+
(defhol
26+
:fns ((lam_1 (:arrow* (:arrow* a b :bool) a :bool)))
27+
:defs ((:forall ((p (:arrow* a b :bool)) (x a))
28+
(equal (hap* (lam_1 (typ (:arrow* (:arrow* a b :bool) a :bool))) p x)
29+
(hp-exists
30+
(hap* (lam_0 (typ (:arrow* (:arrow* a b :bool) a b :bool))) p x))))))
31+
32+
(defhol
33+
:fns ((lam_2 (:arrow* (:arrow* a b :bool) (:arrow* a b) a :bool)))
34+
:defs ((:forall ((p (:arrow* a b :bool)) (f (:arrow* a b)) (x a))
35+
(equal
36+
(hap* (lam_2 (typ (:arrow* (:arrow* a b :bool) (:arrow* a b) a :bool)))
37+
p f x) (hap* p x (hap* f x))))))
38+
39+
(defhol
40+
:fns ((lam_3 (:arrow* (:arrow* a b :bool) (:arrow* a b) :bool)))
41+
:defs ((:forall ((p (:arrow* a b :bool)) (f (:arrow* a b)))
42+
(equal
43+
(hap* (lam_3 (typ (:arrow* (:arrow* a b :bool) (:arrow* a b) :bool))) p
44+
f)
45+
(hp-forall
46+
(hap*
47+
(lam_2 (typ (:arrow* (:arrow* a b :bool) (:arrow* a b) a :bool))) p
48+
f))))))
49+
50+
(defhol
51+
:name skolem_thm
52+
:thm (:forall ((p (:arrow* a b :bool)))
53+
(hp=
54+
(hp-forall (hap* (lam_1 (typ (:arrow* (:arrow* a b :bool) a :bool))) p))
55+
(hp-exists
56+
(hap* (lam_3 (typ (:arrow* (:arrow* a b :bool) (:arrow* a b) :bool)))
57+
p)))))
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Theory skolem
2+
Ancestors
3+
hol_to_acl2
4+
Libs
5+
HOL_to_ACL2 Elim_Lambda
6+
7+
val skolem = thm_bundle "SKOLEM_THM" SKOLEM_THM;
8+
9+
(*---------------------------------------------------------------------------*)
10+
(* Output defhol file *)
11+
(*---------------------------------------------------------------------------*)
12+
13+
val _ = print_bundles_to_file "skolem.defhol" [skolem];

0 commit comments

Comments
 (0)