src/Tools/Code/code_thingol.ML
changeset 59058 a78612c67ec0
parent 58893 9e0ecb66d6a7
child 59206 36808125e00f
equal deleted inserted replaced
59057:5b649fb2f2e1 59058:a78612c67ec0
   303       (map_terms_bottom_up f t1 `$ map_terms_bottom_up f t2)
   303       (map_terms_bottom_up f t1 `$ map_terms_bottom_up f t2)
   304   | map_terms_bottom_up f ((v, ty) `|=> t) = f
   304   | map_terms_bottom_up f ((v, ty) `|=> t) = f
   305       ((v, ty) `|=> map_terms_bottom_up f t)
   305       ((v, ty) `|=> map_terms_bottom_up f t)
   306   | map_terms_bottom_up f (ICase { term = t, typ = ty, clauses = clauses, primitive = t0 }) = f
   306   | map_terms_bottom_up f (ICase { term = t, typ = ty, clauses = clauses, primitive = t0 }) = f
   307       (ICase { term = map_terms_bottom_up f t, typ = ty,
   307       (ICase { term = map_terms_bottom_up f t, typ = ty,
   308         clauses = (map o pairself) (map_terms_bottom_up f) clauses,
   308         clauses = (map o apply2) (map_terms_bottom_up f) clauses,
   309         primitive = map_terms_bottom_up f t0 });
   309         primitive = map_terms_bottom_up f t0 });
   310 
   310 
   311 fun map_classparam_instances_as_term f =
   311 fun map_classparam_instances_as_term f =
   312   (map o apfst o apsnd o apfst) (fn const => case f (IConst const) of IConst const' => const')
   312   (map o apfst o apsnd o apfst) (fn const => case f (IConst const) of IConst const' => const')
   313 
   313 
   887       | SOME s =>
   887       | SOME s =>
   888           if String.isSuffix "._" s
   888           if String.isSuffix "._" s
   889           then ([], consts_of_select (Context.this_theory thy (unsuffix "._" s)))
   889           then ([], consts_of_select (Context.this_theory thy (unsuffix "._" s)))
   890           else ([Code.read_const thy str], [])
   890           else ([Code.read_const thy str], [])
   891       | NONE => ([Code.read_const thy str], []));
   891       | NONE => ([Code.read_const thy str], []));
   892   in pairself flat o split_list o map read_const_expr end;
   892   in apply2 flat o split_list o map read_const_expr end;
   893 
   893 
   894 fun read_const_exprs_all ctxt = op @ o read_const_exprs_internal ctxt;
   894 fun read_const_exprs_all ctxt = op @ o read_const_exprs_internal ctxt;
   895 
   895 
   896 fun read_const_exprs ctxt const_exprs =
   896 fun read_const_exprs ctxt const_exprs =
   897   let
   897   let