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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] String Reducers + Canonicalization #945

Closed
18 tasks done
gluax opened this issue May 11, 2021 · 1 comment
Closed
18 tasks done

[Feature] String Reducers + Canonicalization #945

gluax opened this issue May 11, 2021 · 1 comment
Assignees
Labels
feature A new feature.

Comments

@gluax
Copy link
Contributor

gluax commented May 11, 2021

馃殌 Feature

The goal is to add string to the Phases Reducer, allowing type-inference to handle characters.
Depends on #943.

Motivation

Right now, each of the AST and ASG relies on a reducer to handle certain phases such as canonicalization, type inference, etc.
The goal is to update the Reducers allowing for compilation.

Implementation

AST

  • Reducer
    • A new function reduce_string should be added to the trait ReconstructingReducer block leo/ast/src/reducer/reconstructing_reducer.rs. It should return an Expression.
    • Need to modify reduce_value to return an Expression.
  • Director
    • A new function reduce_string should be added to the impl<R: ReconstructingReducer> ReconstructingDirector<R> block leo/ast/src/reducer/reconstructing_director.rs. The function should return the string Value Expression Node wrapped in an Expression Node.
    • The reduce_value function should match the string Value Expression Node and call reduce_string. It should be modified to return an expression.
    • The reduce_expression function should return the expression rather than type wrapping it.
  • Canonicalization
    • A new function reduce_string should be added to the impl ReconstructingReducer for Canonicalizer block.
    • The function should convert the string AST Node to an ArrayInline Expression Node.

Tests

  • Compiler Tests:
    • Assigning a string.
      • Explicit.
      • Non-Explicit. Type Inference Should be tested here as well.
    • Should test after Canonicalization a string is an inline-array.
    • Passing a string to functions.
    • Circuit member variable string fields.
    • Global const string.
@damirka
Copy link
Contributor

damirka commented May 26, 2021

Closed by #957.

@damirka damirka closed this as completed May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature.
Projects
None yet
Development

No branches or pull requests

2 participants