cuplv / dai Goto Github PK
View Code? Open in Web Editor NEWDAI: Demanded Abstract Interpretation
DAI: Demanded Abstract Interpretation
I am trying to build the master branch as suggested in the README, but the build fails with
File "src/frontend/dune", line 3, characters 23-39:
3 | (libraries dai syntax tree_sitter_java patience_diff)
^^^^^^^^^^^^^^^^
Error: Library "tree_sitter_java" not found.
I am new to Ocaml, so I might be missing something.
opam install tree_sitter_java
, but the library is not found.solved_ArraySwap.dsg.zip
Here is a Java version of bucket_swap.js
from DAI's benchmarks:
public class ArraySwap {
static boolean swap(int[] array, int i, int j) {
int temp;
if (i < 0 || i >= array.length || j < 0 || j >= array.length) {
return false;
}
temp = array[i];
array[i] = array[j];
array[j] = temp;
return true;
}
public static void main(String[] args) {
int[] numberArray = {1, 8, 10};//;1, 8, 8, 8, 10, 10};
boolean mustTrue = numberArray[1] == 8;
// test cases "swap only accepts valid positions"
boolean test1 = swap(numberArray, 0, 2);
boolean test2 = swap(numberArray, 0, 1);
// the analysis is unsound: it reports true here
boolean mustFalse = numberArray[1] == 8;
// test cases "swap accepts bad positions"
boolean test3 = swap(numberArray, 42, 1);
}
}
Interprocedural analysis with Array_bounds
computes mustFalse
to be true.
Looking at the DAIG of swap
, I see that elements of the input array are removed from the abstract memory when the array is modified. And then in the main function, abstract memory remains the same, "forgetting" the fact the array has changed.
[UPD] The DSG is attached.
dai/src/analysis/domain/octagon.ml
Line 297 in dc9bc57
Because of this, the analysis succeeds but produces unsound results. Would it be better to fail rather than silently proceed?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.