summaryrefslogtreecommitdiff
path: root/snapshots/isabelle/lib/lem/Lem_assert_extra.thy
blob: 9dedb07ad5f9b95e8bad1e8548563e5d5236adfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
chapter \<open>Generated by Lem from \<open>assert_extra.lem\<close>.\<close>

theory "Lem_assert_extra" 

imports
  Main
  "Lem"

begin 


(*open import {ocaml} `Xstring`*)
(*open import {hol} `stringTheory` `lemTheory`*)
(*open import {coq} `Coq.Strings.Ascii` `Coq.Strings.String`*)
(*open import {isabelle} `$LIB_DIR/Lem`*)

(* ------------------------------------ *)
(* failing with a proper error message  *)
(* ------------------------------------ *)

(*val failwith: forall 'a. string -> 'a*)

(* ------------------------------------ *)
(* failing without an error message     *)
(* ------------------------------------ *)

(*val fail : forall 'a. 'a*)
definition fail  :: " 'a "  where 
     " fail = ( failwith (''fail''))"


(* ------------------------------------- *)
(* assertions                            *)
(* ------------------------------------- *)

(*val ensure : bool -> string -> unit*)
definition ensure  :: " bool \<Rightarrow> string \<Rightarrow> unit "  where 
     " ensure test msg = (
  if test then
    () 
  else
    failwith msg )"


end