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

First version of partial evaluator: support for +,-,* operators and associative rules #528

Merged
merged 25 commits into from
Jul 15, 2024

Commits on Jun 28, 2024

  1. First commit for partial evaluator.

    There are still some TODOs (so, this is only a partial commit):
    - Implementation of association rule 3 and simple algebraic rules (to be added to file algebraic.ts)
    described in comments of issue: #435
    - Processing of structs, function calls, id lookups, ternary conditional operator.
    - Extensive documentation, specially in the description of what each rule does.
    - Extensive testing of the rewrite rules.
    jeshecdom committed Jun 28, 2024
    Configuration menu
    Copy the full SHA
    fa5bb05 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. Finished associative rule 3. Refactored Rule type into an interface. …

    …Priorities are no longer a property of rules, but are managed by the optimizer.
    jeshecdom committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    aae1dd0 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'partial_evaluator'. Resolved conflicts in constEval. Ad…

    …ded a function to call the partial evaluator in the interpreter to ease testing.
    jeshecdom committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    4533de6 View commit details
    Browse the repository at this point in the history

Commits on Jul 4, 2024

  1. Configuration menu
    Copy the full SHA
    34970cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a109d38 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    99b687f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2688771 View commit details
    Browse the repository at this point in the history

Commits on Jul 5, 2024

  1. Configuration menu
    Copy the full SHA
    9e871ca View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bd89e02 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cdb7cb2 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    15998a5 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    bfb37af View commit details
    Browse the repository at this point in the history
  6. - Changed all Ref in parameters for Loc. (https://github.com/tact…

    …-lang/tact/pull/528/files#r1666596822)
    
    - Added `dummySrcInfo` as default parameter values to functions `__evalUnaryOp` and `__evalBinaryOp`. This way I was able to eliminate them and simply leave `evalUnaryOp` and `evalBinaryOp` as exportable functions. (https://github.com/tact-lang/tact/pull/528/files#r1666598821)
    - Renamed ValueExpression for AstValue (https://github.com/tact-lang/tact/pull/528/files#r1666602072)
    - Used Dummy interval in grammar.ts (https://github.com/tact-lang/tact/pull/528/files#r1666602072)
    - Changed interfaces for abstract classes (https://github.com/tact-lang/tact/pull/528/files#r1666604615)
    - Renamed `areEqualExpressions` to `eqExpressions`, and moved it to `ast.ts`. Used `eqNames` and moved `ast1.kind === ast2.kind` check before switch. (https://github.com/tact-lang/tact/pull/528/files#r1666609433)
    jeshecdom committed Jul 5, 2024
    Configuration menu
    Copy the full SHA
    648f188 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    0426245 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e207389 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    82a9873 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. - Added try/catch in switch of eqExpressions in ast.ts.

    - Added test cases for eqExpressions function in ast.ts.
    - Changed if statement for conditional expressions in optimizer/util.ts.
    - Changed lookupID for lookupName and evalX for fullyEvalX in constEval.ts.
    jeshecdom committed Jul 12, 2024
    Configuration menu
    Copy the full SHA
    45289f8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8d7b977 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    0c77158 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9405f98 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e10a838 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2024

  1. - Moved isValue to ast.ts.

    - Moved AstValue to ast.ts.
    - Removed try/catch from eqExpressions in ast.ts.
    - Removed `traverse` from ast.ts since it has been already moved to iterators.ts
    - Moved expr-equality.spec.ts and partial-eval.spec.ts to src/grammar/test
    - Added test cases for `isValue' function in ast.ts in src/grammar/test/expr-is-value.spec.ts.
    jeshecdom committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    8991852 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2ebd128 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4204dc0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    607da81 View commit details
    Browse the repository at this point in the history