Skip to content

Conversation

@andres-erbsen
Copy link
Contributor

@andres-erbsen andres-erbsen commented Jul 15, 2025

Perhaps there is a way forward here after all.

@JasonGross did I get this right?

@JasonGross
Copy link
Collaborator

@JasonGross did I get this right?

Yes, that sounds right to me

Comment on lines +83 to +91
if ((Z.of_nat k <=? Z.of_nat (length a))
&& (Z.of_nat (length b) <=? Z.of_nat (length a))
&& (0 <=? c)
&& (c <? weight bound k)
&& (0 <=? eval bound a)
&& (eval bound a <? weight bound (length a))
&& (c*Z.abs (eval bound b) <=? weight bound k - c))%bool
then reduce' bound k c a b
else a ++ b.
Copy link
Contributor Author

@andres-erbsen andres-erbsen Jul 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another alternative to #1761 would be to remove this kind of checks from the templates, avoiding the need to do range analysis on thunks by doing that range analysis in proofs instead. This might involve using list (word 64) instead of list Z. Going in this direction would be shifting work from the rewriter and associated pipeline into tactic-based proofs. However, there's a good chance the resulting code would work with the current rewriter, or perhaps even with eval-cbv (if first transformed to continuation-passing style).

@andres-erbsen
Copy link
Contributor Author

The first step listed above seems like the most uncertain still, so if we want to move forward here, that would be the one to try first. Following

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants