src/HOL/MiniML/Maybe.ML
author nipkow
Mon, 20 May 1996 18:41:55 +0200
changeset 1751 946efd210837
parent 1300 c7a8f374339b
child 1757 f7a573c46611
permissions -rw-r--r--
Added thm I_complete_wrt_W to I. Added a few lemmas to Maybe and Type.

open Maybe;

(* constructor laws for bind *)
goalw thy [bind_def] "(Ok s) bind f = (f s)";
by (Simp_tac 1);
qed "bind_Ok";

goalw thy [bind_def] "Fail bind f = Fail";
by (Simp_tac 1);
qed "bind_Fail";

Addsimps [bind_Ok,bind_Fail];

(* expansion of bind *)
goal thy
  "P(res bind f) = ((res = Fail --> P Fail) & (!s. res = Ok s --> P(f s)))";
by (maybe.induct_tac "res" 1);
by (fast_tac (HOL_cs addss !simpset) 1);
by (Asm_simp_tac 1);
qed "expand_bind";

goal Maybe.thy "!!x. x = Ok y ==> x ~= Fail";
by(Asm_simp_tac 1);
qed "eq_OkD";