-
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
Witgen inference. #2219
Merged
Merged
Witgen inference. #2219
Changes from all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
aeec462
Expressions and solving routines.
chriseth 3749925
Fixes and one more test.
chriseth 41d1270
Remove comment.
chriseth ba5fb7b
Merge remote-tracking branch 'origin/main' into jit_solving
chriseth f5e5edd
Add assertions.
chriseth 09773df
clippy
chriseth cb5638d
Only mention constraint in error message.
chriseth e348031
witgen inference.
chriseth fe7908e
Generic vars for symbolic expression.
chriseth 0a2099e
Merge remote-tracking branch 'origin/main' into jit_solving
chriseth 5014950
Also implement operations for non-ref.
chriseth 34f52c6
Merge remote-tracking branch 'origin/jit_solving' into witgen_inference
chriseth e3e1fdb
witgen inference.
chriseth d21c061
Move "from_var" fn.
chriseth 6bbaf54
Use rc.
chriseth 1070ce9
use retain.
chriseth ff6a2f7
Fix bug and check for zero in "bitor"
chriseth aa91ce3
Merge remote-tracking branch 'origin/jit_solving' into witgen_inference
chriseth e6843ba
Simplify known.
chriseth 372f417
Merge branch 'jit_solving' into witgen_inference
chriseth eb62678
Add test.
chriseth 53dddb4
Add completeness flag.
chriseth 67e238e
Change completeness condition.
chriseth 9a8b3ad
pow
chriseth 236f056
remove todo
chriseth cad7f37
Simplify and fix solving and remove unused conversion.
chriseth ef33a56
Make use of range constraints in division check.
chriseth b3e81e3
Typos
chriseth 84c5d75
Comment display and remove parentheses for unary.
chriseth 99cbb3d
extend documentation.
chriseth 7c2f994
clippy
chriseth a21ca0c
simplify "allows_value"
chriseth 479a96d
Store all range constraints with expressions.
chriseth 1a77808
Improved allows_value.
chriseth 8c588f8
Add another case for division.
chriseth 969e2ba
Fix tests.
chriseth 88cd264
Rename Variable to Symbol and relax one check.
chriseth 8183620
clippy
chriseth d7d37b0
Merge remote-tracking branch 'origin/jit_solving' into witgen_inference
chriseth be36d96
fix test
chriseth ba0e2ce
Merge remote-tracking branch 'origin/main' into jit_solving
chriseth 69af634
Merge branch 'jit_solving' into witgen_inference
chriseth bfb5371
Access to fixed columns.
chriseth f7bc144
Support permutations.
chriseth 6ab422e
Fix a bug and add another test.
chriseth 111902f
Update executor/src/witgen/jit/witgen_inference.rs
chriseth 2b73e09
review
chriseth 720645f
Merge branch 'witgen_inference' of ssh://github.com/powdr-labs/powdr …
chriseth f57bdd7
Rename reference evaluator.
chriseth fea920e
Fix range constraint for bitwise operations.
chriseth fd363b2
Fix xor test.
chriseth 1ed01be
Merge remote-tracking branch 'origin/main' into witgen_inference
chriseth b715662
Remove (for now) unused function.
chriseth a905288
trick clippy.
chriseth File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
use std::{ | ||
fmt::{self, Display, Formatter}, | ||
hash::{Hash, Hasher}, | ||
}; | ||
|
||
use powdr_ast::analyzed::AlgebraicReference; | ||
|
||
/// The identifier of a witness cell in the trace table. | ||
/// The `row_offset` is relative to a certain "zero row" defined | ||
/// by the component that uses this data structure. | ||
#[derive(Debug, Clone, Eq)] | ||
pub struct Cell { | ||
/// Name of the column, used only for display purposes. | ||
pub column_name: String, | ||
pub id: u64, | ||
pub row_offset: i32, | ||
} | ||
|
||
impl Hash for Cell { | ||
fn hash<H: Hasher>(&self, state: &mut H) { | ||
self.id.hash(state); | ||
self.row_offset.hash(state); | ||
} | ||
} | ||
|
||
impl PartialEq for Cell { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.id == other.id && self.row_offset == other.row_offset | ||
} | ||
} | ||
|
||
impl Ord for Cell { | ||
fn cmp(&self, other: &Self) -> std::cmp::Ordering { | ||
(self.id, self.row_offset).cmp(&(other.id, other.row_offset)) | ||
} | ||
} | ||
|
||
impl PartialOrd for Cell { | ||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { | ||
Some(self.cmp(other)) | ||
} | ||
} | ||
|
||
impl Cell { | ||
pub fn from_reference(r: &AlgebraicReference, row_offset: i32) -> Self { | ||
assert!(r.is_witness()); | ||
Self { | ||
column_name: r.name.clone(), | ||
id: r.poly_id.id, | ||
row_offset: r.next as i32 + row_offset, | ||
} | ||
} | ||
} | ||
|
||
impl Display for Cell { | ||
fn fmt(&self, f: &mut Formatter) -> fmt::Result { | ||
write!(f, "{}[{}]", self.column_name, self.row_offset) | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 seems confusing, if we cannot solve it, why is it complete?
I think the answer is that there are no unknown symbols, right? But in that case, it is already solved, right?
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 mean it says it in the comment "we cannot learn anything new from it"