equal
deleted
inserted
replaced
4 Copyright 1993 University of Cambridge |
4 Copyright 1993 University of Cambridge |
5 |
5 |
6 Derived rules and other operations on theorems. |
6 Derived rules and other operations on theorems. |
7 *) |
7 *) |
8 |
8 |
9 infix 0 RS nRS RSN RL RLN MRS MRL OF COMP; |
9 infix 0 RS RSN RL RLN MRS MRL OF COMP; |
10 |
10 |
11 signature BASIC_DRULE = |
11 signature BASIC_DRULE = |
12 sig |
12 sig |
13 val mk_implies : cterm * cterm -> cterm |
13 val mk_implies : cterm * cterm -> cterm |
14 val list_implies : cterm list * cterm -> cterm |
14 val list_implies : cterm list * cterm -> cterm |
43 val rotate_prems : int -> thm -> thm |
43 val rotate_prems : int -> thm -> thm |
44 val rearrange_prems : int list -> thm -> thm |
44 val rearrange_prems : int list -> thm -> thm |
45 val assume_ax : theory -> string -> thm |
45 val assume_ax : theory -> string -> thm |
46 val RSN : thm * (int * thm) -> thm |
46 val RSN : thm * (int * thm) -> thm |
47 val RS : thm * thm -> thm |
47 val RS : thm * thm -> thm |
48 val nRS : thm * thm -> thm |
|
49 val RLN : thm list * (int * thm list) -> thm list |
48 val RLN : thm list * (int * thm list) -> thm list |
50 val RL : thm list * thm list -> thm list |
49 val RL : thm list * thm list -> thm list |
51 val MRS : thm list * thm -> thm |
50 val MRS : thm list * thm -> thm |
52 val MRL : thm list list * thm list -> thm list |
51 val MRL : thm list list * thm list -> thm list |
53 val OF : thm * thm list -> thm |
52 val OF : thm * thm list -> thm |
456 | _ => raise THM("RSN: multiple unifiers", i, [tha,thb]); |
455 | _ => raise THM("RSN: multiple unifiers", i, [tha,thb]); |
457 |
456 |
458 (*resolution: P==>Q, Q==>R gives P==>R. *) |
457 (*resolution: P==>Q, Q==>R gives P==>R. *) |
459 fun tha RS thb = tha RSN (1,thb); |
458 fun tha RS thb = tha RSN (1,thb); |
460 |
459 |
461 (* preserves the name of the thm on the LEFT: *) |
|
462 fun th nRS rl = Thm.name_thm (Thm.name_of_thm th, th RS rl) |
|
463 |
|
464 |
|
465 (*For joining lists of rules*) |
460 (*For joining lists of rules*) |
466 fun thas RLN (i,thbs) = |
461 fun thas RLN (i,thbs) = |
467 let val resolve = biresolution false (map (pair false) thas) i |
462 let val resolve = biresolution false (map (pair false) thas) i |
468 fun resb thb = Seq.list_of (resolve thb) handle THM _ => [] |
463 fun resb thb = Seq.list_of (resolve thb) handle THM _ => [] |
469 in List.concat (map resb thbs) end; |
464 in List.concat (map resb thbs) end; |