Skip to main content
5 events
when toggle format what by license comment
Oct 15, 2022 at 19:04 comment added Dan Doel On the flip side: most rigorous specifications of inductive definitions I'm aware of would say that Type is not an actual specification, and it must be compiled into essentially a mutual definition between Type and List Type. Then it is no surprise that recursive definitions on Type require a mutual definition on List Type. The foundational accounts for inductive definitions themselves fail to be compositional in the same way as Agda's termination checker. (Possibly recent work by Henning Basold does not have this problem.)
Oct 15, 2022 at 18:48 comment added Dan Doel Requiring some kind of mutual definition here is a pretty well-known shortcoming of Agda's termination checker. The check is just not very compositional, and recursive definitions can't just be inlined for the checker to 'see through' them. This is the reason that sized types were invented, and although I'm not a great fan of them, I'm also not aware of any other promising solutions.
Oct 14, 2022 at 19:58 vote accept TerminationCheckFailed
Oct 14, 2022 at 19:57 comment added TerminationCheckFailed I tried writing mappings between Value (struct ts) and All Value ts using both your solutions, fully inlined All and a Value defined as a data type. Your second solution and full inlining required to match on (implicit) ts, while the others allowed to directly match on Value (which is maybe convenient? at least less verbose). Since I don't know if GADT approach will bring any advantages, I'll go with your first solution for now since it doesn't require casts between Value nat and Nat. Thanks for an answer.
Oct 14, 2022 at 18:34 history answered Andrej Bauer CC BY-SA 4.0