src/Pure/Isar/specification.ML
changeset 21746 9d0652354513
parent 21729 7b3ccdae9212
child 21793 74409847e349
equal deleted inserted replaced
21745:a1d8806b5267 21746:9d0652354513
   151     val mx = (case vars of [] => NoSyn | [((y, _), mx)] =>
   151     val mx = (case vars of [] => NoSyn | [((y, _), mx)] =>
   152       if x = y then mx
   152       if x = y then mx
   153       else error ("Head of abbreviation " ^ quote x ^ " differs from declaration " ^ quote y));
   153       else error ("Head of abbreviation " ^ quote x ^ " differs from declaration " ^ quote y));
   154     val lthy' = lthy
   154     val lthy' = lthy
   155       |> ProofContext.set_syntax_mode mode    (* FIXME !? *)
   155       |> ProofContext.set_syntax_mode mode    (* FIXME !? *)
   156       |> TermSyntax.abbrev mode ((x, mx), rhs)
   156       |> LocalTheory.abbrev mode ((x, mx), rhs)
   157       |> ProofContext.restore_syntax_mode lthy;
   157       |> ProofContext.restore_syntax_mode lthy;
   158     val _ = print_consts lthy' (K false) [(x, T)]
   158     val _ = print_consts lthy' (K false) [(x, T)]
   159   in lthy' end;
   159   in lthy' end;
   160 
   160 
   161 val abbreviation = gen_abbrev read_specification;
   161 val abbreviation = gen_abbrev read_specification;
   163 
   163 
   164 
   164 
   165 (* notation *)
   165 (* notation *)
   166 
   166 
   167 fun gen_notation prep_const mode args lthy =
   167 fun gen_notation prep_const mode args lthy =
   168   lthy |> TermSyntax.notation mode (map (apfst (prep_const lthy)) args);
   168   lthy |> LocalTheory.notation mode (map (apfst (prep_const lthy)) args);
   169 
   169 
   170 val notation = gen_notation ProofContext.read_const;
   170 val notation = gen_notation ProofContext.read_const;
   171 val notation_i = gen_notation (K I);
   171 val notation_i = gen_notation (K I);
   172 
   172 
   173 
   173