UniFormal / MMT

The MMT Language and System
https://uniformal.github.io/
Other
68 stars 22 forks source link

Streamline large theory graph definitions #347

Open florian-rabe opened 6 years ago

florian-rabe commented 6 years ago

I've looked at the lattice formalization @kohlhase and @Jazzpirate did recently.

I noticed it doesn't look as nice as it should. I think my main concern is that there is way too much boilerplate.

I'm not entirely sure what the problem is - the theory-method, the MMT implementation, the convention with nested theories, or something else. I would like to use this case study to understand what is needed to allow such formalizations to be much more concise.

Do you have any suggestions already?

Here are some first ideas I had:

Jazzpirate commented 6 years ago
kohlhase commented 6 years ago

I noticed it doesn't look as nice as it should. I think my main concern is that there is way too much boilerplate.

I completely agree. I think the main culprit is the internal/external structure. I suspect that a couple of structural features could help here. Something like

theotype foo // theory + record type definition
   include ?bar // ?bar must be another theotype
   internal <the stuff to add to the internal theory>
   external <the stuff to add to the external theory>
|||

which would elaborate to

theory foo : <meta>
   include ?bar
   theory foo_theory : <meta>
      include ?bar_theory 
      <the stuff to add to the internal theory>
    ||| 
   foo = Mod foo_theory | role = application
   <the stuff to add to the external theory>
|||
kohlhase commented 6 years ago

I think that such a thing (and I am sure that there is more boilerplate we can include into this) would help structure things quite a lot. We might add the usual "accessor methods" for the main structural constants of the internal theory.