-
Notifications
You must be signed in to change notification settings - Fork 111
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
base: main
Are you sure you want to change the base?
Commits on Aug 23, 2024
-
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.
Configuration menu - View commit details
-
Copy full SHA for 114aa88 - Browse repository at this point
Copy the full SHA 114aa88View commit details
Commits on Aug 31, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 2ae5c49 - Browse repository at this point
Copy the full SHA 2ae5c49View commit details
Commits on Sep 6, 2024
-
Added support for variable tracing in loops, try-catch and init() met…
…hod. It also supports variable tracing in structs.
Configuration menu - View commit details
-
Copy full SHA for 1731548 - Browse repository at this point
Copy the full SHA 1731548View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 1bd97f8 - Browse repository at this point
Copy the full SHA 1bd97f8View commit details -
Fixes failing test cases during yarn gen:
- forgot to change initialSctx in foreach statement to foreachSctx
Configuration menu - View commit details
-
Copy full SHA for 6f0888e - Browse repository at this point
Copy the full SHA 6f0888eView commit details
Commits on Sep 9, 2024
-
Further fixes to the handling of structs and contracts.
Added negative tests.
Configuration menu - View commit details
-
Copy full SHA for bcba0b1 - Browse repository at this point
Copy the full SHA bcba0b1View commit details
Commits on Sep 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d7ef552 - Browse repository at this point
Copy the full SHA d7ef552View commit details -
Configuration menu - View commit details
-
Copy full SHA for 211b768 - Browse repository at this point
Copy the full SHA 211b768View commit details -
Configuration menu - View commit details
-
Copy full SHA for ec78d68 - Browse repository at this point
Copy the full SHA ec78d68View commit details -
Configuration menu - View commit details
-
Copy full SHA for d68a48e - Browse repository at this point
Copy the full SHA d68a48eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 76f0115 - Browse repository at this point
Copy the full SHA 76f0115View commit details -
Configuration menu - View commit details
-
Copy full SHA for 919c6ce - Browse repository at this point
Copy the full SHA 919c6ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a3a11e - Browse repository at this point
Copy the full SHA 6a3a11eView commit details
Commits on Oct 7, 2024
-
Merge branch 'monadish' into issue716
Partial commit (does not compile).
Configuration menu - View commit details
-
Copy full SHA for 2107ce0 - Browse repository at this point
Copy the full SHA 2107ce0View commit details
Commits on Oct 10, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0c976dc - Browse repository at this point
Copy the full SHA 0c976dcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 45aba08 - Browse repository at this point
Copy the full SHA 45aba08View commit details
Commits on Oct 17, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0d926d8 - Browse repository at this point
Copy the full SHA 0d926d8View commit details
Commits on Oct 26, 2024
-
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.
Configuration menu - View commit details
-
Copy full SHA for 5833c59 - Browse repository at this point
Copy the full SHA 5833c59View commit details -
Configuration menu - View commit details
-
Copy full SHA for d59679c - Browse repository at this point
Copy the full SHA d59679cView commit details
Commits on Oct 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 443720c - Browse repository at this point
Copy the full SHA 443720cView commit details
Commits on Nov 9, 2024
-
Added fixpoint computation of loops.
Added lattice for values: this simplified join operations.
Configuration menu - View commit details
-
Copy full SHA for 7753ac3 - Browse repository at this point
Copy the full SHA 7753ac3View commit details
Commits on Nov 22, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 7446d7e - Browse repository at this point
Copy the full SHA 7446d7eView commit details -
Configuration menu - View commit details
-
Copy full SHA for cecf680 - Browse repository at this point
Copy the full SHA cecf680View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2a38e18 - Browse repository at this point
Copy the full SHA 2a38e18View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7d6b697 - Browse repository at this point
Copy the full SHA 7d6b697View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0c91dc - Browse repository at this point
Copy the full SHA d0c91dcView commit details -
Removed use of Set.intersection in constant propagation analyzer for …
…backward compatibility.
Configuration menu - View commit details
-
Copy full SHA for eb0918c - Browse repository at this point
Copy the full SHA eb0918cView commit details -
Removed use of MapIterator.filter from Constant Propagation analyzer …
…for backwards compatibility.
Configuration menu - View commit details
-
Copy full SHA for f29d94d - Browse repository at this point
Copy the full SHA f29d94dView commit details -
Removed use of MapIterator.toArray from Constant Propagation analyzer…
… for backwards compatibility.
Configuration menu - View commit details
-
Copy full SHA for 22c37a6 - Browse repository at this point
Copy the full SHA 22c37a6View commit details -
Removed another use of Set.intersection for backwards compatibility. …
…Crossing fingers now :)
Configuration menu - View commit details
-
Copy full SHA for 2608a8f - Browse repository at this point
Copy the full SHA 2608a8fView commit details
Commits on Nov 29, 2024
-
- Fix problem for handling return statements: return statements shoul…
…d cancel branches during joining. - Added a lot of more tests to cover return statements, struct joining, short-circuiting in && and ||, ternary conditional operatior ? _ : _, static calls, null dereferencing and integer overflow.
Configuration menu - View commit details
-
Copy full SHA for 9114088 - Browse repository at this point
Copy the full SHA 9114088View commit details -
Configuration menu - View commit details
-
Copy full SHA for 42035fc - Browse repository at this point
Copy the full SHA 42035fcView commit details -
Simplified join operation so that it only receives two arguments (pre…
…viously it received an array of environments). Makes the code more simple. There is no place in the code where more than two environments are joined.
Configuration menu - View commit details
-
Copy full SHA for 9172e2c - Browse repository at this point
Copy the full SHA 9172e2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for a527a44 - Browse repository at this point
Copy the full SHA a527a44View commit details