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

Simple constant propagation AST-based analysis #852

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Commits on Aug 23, 2024

  1. This commit does not introduce new functionality to the interpreter. …

    …It only refactors the interpreter to be able to change the semantics or add additional functionality to it.
    
    At first, I was trying to do a monad-style interpreter, but TypeScript does not have do-notation, which can quickly produce unreadable code because of the bind functions.
    Although, there are some suggestions over the internet on how to emulate do-notation using generators, it looks ad-hoc, hacky, and unnatural.
    So, I decided to take the idea of monad and adapt it into an imperative flavor.
    The idea is to define the semantics of an interpreter as an abstract class parametric over two generic types: "V" (the type of expressions' results) and
    "S" (the type of statements' results).
    At the moment, module level declarations do not have an associated generic type, but it will probably be added.
    
    Specific semantics can be represented by implementing the abstract class.
    For example, to create an interpreter with the standard semantics, just write:
    
    const interpreter = new Interpreter(new StandardSemantics(ctx));
    
    If we want to change the behavior, for example, by collecting special values when statements execute, just pass another semantics:
    
    const interpreter = new Interpreter(new YourCustomSemantics(ctx));
    
    This is a first version of the "monadish" interpreter. As such, it probably will suffer changes as more semantics are added since
    they will probably force changes to the interface in the abstract class.
    jeshecdom committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    114aa88 View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2024

  1. Configuration menu
    Copy the full SHA
    2ae5c49 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2024

  1. Added support for variable tracing in loops, try-catch and init() met…

    …hod.
    
    It also supports variable tracing in structs.
    jeshecdom committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    1731548 View commit details
    Browse the repository at this point in the history
  2. Error messages now show the place in the code. Before, error messages…

    … did not show it. This was due to partial evaluator making use of dummySrcInfo.
    jeshecdom committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    1bd97f8 View commit details
    Browse the repository at this point in the history
  3. Fixes failing test cases during yarn gen:

    - forgot to change initialSctx in foreach statement to foreachSctx
    jeshecdom committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    6f0888e View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2024

  1. Further fixes to the handling of structs and contracts.

    Added negative tests.
    jeshecdom committed Sep 9, 2024
    Configuration menu
    Copy the full SHA
    bcba0b1 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2024

  1. Configuration menu
    Copy the full SHA
    d7ef552 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    211b768 View commit details
    Browse the repository at this point in the history
  3. Run prettier.

    jeshecdom committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    ec78d68 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d68a48e View commit details
    Browse the repository at this point in the history
  5. Added positive test cases.

    jeshecdom committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    76f0115 View commit details
    Browse the repository at this point in the history
  6. Added documentation

    jeshecdom committed Sep 19, 2024
    Configuration menu
    Copy the full SHA
    919c6ce View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6a3a11e View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2024

  1. Merge branch 'monadish' into issue716

    Partial commit (does not compile).
    jeshecdom committed Oct 7, 2024
    Configuration menu
    Copy the full SHA
    2107ce0 View commit details
    Browse the repository at this point in the history

Commits on Oct 10, 2024

  1. Configuration menu
    Copy the full SHA
    0c976dc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    45aba08 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2024

  1. Configuration menu
    Copy the full SHA
    0d926d8 View commit details
    Browse the repository at this point in the history

Commits on Oct 26, 2024

  1. Further bug fixes and refactorings after running tests. Moved tests r…

    …elated to variable tracing to a test folder inside interpreters folder (since constant propagation analyzer is an instance of interpreter).
    
    However, one test case is still failing, but it does not have to do with the analyzer. Will merge with main to see if it solves the issue.
    jeshecdom committed Oct 26, 2024
    Configuration menu
    Copy the full SHA
    5833c59 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d59679c View commit details
    Browse the repository at this point in the history

Commits on Oct 27, 2024

  1. Configuration menu
    Copy the full SHA
    443720c View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2024

  1. Added fixpoint computation of loops.

    Added lattice for values: this simplified join operations.
    jeshecdom committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    7753ac3 View commit details
    Browse the repository at this point in the history