src/Pure/Isar/proof_context.ML
changeset 6762 a9a515a43ae0
parent 6721 dcee829f8e21
child 6789 0e5a965de17a
     1.1 --- a/src/Pure/Isar/proof_context.ML	Wed Jun 02 22:27:01 1999 +0200
     1.2 +++ b/src/Pure/Isar/proof_context.ML	Wed Jun 02 22:29:04 1999 +0200
     1.3 @@ -317,11 +317,11 @@
     1.4  fun read_def_termT freeze sg defs sT = apfst hd (read_def_termTs freeze sg defs [sT]);
     1.5  
     1.6  
     1.7 -fun read_term_sg sg (defs as (_, _, used)) s =
     1.8 -  #1 (read_def_termT true sg defs (s, TVar ((variant used "'z", 0), logicS)));
     1.9 +fun read_term_sg freeze sg (defs as (_, _, used)) s =
    1.10 +  #1 (read_def_termT freeze sg defs (s, TVar ((variant used "'z", 0), logicS)));
    1.11  
    1.12 -fun read_prop_sg sg defs s =
    1.13 -  #1 (read_def_termT true sg defs (s, propT));
    1.14 +fun read_prop_sg freeze sg defs s =
    1.15 +  #1 (read_def_termT freeze sg defs (s, propT));
    1.16  
    1.17  
    1.18  fun cert_term_sg sg t = Thm.term_of (Thm.cterm_of sg t);
    1.19 @@ -389,18 +389,23 @@
    1.20  
    1.21  (* dummy patterns *)
    1.22  
    1.23 +local
    1.24 +
    1.25  fun is_dummy (Const (c, _)) = c = PureThy.dummy_patternN
    1.26    | is_dummy _ = false;
    1.27  
    1.28 +fun prep_dummy (i, t) =
    1.29 +  if is_dummy t then (i + 1, Var (("_dummy_", i), Term.fastype_of t)) else (i, t);
    1.30 +
    1.31 +in
    1.32 +
    1.33 +fun prepare_dummies tm = #2 (Term.foldl_map_aterms prep_dummy (1, tm));
    1.34 +
    1.35  fun reject_dummies ctxt tm =
    1.36    if foldl_aterms (fn (ok, t) => ok andalso not (is_dummy t)) (true, tm) then tm
    1.37    else raise CONTEXT ("Illegal dummy pattern(s) in term", ctxt);
    1.38  
    1.39 -
    1.40 -fun prep_dummy (i, t) =
    1.41 -  if is_dummy t then (i + 1, Var (("_dummy_", i), Term.fastype_of t)) else (i, t);
    1.42 -
    1.43 -fun prepare_dummies tm = #2 (Term.foldl_map_aterms prep_dummy (1, tm));
    1.44 +end;
    1.45  
    1.46  
    1.47  (* read terms *)
    1.48 @@ -425,10 +430,10 @@
    1.49    end;
    1.50  
    1.51  val read_termTs = gen_read (read_def_termTs false) (apfst o map) false;
    1.52 -val read_term = gen_read read_term_sg I false;
    1.53 -val read_prop = gen_read read_prop_sg I false;
    1.54 -val read_term_pat = gen_read read_term_sg I true;
    1.55 -val read_prop_pat = gen_read read_prop_sg I true;
    1.56 +val read_term = gen_read (read_term_sg true) I false;
    1.57 +val read_prop = gen_read (read_prop_sg true) I false;
    1.58 +val read_term_pat = gen_read (read_term_sg false) I true;
    1.59 +val read_prop_pat = gen_read (read_prop_sg false) I true;
    1.60  
    1.61  
    1.62  (* certify terms *)