Conversation
70ed9a6 to
e6e1a8d
Compare
|
@epatters You were wondering about what I was muttering about an eta-conversion to |
epatters
left a comment
There was a problem hiding this comment.
Thanks Kevin, this is really nice work. Just a few small comments below.
e6e1a8d to
d9abe77
Compare
19d19a2 to
ba1d14d
Compare
| } | ||
| TmV_::Compose(f, g) => { | ||
| // FIXME: This isn't correct because the morphism types of `f` | ||
| // and `g` need not be the morphism type of their composite. |
There was a problem hiding this comment.
@KevinDCarlson, I noticed this problem while doing a little cleanup.
To avoid a build up of PRs and subsequent merge conflicts, I'm going to merge this as is but I have created #1070 as a tracking issue.
Resolves #782
We add type syntax and values for identity types, with the intended usage being for extensional equality types for morphism terms.
The formal syntax is
Id(TyS,TmS,TmS)where the two terms will evaluate as members of the evaluation of the type, and similar for the value. This type is displayed and entered in plain text asa == b.In the text elaborator, we throw errors if the user attempts to construct the equality type between two terms that are not in a
Morphismtype, or if their types are not themselves convertible.We have a snapshot test to look at the model generated by a commutative square, as well as an test internal to Rust to confirm that this model successfully gets an equation, as a stopgap while pretty-printing for equations remains unimplemented.
The largest diff is in modelgen, but part of this diff count is spurious: we move a lot of methods from
modelgen::ModeltoModelGenerator. This is for consistency with the primary really new function,make_mor, which makes a morphism in aModelGenerator's model, but needs access to the theory in order to make the object of an identity morphism's basepoint. It would be possible to move the moved stuff back and putmake_moronModel, at the cost of asking it to carry around an extraObTypeargument for theIdcase that would be irrelevant in the other cases.For making composite morphisms, we include an unchecked
concat_pathsfunction, which is only used to concatenate paths built from morphism terms which we already know to match up fromsyn. This function could be moved onto Path if that seems desirable.I haven't included any way for the elaborator to use the equations from the equality type itself, since there should be no need: we never need to run
equal_tmmodulo propositional equality on morphism terms. I also haven't included areflequality term, since again there's no obvious need for it; we just let equalities eta-convvert tott.I haven't tried to do anything with the notebook elaborator yet. I think this requires changes to the notebook data structure first, right?