-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add support for Strings and Rationals to the Princess backend #391
Merged
Merged
Changes from 1 commit
Commits
Show all changes
117 commits
Select commit
Hold shift + click to select a range
ccc281a
Start working on string theory for Princess
serras 1f7be15
Rationals in Princess
serras 99337b7
formatting code.
kfriedberger 625a0b6
Merge remote-tracking branch 'origin/master' into 'serras/master'
kfriedberger b7bbc3c
Princess: revert from Scala 2.13 to Scala 2.12.
kfriedberger 53a1885
adding dependency for Ostrich into JavaSMT.
kfriedberger 6f62e05
Use Ostrich for strings
serras d59e56c
Do not use 'floor' for rationals in Princess
serras adaa89c
add Ostrich library into IntelliJ config.
kfriedberger 27faaa7
formatting and smaller cleanup
kfriedberger f8b0c3d
Princess: allow FLOOR for plain Integer theory.
kfriedberger 5df33fe
Princess: improve MULT and DIV for Rationals.
kfriedberger 9a7e920
Princess: improve support and model evaluation for Rationals.
kfriedberger 451b0f3
Princess: fix for last commit.
kfriedberger 3aaf54b
small update on internal documentation.
kfriedberger 34b71ed
update copyright notice for IntelliJ.
kfriedberger 0ad41d3
Princess/Ostrich: add Automaton library into IntelliJ module-/classpath.
kfriedberger e9707d1
Princess: improve support for string values in the model.
kfriedberger f7f9da5
adding improved model test for Real theory with formula evaluation.
kfriedberger 53c0b4b
Merge remote-tracking branch 'origin/master' into HEAD
kfriedberger ebe926f
change Scala from 2.12 to 2.13
kfriedberger 8b906ec
OpenSMT: exclude OpenSMT from some rational-based tests.
kfriedberger 1936c40
improve precondition checks non formula-creation and make them more v…
kfriedberger dac5ac4
Princess: fix Checkstyle warnings and rename method for better docume…
kfriedberger 2df018b
Princess: disable some tests for formula structure with rational/real…
kfriedberger 449a87c
Princess: fix UF application on non-rational arguments like integers.
kfriedberger 2eb9dbf
Princess: move utility method to one place.
kfriedberger 4871bdc
Princess: exclude Princess from division-by-zero-tests.
kfriedberger 4652de9
Princess: improve tests on nested arrays.
kfriedberger 2dde64b
Princess: fix model-evaluation for integral rationals.
kfriedberger 8c9f2b8
Princess: improve string-theory.
kfriedberger d680735
fix Compiler warning for ambiguous type usage.
kfriedberger a40f42a
Princess: improve visitation of constant rational and string-based te…
kfriedberger 13c01a6
Princess: improve visitation of string operation STR_LE.
kfriedberger ec6ebaf
Merge branch 'master' into 257-more-theories-for-princess
daniel-raffler 262bb96
Princess: Fetch Ostrich 1.3.5 from Maven. This is a temporary fix tha…
daniel-raffler b503024
Princess: Disable two tests in StringFormulaManagerTest that will tim…
daniel-raffler 3175cf1
Princess: Add missing dependencies for parsing
daniel-raffler 0210289
Princess: Fix StringFormulaManager.concat(..) when there are more tha…
daniel-raffler 29d25c3
Princess: Disable String test that use (escaped) Unicode literals. Pr…
daniel-raffler 85ebb3d
Princess: Use str.< to define PrincessStringFormulaManager.lessThan d…
daniel-raffler f99740d
Princess: Add a native test class for Princess to help with debugging
daniel-raffler 8eee565
Princess: Fix two issues from earlier commits
daniel-raffler abc11e5
Princess: Replace "a str.<= b" with "a str.< b | a == b" to work arou…
daniel-raffler 1610229
Princess: Added native tests for str.contains
daniel-raffler 076d626
Princess: Added more native tests
daniel-raffler 5df2ce6
Princess: Fix handling of unicode escape sequences
daniel-raffler 9c6ca0e
Princess: Avoid using Scala Seq in PrincessStringFormulaManager to av…
daniel-raffler c546357
Princess: Rewrite a line of code to avoid CI complaints
daniel-raffler 7767d2a
Princess: Add a missing dot
daniel-raffler 51bec64
Princess: Add test cases from the bug reports written by @kfriedberge…
daniel-raffler fd9ae85
Princess: Moved a comment to the right test
daniel-raffler 0ea532a
Princess: Add missing assertions for the tests
daniel-raffler 9f4d16c
Princess: Add workarounds for the broken rational theory tests
daniel-raffler c89c6ac
Princess: Disable a test in ArrayFormulaManagerTest for Princess. The…
daniel-raffler a65769c
Princess: Clean up code in PrincessNativeAPITest
daniel-raffler 47def53
Princess: Removed default arguments for OFlags in PrincessNativeAPITe…
daniel-raffler 96c4d61
Princess: Disable a test in SolverTheoriesTest that uses rational num…
daniel-raffler 296d8e4
Princess: Renamed list of (non-boolean) variables in PrincessAbstract…
daniel-raffler 5b77984
Princess: Add a workaround to evaluate rational formulas with Princes…
daniel-raffler da11b8f
Princess: Remove unnecessary parenthesis
daniel-raffler 0ea2941
Princess: Fix some bugs from 5b7798454aa0f7708be85770dc7030a18b2a237c
daniel-raffler 6eb0f67
Princess: Fix two more bugs
daniel-raffler f5dffee
Princess: Remove an unnecessary cast
daniel-raffler 30c1fe7
Princess: Fix format
daniel-raffler 9569292
Princess: Disable all tests that require use operations with only non…
daniel-raffler f843131
Princess: Re-enable testStringPrefixSuffix from StringFormulaManagerT…
daniel-raffler 76efd95
Princess: Re-enable native prefixSuffixTest in PrincessNativeAPITest.…
daniel-raffler f661c10
Princess: Fix makeNumberImpl for integer arguments
daniel-raffler 2e570a2
Princess: Removed `Rational.int` and `Rational.frac` from the list of…
daniel-raffler d761b17
Princess: Add a case for (IFunApp "true" []) in convertValue
daniel-raffler 2d7df5f
Princess: Fix handling of if-then-else expressions in getFormulaType
daniel-raffler 3bc04a8
Princess: Disable term abbreviations as they seem to cause Princess t…
daniel-raffler 2c06c70
Princess: Remove parameters 14 and 15 for the OFlags constructor. Tho…
daniel-raffler c83063e
Princess: Remove workaround for a bug in Ostrich. The str.<= operatio…
daniel-raffler a1764de
Princess: Added a note about rational values in the model
daniel-raffler 3b7229a
Princess: Fix evalImpl() for formulas that are equations over rationa…
daniel-raffler 4c78733
Merge remote-tracking branch 'origin/master' into 257-more-theories-f…
daniel-raffler 2636f5e
Princess: Added a todo
daniel-raffler 1e8176f
Princess: Remove the native API test
daniel-raffler 3e1dad8
Princess: Cleaned up some function names
daniel-raffler bbf9b9c
Princess: Added a todo
daniel-raffler e950269
Princess: Added missing dots for checkstyle
daniel-raffler 872944f
Princess: Fix visitors for rational values
daniel-raffler c161f00
Princess: Resolve checkstyle issues
daniel-raffler f3a277e
Revert "Princess: Fix evalImpl() for formulas that are equations over…
daniel-raffler c2b685b
Princess: Move comments to their own if-then-else branch
daniel-raffler 6beb6f5
Princess: Fix PrincessRationalFormulaManager.makeNumberImpl() for int…
daniel-raffler 9e1d69d
Princess: Renamed IntegerFormulaManager in PrincessRationalFormulaMan…
daniel-raffler ea21421
Princess: Work around a bug in princess where multiplying a rational …
daniel-raffler 6351613
Princess: Enabled tests for arrays with rational indices/elements. Th…
daniel-raffler 6fc4b9a
Princess: Add two comments about failed tests in FomulaClassifierTest…
daniel-raffler 43c2c83
Princess: Added a comment to testDivisionByZero test. Princess does s…
daniel-raffler 3b6102d
Princess: Fix evaluation of (boolean) formulas
daniel-raffler fa38940
Revert "Princess: Disable term abbreviations as they seem to cause Pr…
daniel-raffler e075090
Princess: Clean up dependencies and prepare for upgrading Princess/Os…
daniel-raffler ce2e7f9
Princess: Add a comment about the default values for OFlags
daniel-raffler 52fd628
Princess: Throw and UnsupportedOperationExcpetion in PrincessRational…
daniel-raffler 98e49f7
Princess: Remove a duplicate requireRationalFloor()
daniel-raffler bcb696d
Princess: Add unit tests for PrincessStringFormulaManager.unescapeString
daniel-raffler 9320257
Princess: Fix handling of broken Unicode sequences "\\u{" with no clo…
daniel-raffler 3648bf0
Princess: Throw an exception in PrincessStringFormulaManager.unescape…
daniel-raffler 441e947
Princess: Fix spelling
daniel-raffler 0e949d7
Princess: Skip internal variable "Rat_denom" when generating the model
daniel-raffler ba486a5
Princess: Removed an outdated note
daniel-raffler 21abead
Princess: Stopped using the partial model for Model.evaluate()
daniel-raffler 5cfbef7
Solved a concurrent modification issues in AbstractProver when models…
daniel-raffler 7ea3b68
Princess: Update Princess to version 2024-11-08 and Ostrich to 1.4.1
daniel-raffler a2d2497
remove transitive dependency from Ostrich to JavaCup.
kfriedberger 922dd53
Merge remote-tracking branch 'origin/master' into 257-more-theories-f…
kfriedberger fd8e810
ignore potential resource leak, as for models of other solvers.
kfriedberger ae05a8b
Princess: Restore ivysettings.xml to its original version
daniel-raffler 1b4ff68
revert whitespace changes in branch.
kfriedberger 669743f
simplify model tracking for Princess.
kfriedberger 69517ec
fix import of Builder
kfriedberger e6bc8f1
improve documentation
kfriedberger 0c70424
improve counter by making it non-static.
kfriedberger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be a bigger issue for Princess.
Can we add a plain test for Princess (without this code) to see where Princess fails to be consistant?
Can we ask the authors to provide a consistant model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm afraid in this case the problem here is really with the work-around, and not with Princess. We effectively emulate
(get-values (<expr>))
with a sequence of commands:The problem is than the sat check causes the solver to forget the old model, and because of this it can choose a different assignment for the variables. For instance, if the only assertion on the stack is
x < y
then callingevaluate(x)
twice may return different values as the solver simply chooses a different model each time. You can see this by replacing the code inPrincessAbstractProver.getEvaluatedTerms()
withImmutableList.of()
. This should cause tests inModelTest
andSolverAllSatTest
to fail as the model is not kept consistent across multiply calls toevaluate()
.EDIT:
I did some testing earlier and we may not actually need the call to
prover.addEvaluatedTerm()
inPrincessModel.evalImpl()
. Just adding the assignments from the model inPrincessAbstractProver.isUnsat()
seems to be enough.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of
PrincessAbstractProver.isUnsat()
should not depend on earlier model evaluations, because it can produce a completely different model. The current implementation seems to work well, even if its runtime is not optimal. We can improve this in the future.