diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.cbor.size.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.cbor.size.golden index 3827a8bde10..0e7b65dcfe3 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.cbor.size.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.cbor.size.golden @@ -1 +1 @@ -2132 \ No newline at end of file +2144 \ No newline at end of file diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.large.budget.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.large.budget.golden index 599c961fc12..ea0e30324d6 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.large.budget.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.large.budget.golden @@ -1 +1 @@ -ExBudget {exBudgetCPU = ExCPU 601476171, exBudgetMemory = ExMemory 2971818} \ No newline at end of file +ExBudget {exBudgetCPU = ExCPU 604948171, exBudgetMemory = ExMemory 2993518} \ No newline at end of file diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.pir.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.pir.golden index f9cb8fd93bc..3a89a11658f 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.pir.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.pir.golden @@ -491,26 +491,30 @@ program Nothing : Maybe a in letrec - !go : list (pair data data) -> List (Tuple2 data data) - = \(l : list (pair data data)) -> - chooseList - {pair data data} - {unit -> List (Tuple2 data data)} - l - (\(ds : unit) -> Nil {Tuple2 data data}) - (\(ds : unit) -> - Cons - {Tuple2 data data} - (let - !p : pair data data = headList {pair data data} l - in - Tuple2 - {data} - {data} - (fstPair {data} {data} p) - (sndPair {data} {data} p)) - (go (tailList {pair data data} l))) - () + ~caseData_go : list (pair data data) -> List (Tuple2 data data) + = (let + a = pair data data + in + /\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}) + {List (Tuple2 data data)} + (Nil {Tuple2 data data}) + (\(x : pair data data) (xs : list (pair data data)) -> + Cons + {Tuple2 data data} + (Tuple2 + {data} + {data} + (fstPair {data} {data} x) + (sndPair {data} {data} x)) + (caseData_go xs)) in let !fun : List (Tuple2 data data) -> Bool @@ -5329,11 +5333,13 @@ program (/\dead -> Just {List (Tuple2 data data)} - (go - (unMapData - (headList - {data} - (tailList {data} (sndPair {integer} {list data} ds)))))) + (let + !d : data + = headList + {data} + (tailList {data} (sndPair {integer} {list data} ds)) + in + caseData_go (unMapData d))) (/\dead -> Bool_match (ifThenElse {Bool} (equalsInteger 2 x) True False) diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.small.budget.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.small.budget.golden index b4f2588f1b2..dae76885acc 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.small.budget.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.small.budget.golden @@ -1 +1 @@ -ExBudget {exBudgetCPU = ExCPU 91525157, exBudgetMemory = ExMemory 413605} \ No newline at end of file +ExBudget {exBudgetCPU = ExCPU 91749157, exBudgetMemory = ExMemory 415005} \ No newline at end of file diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.uplc.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.uplc.golden index fc56140d431..a60c0e68235 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.uplc.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/sorted.uplc.golden @@ -10,7 +10,7 @@ program (\validateParamValue -> (\validateParamValues -> (\runRules -> - (\go -> + (\caseData_go -> (\cse -> (\cse -> (\cse -> @@ -56,16 +56,19 @@ program (delay (delay (constr 0 - [ (go - (unMapData + [ ((\d -> + force + caseData_go + (unMapData + d)) + (force + headList (force - headList + tailList (force - tailList (force - (force - sndPair) - cse))))) ]))) + sndPair) + cse)))) ]))) (delay (delay (force @@ -742,18 +745,7 @@ program (constr 3 [ (constr 1 [ cse - , (constr 1 - [ (constr 0 - [ (constr 0 - [ ]) - , (constr 1 - [ cse - , (constr 1 - [ cse - , (constr 0 - [ ]) ]) ]) ]) - , (constr 0 - [ ]) ]) ]) ])) + , cse ]) ])) (constr 3 [ (constr 1 [ cse @@ -769,7 +761,18 @@ program (constr 3 [ (constr 1 [ cse - , cse ]) ])) + , (constr 1 + [ (constr 0 + [ (constr 0 + [ ]) + , (constr 1 + [ cse + , (constr 1 + [ cse + , (constr 0 + [ ]) ]) ]) ]) + , (constr 0 + [ ]) ]) ]) ])) (constr 1 [ (constr 3 [ (constr 1 @@ -790,7 +793,8 @@ program , (constr 1 [ cse , (constr 1 - [ cse + [ (cse + 10) , (constr 0 [ ]) ]) ]) ]) , (constr 0 @@ -808,8 +812,7 @@ program [ (constr 1 [ ]) , (constr 1 - [ (cse - 10) + [ cse , cse ]) ])) (constr 1 [ (constr 0 @@ -835,71 +838,83 @@ program , (constr 0 [ ]) ])) (constr 1 - [ (cse - 4) + [ cse , (constr 0 [ ]) ])) (constr 1 - [ (constr 0 - [ (constr 0 - [ ]) - , (constr 1 - [ 500000000 - , (constr 0 - [ ]) ]) ]) + [ cse , (constr 0 [ ]) ])) (constr 1 - [ cse + [ (constr 0 + [ (constr 0 + [ ]) + , (constr 1 + [ 500000000 + , (constr 0 + [ ]) ]) ]) , (constr 0 [ ]) ])) (constr 1 - [ cse + [ (cse + 4) , (constr 0 [ ]) ])) - (cse - 2)) + (constr 0 + [ (constr 1 + [ ]) + , cse ])) (cse - 100)) - (cse - 1)) - (constr 0 - [ (constr 1 - [ ]) - , cse ])) - (cse 5)) - (constr 0 - [ (constr 1 - []) - , (constr 1 - [ 1 - , (constr 0 - [ ]) ]) ])) - (cse 1)) - (cse 10)) - (unsafeRatio 4)) - (unsafeRatio 0)) - (unsafeRatio 3)) - (unsafeRatio 9)) - (constr 1 [0, (constr 0 [])])) - (unsafeRatio 1)) - (unsafeRatio 51)) + 5)) + (constr 0 + [ (constr 1 + [ ]) + , (constr 1 + [ 1 + , (constr 0 + [ ]) ]) ])) + (cse 1)) + (cse 2)) + (cse 10)) + (cse 100)) + (cse 1)) + (unsafeRatio 51)) + (unsafeRatio 3)) + (unsafeRatio 0)) + (constr 1 [0, (constr 0 [])])) + (unsafeRatio 9)) + (unsafeRatio 4)) + (unsafeRatio 1)) (fix1 - (\go l -> - force (force chooseList) - l - (\ds -> constr 0 []) - (\ds -> - constr 1 - [ ((\p -> - constr 0 - [ (force (force fstPair) - p) - , (force (force sndPair) - p) ]) - (force headList l)) - , (go (force tailList l)) ]) - ()))) + (\caseData_go arg -> + delay + (\xs -> + force + (force (force chooseList) + xs + (delay (constr 0 [])) + (delay + ((\x xs -> + constr 1 + [ (constr 0 + [ (force + (force + fstPair) + x) + , (force + (force + sndPair) + x) ]) + , (force + (caseData_go + (delay + (\x -> + x))) + xs) ]) + (force headList xs) + (force tailList + xs)))))) + (delay (\x -> x)))) (fix1 (\runRules ds cparams -> force diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.cbor.size.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.cbor.size.golden index bc29fcae9c2..fa95f75a6f8 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.cbor.size.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.cbor.size.golden @@ -1 +1 @@ -2127 \ No newline at end of file +2139 \ No newline at end of file diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.large.budget.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.large.budget.golden index 3742ab98948..21778ed1a59 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.large.budget.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.large.budget.golden @@ -1 +1 @@ -ExBudget {exBudgetCPU = ExCPU 960426341, exBudgetMemory = ExMemory 4867088} \ No newline at end of file +ExBudget {exBudgetCPU = ExCPU 963898341, exBudgetMemory = ExMemory 4888788} \ No newline at end of file diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.pir.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.pir.golden index d3676b47593..55d72d55a41 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.pir.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.pir.golden @@ -423,26 +423,30 @@ program Nothing : Maybe a in letrec - !go : list (pair data data) -> List (Tuple2 data data) - = \(l : list (pair data data)) -> - chooseList - {pair data data} - {unit -> List (Tuple2 data data)} - l - (\(ds : unit) -> Nil {Tuple2 data data}) - (\(ds : unit) -> - Cons - {Tuple2 data data} - (let - !p : pair data data = headList {pair data data} l - in - Tuple2 - {data} - {data} - (fstPair {data} {data} p) - (sndPair {data} {data} p)) - (go (tailList {pair data data} l))) - () + ~caseData_go : list (pair data data) -> List (Tuple2 data data) + = (let + a = pair data data + in + /\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}) + {List (Tuple2 data data)} + (Nil {Tuple2 data data}) + (\(x : pair data data) (xs : list (pair data data)) -> + Cons + {Tuple2 data data} + (Tuple2 + {data} + {data} + (fstPair {data} {data} x) + (sndPair {data} {data} x)) + (caseData_go xs)) in let !cfg : List (Tuple2 integer ParamValue) @@ -5263,11 +5267,13 @@ program (/\dead -> Just {List (Tuple2 data data)} - (go - (unMapData - (headList - {data} - (tailList {data} (sndPair {integer} {list data} ds)))))) + (let + !d : data + = headList + {data} + (tailList {data} (sndPair {integer} {list data} ds)) + in + caseData_go (unMapData d))) (/\dead -> Bool_match (ifThenElse {Bool} (equalsInteger 2 x) True False) diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.small.budget.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.small.budget.golden index 3f487d3f64f..06ca3589258 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.small.budget.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.small.budget.golden @@ -1 +1 @@ -ExBudget {exBudgetCPU = ExCPU 89279267, exBudgetMemory = ExMemory 402103} \ No newline at end of file +ExBudget {exBudgetCPU = ExCPU 89503267, exBudgetMemory = ExMemory 403503} \ No newline at end of file diff --git a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.uplc.golden b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.uplc.golden index a2502224c04..aa9ab75018b 100644 --- a/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.uplc.golden +++ b/cardano-constitution/test/Cardano/Constitution/Validator/GoldenTests/unsorted.uplc.golden @@ -10,7 +10,7 @@ program (\cse -> (\validateParamValue -> (\validateParamValues -> - (\go -> + (\caseData_go -> (\cse -> (\cse -> (\cse -> @@ -58,16 +58,19 @@ program (delay (delay (constr 0 - [ (go - (unMapData + [ ((\d -> + force + caseData_go + (unMapData + d)) + (force + headList (force - headList + tailList (force - tailList (force - (force - sndPair) - cse))))) ]))) + sndPair) + cse)))) ]))) (delay (delay (force @@ -812,7 +815,10 @@ program [ ]) , (constr 1 [ cse - , cse ]) ]) + , (constr 1 + [ cse + , (constr 0 + [ ]) ]) ]) ]) , (constr 0 [ ]) ]) ]) ])) (constr 3 @@ -824,10 +830,7 @@ program [ ]) , (constr 1 [ cse - , (constr 1 - [ cse - , (constr 0 - [ ]) ]) ]) ]) + , cse ]) ]) , (constr 0 [ ]) ]) ]) ])) (constr 1 @@ -850,7 +853,8 @@ program , (constr 1 [ cse , (constr 1 - [ cse + [ (cse + 10) , (constr 0 [ ]) ]) ]) ]) , (constr 0 @@ -860,16 +864,16 @@ program [ ]) , (constr 1 [ cse - , (constr 1 - [ cse - , (constr 0 - [ ]) ]) ]) ])) + , cse ]) ])) (constr 0 [ (constr 1 [ ]) , (constr 1 [ cse - , cse ]) ])) + , (constr 1 + [ cse + , (constr 0 + [ ]) ]) ]) ])) (constr 1 [ (constr 0 [ (constr 0 @@ -912,53 +916,67 @@ program , (constr 0 [ ]) ])) (constr 1 - [ (cse - 1) + [ cse , (constr 0 [ ]) ])) (cse - 10)) + 2)) (cse - 10)) - (constr 0 - [ (constr 1 - [ ]) - , cse ])) + 1)) + (cse + 5)) (cse - 5)) - (cse 2)) - (cse 100)) - (cse 1)) + 100)) + (constr 0 + [ (constr 1 + [ ]) + , cse ])) + (cse 4)) + (cse 10)) (constr 0 [ (constr 1 []) , (constr 1 [ 1 , (constr 0 [ ]) ]) ])) - (cse 4)) - (unsafeRatio 9)) - (unsafeRatio 3)) - (unsafeRatio 1)) - (unsafeRatio 0)) - (unsafeRatio 4)) - (unsafeRatio 51)) + (cse 1)) + (unsafeRatio 1)) + (unsafeRatio 51)) + (unsafeRatio 0)) + (unsafeRatio 4)) + (unsafeRatio 9)) + (unsafeRatio 3)) (constr 1 [0, (constr 0 [])])) (fix1 - (\go l -> - force (force chooseList) - l - (\ds -> constr 0 []) - (\ds -> - constr 1 - [ ((\p -> - constr 0 - [ (force (force fstPair) - p) - , (force (force sndPair) - p) ]) - (force headList l)) - , (go (force tailList l)) ]) - ()))) + (\caseData_go arg -> + delay + (\xs -> + force + (force (force chooseList) + xs + (delay (constr 0 [])) + (delay + ((\x xs -> + constr 1 + [ (constr 0 + [ (force + (force + fstPair) + x) + , (force + (force + sndPair) + x) ]) + , (force + (caseData_go + (delay + (\x -> + x))) + xs) ]) + (force headList xs) + (force tailList + xs)))))) + (delay (\x -> x)))) (cse (\arg_0 arg_1 -> arg_1))) (cse (\arg_0 arg_1 -> arg_0))) (force