src/Pure/Isar/generic_target.ML
changeset 47288 b79bf8288b29
parent 47286 392c4cd97e5c
child 47290 ba9c8613ad9b
equal deleted inserted replaced
47287:8f06d8ac4609 47288:b79bf8288b29
   255         context
   255         context
   256         |> Context.mapping (Sign.const_alias b c) (Proof_Context.const_alias b c)
   256         |> Context.mapping (Sign.const_alias b c) (Proof_Context.const_alias b c)
   257         |> Morphism.form (Proof_Context.generic_notation true prmode [(t, mx)])
   257         |> Morphism.form (Proof_Context.generic_notation true prmode [(t, mx)])
   258     | NONE =>
   258     | NONE =>
   259         context
   259         context
   260         |> Proof_Context.generic_add_abbrev Print_Mode.internal (b, t)
   260         |> Proof_Context.generic_add_abbrev Print_Mode.internal (b, Term.close_schematic_term t)
   261         |-> (fn (const as Const (c, _), _) => same_shape ?
   261         |-> (fn (const as Const (c, _), _) => same_shape ?
   262               (Proof_Context.generic_revert_abbrev (#1 prmode) c #>
   262               (Proof_Context.generic_revert_abbrev (#1 prmode) c #>
   263                Morphism.form (Proof_Context.generic_notation true prmode [(const, mx)]))))
   263                Morphism.form (Proof_Context.generic_notation true prmode [(const, mx)]))))
   264   end;
   264   end;
   265 
   265 
   267   standard_declaration pred (fn phi =>
   267   standard_declaration pred (fn phi =>
   268     let
   268     let
   269       val b' = Morphism.binding phi b;
   269       val b' = Morphism.binding phi b;
   270       val rhs' = Morphism.term phi rhs;
   270       val rhs' = Morphism.term phi rhs;
   271       val same_shape = Term.aconv_untyped (rhs, rhs');
   271       val same_shape = Term.aconv_untyped (rhs, rhs');
   272     in generic_const same_shape prmode ((b', mx), Term.close_schematic_term rhs') end);
   272     in generic_const same_shape prmode ((b', mx), rhs') end);
   273 
   273 
   274 
   274 
   275 
   275 
   276 (** primitive theory operations **)
   276 (** primitive theory operations **)
   277 
   277