-
Notifications
You must be signed in to change notification settings - Fork 30
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
Added support for includes and functions in cat #736
Conversation
Commented out includes in LKMM because the included file contains unsupported features.
Commented out non-working include in aarch64.cat
Do we want to keep treating
Put it differently, do we want to get rid of all relations that make use of operators in |
Possibly. The awkward part is that some of those base relations like |
dartagnan/src/main/java/com/dat3m/dartagnan/wmm/RelationNameRepository.java
Outdated
Show resolved
Hide resolved
dartagnan/src/main/java/com/dat3m/dartagnan/parsers/cat/VisitorCat.java
Outdated
Show resolved
Hide resolved
dartagnan/src/main/java/com/dat3m/dartagnan/utils/options/BaseOptions.java
Outdated
Show resolved
Hide resolved
Fix cat grammar to make fencerel a valid function name
Signed-off-by: Hernan Ponce de Leon <[email protected]>
Signed-off-by: Hernan Ponce de Leon <[email protected]>
Signed-off-by: Hernan Ponce de Leon <[email protected]>
Co-authored-by: Hernan Ponce de Leon <[email protected]>
This PR is marked as DRAFT simply because there are currently no tests related this feature, and no existing.cat
-files were updated. Otherwise, the PR is functional.Added functionality:
include "filePath"
now has semantics in.cat
files.filePath
is resolved relative to an optionally provided--cat.include=<includeDirectory>
which defaults toDAT3M_HOME/cat
.If anyone (@hernan-poncedeleon ? :)) is interested in rewriting existing
.cat
files to make use of this feature, you are welcome to add to this PR. In particular, a simplebasic.cat
with definitions such aslet poloc = po & loc
would be nice to have so that we can remove a lot of hardcoded definitions from theWmm
class.Possible other feature: I want to take a look into adding parametric definitions as in #733 to this PR but with a less invasive approach (i.e., purely implemented in the parser).EDIT: I implemented functions/function calls in
.cat
. The support is very extensive:let f(x, y) = x | y
(though 0 parameters are currently unsupported)let hb = f(po, f(co, f(rf, f(fr))))
let g(x) = f(x, x)
. They cannot call themselves (recursion in functions is not allowed)