-
Notifications
You must be signed in to change notification settings - Fork 5
/
customfst.v
39 lines (28 loc) · 1.08 KB
/
customfst.v
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
Require Import String.
Require Import Vectors.Vector.
Require Import Fixtranslation.Fixtoelim.
Set Nonrecursive Elimination Schemes.
(* When these two lines are commented out, the lifting of [get_record_type]
works! *)
Definition fst {A B} := @fst A B.
Definition snd {A B} := @snd A B.
Definition Vec n t := Vector.t t n.
Definition seq : nat -> Type -> Type := Vec.
Module HandshakeAction.
Definition cry_handshake_action : Type
:= (seq 8 bool * (seq 8 bool * seq 8 bool)).
Record HandshakeAction := MkHandshakeAction
{
recordType : seq 8 bool;
messageType : seq 8 bool;
writer : seq 8 bool;
}.
Definition get_record_type (ha : cry_handshake_action) : seq 8 bool :=
fst ha.
Definition get_message_type (ha : cry_handshake_action) : seq 8 bool :=
fst (snd ha).
Definition get_writer (ha : cry_handshake_action) : seq 8 bool :=
snd (snd ha).
End HandshakeAction.
Preprocess Module HandshakeAction
as HandshakeAction'.