summaryrefslogtreecommitdiff
path: root/snapshots/hol4/lem/hol-lib/lem_assert_extraScript.sml
blob: 79d5eda731929a9e96c6ad6e98bf917f0b03f383 (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
46
(*Generated by Lem from assert_extra.lem.*)
open HolKernel Parse boolLib bossLib;
open stringTheory lemTheory;

val _ = numLib.prefer_num();



val _ = new_theory "lem_assert_extra"


(*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*)
val _ = Define `
 ((fail:'a)=  (failwith "fail"))`;


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

(*val ensure : bool -> string -> unit*)
val _ = Define `
 ((ensure:bool -> string -> unit) test msg=
   (if test then
    () 
  else
    failwith msg))`;


val _ = export_theory()