src/HOL/Tools/Function/termination.ML
changeset 45740 132a3e1c0fe5
parent 42793 88bee9f6eec7
child 46218 ecf6375e2abb
equal deleted inserted replaced
45739:b545ea8bc731 45740:132a3e1c0fe5
   180        Solved thm => Less thm
   180        Solved thm => Less thm
   181      | Stuck thm =>
   181      | Stuck thm =>
   182        (case try @{const_name Orderings.less_eq} of
   182        (case try @{const_name Orderings.less_eq} of
   183           Solved thm2 => LessEq (thm2, thm)
   183           Solved thm2 => LessEq (thm2, thm)
   184         | Stuck thm2 =>
   184         | Stuck thm2 =>
   185           if prems_of thm2 = [HOLogic.Trueprop $ HOLogic.false_const]
   185           if prems_of thm2 = [HOLogic.Trueprop $ @{term False}]
   186           then False thm2 else None (thm2, thm)
   186           then False thm2 else None (thm2, thm)
   187         | _ => raise Match) (* FIXME *)
   187         | _ => raise Match) (* FIXME *)
   188      | _ => raise Match
   188      | _ => raise Match
   189 end
   189 end
   190 
   190 
   258 fun mk_pair_compr (T, qs, l, r, conds) =
   258 fun mk_pair_compr (T, qs, l, r, conds) =
   259   let
   259   let
   260     val pT = HOLogic.mk_prodT (T, T)
   260     val pT = HOLogic.mk_prodT (T, T)
   261     val n = length qs
   261     val n = length qs
   262     val peq = HOLogic.eq_const pT $ Bound n $ (HOLogic.pair_const T T $ l $ r)
   262     val peq = HOLogic.eq_const pT $ Bound n $ (HOLogic.pair_const T T $ l $ r)
   263     val conds' = if null conds then [HOLogic.true_const] else conds
   263     val conds' = if null conds then [@{term True}] else conds
   264   in
   264   in
   265     HOLogic.Collect_const pT $
   265     HOLogic.Collect_const pT $
   266     Abs ("uu_", pT,
   266     Abs ("uu_", pT,
   267       (foldr1 HOLogic.mk_conj (peq :: conds')
   267       (foldr1 HOLogic.mk_conj (peq :: conds')
   268       |> fold_rev (fn v => fn t => HOLogic.exists_const (fastype_of v) $ lambda v t) qs))
   268       |> fold_rev (fn v => fn t => HOLogic.exists_const (fastype_of v) $ lambda v t) qs))