Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RefinedC
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
Iris
RefinedC
Commits
8ac2ab92
Commit
8ac2ab92
authored
4 years ago
by
Rodolphe Lepigre
Browse files
Options
Downloads
Patches
Plain Diff
Implemented missing operators.
parent
1ab4bc47
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#33295
passed
4 years ago
Stage: build
Changes
4
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
frontend/coq_ast.ml
+1
-1
1 addition, 1 deletion
frontend/coq_ast.ml
frontend/coq_pp.ml
+3
-5
3 additions, 5 deletions
frontend/coq_pp.ml
theories/lang/lang.v
+1
-1
1 addition, 1 deletion
theories/lang/lang.v
theories/lang/notation.v
+6
-0
6 additions, 0 deletions
theories/lang/notation.v
with
11 additions
and
7 deletions
frontend/coq_ast.ml
+
1
−
1
View file @
8ac2ab92
...
...
@@ -28,7 +28,7 @@ type un_op =
type
bin_op
=
|
AddOp
|
SubOp
|
MulOp
|
DivOp
|
ModOp
|
AndOp
|
OrOp
|
XorOp
|
ShlOp
|
ShrOp
|
EqOp
|
NeOp
|
LtOp
|
GtOp
|
LeOp
|
GeOp
|
RoundDownOp
|
RoundUpOp
|
ShrOp
|
EqOp
|
NeOp
|
LtOp
|
GtOp
|
LeOp
|
GeOp
type
value
=
|
Null
...
...
This diff is collapsed.
Click to expand it.
frontend/coq_pp.ml
+
3
−
5
View file @
8ac2ab92
...
...
@@ -110,9 +110,9 @@ let pp_bin_op : Coq_ast.bin_op pp = fun ff op ->
|
MulOp
->
"×"
|
DivOp
->
"/"
|
ModOp
->
"%"
|
AndOp
->
"
..."
(* TODO *)
|
OrOp
->
"
..."
(* TODO *)
|
XorOp
->
"
..."
(* TODO *)
|
AndOp
->
"
&"
|
OrOp
->
"
|"
|
XorOp
->
"
^"
|
ShlOp
->
"<<"
|
ShrOp
->
">>"
|
EqOp
->
"="
...
...
@@ -121,8 +121,6 @@ let pp_bin_op : Coq_ast.bin_op pp = fun ff op ->
|
GtOp
->
">"
|
LeOp
->
"≤"
|
GeOp
->
"≥"
|
RoundDownOp
->
"..."
(* TODO *)
|
RoundUpOp
->
"..."
(* TODO *)
let
rec
pp_expr
:
Coq_ast
.
expr
pp
=
fun
ff
e
->
let
pp
fmt
=
Format
.
fprintf
ff
fmt
in
...
...
This diff is collapsed.
Click to expand it.
theories/lang/lang.v
+
1
−
1
View file @
8ac2ab92
...
...
@@ -133,7 +133,7 @@ Definition u64 : int_type := {| it_size := 3; it_signed := false; |}.
(* see http://compcert.inria.fr/doc/html/compcert.cfrontend.Cop.html#binary_operation *)
Inductive
bin_op
:
Set
:=
|
AddOp
|
SubOp
|
MulOp
|
DivOp
|
ModOp
|
AndOp
|
OrOp
|
XorOp
|
ShlOp
|
ShrOp
|
EqOp
|
NeOp
|
LtOp
|
GtOp
|
LeOp
|
GeOp
|
RoundDownOp
|
RoundUpOp
|
ShrOp
|
EqOp
|
NeOp
|
LtOp
|
GtOp
|
LeOp
|
GeOp
(* Ptr is the second argument and pffset the first *)
|
PtrOffsetOp
(
ly
:
layout
)
.
...
...
This diff is collapsed.
Click to expand it.
theories/lang/notation.v
+
6
−
0
View file @
8ac2ab92
...
...
@@ -40,6 +40,12 @@ Notation "e1 <<{ ot1 , ot2 } e2" := (BinOp ShlOp ot1 ot2 e1%E e2%E)
(
at
level
70
,
format
"e1 <<{ ot1 , ot2 } e2"
)
:
expr_scope
.
Notation
"e1 >>{ ot1 , ot2 } e2"
:=
(
BinOp
ShrOp
ot1
ot2
e1
%
E
e2
%
E
)
(
at
level
70
,
format
"e1 >>{ ot1 , ot2 } e2"
)
:
expr_scope
.
Notation
"e1 &{ ot1 , ot2 } e2"
:=
(
BinOp
AndOp
ot1
ot2
e1
%
E
e2
%
E
)
(
at
level
70
,
format
"e1 &{ ot1 , ot2 } e2"
)
:
expr_scope
.
Notation
"e1 |{ ot1 , ot2 } e2"
:=
(
BinOp
OrOp
ot1
ot2
e1
%
E
e2
%
E
)
(
at
level
70
,
format
"e1 |{ ot1 , ot2 } e2"
)
:
expr_scope
.
Notation
"e1 ^{ ot1 , ot2 } e2"
:=
(
BinOp
XorOp
ot1
ot2
e1
%
E
e2
%
E
)
(
at
level
70
,
format
"e1 ^{ ot1 , ot2 } e2"
)
:
expr_scope
.
(* The offset must be evaluated first for the type system to work, thus the order is switched here. *)
Notation
"e1 'at_offset{' ly , ot1 , ot2 } e2"
:=
(
BinOp
(
PtrOffsetOp
ly
)
ot2
ot1
e2
%
E
e1
%
E
)
(
at
level
70
,
format
"e1 at_offset{ ly , ot1 , ot2 } e2"
)
:
expr_scope
.
...
...
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