2 File: aux_definitions.ml
4 Description: This file defines a few useful functions
6 Author: (c) Copyright 1989-2008 by Flemming Andersen
8 Last Update: December 30, 2007
11 let prove_thm ((thm_name:string), thm_term, thm_tactic) =
12 prove (thm_term, thm_tactic);;
14 (* Uniform error facility *)
15 let UNITY_ERR (func,mesg) = ( failwith func, Failure mesg );;
17 (*----------------------------------------------------------------------*)
18 (* Auxilliary definitions *)
19 (*----------------------------------------------------------------------*)
22 let th_tac (th:thm) (tac:tactic) = (MP_TAC th) THEN tac in
23 let u_asml (thml:thm list) = itlist th_tac thml ALL_TAC in
28 let th_tac (th:thm) (tac:tactic) = (UNDISCH_TAC (concl th)) THEN tac in
29 let u_asm (th:thm) = itlist th_tac [th] ALL_TAC in
33 let LIST_INDUCT = list_INDUCT;;
36 let a = `a:bool` and b = `b:bool` in
37 let pth = ITAUT `(a ==> b) ==> (~b ==> ~a)` in
39 try let P,Q = dest_imp(concl th) in
40 MP (INST [P,a; Q,b] pth) th
41 with Failure _ -> failwith "CONTRAPOS";;
46 let new_infix_definition (define_name, name_org, define_term, fixity) =
48 let defined_thm = new_definition define_term in
49 let (infix_num, assoc_str) = get_infix_status name_org in
51 ( parse_as_infix ( define_name, (infix_num + fixity, assoc_str) ) ) in
52 (fst (defined_thm, defined_infix))
65 let new_binder_definition def_term def_binder =
67 let def_thm = ( new_definition def_term ) in
68 let def_bind = ( parse_as_binder def_binder ) in
69 (fst (def_thm, def_bind))