mirror of
https://github.com/powdr-labs/powdr.git
synced 2026-05-13 03:00:26 -04:00
@@ -29,7 +29,7 @@ impl From<u32> for AffineExpression {
|
||||
}
|
||||
|
||||
impl AffineExpression {
|
||||
pub fn from_wittness_poly_value(poly_id: usize) -> AffineExpression {
|
||||
pub fn from_witness_poly_value(poly_id: usize) -> AffineExpression {
|
||||
AffineExpression {
|
||||
coefficients: [vec![0.into(); poly_id], vec![1.into()]].concat(),
|
||||
offset: 0.into(),
|
||||
|
||||
@@ -173,7 +173,7 @@ where
|
||||
.map(|(i, v)| {
|
||||
format!(
|
||||
"{} = {}",
|
||||
AffineExpression::from_wittness_poly_value(i).format(self.fixed_data),
|
||||
AffineExpression::from_witness_poly_value(i).format(self.fixed_data),
|
||||
v.as_ref()
|
||||
.map(format_number)
|
||||
.unwrap_or("<unknown>".to_string())
|
||||
@@ -360,7 +360,7 @@ impl<'a> SymbolicVariables for EvaluationData<'a> {
|
||||
value.clone().into()
|
||||
} else {
|
||||
// We continue with a symbolic value
|
||||
AffineExpression::from_wittness_poly_value(*id)
|
||||
AffineExpression::from_witness_poly_value(*id)
|
||||
})
|
||||
}
|
||||
(true, EvaluationRow::Next) => {
|
||||
|
||||
@@ -107,8 +107,8 @@ fn check_constraint<'a>(fixed_data: &'a FixedData, constraint: &Expression) -> O
|
||||
_ => return None,
|
||||
};
|
||||
let witness_count = fixed_data.witness_cols.len();
|
||||
let pattern = AffineExpression::from_wittness_poly_value(key_column_id + witness_count)
|
||||
- AffineExpression::from_wittness_poly_value(key_column_id);
|
||||
let pattern = AffineExpression::from_witness_poly_value(key_column_id + witness_count)
|
||||
- AffineExpression::from_witness_poly_value(key_column_id);
|
||||
if sort_constraint != pattern {
|
||||
return None;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ impl<'a> SymbolicVariables for SymbolicEvaluator<'a> {
|
||||
// TODO arrays
|
||||
if let Some(id) = self.fixed_data.witness_ids.get(name) {
|
||||
let witness_count = self.fixed_data.witness_ids.len();
|
||||
Ok(AffineExpression::from_wittness_poly_value(
|
||||
Ok(AffineExpression::from_witness_poly_value(
|
||||
*id + if next { witness_count } else { 0 },
|
||||
))
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user