-
Notifications
You must be signed in to change notification settings - Fork 9
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
Move assumption/assertion generation to its own pass #496
base: main
Are you sure you want to change the base?
Conversation
@rachitnigam There is some finicky stuff here caused by the fact that |
pub type PortInfo = | ||
(/*lens=*/ Vec<usize>, /*gen_ports=*/ Vec<PortIdx>); | ||
/// A mapping from a bundle with a list of dimensions to the list of generated ports. | ||
type PortInfo = (/*lens=*/ Vec<usize>, /*gen_ports=*/ Vec<PortIdx>); |
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.
If we're extracting these into separate types, might as well give the fields real names?
@@ -4,9 +4,9 @@ use fil_ir::{self as ir, AddCtx, Ctx, ExprIdx, PropIdx}; | |||
|
|||
/// Generates default assumptions to the Filament program for assumptions using custom functions | |||
#[derive(Default)] | |||
pub struct Assume; | |||
pub struct FunAssumptions; |
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.
Nit: I don't love the name. Can we use something like InferAssumes
which implies some relationship between existing assumptions and created ones?
Time, TimeIdx, TimeSub, | ||
}; | ||
|
||
impl<C> Foreign<Expr, C> |
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.
What is this exactly used for and can we give this a better name/trait wrapper?
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.
Seems cool! I'm curious if this basically brings us back to the old world where the well-formed pass would add all of the assumptions and they could be discharged later?
This PR divests core assumption/assertion generation (about event constraints, param constraints, and range constraints) from astconv. This cleans up astconv a bit and also adds the important ability for the IR to generate its own assertions necessary for discharging. This will be useful in scheduling and is also necessary if we want to be able to discharge after monomorphization properly.