Unsafe coerce and more efficient Agda code (-ftrust-me-im-agda)
Since this is a research question, we’ve got a few possible ways forward, but they all come down to: Play tricks reversing the tag bits of Maybe
Since this is a research question, we’ve got a few possible ways forward, but they all come down to: Play tricks reversing the tag bits of Maybe
When I started learning Agda about a year ago I think I tried all available tutorials and each taught me something new. You should probably give Coq a try, because it has a larger user base and there are two nice books available for it: Coq’Art – slightly dated, but beginner friendly Certified Programming with … Read more
Coq has been designed with theorem proving in mind, whereas Agda has been designed with dependently-typed programming in mind. They are somewhat equivalent on the theoretical side (even though they have differences, Coq being slightly more conservative in its axioms and sticking closer to the mathematical foundation of CIC by default), but I would trust … Read more
tl;dr the proposed candidate is not quite an equaliser, but its irrelevant counterpart is The candidate for an equaliser in Agda looks good. So let’s just try it. We’ll need some basic kit. Here are my refusenik ASCII dependent pair type and homogeneous intensional equality. record Sg (S : Set)(T : S -> Set) : … Read more
Are there examples Agda code running in production? [closed]
To my mind, the value of containers (as in container theory) is their uniformity. That uniformity gives considerable scope to use container representations as the basis for executable specifications, and perhaps even machine-assisted program derivation. Containers: a theoretical tool, not a good run-time data representation strategy I would not recommend fixpoints of (normalized) containers as … Read more
When you see a family of types, you may wonder whether each of the arguments it has are parameters or indices. Parameters are merely indicative that the type is somewhat generic, and behaves parametrically with regards to the argument supplied. What this means for instance, is that the type List T will have the same … Read more
The confusion arises from using similar terminology for the structure of a Σ type and for how its values look like. A value of Σ(x:A) B(x) is a pair (a,b) where a∈A and b∈B(a). The type of the second element depends on the value of the first one. If we look at the structure of … Read more
Axiom K is also called the principle of uniqueness of identity proofs, and it is an axiom about the nature of the identity type in Martin-Löf’s dependent type theory. This type doesn’t exist (and in fact cannot be defined) in simpler type theories such as System F, so that is probably the reason why you … Read more
I would highly recommend Software Foundations. This book is quite good at introducing you to Coq one step at a time. There is a lot of theorem proving, yes, but that’s part of the deliciousness of dependent types. It’s a great feeling when the line between “programming” and “proving” starts to blur. I’m lacking in … Read more