I mean, when you’re defining classes of judgements you could do worse than just label them clearly.
[ Γ ⊢ x ⇐ T ] checking
…
[ Γ ⊢ x ⇒ T ] synthesis
…
would go a long way, without requiring people adhere to any particular notation or whatever.
Conversation
YES! Clear labels for the judgement forms in boxes would go a long way to reducing the overhead of reading unfamiliar rules.
2
7
I still also think we could somehow work on making the distinction between bits of 'syntax' and 'non-terminals' clearer. Like `_⊢_⇒_` vs `Γ`, `e`, `t`. Perhaps making a more uniform notation, like `synth(_, _, _)` would help with reducing the mental overhead?
2
4
relation check(_ : context, _ : term, _ : type).
relation synth(_ : context, _ : term, _ : type).
mode check(_ : in, _ : in, _ : in) is semidet.
mode synth(_ : in, _ : in, _ : out) is semidet.
😊
1
3
maybe we should just use Twelf or Mercury 🙃
1
More just pointing out that there are some neat things about how logic programming does things. Eg. with modes and determinism. Could possibly be a handy perspective perhaps when coming up with a general notation for this stuff, but I dunno.
2
1
Oh yeah, definitely thinking more in terms of 'high level specifications for communication' rather than an actual implementation. I definitely care about the precise proof search strategy too, however.
That said, Mercury would be able to generate pretty efficient code for a bidirectional type checker defined using the modes above. I wouldn't want to use it for an implementation though - more because I'd want an actual implementation to do error recovery, and give nice errors.
1
1
It would be neat if you could somehow 'decorate' the high level spec with stuff to do with errors though - kind of like how ornaments work?
1
1
Show replies
yeah that distinction is pretty handy, e.g. replace all the ⇒/⇐s in a bidi typesystem with : and you recover the nondeterministic specification of it (which sounds annoying to have to prove correct if you’ve gone in the other direction by bidirectionalizing an existing theory)
1

