2014-04-18 02:34:25 +04:00
|
|
|
Loading module Cryptol
|
|
|
|
Loading module Cryptol
|
|
|
|
Loading module issue226r2
|
|
|
|
Loading module issue226
|
|
|
|
Type Synonyms
|
|
|
|
=============
|
|
|
|
type Bool = Bit
|
|
|
|
type Char = [8]
|
2018-04-03 01:35:10 +03:00
|
|
|
type lg2 n = width (max 1 n - 1)
|
2014-04-18 02:34:25 +04:00
|
|
|
type String n = [n][8]
|
|
|
|
type Word n = [n]
|
|
|
|
|
|
|
|
Symbols
|
|
|
|
=======
|
2018-04-03 01:35:10 +03:00
|
|
|
(==>) : Bit -> Bit -> Bit
|
|
|
|
(\/) : Bit -> Bit -> Bit
|
|
|
|
(/\) : Bit -> Bit -> Bit
|
2015-08-13 01:52:18 +03:00
|
|
|
(!=) : {a} (Cmp a) => a -> a -> Bit
|
|
|
|
(!==) : {a, b} (Cmp b) => (a -> b) -> (a -> b) -> a -> Bit
|
2018-04-03 01:35:10 +03:00
|
|
|
(==) : {a} (Cmp a) => a -> a -> Bit
|
|
|
|
(===) : {a, b} (Cmp b) => (a -> b) -> (a -> b) -> a -> Bit
|
2015-08-13 01:52:18 +03:00
|
|
|
(<) : {a} (Cmp a) => a -> a -> Bit
|
2017-08-17 03:37:24 +03:00
|
|
|
(<$) : {a} (SignedCmp a) => a -> a -> Bit
|
2015-08-13 01:52:18 +03:00
|
|
|
(<=) : {a} (Cmp a) => a -> a -> Bit
|
2017-08-17 03:37:24 +03:00
|
|
|
(<=$) : {a} (SignedCmp a) => a -> a -> Bit
|
2015-08-13 01:52:18 +03:00
|
|
|
(>) : {a} (Cmp a) => a -> a -> Bit
|
2017-08-17 03:37:24 +03:00
|
|
|
(>$) : {a} (SignedCmp a) => a -> a -> Bit
|
2015-08-13 01:52:18 +03:00
|
|
|
(>=) : {a} (Cmp a) => a -> a -> Bit
|
2017-08-17 03:37:24 +03:00
|
|
|
(>=$) : {a} (SignedCmp a) => a -> a -> Bit
|
2018-04-03 01:35:10 +03:00
|
|
|
(||) : {a} (Logic a) => a -> a -> a
|
|
|
|
(^) : {a} (Logic a) => a -> a -> a
|
|
|
|
(&&) : {a} (Logic a) => a -> a -> a
|
|
|
|
(#) :
|
|
|
|
{front, back, a} (fin front) =>
|
|
|
|
[front]a -> [back]a -> [front + back]a
|
|
|
|
(<<) : {a, b, c} (fin b, Zero c) => [a]c -> [b] -> [a]c
|
|
|
|
(<<<) : {a, b, c} (fin a, fin b) => [a]c -> [b] -> [a]c
|
2017-09-16 02:38:03 +03:00
|
|
|
(>>) : {a, b, c} (fin b, Zero c) => [a]c -> [b] -> [a]c
|
2017-08-17 03:37:24 +03:00
|
|
|
(>>$) : {n, k} (fin n, n >= 1, fin k) => [n] -> [k] -> [n]
|
2015-06-10 00:32:17 +03:00
|
|
|
(>>>) : {a, b, c} (fin a, fin b) => [a]c -> [b] -> [a]c
|
2018-04-03 01:35:10 +03:00
|
|
|
(+) : {a} (Arith a) => a -> a -> a
|
|
|
|
(-) : {a} (Arith a) => a -> a -> a
|
|
|
|
(%) : {a} (Arith a) => a -> a -> a
|
|
|
|
(%$) : {a} (Arith a) => a -> a -> a
|
|
|
|
(*) : {a} (Arith a) => a -> a -> a
|
|
|
|
(/) : {a} (Arith a) => a -> a -> a
|
|
|
|
(/$) : {a} (Arith a) => a -> a -> a
|
|
|
|
(^^) : {a} (Arith a) => a -> a -> a
|
|
|
|
(!) : {a, b, c} (fin a, fin c) => [a]b -> [c] -> b
|
|
|
|
(!!) : {a, b, c, d} (fin a, fin d) => [a]b -> [c][d] -> [c]b
|
2015-06-10 00:32:17 +03:00
|
|
|
(@) : {a, b, c} (fin c) => [a]b -> [c] -> b
|
|
|
|
(@@) : {a, b, c, d} (fin d) => [a]b -> [c][d] -> [c]b
|
2018-05-24 19:23:17 +03:00
|
|
|
all : {a, n} (fin n) => (a -> Bit) -> [n]a -> Bit
|
|
|
|
and : {n} (fin n) => [n] -> Bit
|
|
|
|
any : {a, n} (fin n) => (a -> Bit) -> [n]a -> Bit
|
2017-08-17 03:37:24 +03:00
|
|
|
carry : {n} (fin n) => [n] -> [n] -> Bit
|
2017-09-16 00:05:27 +03:00
|
|
|
complement : {a} (Logic a) => a -> a
|
2018-05-24 19:23:17 +03:00
|
|
|
curry : {a, b, c} ((a, b) -> c) -> a -> b -> c
|
2018-06-14 22:33:20 +03:00
|
|
|
demote : {val, bits} (fin bits, bits >= width val) => [bits]
|
2017-10-26 02:39:29 +03:00
|
|
|
drop :
|
|
|
|
{front, back, elem} (fin front) => [front + back]elem -> [back]elem
|
2018-05-24 19:23:17 +03:00
|
|
|
elem : {n, a} (fin n, Cmp a) => a -> [n]a -> Bit
|
2015-06-10 00:32:17 +03:00
|
|
|
error : {at, len} (fin len) => [len][8] -> at
|
2018-04-03 01:35:10 +03:00
|
|
|
False : Bit
|
2018-05-24 19:23:17 +03:00
|
|
|
foldl : {a, b, n} (fin n) => (a -> b -> a) -> a -> [n]b -> a
|
|
|
|
foldr : {a, b, n} (fin n) => (a -> b -> b) -> b -> [n]a -> b
|
2014-04-18 02:34:25 +04:00
|
|
|
foo : {a} a -> a
|
2017-09-14 03:04:52 +03:00
|
|
|
fromInteger : {a} (fin a) => Integer -> [a]
|
2017-10-26 02:39:29 +03:00
|
|
|
fromThen :
|
|
|
|
{first, next, bits, len} (fin first, fin next, fin bits,
|
|
|
|
bits >= width first, bits >= width next,
|
|
|
|
lengthFromThen first next bits == len) =>
|
|
|
|
[len][bits]
|
|
|
|
fromThenTo :
|
|
|
|
{first, next, last, bits, len} (fin first, fin next, fin last,
|
|
|
|
fin bits, bits >= width first, bits >= width next,
|
|
|
|
bits >= width last,
|
|
|
|
lengthFromThenTo first next last == len) =>
|
|
|
|
[len][bits]
|
|
|
|
fromTo :
|
|
|
|
{first, last, bits} (fin last, fin bits, last >= first,
|
|
|
|
bits >= width last) =>
|
|
|
|
[1 + (last - first)][bits]
|
2018-06-15 20:18:02 +03:00
|
|
|
fromZ : {n} (fin n, n >= 1) => Z n -> Integer
|
2017-10-26 02:39:29 +03:00
|
|
|
groupBy :
|
|
|
|
{each, parts, elem} (fin each) =>
|
|
|
|
[each * parts]elem -> [parts][each]elem
|
2018-03-17 01:10:17 +03:00
|
|
|
head : {a, b} [1 + a]b -> b
|
2015-06-10 00:32:17 +03:00
|
|
|
infFrom : {bits} (fin bits) => [bits] -> [inf][bits]
|
|
|
|
infFromThen : {bits} (fin bits) => [bits] -> [bits] -> [inf][bits]
|
2017-09-14 03:04:52 +03:00
|
|
|
integer : {val} (fin val) => Integer
|
2018-06-14 22:24:32 +03:00
|
|
|
intmod :
|
|
|
|
{val, modulus} (fin modulus, modulus >= 1 + val) => Z modulus
|
2018-05-24 19:23:17 +03:00
|
|
|
iterate : {a} (a -> a) -> a -> [inf]a
|
2017-10-26 02:39:29 +03:00
|
|
|
join :
|
|
|
|
{parts, each, a} (fin each) => [parts][each]a -> [parts * each]a
|
2018-03-17 01:10:17 +03:00
|
|
|
last : {a, b} (fin a) => [1 + a]b -> b
|
2015-06-10 00:32:17 +03:00
|
|
|
lg2 : {a} (Arith a) => a -> a
|
2018-05-24 19:23:17 +03:00
|
|
|
map : {a, b, n} (a -> b) -> [n]a -> [n]b
|
2015-06-10 00:32:17 +03:00
|
|
|
max : {a} (Cmp a) => a -> a -> a
|
|
|
|
min : {a} (Cmp a) => a -> a -> a
|
|
|
|
negate : {a} (Arith a) => a -> a
|
2018-05-24 19:23:17 +03:00
|
|
|
or : {n} (fin n) => [n] -> Bit
|
2015-06-10 00:32:17 +03:00
|
|
|
pdiv : {a, b} (fin a, fin b) => [a] -> [b] -> [a]
|
|
|
|
pmod : {a, b} (fin a, fin b) => [a] -> [1 + b] -> [b]
|
2017-10-26 02:39:29 +03:00
|
|
|
pmult :
|
|
|
|
{a, b} (fin a, fin b) => [1 + a] -> [1 + b] -> [1 + (a + b)]
|
2016-01-20 05:17:34 +03:00
|
|
|
random : {a} [256] -> a
|
2018-05-24 19:23:17 +03:00
|
|
|
repeat : {n, a} a -> [n]a
|
2015-06-10 00:32:17 +03:00
|
|
|
reverse : {a, b} (fin a) => [a]b -> [a]b
|
2017-08-17 03:37:24 +03:00
|
|
|
sborrow : {n} (fin n, n >= 1) => [n] -> [n] -> Bit
|
2018-05-24 19:23:17 +03:00
|
|
|
scanl : {b, a, n} (b -> a -> b) -> b -> [n]a -> [1 + n]b
|
|
|
|
scanr : {a, b, n} (fin n) => (a -> b -> b) -> b -> [n]a -> [1 + n]b
|
2017-08-17 03:37:24 +03:00
|
|
|
scarry : {n} (fin n, n >= 1) => [n] -> [n] -> Bit
|
|
|
|
sext : {n, m} (fin m, m >= n, n >= 1) => [n] -> [m]
|
2017-10-26 02:39:29 +03:00
|
|
|
split :
|
|
|
|
{parts, each, a} (fin each) => [parts * each]a -> [parts][each]a
|
|
|
|
splitAt :
|
|
|
|
{front, back, a} (fin front) =>
|
|
|
|
[front + back]a -> ([front]a, [back]a)
|
2018-05-24 19:23:17 +03:00
|
|
|
sum : {a, n} (fin n, Zero a, Arith a) => [n]a -> a
|
2018-04-03 01:35:10 +03:00
|
|
|
True : Bit
|
2014-04-18 02:34:25 +04:00
|
|
|
tail : {a, b} [1 + a]b -> [a]b
|
2017-10-26 02:39:29 +03:00
|
|
|
take :
|
|
|
|
{front, back, elem} (fin front) =>
|
|
|
|
[front + back]elem -> [front]elem
|
2017-09-14 03:04:52 +03:00
|
|
|
toInteger : {a} (fin a) => [a] -> Integer
|
2018-06-15 20:18:02 +03:00
|
|
|
toZ : {n} (fin n, n >= 1) => Integer -> Z n
|
2017-07-10 21:05:59 +03:00
|
|
|
trace : {n, a, b} (fin n) => [n][8] -> a -> b -> b
|
|
|
|
traceVal : {n, a} (fin n) => [n][8] -> a -> a
|
2015-06-10 00:32:17 +03:00
|
|
|
transpose : {a, b, c} [a][b]c -> [b][a]c
|
2018-05-24 19:23:17 +03:00
|
|
|
uncurry : {a, b, c} (a -> b -> c) -> (a, b) -> c
|
2014-04-18 02:34:25 +04:00
|
|
|
undefined : {a} a
|
2016-08-12 22:22:58 +03:00
|
|
|
update : {a, b, c} (fin c) => [a]b -> [c] -> b -> [a]b
|
|
|
|
updateEnd : {a, b, c} (fin a, fin c) => [a]b -> [c] -> b -> [a]b
|
2017-10-26 02:39:29 +03:00
|
|
|
updates :
|
|
|
|
{a, b, c, d} (fin c, fin d) => [a]b -> [d][c] -> [d]b -> [a]b
|
|
|
|
updatesEnd :
|
|
|
|
{a, b, c, d} (fin a, fin c, fin d) =>
|
|
|
|
[a]b -> [d][c] -> [d]b -> [a]b
|
|
|
|
width :
|
|
|
|
{bits, len, elem} (fin len, fin bits, bits >= width len) =>
|
|
|
|
[len]elem -> [bits]
|
2017-09-16 02:38:03 +03:00
|
|
|
zero : {a} (Zero a) => a
|
2017-08-17 03:37:24 +03:00
|
|
|
zext : {n, m} (fin m, m >= n) => [n] -> [m]
|
2018-05-24 19:23:17 +03:00
|
|
|
zip : {a, b, n} [n]a -> [n]b -> [n](a, b)
|
|
|
|
zipWith : {a, b, c, n} (a -> b -> c) -> [n]a -> [n]b -> [n]c
|
2014-04-18 02:34:25 +04:00
|
|
|
|