Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ Please provide a clear and concise description of the vulnerability, including:
If you have developed any code or utilities that can help demonstrate the suspected
vulnerability, please mention them in your email but ***DO NOT*** attempt to include them as
attachments as this may cause your Email to be blocked by spam filters.
See the security file in the [Cardano engineering handbook](https://github.com/input-output-hk/cardano-engineering-handbook/blob/main/SECURITY.md).
See the security file in the [Cardano engineering handbook](https://github.com/input-output-hk/cardano-engineering-handbook/blob/main/SECURITY.md).

5 changes: 5 additions & 0 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/(++).eval.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CPU: 10_746_784
Memory: 44_612
Size: 83

(con (list integer) [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10])
48 changes: 48 additions & 0 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/(++).pir.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
let
!caseList' : all a r. r -> (a -> list a -> r) -> list a -> r
= /\a r ->
\(z : r) (f : a -> list a -> r) (xs : list a) ->
chooseList
{a}
{all dead. r}
xs
(/\dead -> z)
(/\dead -> f (headList {a} xs) (tailList {a} xs))
{r}
~foldr : all a b. (a -> b -> b) -> b -> list a -> b
= /\a b ->
\(f : a -> b -> b) ->
let
!f : a -> b -> b = f
in
\(acc : b) ->
let
!acc : b = acc
in
letrec
~go : list a -> b
= caseList'
{a}
{b}
acc
(\(x : a) ->
let
!x : a = x
in
\(xs : list a) -> let !xs : list a = xs in f x (go xs))
in
go
!mkCons : all a. a -> list a -> list a = mkCons
~`++` : all a. list a -> list a -> list a
= /\a ->
\(l : list a) ->
let
!l : list a = l
in
\(r : list a) ->
let
!r : list a = r
in
foldr {a} {list a} (mkCons {a}) r l
in
\(xs : list integer) -> let !xs : list integer = xs in `++` {integer} xs xs
22 changes: 22 additions & 0 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/(++).uplc.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(program
1.1.0
(\xs ->
force
((\f ->
(\s -> f (\x -> f (\x -> f (\x -> f (\x -> s s x) x) x) x))
(\s -> f (\x -> s s x)))
(\go arg ->
delay
(\xs ->
force
(force (force chooseList)
xs
(delay xs)
(delay
((\xs ->
force mkCons
(force headList xs)
(force (go (delay (\x -> x))) xs))
(force tailList xs))))))
(delay (\x -> x)))
xs))
5 changes: 5 additions & 0 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/(<|).eval.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CPU: 216_462
Memory: 1_032
Size: 9

(con (list integer) [42,1,2,3,4,5,6,7,8,9,10])
5 changes: 5 additions & 0 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/(<|).pir.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
let
!mkCons : all a. a -> list a -> list a = mkCons
~`<|` : all a. a -> list a -> list a = mkCons
in
\(xs : list integer) -> let !xs : list integer = xs in `<|` {integer} 42 xs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(program 1.1.0 (\xs -> force mkCons 42 xs))
6 changes: 3 additions & 3 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/all.eval.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CPU: 14_535_700
Memory: 62_410
Size: 86
CPU: 15_879_700
Memory: 70_810
Size: 124

(constr 0 (constr 1) (constr 0))
61 changes: 44 additions & 17 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/all.pir.golden
Original file line number Diff line number Diff line change
@@ -1,41 +1,68 @@
let
~v : integer = 0
~v : integer = 8
data (Tuple2 :: * -> * -> *) a b | Tuple2_match where
Tuple2 : a -> b -> Tuple2 a b
!caseList' : all a r. r -> (a -> list a -> r) -> list a -> r
= /\a r ->
\(z : r) (f : a -> list a -> r) (xs : list a) ->
chooseList
{a}
{all dead. r}
xs
(/\dead -> z)
(/\dead -> f (headList {a} xs) (tailList {a} xs))
{r}
data Bool | Bool_match where
True : Bool
False : Bool
!all : all a. (a -> Bool) -> list a -> Bool
~all : all a. (a -> Bool) -> list a -> Bool
= /\a ->
\(p : a -> Bool) ->
let
!p : a -> Bool = p
in
letrec
!go : list a -> Bool
= \(xs : list a) ->
chooseList
{a}
{all dead. Bool}
xs
(/\dead -> True)
(/\dead ->
~go : list a -> Bool
= caseList'
{a}
{Bool}
True
(\(x : a) ->
let
!x : a = x
in
\(xs : list a) ->
let
!x : a = headList {a} xs
!xs : list a = tailList {a} xs
!xs : list a = xs
in
Bool_match
(p x)
{all dead. Bool}
(/\dead -> go xs)
(/\dead -> False)
{all dead. dead})
{Bool}
in
go
!greaterThanEqualsInteger : integer -> integer -> Bool
= \(x : integer) (y : integer) ->
ifThenElse {Bool} (lessThanInteger x y) False True
!ifThenElse : all a. bool -> a -> a -> a = ifThenElse
!lessThanInteger : integer -> integer -> bool = lessThanInteger
~greaterThanEqualsInteger : integer -> integer -> Bool
= \(x : integer) ->
let
!x : integer = x
in
\(y : integer) ->
let
!y : integer = y
in
ifThenElse {Bool} (lessThanInteger x y) False True
in
\(xs : list integer) ->
let
!xs : list integer = xs
in
Tuple2
{Bool}
{Bool}
(all {integer} (\(v : integer) -> greaterThanEqualsInteger v 8) xs)
(all {integer} (\(v : integer) -> greaterThanEqualsInteger v 0) xs)
(all {integer} (\(v : integer) -> greaterThanEqualsInteger v v) xs)
(all {integer} (\(v : integer) -> greaterThanEqualsInteger v v) xs)
44 changes: 25 additions & 19 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/all.uplc.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,32 @@
1.1.0
(\xs ->
(\greaterThanEqualsInteger ->
(\all ->
(\cse ->
constr 0
[ (all (\v -> greaterThanEqualsInteger v 8) xs)
, (all (\v -> greaterThanEqualsInteger v 0) xs) ])
[ (cse (\v -> greaterThanEqualsInteger v 8) xs)
, (cse (\v -> greaterThanEqualsInteger v 0) xs) ])
(\p ->
(\s -> s s)
(\s xs ->
force
(force (force chooseList)
xs
(delay (constr 0 []))
(delay
((\x ->
(\xs ->
force
(case
(p x)
[ (delay (s s xs))
, (delay (constr 1 [])) ]))
(force tailList xs))
(force headList xs)))))))
force
((\f ->
(\s -> f (\x -> f (\x -> f (\x -> f (\x -> s s x) x) x) x))
(\s -> f (\x -> s s x)))
(\go arg ->
delay
(\xs ->
force
(force (force chooseList)
xs
(delay (constr 0 []))
(delay
((\xs ->
force
(case
(p (force headList xs))
[ (delay
(force (go (delay (\x -> x)))
xs))
, (delay (constr 1 [])) ]))
(force tailList xs))))))
(delay (\x -> x)))))
(\x y ->
force ifThenElse (lessThanInteger x y) (constr 1 []) (constr 0 []))))
5 changes: 5 additions & 0 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/and.eval.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CPU: 2_267_812
Memory: 9_794
Size: 91

(constr 1)
49 changes: 49 additions & 0 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/and.pir.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
let
data Bool | Bool_match where
True : Bool
False : Bool
!caseList' : all a r. r -> (a -> list a -> r) -> list a -> r
= /\a r ->
\(z : r) (f : a -> list a -> r) (xs : list a) ->
chooseList
{a}
{all dead. r}
xs
(/\dead -> z)
(/\dead -> f (headList {a} xs) (tailList {a} xs))
{r}
~all : all a. (a -> Bool) -> list a -> Bool
= /\a ->
\(p : a -> Bool) ->
let
!p : a -> Bool = p
in
letrec
~go : list a -> Bool
= caseList'
{a}
{Bool}
True
(\(x : a) ->
let
!x : a = x
in
\(xs : list a) ->
let
!xs : list a = xs
in
Bool_match
(p x)
{all dead. Bool}
(/\dead -> go xs)
(/\dead -> False)
{all dead. dead})
in
go
!ifThenElse : all a. bool -> a -> a -> a = ifThenElse
~and : list bool -> Bool
= all
{bool}
(\(x : bool) -> let !x : bool = x in ifThenElse {Bool} x True False)
in
\(xs : list bool) -> let !xs : list bool = xs in and xs
27 changes: 27 additions & 0 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/and.uplc.golden
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
(program
1.1.0
(\xs ->
force
((\f ->
(\s -> f (\x -> f (\x -> f (\x -> f (\x -> s s x) x) x) x))
(\s -> f (\x -> s s x)))
(\go arg ->
delay
(\xs ->
force
(force (force chooseList)
xs
(delay (constr 0 []))
(delay
((\xs ->
force
(force
(force ifThenElse
(force headList xs)
(delay
(delay
(force (go (delay (\x -> x))) xs)))
(delay (delay (constr 1 []))))))
(force tailList xs))))))
(delay (\x -> x)))
xs))
6 changes: 3 additions & 3 deletions plutus-tx-plugin/test/BuiltinList/Budget/9.6/any.eval.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CPU: 23_293_722
Memory: 99_496
Size: 86
CPU: 25_389_722
Memory: 112_596
Size: 124

(constr 0 (constr 0) (constr 1))
Loading
Loading