DeepSpec / InteractionTrees

A Library for Representing Recursive and Impure Programs in Coq
MIT License
204 stars 51 forks source link

Library organization #93

Closed Lysxia closed 5 years ago

Lysxia commented 5 years ago

WIP. Right now I'm just putting the plan up for discussion.

We should probably undertake the reorganization in this very PR so we can address directly unforeseen practical problems.


The rendered plan.

Lysxia commented 5 years ago

As I actually try to implement this, I find I missed three files:

In fact, all four categories in this plan are cocartesian, so it would make sense to describe that in Basics.Categories as well.

Lysxia commented 5 years ago

The InterpretFacts file is going to be quite big, so it might make sense to split things further. *Facts and *Proper modules, perhaps?

gmalecha commented 5 years ago

This seems like a pretty reasonable plan. The contexts of Basics would be nice to move out somewhere else (if people buy into package managers, this shouldn't be a problem). Either ExtLib or some other library. I've been wondering if ExtLib should be more minimal.

Lysxia commented 5 years ago

So far I'm following the approach of "Type classes for Mathematics in Type Theory" to implement categories, http://www.eelis.net/research/math-classes/mscs.pdf and it works pretty well.

Lysxia commented 5 years ago

I'm running into universe inconsistencies while putting the category of effect morphisms E ~> F under the Category interface.

@gmalecha Can you take a look?

I put the current state of my code in branch reorg-category-ui, and the problem comes up in theories/Interp/HandlerFacts.v, line 115.

One workaround is to not have the different categories share the same type classes and live with the duplication.

Lysxia commented 5 years ago

Not using universe polymorphism seems to help (test-no-up branch)

gmalecha commented 5 years ago

I had a busy week last week, so I didn't get a chance to look at this. The current reorg-category-ui doesn't seem to build for me.

COQC theories/Core/KTree.v
File "./theories/Core/KTree.v", line 10, characters 5-16:
Error: Unable to locate library Eq.UpToTaus with prefix ITree.

make[2]: *** [Makefile.coq:663: theories/Core/KTree.vo] Error 1
COQC theories/Core/KTreeFacts.v
File "./theories/Core/KTreeFacts.v", line 12, characters 5-15:
Error: Unable to locate library Core.KTree with prefix ITree.
Lysxia commented 5 years ago

Ah sorry about that, I forgot to add a file. But somehow the error disappeared!?

gmalecha commented 5 years ago

Does this mean you don't see the universe inconsistency anymore?

Lysxia commented 5 years ago

That's right.

Lysxia commented 5 years ago

This is starting to stabilize. The main changes are:


The main things left to do after this are:

Zdancewic commented 5 years ago

This looks like it's coming along well!

Do you think that it has stabilized enough for me to start working on the tutorial material? I'll start with something very basic like examples/Factorial.v so I'm not in the way. I'm anxious to start generating documentation about the primary interfaces.

Lysxia commented 5 years ago

Yes I think things are pretty stable now.

gmalecha commented 5 years ago

I'll try to take a look at the universe polymorphism bit. It may just be a matter of adding cumulativity.

Lysxia commented 5 years ago

Ok. I think this is good to merge.

Zdancewic commented 5 years ago

I agree -- we can then work on documentation from there. Thanks!