Comments (2)
x1
and x2
are unbounds and so generate too many large traces with terms like 16*x1*x1*x2*x2
. Here's a fix (add bounds to x1
and x2
) and also an improved version (use more terms)
#include <stdio.h>
#include <stdlib.h>
void vassume(int b) {}
void vtrace(int g, int h, int x, int y) {}
void vtrace1(int f_x_f_x, int f_y_f_x, int f_y_f_y, int f_x1_f_x2) {}
// f(x) = x(x + 1)
int F(int x) { return x * x; }
void mainQ(int x1, int x2) {
vassume(-20 < x1); vassume(x1 < 20);
vassume(-20 < x2); vassume(x2 < 20);
int x = x1 + x2;
int y = x1 - x2;
int f_x = F(x);
int f_y = F(y);
int f_x1 = F(x1);
int f_x2 = F(x2);
int myg = f_x*f_x - 2*f_y*f_x + f_y*f_y;
int myh = f_x1*f_x2;
vtrace(myg, myh, x, y); // <--------------------------HERE
int f_x_f_x = f_x*f_x;
int f_y_f_x = f_y*f_x;
int f_y_f_y = f_y*f_y;
int f_x1_f_x2 = f_x1*f_x2;
vtrace1(f_x_f_x,f_y_f_x,f_y_f_y,f_x1_f_x2);
}
void main(int argc, char *argv[]) {
mainQ(atoi(argv[1]), atoi(argv[2]));
}
tnguyen@DynaROARS ~/g/d/src (dev)> time ~/miniconda3/bin/python3 -O dig.py ../tests/t2.c --maxdeg 1 --noss --noieq --nocong --nominmax (base)
settings:INFO:2023-05-22 13:54:58.882998: dig.py ../tests/t2.c --maxdeg 1 --noss --noieq --nocong --nominmax
alg:INFO:analyzing '../tests/t2.c'
alg:INFO:analyzing '../tests/t2.c'
alg:INFO:got 152 traces over 2 locs
alg:INFO:check 2 invs using 152 traces (0.03s)
alg:INFO:simplify 2 invs (0.01s)
tmpdir: /var/tmp/dig_2029142113675619442_wwoafspq
vtrace (1 invs):
1. -g + 16*h == 0
vtrace1 (1 invs):
1. 16*f_x1_f_x2 - f_x_f_x + 2*f_y_f_x - f_y_f_y == 0
from dig.
also fix a bug with abs here c31dc37. The bug is forgetting to filter out very large negative traces and therefore screw things up.
Still cannot get g=16*h
sometimes because linsolve cannot get the correct coefs in the first place
from dig.
Related Issues (20)
- Support array invariants from traces HOT 1
- support float point numbers from traces
- Support purely random trace generation (no symbolic execution) HOT 1
- replace symbolic execution with fuzzing HOT 1
- replace CIL with pycparser HOT 2
- Support congruence domain (trace only) HOT 1
- Support Java analysis in Docker
- Emphasize Relational and Non-Relational Abstract Domains HOT 1
- user term is broken HOT 2
- Why can't I get the analysis results of this simple trace files? HOT 1
- How to analyze java in docker HOT 1
- add beartype HOT 1
- add ability to check user-supplied invariants in src code
- dealing with strong preconds
- Issue with setting up using Docker HOT 4
- docker issue (ModuleNotFoundError: No module named 'pycparser') HOT 4
- Using dynamically generated invariants to help static analyzers to prove properties that they cannot prove previously
- Docker Issue (SARL Configuration Error: Mismatched Z3 Version) HOT 2
- Some problems encountered while testing custom cases HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dig.