src/Pure/Isar/locale.ML
changeset 17316 fc7cc8137b97
parent 17271 2756a73f63a5
child 17355 5b31131c0365
equal deleted inserted replaced
17315:5bf0e0aacc24 17316:fc7cc8137b97
  1659       | items prfx (x :: xs) = Pretty.block [Pretty.str prfx, Pretty.brk 1, x] :: items "  and" xs;
  1659       | items prfx (x :: xs) = Pretty.block [Pretty.str prfx, Pretty.brk 1, x] :: items "  and" xs;
  1660     fun prt_elem (Fixes fixes) = items "fixes" (map prt_fix fixes)
  1660     fun prt_elem (Fixes fixes) = items "fixes" (map prt_fix fixes)
  1661       | prt_elem (Constrains csts) = items "constrains" (map prt_cst csts)
  1661       | prt_elem (Constrains csts) = items "constrains" (map prt_cst csts)
  1662       | prt_elem (Assumes asms) = items "assumes" (map prt_asm asms)
  1662       | prt_elem (Assumes asms) = items "assumes" (map prt_asm asms)
  1663       | prt_elem (Defines defs) = items "defines" (map prt_def defs)
  1663       | prt_elem (Defines defs) = items "defines" (map prt_def defs)
  1664       | prt_elem (Notes facts) =
  1664       | prt_elem (Notes facts) = items "notes" (map prt_note facts);
  1665         if show_facts then items "notes" (map prt_note facts) else [];
       
  1666   in
  1665   in
  1667     Pretty.big_list "context elements:" (map (Pretty.chunks o prt_elem) all_elems)
  1666     Pretty.big_list "context elements:" (all_elems
       
  1667       |> (if show_facts then I else filter (fn Notes _ => false | _ => true))
       
  1668       |> map (Pretty.chunks o prt_elem))
  1668     |> Pretty.writeln
  1669     |> Pretty.writeln
  1669   end;
  1670   end;
  1670 
  1671 
  1671 
  1672 
  1672 
  1673 
  2176     fun add_def ((inst, tinst), (p, pT)) =
  2177     fun add_def ((inst, tinst), (p, pT)) =
  2177       let
  2178       let
  2178         val (t, T) = case find_first (fn (Free (a, _), _) => a = p) defs of
  2179         val (t, T) = case find_first (fn (Free (a, _), _) => a = p) defs of
  2179                NONE => error ("Instance missing for parameter " ^ quote p)
  2180                NONE => error ("Instance missing for parameter " ^ quote p)
  2180              | SOME (Free (_, T), t) => (t, T);
  2181              | SOME (Free (_, T), t) => (t, T);
  2181         val d = t |> inst_tab_term (inst, tinst) |> Envir.beta_norm;
  2182         val d = inst_tab_term (inst, tinst) t;
  2182       in (Symtab.curried_update_new (p, d) inst, tinst) end;
  2183       in (Symtab.curried_update_new (p, d) inst, tinst) end;
  2183     val (inst, tinst) = Library.foldl add_def ((inst, tinst), not_given);
  2184     val (inst, tinst) = Library.foldl add_def ((inst, tinst), not_given);
  2184     (* Note: inst and tinst contain no vars. *)
  2185     (* Note: inst and tinst contain no vars. *)
  2185 
  2186 
  2186     (** compute proof obligations **)
  2187     (** compute proof obligations **)