-
Notifications
You must be signed in to change notification settings - Fork 12
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
Use Asrt.t
instead of fixes!
#313
Conversation
Why are SpecVar fixes required? |
But also thank you, I wanted to have this forever! This is really nice |
Well I'm not 100% sure they're needed; they just list the logical variables that need to be kept for the specification and can't be removed/renamed, I think? Didn't try to get rid of them |
Hmm turns out SpecVars was apparently not needed? When running my biab tests I get the same results for WISL+C except that one postcondition for one C spec has one less logical variable, which is not used anyway: spec listPrepend (x, z)
[[ (x == #x) *
(z == #z) *
(#x == {{ _$l_40, _lvar_7 }}) *
(#z == {{ "long", 0i }}) *
(0i i<=# _lvar_7) *
(0i i<=# (l-len #x)) *
(0i i<=# (l-len #z)) *
types(#x : List, _lvar_7 : Int, _lvar_34 : Int, #z : List) *
types(_lvar_34 : Int) *
<mem_single>(_$l_40, (8i i+ _lvar_7), "ptr"; {{ _$l_39, _lvar_34 }}, "Freeable") ]]
[[ (ret == #x) *
(#x == {{ _$l_35, _lvar_7 }}) *
(#z == {{ "long", 0i }}) *
- (_lvar_33 == _$l_36) *
(_lvar_8 == _$l_35) *
(0i i<=# _lvar_7) *
(0i i<=# (l-len #x)) *
(0i i<=# (l-len #z)) *
types(#x : List, _lvar_7 : Int, _lvar_8 : Obj, _lvar_34 : Int,
+ #z : List) *
- #z : List, _lvar_33 : Obj) *
types(l-nth(#z, 1i) : Int) *
<mem_single>(_$l_35, (8i i+ _lvar_7), "ptr"; {{ "long", l-nth(#z, 1i) }}, "Freeable") ]] |
So basically I removed everything fix-related and now fixes are simple assertions :) The only thing is I throw an error when the fix encountered is a Wand/Pred since I'm not really sure these are ok fixes anyways (in particular Wand; does it make any sense?) |
I'm impressed at how you get EXACTLY the same results by using Asrt.t as fixes |
What I'm thinking is that SpecVars shouldn't be fixed, but they still need to be properly added: |
What I'm running, btw, is : opam exec -- dune exec -- gillian-c act \
../collections-c-for-gillian/gillian-compcert/biabduction/array/array_test_add.c \
-I ../collections-c-for-gillian/gillian-compcert/utils \
-I ../collections-c-for-gillian/libs/fixed-bi/include \
-S ../collections-c-for-gillian/gillian-compcert/utils \
-S ../collections-c-for-gillian/libs/fixed-bi \
--ignore-undef --allocated-functions --ignore-multdef \
--bi-unroll 3 -l disabled where collections-c-for-gillian is cloned next to Gillian |
Ahhhh right yes! Ok makes sense, I'll fix this then |
Oh wow just 2 lines of code were enough to re-add the spec vars automatically! Cool now same results as before |
Also fyi I have a branch (https://github.com/N1ark/Gillian/tree/asrt-as-list) to try to remove |
👀👀👀👀👀👀 |
Merging when CI's done |
I think CI is done now lmao |
c_fix_t
fromSMemory
, useAsrt.t
insteadfix_t
fromState
, useAsrt.t
insteadget_fixes
:err_t -> (Asrt.t list * Containers.SS.t) list
(ie. remove PFS, TypeEnv and State; the error should be enough to generate fixes)apply_fix
,pp_fix_t
,fix_t
(ping @NatKarmios / @giltho!)