# HG changeset patch # User berghofe # Date 1051049695 -7200 # Node ID 2134ed516b1bb202ada289dc74238871c6937e5e # Parent a67c9e6570ac4d67ed0841d41cc5679e02a5f843 Tuned realizer for exE rule, to avoid blowup of extracted program. diff -r a67c9e6570ac -r 2134ed516b1b src/HOL/Extraction.thy --- a/src/HOL/Extraction.thy Wed Apr 23 00:13:32 2003 +0200 +++ b/src/HOL/Extraction.thy Wed Apr 23 00:14:55 2003 +0200 @@ -210,7 +210,14 @@ by simp theorem exI_realizer: - "P x y \ P (fst (x, y)) (snd (x, y))" by simp + "P y x \ P (snd (x, y)) (fst (x, y))" by simp + +theorem exE_realizer: "P (snd p) (fst p) \ + (\x y. P y x \ Q (f x y)) \ Q (case p of (x, y) \ f x y)" + by (cases p) simp + +theorem exE_realizer': "P (snd p) (fst p) \ + (\x y. P y x \ Q) \ Q" by (cases p) simp realizers impI (P, Q): "\pq. pq" @@ -241,15 +248,15 @@ spec: "Null" "spec" - exI (P): "\x p. (x, p)" "\P. exI_realizer \ _" + exI (P): "\x p. (x, p)" "\P x p. exI_realizer \ P \ p \ x" exI: "\x. x" "\P x (h: _). h" - exE (P, Q): "\p pq. pq (fst p) (snd p)" - "\P Q p (h1: _) pq (h2: _). h2 \ (fst p) \ (snd p) \ h1" + exE (P, Q): "\p pq. case p of (x, y) \ pq x y" + "\P Q p (h: _) pq. exE_realizer \ P \ p \ Q \ pq \ h" exE (P): "Null" - "\P Q p (h1: _) (h2: _). h2 \ (fst p) \ (snd p) \ h1" + "\P Q p. exE_realizer' \ _ \ _ \ _" exE (Q): "\x pq. pq x" "\P Q x (h1: _) pq (h2: _). h2 \ x \ h1"