src/HOL/Tools/lin_arith.ML
changeset 33339 d41f77196338
parent 33317 b4534348b8fd
child 33519 e31a85f92ce9
equal deleted inserted replaced
33338:de76079f973a 33339:d41f77196338
   643 (* remove terms that do not satisfy 'p'; change the order of the remaining   *)
   643 (* remove terms that do not satisfy 'p'; change the order of the remaining   *)
   644 (* terms in the same way as filter_prems_tac does                            *)
   644 (* terms in the same way as filter_prems_tac does                            *)
   645 
   645 
   646 fun filter_prems_tac_items (p : term -> bool) (terms : term list) : term list =
   646 fun filter_prems_tac_items (p : term -> bool) (terms : term list) : term list =
   647 let
   647 let
   648   fun filter_prems (t, (left, right)) =
   648   fun filter_prems t (left, right) =
   649     if  p t  then  (left, right @ [t])  else  (left @ right, [])
   649     if p t then (left, right @ [t]) else (left @ right, [])
   650   val (left, right) = List.foldl filter_prems ([], []) terms
   650   val (left, right) = fold filter_prems terms ([], [])
   651 in
   651 in
   652   right @ left
   652   right @ left
   653 end;
   653 end;
   654 
   654 
   655 (* return true iff TRY (etac notE) THEN eq_assume_tac would succeed on a     *)
   655 (* return true iff TRY (etac notE) THEN eq_assume_tac would succeed on a     *)