Skip to content

Commit 0d0dfa4

Browse files
Make Builtins.unsafeUncons use builtin list casing (#7519)
* Make `Builtins.unsafeUncons` use builtin list casing instead of head, tail calls * correct according to PR feedback by @SeungheonOh * Add PIR definition to unsafeCaseList, add tests * Change log * Silly mistake * Update golden --------- Co-authored-by: Sohang Chopra <sohangchopra@gmail.com>
1 parent 0a906af commit 0d0dfa4

30 files changed

+2655
-2509
lines changed

cardano-constitution/test/Cardano/Constitution/Validator/Data/GoldenTests/sorted.golden.uplc

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -729,15 +729,7 @@ program
729729
(constr 3
730730
[ (constr 1
731731
[ cse
732-
, (constr 1
733-
[ (constr 0
734-
[ (constr 0
735-
[ ])
736-
, (constr 1
737-
[ cse
738-
, cse ]) ])
739-
, (constr 0
740-
[ ]) ]) ]) ]))
732+
, cse ]) ]))
741733
(constr 3
742734
[ (constr 1
743735
[ cse
@@ -756,7 +748,15 @@ program
756748
(constr 3
757749
[ (constr 1
758750
[ cse
759-
, cse ]) ]))
751+
, (constr 1
752+
[ (constr 0
753+
[ (constr 0
754+
[ ])
755+
, (constr 1
756+
[ cse
757+
, cse ]) ])
758+
, (constr 0
759+
[ ]) ]) ]) ]))
760760
(constr 1
761761
[ (constr 3
762762
[ (constr 1
@@ -787,16 +787,17 @@ program
787787
[ ])
788788
, (constr 1
789789
[ cse
790-
, (constr 1
791-
[ cse
792-
, (constr 0
793-
[ ]) ]) ]) ]))
790+
, cse ]) ]))
794791
(constr 0
795792
[ (constr 1
796793
[ ])
797794
, (constr 1
798795
[ cse
799-
, cse ]) ]))
796+
, (constr 1
797+
[ (cse
798+
100)
799+
, (constr 0
800+
[ ]) ]) ]) ]))
800801
(constr 1
801802
[ (constr 0
802803
[ (constr 0
@@ -814,25 +815,24 @@ program
814815
, (constr 0
815816
[ ]) ]) ]) ]))
816817
(constr 1
817-
[ (constr 0
818-
[ (constr 2
819-
[ ])
820-
, cse ])
818+
[ cse
821819
, (constr 0
822820
[ ]) ]))
823821
(constr 1
824822
[ (constr 0
825-
[ (constr 0
823+
[ (constr 2
826824
[ ])
827-
, (constr 1
828-
[ 500000000
829-
, (constr 0
830-
[ ]) ]) ])
825+
, cse ])
831826
, (constr 0
832827
[ ]) ]))
833828
(constr 1
834-
[ (cse
835-
1)
829+
[ (constr 0
830+
[ (constr 0
831+
[ ])
832+
, (constr 1
833+
[ 500000000
834+
, (constr 0
835+
[ ]) ]) ])
836836
, (constr 0
837837
[ ]) ]))
838838
(constr 1
@@ -844,29 +844,30 @@ program
844844
, (constr 0
845845
[ ]) ]))
846846
(cse
847-
100))
847+
5))
848848
(constr 0
849849
[ (constr 1
850850
[ ])
851851
, cse ]))
852852
(cse 10))
853-
(cse 4))
854-
(cse 10))
855-
(cse 5))
856-
(constr 0
857-
[ (constr 1 [])
858-
, (constr 1
859-
[ 1
860-
, (constr 0
861-
[ ]) ]) ]))
853+
(cse 1))
854+
(constr 0
855+
[ (constr 1
856+
[])
857+
, (constr 1
858+
[ 1
859+
, (constr 0
860+
[ ]) ]) ]))
861+
(cse 4))
862+
(cse 2))
862863
(cse 1))
863-
(cse 2))
864-
(unsafeRatio 4))
865-
(unsafeRatio 1))
866-
(unsafeRatio 51))
867-
(constr 1 [0, (constr 0 [])]))
868-
(unsafeRatio 9))
869-
(unsafeRatio 0))
864+
(cse 10))
865+
(unsafeRatio 51))
866+
(unsafeRatio 0))
867+
(unsafeRatio 9))
868+
(unsafeRatio 4))
869+
(unsafeRatio 1))
870+
(constr 1 [0, (constr 0 [])]))
870871
(unsafeRatio 3))
871872
((\s -> s s)
872873
(\s arg ->
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2041
1+
2036
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ExBudget {exBudgetCPU = ExCPU 568927992, exBudgetMemory = ExMemory 2944491}
1+
ExBudget {exBudgetCPU = ExCPU 568831992, exBudgetMemory = ExMemory 2943891}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ExBudget {exBudgetCPU = ExCPU 58683921, exBudgetMemory = ExMemory 267719}
1+
ExBudget {exBudgetCPU = ExCPU 58587921, exBudgetMemory = ExMemory 267119}

0 commit comments

Comments
 (0)