blob: 7a82aa845bc5150b5731ae4d87ca4c30ea94e698 (
plain)
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
|
{-# OPTIONS --safe --without-K #-}
module Wasm.Type where
open import Data.Fin using (Fin; Fin′)
open import Data.List using (List)
open import Data.Maybe using (Maybe; maybe)
open import Data.Nat using (ℕ)
open import Wasm.Value using (I32)
infix 4 _⟶_ _,_
record Limits (k : ℕ) : Set where
constructor _,_
field
max : Maybe (Fin k)
min : maybe Fin′ (Fin k) max
data NumType : Set where
i32 : NumType
i64 : NumType
f32 : NumType
f64 : NumType
data RefType : Set where
funcref : RefType
externref : RefType
data ValType : Set where
num : NumType → ValType
ref : RefType → ValType
record FuncType : Set where
constructor _⟶_
field
from : List ValType
to : List ValType
data Mutability : Set where
const : Mutability
var : Mutability
record GlobalType : Set where
constructor _,_
field
mut : Mutability
type : ValType
record TableType : Set where
field
limits : Limits 4294967295
type : RefType
record MemType : Set where
field
limits : Limits 65536
|