-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShow.v
More file actions
59 lines (52 loc) · 1.72 KB
/
Show.v
File metadata and controls
59 lines (52 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(* Time-stamp: <Sat 6/3/23 12:19 Dan Dougherty Show.v> *)
Require Import String List.
Import ListNotations.
From RC Require Import
Utilities
Decidability
Sorts
Term
Proc
.
(* =============================== *)
(** * Showing *)
Open Scope string_scope.
#[export] Instance show_tloc : Show tloc :=
{show := fun l =>
match l with
| L n t => "l_" ++ (show n) ++ (show t)
end}.
#[export] Instance show_expr : Show expr :=
{show := fun e =>
match e with
| _Pair l1 l2 => "_Pair " ++ show l1 ++ show l2
| _Encr l1 l2 => "_Encr " ++ show l1 ++ show l2
| _Hash l => "_Hash " ++ show l
| _Genr s => "_Hash " ++ show s
| _Quot s => "_Quot " ++ s
| _Read => "_Read () "
| _Frst l => "_Hash " ++ show l
| _Scnd l => "_Hash " ++ show l
| _Decr l1 l2 => "_Hash " ++ show l1 ++ show l2
end}.
#[export] Instance show_smt : Show smt :=
{show := fun s =>
match s with
| Snd c t => "Snd " ++ show c ++ show t
| Rcv c t => "Rcv " ++ show c ++ show t
| Bnd t e => "Bnd " ++ show t ++ show e
| Inv l1 l2 => "Bnd " ++ show l1 ++ show l2
| _Same l1 l2 => "_Same " ++ show l1 ++ show l2
| _Csrt l s => "_Csrt " ++ show l ++ show s
| Ret ls => "Ret " ++ show ls
| Com s => "Com" ++ show s
end}.
#[export] Instance show_tproc : Show tproc :=
{show := fun p =>
"tProc "
++ show (inputtlocs p)
++ "\n"
++ show (outputSorts p)
++ show (body p)
}.
Close Scope string_scope.