-
Notifications
You must be signed in to change notification settings - Fork 97
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
Remove constraints blocks #652
Conversation
3500770
to
8af2582
Compare
*body = self.expand_macros(std::mem::take(body)) | ||
} | ||
InstructionBody::CallableRef(..) => { | ||
machine.statements = machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was changed to a functional approach, as a statement can yield many, and iter_mut
does not allow that. Hence the usage of flat_map here.
_ => {} | ||
}); | ||
MachineStatement::Pil(start, statement) => self | ||
.expand_macros(vec![statement]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make more sense to me for expand_macros
to take a single statement rather than a list, but I tried to keep this diff small.
@@ -40,7 +40,7 @@ impl<T: Display> Display for Machine<T> { | |||
write_items_indented(f, &self.registers)?; | |||
write_items_indented(f, &self.instructions)?; | |||
write_items_indented(f, &self.callable)?; | |||
write_items_indented(f, &self.constraints)?; | |||
write_items_indented(f, &self.pil)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it a problem that these might be ordered differently? I mean can we always re-parse stuff that is printed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate here? Within constraints, the order is preserved throughout the compiler, but eventually this should not be a requirement, right? There are no tests which parse outputs of this display afaik, this could make sense to add but it seems unrelated to this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just wondering if it might make sense to move the pil a bit further up or what happens if you mix constraints and instruction declarations and such, but yes, unrelated to this PR.
fa493ad
to
71b1dc1
Compare
71b1dc1
to
0950ff5
Compare
still conflicts. |
0950ff5
to
a3ebf46
Compare
Becomes
I did not change
analysis/README.md
as the diff looks quite different now.I also tried to update the book in a way that made sense, pointing to the docs for powdr-pil when mentioning pil code in machines.