src/HOL/Tools/Nitpick/nitpick_hol.ML
changeset 46089 d98eb715444d
parent 46088 948bef826443
child 46091 472c952d42dd
equal deleted inserted replaced
46088:948bef826443 46089:d98eb715444d
  1921     else case typedef_info ctxt abs_s of
  1921     else case typedef_info ctxt abs_s of
  1922       SOME {abs_type, rep_type, Rep_name, prop_of_Rep, set_name, ...} =>
  1922       SOME {abs_type, rep_type, Rep_name, prop_of_Rep, set_name, ...} =>
  1923       let
  1923       let
  1924         val rep_T = varify_and_instantiate_type ctxt abs_type abs_T rep_type
  1924         val rep_T = varify_and_instantiate_type ctxt abs_type abs_T rep_type
  1925         val rep_t = Const (Rep_name, abs_T --> rep_T)
  1925         val rep_t = Const (Rep_name, abs_T --> rep_T)
  1926         val set_t = Const (set_name, Type (@{type_name set}, [rep_T]))
  1926         val set_t = Const (set_name, HOLogic.mk_setT rep_T)
  1927         val set_t' =
  1927         val set_t' =
  1928           prop_of_Rep |> HOLogic.dest_Trueprop
  1928           prop_of_Rep |> HOLogic.dest_Trueprop
  1929                       |> specialize_type thy (dest_Const rep_t)
  1929                       |> specialize_type thy (dest_Const rep_t)
  1930                       |> HOLogic.dest_mem |> snd
  1930                       |> HOLogic.dest_mem |> snd
  1931       in
  1931       in
  2058           |> filter_out (null o #2) of
  2058           |> filter_out (null o #2) of
  2059        [] => true
  2059        [] => true
  2060      | triples =>
  2060      | triples =>
  2061        let
  2061        let
  2062          val binders_T = HOLogic.mk_tupleT (binder_types T)
  2062          val binders_T = HOLogic.mk_tupleT (binder_types T)
  2063          val rel_T = HOLogic.mk_prodT (binders_T, binders_T) --> bool_T
  2063          val rel_T = HOLogic.mk_setT (HOLogic.mk_prodT (binders_T, binders_T))
  2064          val j = fold Integer.max (map maxidx_of_term intro_ts) 0 + 1
  2064          val j = fold Integer.max (map maxidx_of_term intro_ts) 0 + 1
  2065          val rel = (("R", j), rel_T)
  2065          val rel = (("R", j), rel_T)
  2066          val prop = Const (@{const_name wf}, rel_T --> bool_T) $ Var rel ::
  2066          val prop = Const (@{const_name wf}, rel_T --> bool_T) $ Var rel ::
  2067                     map (wf_constraint_for_triple rel) triples
  2067                     map (wf_constraint_for_triple rel) triples
  2068                     |> foldr1 s_conj |> HOLogic.mk_Trueprop
  2068                     |> foldr1 s_conj |> HOLogic.mk_Trueprop