*To*: Brian Huffman <brianh at cs.pdx.edu>*Subject*: Re: [isabelle] lattice syntax problems (OR: what does it mean to merge two theories?)*From*: Lukas Bulwahn <bulwahn at in.tum.de>*Date*: Thu, 28 Jul 2011 18:26:20 +0200*Cc*: isabelle-users <isabelle-users at cl.cam.ac.uk>*In-reply-to*: <CAAMXsiZhut9MU-ew+kZAk0fUarT+v6SCVaF_q0ncW-ANMb7a_A@mail.gmail.com>*References*: <CAAMXsiZhut9MU-ew+kZAk0fUarT+v6SCVaF_q0ncW-ANMb7a_A@mail.gmail.com>*User-agent*: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Thunderbird/3.1.11

On 07/28/2011 05:28 PM, Brian Huffman wrote:

Hello all, I have recently noticed some weird/undesirable behavior with regards to lattice syntax. Exploring this issue brings up some fundamental questions about what it really means for Isabelle to merge two theories. As many of you may know, HOL/Lattices.thy defines infix syntax for various lattice operations, including binary "inf" and "sup"; but then it uses "no_notation" to erase this syntax at the end of the file, to avoid using up so many precious symbols. Users who want to use the syntax can import it from HOL/Library/Lattice_Syntax, like this: theory Scratch imports "~~/src/HOL/Library/Lattice_Syntax" begin term "x \<sqinter> y" (* parses as "inf x y" *) When I wrote my Free Boolean Algebra AFP entry (which makes heavy use of the lattice syntax) I followed what seemed to be the best practice, and used "no_notation" to delete the syntax again. I expected that users of my Free_Boolean_Algebra library would be able to use the lattice syntax (if they chose to do so) by importing Library/Lattice_Syntax again. Unfortunately this does not work! theory Scratch imports "~~/src/HOL/Library/Lattice_Syntax" "~/hg/afp/thys/Free-Boolean-Algebra/Free_Boolean_Algebra" begin term "x \<sqinter> y" *** Inner lexical error at: \<sqinter> y (line 7 of "/home/brianh/Documents/Isabelle/Scratch.thy") *** Failed to parse term *** At command "term" (line 7 of "/home/brianh/Documents/Isabelle/Scratch.thy") I thought that when you say "theory C imports A B begin", Isabelle should actually merge theories A and B. In particular, any input syntax that exists in either theory A or theory B should be available in theory C. But that is not the case here! The syntax in Lattice_Syntax is completely ignored. Evidently, Isabelle assumes that merging Lattice_Syntax + Free_Boolean_Algebra will be equal to the Free_Boolean_Algebra theory by itself (because Lattice_Syntax is an ancestor theory of Free_Boolean_Algebra) and optimizes away the actual theory merge. But this is an invalid assumption.

Obviously, you cannot load a theory twice in Isabelle.

Lukas

- Brian

**Follow-Ups**:

**References**:

- Previous by Date: [isabelle] lattice syntax problems (OR: what does it mean to merge two theories?)
- Next by Date: Re: [isabelle] lattice syntax problems (OR: what does it mean to merge two theories?)
- Previous by Thread: [isabelle] lattice syntax problems (OR: what does it mean to merge two theories?)
- Next by Thread: Re: [isabelle] lattice syntax problems (OR: what does it mean to merge two theories?)
- Cl-isabelle-users July 2011 archives indexes sorted by: [ thread ] [ subject ] [ author ] [ date ]
- Cl-isabelle-users list archive Table of Contents
- More information about the Cl-isabelle-users mailing list