-
Notifications
You must be signed in to change notification settings - Fork 112
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
Arrabiata: define correctly the different challenges used in the protocol #2684
Changes from 1 commit
9b78f11
9a20e08
e815585
363fc03
286dfc6
bde9704
4d7c283
3e5f19f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -843,28 +843,6 @@ impl<Column: Copy> Variable<Column> { | |
} | ||
} | ||
|
||
impl<Column: FormattedOutput + Debug> Variable<Column> { | ||
pub fn ocaml(&self) -> String { | ||
format!("var({:?}, {:?})", self.col, self.row) | ||
} | ||
|
||
pub fn latex(&self) -> String { | ||
let col = self.col.latex(&mut HashMap::new()); | ||
match self.row { | ||
Curr => col, | ||
Next => format!("\\tilde{{{col}}}"), | ||
} | ||
} | ||
|
||
pub fn text(&self) -> String { | ||
let col = self.col.text(&mut HashMap::new()); | ||
match self.row { | ||
Curr => format!("Curr({col})"), | ||
Next => format!("Next({col})"), | ||
} | ||
} | ||
} | ||
|
||
impl<F: FftField, Column: Copy, ChallengeTerm: Copy> PolishToken<F, Column, ChallengeTerm> { | ||
/// Evaluate an RPN expression to a field element. | ||
pub fn evaluate<Evaluations: ColumnEvaluations<F, Column = Column>>( | ||
|
@@ -2870,6 +2848,32 @@ where | |
} | ||
} | ||
|
||
impl<Column: FormattedOutput + Debug> FormattedOutput for Variable<Column> { | ||
fn is_alpha(&self) -> bool { | ||
false | ||
} | ||
|
||
fn ocaml(&self, _cache: &mut HashMap<CacheId, Self>) -> String { | ||
format!("var({:?}, {:?})", self.col, self.row) | ||
} | ||
|
||
fn latex(&self, _cache: &mut HashMap<CacheId, Self>) -> String { | ||
let col = self.col.latex(&mut HashMap::new()); | ||
match self.row { | ||
Curr => col, | ||
Next => format!("\\tilde{{{col}}}"), | ||
} | ||
} | ||
|
||
fn text(&self, _cache: &mut HashMap<CacheId, Self>) -> String { | ||
let col = self.col.text(&mut HashMap::new()); | ||
match self.row { | ||
Curr => format!("Curr({col})"), | ||
Next => format!("Next({col})"), | ||
} | ||
} | ||
} | ||
|
||
impl<T: FormattedOutput + Clone> FormattedOutput for Operations<T> { | ||
fn is_alpha(&self) -> bool { | ||
match self { | ||
|
@@ -3011,7 +3015,7 @@ where | |
}); | ||
res | ||
} | ||
Atom(Cell(v)) => format!("cell({})", v.ocaml()), | ||
Atom(Cell(v)) => format!("cell({})", v.ocaml(&mut HashMap::new())), | ||
Atom(UnnormalizedLagrangeBasis(i)) => { | ||
format!("unnormalized_lagrange_basis({}, {})", i.zk_rows, i.offset) | ||
} | ||
|
@@ -3075,7 +3079,7 @@ where | |
}); | ||
res | ||
} | ||
Atom(Cell(v)) => v.latex(), | ||
Atom(Cell(v)) => v.latex(&mut HashMap::new()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why isn't the cache in the arg of the function given as arg to the recursive call ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not the same type, and also, it is unused in any case. |
||
Atom(UnnormalizedLagrangeBasis(RowOffset { | ||
zk_rows: true, | ||
offset: i, | ||
|
@@ -3122,7 +3126,7 @@ where | |
}); | ||
res | ||
} | ||
Atom(Cell(v)) => v.text(), | ||
Atom(Cell(v)) => v.text(&mut HashMap::new()), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why isn't the cache in the arg of the function given as arg to the recursive call ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not the same type, and also, it is unused in any case. |
||
Atom(UnnormalizedLagrangeBasis(RowOffset { | ||
zk_rows: true, | ||
offset: i, | ||
|
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.
why isn't the cache in the arg of the function given as arg to the recursive call of text ?
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.
Not the same type, and also, it is unused in any case.