Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Abhishek Anand
Iris
Commits
de86652f
Commit
de86652f
authored
6 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
allow comparing more things in CAS
See the comments in the code for why that makes sense
parent
6b0f3bfb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/heap_lang/lang.v
+8
-5
8 additions, 5 deletions
theories/heap_lang/lang.v
with
8 additions
and
5 deletions
theories/heap_lang/lang.v
+
8
−
5
View file @
de86652f
...
...
@@ -370,13 +370,16 @@ Definition bin_op_eval (op : bin_op) (v1 v2 : val) : option val :=
(** Return whether it is possible to use CAS to compare vl (current value) with v1 (netest value). *)
Definition
vals_cas_compare_safe
(
vl
v1
:
val
)
:
Prop
:=
match
vl
,
v1
with
(* We allow comparing literals with each other. *)
|
LitV
_,
LitV
_
=>
True
(* We want to support CAS'ing [NONEV] to [SOMEV #l]. An implementation of
this is possible if literals have an invalid bit pattern that can be used to
represent NONE. *)
(* We assume that [NONEV] is represented as a NULL-pointer and [SOMEV x] as a
pointer to a location (never written to after allocation) storing [x]. Then
comparing [NONEV] with [NONEV] or [SOMEV x] is possible atomically by testing
for NULL. Comparing [SOMEV x] with [SOMEV y] is not possible though. *)
|
NONEV
,
NONEV
=>
True
|
NONEV
,
SOMEV
(
LitV
_)
=>
True
|
SOMEV
(
LitV
_),
NONEV
=>
True
|
NONEV
,
SOMEV
_
=>
True
|
SOMEV
_,
NONEV
=>
True
(* We don't allow comparing anything else. *)
|
_,
_
=>
False
end
.
(** Just a sanity check. *)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment