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

How can I use DIG to find the relationships between elements of an array? #51

Open
jsforyu opened this issue Jan 21, 2025 · 1 comment

Comments

@jsforyu
Copy link

jsforyu commented Jan 21, 2025

For example, the following program,the vtrace1 I added correct?

int main () 
{
    int a [100000];
    int b [100000];
    int res [100000];
    int i = 0;int x ;
    while ( i < 100000) 
    { 
        vtrace1(res,a,b,i);
        res [ i ] = a [ i ] + b [ i ]; 
        i ++; 
    } 
        //__VERIFIER_assert ( __forall (x , (!(( x < i ) && (x >= 0)) || ( res [ x ] == a [ x ] + b [ x ])) )); 
    return 0;
}
@nguyenthanhvuh
Copy link
Member

nguyenthanhvuh commented Jan 28, 2025

For array relations, you will need to give DIG a tracefile directly. An example would be

file.tcs

# DIG will find the relation A[i1] = B[-2*i1 + 5]
vtrace1; array A; array B; array C
vtrace1; [7,1,-3]; [1,-3,5,1,0,7,1]; [8,5,6,6,2,1,4]
vtrace1; [7,1,-3]; [1,-3,5,1,0,7,1]; [1,7,8,8,9,10,3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants