-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstracting/annotating the result of a recursive call #482
Comments
Thanks for reporting this. Your suspicion is correct, the problem is that the AML type checker doesn't know what ML type to assign to
A different solution is to locally annotate the expression (the computation) that is reported as problematic, namely the recursive call:
Finally, to answer your question of how to annotate an expression as an equality judgement. In Andromeda the verification of derivability of a judgement is bi-directional, to save the user some annotations. Only derivable judgements can be constructed. However, sometimes the user wants to input something like a judgement to steer the construction in a certain direction. In your case, you want to write down But there is a different AML type, namely
Equations are a bit more peculiar because they don't have a head as such. The syntax we use is similar to the way we name equations in rules. In particular, for the equation you wrote, the syntax is
You can then use
A computation that was ascribed a boundary must be of type Epilogue: |
Wow, thank you for that very extensive answer (i.e. for essentially writing some documentation of code-in-progress just for me (-:O ). I thought that I also tried annotating things as One question: when I ascribe something to a type like |
Ah, I see what i didn't figure out. The error message highlighted the entire expression |
Yeah the annotation on recursive functions is a bit unfortunate right now, we'll fix that. The error being reported on the Indeed, |
It's too bad there can't be a parallel syntax for equalities, especially since the syntax for defining rules is parallel:
|
Is there a way for an AML function to explicitly access the boundary that's been given to it, if any? |
I'm not sure exactly what's going on here:
I get
Type error: cannot determine the type of this expression, please annotate it
on theabstract
line. Comparing this to other variants that do work, I suspect that perhaps sincefoo
isin the process of being defined, Andromeda can't infer its type sufficiently to be able to do the abstraction. (It works fine if the call is to a previously defined function rather than a recursive call, and also without the
abstract
.) So okay, sure, and if the function is computing a term rather than an equality I can figure out how to annotate the return value to make it work:But I can't figure out how to annotate something as an equality. My first guess was
but that gives
Parsing error: unexpected )
. I tried leaving off the: A
and/or adding all the parentheses I could think of, but nothing seems to work. Is there a way to annotate something as an equality?The text was updated successfully, but these errors were encountered: