Skip to content
This repository has been archived by the owner on Oct 3, 2021. It is now read-only.

Programs with Nonlinear Properties #808

Merged
merged 21 commits into from
Aug 20, 2019
Merged

Programs with Nonlinear Properties #808

merged 21 commits into from
Aug 20, 2019

Conversation

nguyenthanhvuh
Copy link
Contributor

@nguyenthanhvuh nguyenthanhvuh commented Jun 7, 2019

Added programs with nonlinear polynomial invariants in c/nla-digbench.

  • [x ] programs added to new and appropriately named directory

  • [x ] license present and acceptable (either in separate file or as comment at beginning of program)

  • [x ] contributed-by present (either in README file or as comment at beginning of program)

  • programs added to a .set file of an existing category, or new sub-category established (if justified)

  • intended property matches the corresponding .prp file

  • expected answer in file names according to convention

  • architecture (32 bit vs. 64 bit) matches the corresponding .cfg file
  • original sources present
  • preprocessed files present
  • preprocessed files generated with correct architecture
  • Makefile added with correct content and without overly broad suppression of warnings

@dbeyer
Copy link
Member

dbeyer commented Jun 7, 2019

The CI check complains that there is no license file.
Could you please rename LICSENSE.txt to LICENSE.txt?

@dbeyer
Copy link
Member

dbeyer commented Jun 7, 2019

The task definitions are missing: Please have a look at Section Task Definitions
https://github.com/sosy-lab/sv-benchmarks/blob/master/README.md#task-definitions

Copy link
Member

@PhilippWendler PhilippWendler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For task-definition files, I guess most of them would look like this (foo.yml for foo.c):

format_version: '1.0'
input_files: 'foo.c'
properties:
  - property_file: ../properties/unreach-call.prp
    expected_verdict: ...

Leave out expected_verdict if you don't know it.
You can also consider adding other properties like termination, no-overflows, etc. if you consider them interesting for your programs.

c/nla-digbench/LICSENSE.txt Outdated Show resolved Hide resolved
c/nla-digbench/Makefile Outdated Show resolved Hide resolved
@nguyenthanhvuh
Copy link
Contributor Author

nguyenthanhvuh commented Jun 7, 2019 via email

@nguyenthanhvuh
Copy link
Contributor Author

nguyenthanhvuh commented Jun 10, 2019 via email

@PhilippWendler
Copy link
Member

If the assertion is true then I should use expected_verdict: true, right ? I believe I can prove most of these by hand, but I don’t think there are existing tools to automatically prove them yet. Should I still put in expected verdicts then ?

I would say yes.

Also, should I add these programs to an existing or a new a new category (.set and .cfg files) ?

Usually it is better to use an existing category, if there is one that fits. I guess ReachSafety-Loops.set would be a good category?

When I am done making and committing the changes, do I create a new pull request ?

No, please just update this pull request (as you have already done).

@nguyenthanhvuh
Copy link
Contributor Author

Update branch with expected properties and add files to ReachSafety-Loops.set

@nguyenthanhvuh
Copy link
Contributor Author

Looks like the latest update passes all the checks. Ready for review now.

PhilippWendler
PhilippWendler previously approved these changes Jun 12, 2019
Copy link
Member

@PhilippWendler PhilippWendler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

I suggest to do a "Squash and Merge" because this PR contains a lot of individual commits.

@nguyenthanhvuh
Copy link
Contributor Author

nguyenthanhvuh commented Jun 12, 2019

There's a message above saying that I "dismissed PhilippWendler’s stale review via 2815e06 10 hours ago". Not sure what that means. I did make some small edits to the README.md.

@nguyenthanhvuh
Copy link
Contributor Author

Hi, anything that might block this from being pulled ?

Copy link
Member

@PhilippWendler PhilippWendler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash merge suggested.

@nguyenthanhvuh
Copy link
Contributor Author

Hi, just want to check the status of this PR.

@dbeyer dbeyer merged commit ea7880b into sosy-lab:master Aug 20, 2019
@PhilippWendler
Copy link
Member

The file knuth.c includes math.h, this needs to be removed.

@nguyenthanhvuh
Copy link
Contributor Author

Thanks Phillipp. 'knuth.c' requires the sqrt function from math.h. Any suggestion on how to replace sqrt with? If not I can remove knuth.c from the directory.

@PhilippWendler
Copy link
Member

Just provide an extern declaration of the sqrt function as declared in the header. You could also preprocess the file (which leads to inlining the complete header), but in this case I guess adding the single declaration is easier.

@nguyenthanhvuh
Copy link
Contributor Author

nguyenthanhvuh commented Aug 26, 2019 via email

@PhilippWendler
Copy link
Member

One cannot merge a PR twice, you need a new PR.

@MartinSpiessl
Copy link
Contributor

There seem to be overflows in the tasks, e.g. divbin.c in line 30.

@dbeyer
Copy link
Member

dbeyer commented Sep 21, 2019

@nguyenthanhvuh Could you please submit a new pull request?
Best is two:

  • one for fixing the preprocessing
  • one fixing the overflows (and leave the originals: they are perhaps good tests for overflow checking)

@dbeyer
Copy link
Member

dbeyer commented Sep 21, 2019

I wonder if this should become a new sub category.
The tasks require a certain powerful technology.
For the other tasks that require non-linear arithmetic, we had created a new sub-category "bitvectors".
The tasks here are also non-linear, but of a special type: polynomial.

@dbeyer
Copy link
Member

dbeyer commented Sep 21, 2019

@nguyenthanhvuh Could you please add to the README a small paragraph that briefly describes the kind of non-linearity? I.e., they invariants are polynomials. This would be good to know in order to understand that these tasks are very different from the other tasks with non-linear arithmetic.
I would even suggest to rename the directory from "nla" to "polynomial" or so.

@nguyenthanhvuh
Copy link
Contributor Author

nguyenthanhvuh commented Sep 21, 2019

Hi, thanks. I will work on it this weekend.

  • Regarding to the overflows, could you provide some suggestions on how to fix them ? Thanks.

  • For the README, I've added something like this :
    These programs contain nonlinear polynomial properties (mostly equalities) that are challenging for program analysis. For example, program cohendiv.c has the loop invariants such as b == ya and x == qy + r where x,q,y,r,a are int variables. Let me know if that looks ok.

  • About becoming new sub category: that might be a good idea to have a polynomial nonlinear pros category. But It's up to you. I'll do what you think is best.

@dbeyer
Copy link
Member

dbeyer commented Sep 23, 2019

(Just for the book-keeping: This PR addresses issue #796, which can now get closed.)

@dbeyer
Copy link
Member

dbeyer commented Sep 23, 2019

@nguyenthanhvuh Could you please start a new pull request (or two of them), such that we can track the discussion there, instead of under this already closed PR?

Yes, what you plan to write to the README sound nice!

I can take care of the new sub-category later.

@nguyenthanhvuh
Copy link
Contributor Author

nguyenthanhvuh commented Sep 23, 2019 via email

dbeyer added a commit that referenced this pull request Nov 16, 2019
Corrected verdict of hard.c (from PR #808) and added its correct version
dbeyer added a commit that referenced this pull request Nov 16, 2019
Corrected divbin verdict (from #808) and its correct version
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

4 participants