added major_prem_of;
authorwenzelm
Sun, 27 Feb 2000 15:13:44 +0100
changeset 8299 52d9f64841d6
parent 8298 9b089bc07f69
child 8300 4c3f83414de3
added major_prem_of;
src/Pure/thm.ML
--- a/src/Pure/thm.ML	Sun Feb 27 15:07:53 2000 +0100
+++ b/src/Pure/thm.ML	Sun Feb 27 15:13:44 2000 +0100
@@ -180,6 +180,7 @@
 signature THM =
 sig
   include BASIC_THM
+  val major_prem_of	: thm -> term
   val no_prems		: thm -> bool
   val no_attributes	: 'a -> 'a * 'b attribute list
   val apply_attributes	: ('a * thm) * 'a attribute list -> ('a * thm)
@@ -477,6 +478,11 @@
 fun nprems_of (Thm {prop, ...}) =
   Logic.count_prems (Logic.skip_flexpairs prop, 0);
 
+fun major_prem_of thm =
+  (case prems_of thm of
+    prem :: _ => prem
+  | [] => raise THM ("major_prem_of: rule with no premises", 0, [thm]));
+
 fun no_prems thm = nprems_of thm = 0;
 
 (*maps object-rule to conclusion*)