Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
ReLoC-v1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dan Frumin
ReLoC-v1
Commits
8294ac2d
Commit
8294ac2d
authored
Mar 24, 2018
by
Dan Frumin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add quot and rem operations
parent
f1a8bd8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
theories/F_mu_ref_conc/lang.v
theories/F_mu_ref_conc/lang.v
+6
-3
theories/F_mu_ref_conc/notation.v
theories/F_mu_ref_conc/notation.v
+3
-0
No files found.
theories/F_mu_ref_conc/lang.v
View file @
8294ac2d
...
...
@@ -11,7 +11,8 @@ Module lang.
Instance
loc_dec_eq
:
EqDecision
loc
:=
_.
(
**
**
Expressions
*
)
Inductive
binop
:=
Mul
|
Add
|
Sub
|
Eq
|
Le
|
Lt
|
Xor
.
Inductive
binop
:=
Mul
|
Add
|
Sub
|
Quot
|
Rem
|
Eq
|
Le
|
Lt
|
Xor
.
Instance
binop_dec_eq
:
EqDecision
binop
.
Proof
.
solve_decision
.
Defined
.
...
...
@@ -108,6 +109,8 @@ Module lang.
|
Mul
,
LitV
(
Nat
a
),
LitV
(
Nat
b
)
=>
Some
$
LitV
(
Nat
(
a
*
b
))
|
Add
,
LitV
(
Nat
a
),
LitV
(
Nat
b
)
=>
Some
$
LitV
(
Nat
(
a
+
b
))
|
Sub
,
LitV
(
Nat
a
),
LitV
(
Nat
b
)
=>
Some
$
LitV
(
Nat
(
a
-
b
))
|
Quot
,
LitV
(
Nat
a
),
LitV
(
Nat
b
)
=>
Some
$
LitV
(
Nat
(
a
/
b
)
%
nat
)
|
Rem
,
LitV
(
Nat
a
),
LitV
(
Nat
b
)
=>
Some
$
LitV
(
Nat
(
a
`mod
`
b
))
|
Eq
,
LitV
(
Nat
a
),
LitV
(
Nat
b
)
=>
Some
$
LitV
(
Bool
(
if
decide
(
a
=
b
)
then
true
else
false
))
|
Eq
,
LitV
(
Bool
a
),
LitV
(
Bool
b
)
=>
Some
$
LitV
(
Bool
(
eqb
a
b
))
|
Eq
,
LitV
(
Loc
l1
),
LitV
(
Loc
l2
)
=>
Some
$
LitV
(
Bool
(
if
decide
(
l1
=
l2
)
then
true
else
false
))
...
...
@@ -181,9 +184,9 @@ Module lang.
Instance
binop_countable
:
Countable
binop
.
Proof
.
refine
(
inj_countable
'
(
λ
op
,
match
op
with
|
Mul
=>
0
|
Add
=>
1
|
Sub
=>
2
|
Eq
=>
3
|
Le
=>
4
|
Lt
=>
5
|
Xor
=>
6
|
Mul
=>
0
|
Add
=>
1
|
Sub
=>
2
|
Eq
=>
3
|
Le
=>
4
|
Lt
=>
5
|
Xor
=>
6
|
Quot
=>
7
|
Rem
=>
8
end
)
(
λ
n
,
match
n
with
|
0
=>
Mul
|
1
=>
Add
|
2
=>
Sub
|
3
=>
Eq
|
4
=>
Le
|
5
=>
Lt
|
_
=>
Xor
|
0
=>
Mul
|
1
=>
Add
|
2
=>
Sub
|
3
=>
Eq
|
4
=>
Le
|
5
=>
Lt
|
6
=>
Xor
|
7
=>
Quot
|
_
=>
Rem
end
)
_
);
by
intros
[].
Qed
.
...
...
theories/F_mu_ref_conc/notation.v
View file @
8294ac2d
...
...
@@ -61,6 +61,9 @@ Notation "e1 = e2" := (BinOp Eq e1%E e2%E) (at level 70) : expr_scope.
Notation
"e1 ⊕ e2"
:=
(
BinOp
Xor
e1
%
E
e2
%
E
)
(
at
level
70
)
:
expr_scope
.
Notation
"¬ e"
:=
(
BinOp
Xor
e
%
E
(
Lit
(
Bool
true
)))
(
at
level
75
,
right
associativity
)
:
expr_scope
.
Notation
"e1 / e2"
:=
(
BinOp
Quot
e1
%
E
e2
%
E
)
:
expr_scope
.
Notation
"e1 `mod` e2"
:=
(
BinOp
Rem
e1
%
E
e2
%
E
)
:
expr_scope
.
(
*
The
unicode
←
is
already
part
of
the
notation
"_ ← _; _"
for
bind
.
*
)
Notation
"e1 <- e2"
:=
(
Store
e1
%
E
e2
%
E
)
(
at
level
80
)
:
expr_scope
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment