Skip to content
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

refactor of SatisfyingAssignment as type alias of WitnessCS #89

Conversation

jobez
Copy link
Contributor

@jobez jobez commented Oct 31, 2023

Per discussion: #77 and pending the merging of: lurk-lang/bellpepper#48

We refactor SatisfyingAssignment as an alias of WitnessCS, parameterized with the Group's associative type of Scalar. This change introduces a level of genericity, which means we need to add explicit type information during instantiation in order to resolve compiler ambiguity.

i.e., We refactor SatisfyingAssignment::new() calls with explicit type information that the compiler needs to construct an instance of WitnessCS

i.e. SatisfyingAssignment::<G>::new()

otherwise we would see errors like:

56 |     let mut cs: SatisfyingAssignment<G> = SatisfyingAssignment::new();
   |                                           ^^^^^^^^^^^^^^^^^^^^ cannot infer type for type parameter `G` declared on the type alias `SatisfyingAssignment`

@jobez jobez changed the title initial refactor of WitnessCS with ex of new constr generic changes refactor of SatisyingAssignment as type alias of WitnessCS Oct 31, 2023
@jobez jobez changed the title refactor of SatisyingAssignment as type alias of WitnessCS refactor of SatisfyingAssignment as type alias of WitnessCS Oct 31, 2023
@huitseeker huitseeker force-pushed the refactor/dedup_SatisfyingAssignment_from_WitnessCS branch from 858338f to b8b4c0e Compare November 5, 2023 15:53
Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank you so much!

@huitseeker huitseeker enabled auto-merge November 5, 2023 15:54
@huitseeker huitseeker added this pull request to the merge queue Nov 6, 2023
Merged via the queue into lurk-lang:dev with commit 25cffb9 Nov 6, 2023
3 checks passed
@jobez jobez deleted the refactor/dedup_SatisfyingAssignment_from_WitnessCS branch November 6, 2023 17:59
github-actions bot pushed a commit that referenced this pull request Nov 9, 2023
* chore: Update bellpepper and neptune dependencies

- Updated `bellpepper-core` and `bellpepper` dependencies to version `0.4.0`
- Upgraded `neptune` dependency to version `13.0.0`

* refactor of SatisfyingAssignment as type alias of WitnessCS (#89)

* initial refactor of WitnessCS with ex of new constr generic changes

* explicit type information for usages of `SatisfyingAssignment::new`

* use `scalar_` public getters for the aliased WitnessCS

* go back to `_assignment` public fields

* remove reference

---------

Co-authored-by: johann bestowrous <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants