Skip to content
Draft
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
1 change: 1 addition & 0 deletions plutus-tx-plugin/plutus-tx-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ test-suite plutus-tx-plugin-tests
Blueprint.Tests.Lib
Blueprint.Tests.Lib.AsData.Blueprint
Blueprint.Tests.Lib.AsData.Decls
Budget.BuiltinAndLib
Budget.Spec
Budget.WithGHCOptimisations
Budget.WithoutGHCOptimisations
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CPU: 919_970
Memory: 5_003
AST Size: 63
Flat Size: 91

(con unit ())
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(let
data Unit | Unit_match where
Unit : Unit
in
\(x : integer) (y : integer) (z : integer) ->
let
!b : bool = lessThanInteger x 100
!b : bool = lessThanInteger y 100
!b : bool = lessThanInteger z 100
!b : bool
= case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)]
()
in
case
(unit -> unit)
(case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ())
[ (\(ds : unit) ->
let
!x : Unit = trace {Unit} "conditions not met" Unit
in
error {unit})
, (\(ds : unit) -> ()) ]
())
50
60
70
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(program
1.1.0
((\x y z ->
(\b ->
(\b ->
(\b ->
(\b ->
case
(case b [(\ds -> False), (\ds -> b)] ())
[ (\ds ->
(\x -> error)
(force trace "conditions not met" (constr 0 [])))
, (\ds -> ()) ]
())
(case b [(\ds -> False), (\ds -> b)] ()))
(lessThanInteger z 100))
(lessThanInteger y 100))
(lessThanInteger x 100))
50
60
70))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
An error has occurred:
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'.
Caused by: error
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(let
data Unit | Unit_match where
Unit : Unit
in
\(x : integer) (y : integer) (z : integer) ->
let
!b : bool = lessThanInteger x 100
!b : bool = lessThanInteger y 100
!b : bool = lessThanInteger z 100
!b : bool
= case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)]
()
in
case
(unit -> unit)
(case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ())
[ (\(ds : unit) ->
let
!x : Unit = trace {Unit} "conditions not met" Unit
in
error {unit})
, (\(ds : unit) -> ()) ]
())
150
60
70
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(program
1.1.0
((\x y z ->
(\b ->
(\b ->
(\b ->
(\b ->
case
(case b [(\ds -> False), (\ds -> b)] ())
[ (\ds ->
(\x -> error)
(force trace "conditions not met" (constr 0 [])))
, (\ds -> ()) ]
())
(case b [(\ds -> False), (\ds -> b)] ()))
(lessThanInteger z 100))
(lessThanInteger y 100))
(lessThanInteger x 100))
150
60
70))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
An error has occurred:
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'.
Caused by: error
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(let
data Unit | Unit_match where
Unit : Unit
in
\(x : integer) (y : integer) (z : integer) ->
let
!b : bool = lessThanInteger x 100
!b : bool = lessThanInteger y 100
!b : bool = lessThanInteger z 100
!b : bool
= case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)]
()
in
case
(unit -> unit)
(case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ())
[ (\(ds : unit) ->
let
!x : Unit = trace {Unit} "conditions not met" Unit
in
error {unit})
, (\(ds : unit) -> ()) ]
())
50
60
150
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
(program
1.1.0
((\x y z ->
(\b ->
(\b ->
(\b ->
(\b ->
case
(case b [(\ds -> False), (\ds -> b)] ())
[ (\ds ->
(\x -> error)
(force trace "conditions not met" (constr 0 [])))
, (\ds -> ()) ]
())
(case b [(\ds -> False), (\ds -> b)] ()))
(lessThanInteger z 100))
(lessThanInteger y 100))
(lessThanInteger x 100))
50
60
150))
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CPU: 839_970
Memory: 4_503
AST Size: 48
Flat Size: 58

(con bool True)
12 changes: 12 additions & 0 deletions plutus-tx-plugin/test/Budget/9.6/andBuiltinAnd_AllTrue.golden.pir
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(\(x : integer) (y : integer) (z : integer) ->
let
!b : bool = lessThanInteger x 100
!b : bool = lessThanInteger y 100
!b : bool = lessThanInteger z 100
!b : bool
= case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ()
in
case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ())
50
60
70
14 changes: 14 additions & 0 deletions plutus-tx-plugin/test/Budget/9.6/andBuiltinAnd_AllTrue.golden.uplc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(program
1.1.0
((\x y z ->
(\b ->
(\b ->
(\b ->
(\b -> case b [(\ds -> False), (\ds -> b)] ())
(case b [(\ds -> False), (\ds -> b)] ()))
(lessThanInteger z 100))
(lessThanInteger y 100))
(lessThanInteger x 100))
50
60
70))
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CPU: 839_970
Memory: 4_503
AST Size: 48
Flat Size: 59

(con bool False)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(\(x : integer) (y : integer) (z : integer) ->
let
!b : bool = lessThanInteger x 100
!b : bool = lessThanInteger y 100
!b : bool = lessThanInteger z 100
!b : bool
= case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ()
in
case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ())
150
60
70
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(program
1.1.0
((\x y z ->
(\b ->
(\b ->
(\b ->
(\b -> case b [(\ds -> False), (\ds -> b)] ())
(case b [(\ds -> False), (\ds -> b)] ()))
(lessThanInteger z 100))
(lessThanInteger y 100))
(lessThanInteger x 100))
150
60
70))
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CPU: 839_970
Memory: 4_503
AST Size: 48
Flat Size: 58

(con bool False)
12 changes: 12 additions & 0 deletions plutus-tx-plugin/test/Budget/9.6/andBuiltinAnd_LateFail.golden.pir
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
(\(x : integer) (y : integer) (z : integer) ->
let
!b : bool = lessThanInteger x 100
!b : bool = lessThanInteger y 100
!b : bool = lessThanInteger z 100
!b : bool
= case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ()
in
case (unit -> bool) b [(\(ds : unit) -> False), (\(ds : unit) -> b)] ())
50
60
150
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
(program
1.1.0
((\x y z ->
(\b ->
(\b ->
(\b ->
(\b -> case b [(\ds -> False), (\ds -> b)] ())
(case b [(\ds -> False), (\ds -> b)] ()))
(lessThanInteger z 100))
(lessThanInteger y 100))
(lessThanInteger x 100))
50
60
150))
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
CPU: 727_970
Memory: 3_803
AST Size: 67
Flat Size: 133

(con unit ())
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(let
data Unit | Unit_match where
Unit : Unit
in
\(x : integer) (y : integer) (z : integer) ->
case
(unit -> unit)
(lessThanInteger x 100)
[ (\(ds : unit) ->
let
!x : Unit = trace {Unit} "conditions not met" Unit
in
error {unit})
, (\(ds : unit) ->
case
(unit -> unit)
(lessThanInteger y 100)
[ (\(ds : unit) ->
let
!x : Unit = trace {Unit} "conditions not met" Unit
in
error {unit})
, (\(ds : unit) ->
case
(unit -> unit)
(lessThanInteger z 100)
[ (\(ds : unit) ->
let
!x : Unit = trace {Unit} "conditions not met" Unit
in
error {unit})
, (\(ds : unit) -> ()) ]
()) ]
()) ]
())
50
60
70
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
(program
1.1.0
((\x y z ->
case
(lessThanInteger x 100)
[ (\ds ->
(\x -> error) (force trace "conditions not met" (constr 0 [])))
, (\ds ->
case
(lessThanInteger y 100)
[ (\ds ->
(\x -> error)
(force trace "conditions not met" (constr 0 [])))
, (\ds ->
case
(lessThanInteger z 100)
[ (\ds ->
(\x -> error)
(force trace "conditions not met" (constr 0 [])))
, (\ds -> ()) ]
()) ]
()) ]
())
50
60
70))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
An error has occurred:
The machine terminated because of an error, either from a built-in function or from an explicit use of 'error'.
Caused by: error
Loading