Closed alex-ozdemir closed 6 years ago
Good stuff!
For testing, please verify that all proofs that are produced by cvc4 in the regressions are correctly checked. This can be done by compiling cvc4 in debug, with proofs and lfsc enabled, and then run make check. Perhaps also make regress2
, make regress3
, make regress4
.
@4tXJ7f and @ajreynol - any other ideas for testing?
Great find and thanks for the quick fix! I think that running it on all of the regression tests should be good for now. Make sure that you configure CVC4 --with-lfsc
to make sure that it actually checks proofs.
Related: We really should have a test suite for LFSC, I've meant to implement this for a while now... It shouldn't be too bad to do. We can discuss this on Wednesday.
Thanks for the fix, this is indeed a really nice bug find, that code is 10+ years old. As Yoni and Andres mention, the important thing is to test CVC4's regressions (LFSC is not independently tested).
Were you able to test the regressions already? Btw. when testing the regressions, make sure that you are not using the contrib/get-lfsc
script to download LFSC as it will not include the changes here (may be obvious but just wanted to point that out :) ). Instead, use the --lfsc-dir
option of configure.sh
to point to your LFSC folder.
I gave it a shot, but a number of regression tests failed because of an unrelated problem (or so matthias/aina said). I'll give it another shot today.
Update:
Most CVC4 regression tests pass on my machine using the new LFSC. There are 6 (5 regression4 and 1 regression3) tests that fail using the new LFSC, but they also fail on my machine using the old LFSC.
I'm not sure why they're failing on my machine with the old version of LFSC -- is this expected behavior? Might I be doing something wrong?
Long Version:
s/(/{/
on line 78 of code.cpp
)make install
in the build directory of LFSCmake check
in CVC4. Verify that tons of test errors are happening.Make sure the code in this PR is in the file system.
make install
LFSC
Configure CVC4 with LFSC's install location indicated.
make check
in CVC4
Be very patient.
Verify that no regress0 or regress1 tests fail.
ctest -j8 -L 'regress[2-4]'
Be very patient
Find that only the following tests fail:
The following tests FAILED:
1758 - regress3/pp-regfile.smt (Failed)
1760 - regress4/C880mul.miter.shuffled-as.sat03-348.smt (Failed)
1762 - regress4/bug143.smt (Failed)
1763 - regress4/comb2.shuffled-as.sat03-420.smt (Failed)
1764 - regress4/hole10.cvc (Failed)
1765 - regress4/instance_1151.smt (Failed)
I then checked out an old version of LFSC, rebuilt and installed it, reconfigured CVC4, and ran regress4 tests, as well as the guilty regress3 test:
1/6 Test #1756: regress4/NEQ016_size5.smt .......................... Passed 295.43 sec
2/6 Test #1759: regress4/hole10.cvc ................................***Failed 613.08 sec
3/6 Test #1755: regress4/C880mul.miter.shuffled-as.sat03-348.smt ...***Failed 727.66 sec
4/6 Test #1757: regress4/bug143.smt ................................***Failed 825.82 sec
5/6 Test #1760: regress4/instance_1151.smt .........................***Failed 1200.07 sec
6/6 Test #1758: regress4/comb2.shuffled-as.sat03-420.smt ...........***Failed 1200.20 sec
...
1/1 Test #1753: regress3/pp-regfile.smt ..........***Failed 1200.21 sec
So the same tests fail without my modifications?
My intuition is that these failures are unrelated, since it would be odd for a bug in the LFSC parser to cause only the hardesr CVC4 tests to fail.
Per offline discussion with Andre & Yoni, we think that these test failures have nothing to do with LFSC, so we're comfortable merging this. Could someone with write-access do so?
I don't have it, but maybe @ajreynol ?
Looks good, I'll merge now.
Summary
Detail
Before if you had a constructor for a data-type that started with a "d", like the
dn
null element anddc
cons element for the list typelist
below, then attempts to pattern match against the constructor would result in an unknown identifier error.Thus simple programs like this one could not be type-checked:
The cause of this was some poorly-planned code paths in the part of the parser that detects
default
cases in amatch
expression.Testing
I tested the fix by
/path/to/lfscc /path/to/CVC4/proofs/signatures/{sat.plf,smt.plf,th_base.plf,th_bv.plf,th_bv_bitblast.plf,th_arrays.plf,th_int.plf,th_quant.plf}