[isabelle-dev] [Fwd: [isabelle] Monad_Syntax breaks display of abbreviations]
c.sternagel at gmail.com
Mon Sep 30 15:07:02 CEST 2013
It seems that the required changes are minimal. See the attached patch.
To be on the safe side: could somebody push this to the test server (in
my local tests I just loaded all theories from the Isabelle repo and the
AFP that contained the keyword "adhoc_overloading" in Isabelle/jEdit
instead of building all heap images).
On 09/30/2013 08:50 PM, Christian Sternagel wrote:
> On 09/30/2013 07:33 PM, Makarius wrote:
>> On Tue, 24 Sep 2013, Christian Sternagel wrote:
>>> After this changeset, variants may be arbitrary terms (due to
>>> localization). Now replacing a variant by the corresponding overloaded
>>> constant is done by rewriting (as Florian already pointed out, this
>>> happens in "insert_overloaded") as follows
>>> fun insert_overloaded ctxt variant =
>>> (case try Term.type_of variant of
>>> NONE => variant
>>> | SOME T =>
>>> Pattern.rewrite_term (Proof_Context.theory_of ctxt) 
>>> [Option.map (Const o rpair T) o
>>> get_overloaded ctxt o Term.map_types (K dummyT)] variant);
>>> Apparently this interferes with abbreviations. Am I doing anything
>>> strange here?
>> I've looked only briefly so far. Abbreviations are only contracted for
>> type-correct terms, but above that information is not fully preserved.
>> Pattern.rewrite_term needs to re-used the type of the replaced subterm
>> (within the proc), not the overall type of the term called "variant"
> Thanks! That's a valuable hint. I will look into it and hope to make
> adhoc overloading and abbreviations produce the expected results again,
> before the release.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 1091 bytes
Desc: not available
More information about the isabelle-dev