equal
deleted
inserted
replaced
42 val prop_of = #prop o rep_thm; |
42 val prop_of = #prop o rep_thm; |
43 |
43 |
44 (*Permits forward proof from rules that discharge assumptions*) |
44 (*Permits forward proof from rules that discharge assumptions*) |
45 fun forward_res nf st = |
45 fun forward_res nf st = |
46 case Seq.pull (ALLGOALS (METAHYPS (fn [prem] => rtac (nf prem) 1)) st) |
46 case Seq.pull (ALLGOALS (METAHYPS (fn [prem] => rtac (nf prem) 1)) st) |
47 of Some(th,_) => th |
47 of SOME(th,_) => th |
48 | None => raise THM("forward_res", 0, [st]); |
48 | NONE => raise THM("forward_res", 0, [st]); |
49 |
49 |
50 |
50 |
51 (*Are any of the constants in "bs" present in the term?*) |
51 (*Are any of the constants in "bs" present in the term?*) |
52 fun has_consts bs = |
52 fun has_consts bs = |
53 let fun has (Const(a,_)) = a mem bs |
53 let fun has (Const(a,_)) = a mem bs |
124 fun forward_res2 nf hyps st = |
124 fun forward_res2 nf hyps st = |
125 case Seq.pull |
125 case Seq.pull |
126 (REPEAT |
126 (REPEAT |
127 (METAHYPS (fn major::minors => rtac (nf (minors@hyps) major) 1) 1) |
127 (METAHYPS (fn major::minors => rtac (nf (minors@hyps) major) 1) 1) |
128 st) |
128 st) |
129 of Some(th,_) => th |
129 of SOME(th,_) => th |
130 | None => raise THM("forward_res2", 0, [st]); |
130 | NONE => raise THM("forward_res2", 0, [st]); |
131 |
131 |
132 (*Remove duplicates in P|Q by assuming ~P in Q |
132 (*Remove duplicates in P|Q by assuming ~P in Q |
133 rls (initially []) accumulates assumptions of the form P==>False*) |
133 rls (initially []) accumulates assumptions of the form P==>False*) |
134 fun nodups_aux rls th = nodups_aux rls (th RS disj_assoc) |
134 fun nodups_aux rls th = nodups_aux rls (th RS disj_assoc) |
135 handle THM _ => tryres(th,rls) |
135 handle THM _ => tryres(th,rls) |