You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FuncDefn stores a FunctionType (inputs, outputs, extension_reqs) as the type of the function declared. This FunctionType is what you get from the static_output of the FuncDefn node.
The FuncDefn node also has its own signature: FunctionType for its dataflow ports. Since it's not a dataflow node, this is:
In extension inference, we make the input/output extensions of the FuncDefn node equal to the extensions of the Input/Output nodes beneath it (FuncDefn is a DataflowParent just like BasicBlock, Dfg, etc.):
let delta = node_type.op_signature().extension_reqs;
let c = if delta.is_empty(){
Constraint::Equal(m_input)
}else{
Constraint::Plus(delta, m_input)
};
self.add_constraint(m_output, c);
}
Putting 2,3,4 together we have that the body of the function must have a zero extension delta (Input and Output nodes of a FuncDefn are constrained to have equal extension requirements), ooops
The text was updated successfully, but these errors were encountered:
FuncDefn stores a FunctionType (inputs, outputs, extension_reqs) as the type of the function declared. This FunctionType is what you get from the static_output of the FuncDefn node.
The FuncDefn node also has its own
signature: FunctionType
for its dataflow ports. Since it's not a dataflow node, this is:hugr/src/ops.rs
Lines 189 to 191 in b256c2b
i.e. no ports, and empty-set extension reqs.
In extension inference, we make the input/output extensions of the FuncDefn node equal to the extensions of the Input/Output nodes beneath it (FuncDefn is a DataflowParent just like BasicBlock, Dfg, etc.):
hugr/src/extension/infer.rs
Lines 277 to 284 in b256c2b
Also in inference, we use the FunctionType from step 2 (not step 1) to constrain the input/output extensions of the FuncDefn node:
hugr/src/extension/infer.rs
Lines 305 to 315 in b256c2b
Putting 2,3,4 together we have that the body of the function must have a zero extension delta (Input and Output nodes of a FuncDefn are constrained to have equal extension requirements), ooops
The text was updated successfully, but these errors were encountered: