src/Pure/Isar/proof_context.ML
changeset 26463 9283b4185fdf
parent 26435 bdce320cd426
child 26673 cda3df424bad
equal deleted inserted replaced
26462:dac4e2bce00d 26463:9283b4185fdf
   569   map (expand_abbrevs ctxt);
   569   map (expand_abbrevs ctxt);
   570 
   570 
   571 fun standard_term_uncheck ctxt =
   571 fun standard_term_uncheck ctxt =
   572   map (contract_abbrevs ctxt);
   572   map (contract_abbrevs ctxt);
   573 
   573 
   574 fun add eq what f = Context.>>
   574 fun add eq what f = Context.>> (what (fn xs => fn ctxt =>
   575   (Context.theory_map (what (fn xs => fn ctxt =>
   575   let val xs' = f ctxt xs in if eq_list eq (xs, xs') then NONE else SOME (xs', ctxt) end));
   576     let val xs' = f ctxt xs in if eq_list eq (xs, xs') then NONE else SOME (xs', ctxt) end)));
       
   577 
   576 
   578 in
   577 in
   579 
   578 
   580 val _ = add (op =) (Syntax.add_typ_check 0 "standard") standard_typ_check;
   579 val _ = add (op =) (Syntax.add_typ_check 0 "standard") standard_typ_check;
   581 val _ = add (op aconv) (Syntax.add_term_check 0 "standard") standard_term_check;
   580 val _ = add (op aconv) (Syntax.add_term_check 0 "standard") standard_term_check;
   920       in Syntax.Constant d end
   919       in Syntax.Constant d end
   921   | const_ast_tr _ _ asts = raise Syntax.AST ("const_ast_tr", asts);
   920   | const_ast_tr _ _ asts = raise Syntax.AST ("const_ast_tr", asts);
   922 
   921 
   923 in
   922 in
   924 
   923 
   925 val _ = Context.>>
   924 val _ = Context.>> (Context.map_theory
   926  (Sign.add_syntax
   925  (Sign.add_syntax
   927    [("_context_const", "id => 'a", Delimfix "CONST _"),
   926    [("_context_const", "id => 'a", Delimfix "CONST _"),
   928     ("_context_const", "longid => 'a", Delimfix "CONST _"),
   927     ("_context_const", "longid => 'a", Delimfix "CONST _"),
   929     ("_context_xconst", "id => 'a", Delimfix "XCONST _"),
   928     ("_context_xconst", "id => 'a", Delimfix "XCONST _"),
   930     ("_context_xconst", "longid => 'a", Delimfix "XCONST _")] #>
   929     ("_context_xconst", "longid => 'a", Delimfix "XCONST _")] #>
   931   Sign.add_advanced_trfuns
   930   Sign.add_advanced_trfuns
   932     ([("_context_const", const_ast_tr true), ("_context_xconst", const_ast_tr false)], [], [], []));
   931     ([("_context_const", const_ast_tr true), ("_context_xconst", const_ast_tr false)], [], [], [])));
   933 
   932 
   934 end;
   933 end;
   935 
   934 
   936 
   935 
   937 (* notation *)
   936 (* notation *)