Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianAlgehed committed Apr 15, 2024
1 parent 858b1f4 commit 1949a6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions libs/cardano-ledger-test/bench/Bench/Constrained/STS.hs
Expand Up @@ -12,13 +12,14 @@ import Cardano.Ledger.Conway
import Cardano.Ledger.Conway.Rules
import Cardano.Ledger.Crypto
import Constrained
import Control.DeepSeq
import Criterion
import Test.Cardano.Ledger.Constrained.Conway

govEnv :: GovEnv (ConwayEra StandardCrypto)
govEnv = genFromSpecWithSeed 10 30 (govEnvSpec @ConwayFn)

singleProposalTreeSpec :: Spec ConwayFn ProposalTree
singleProposalTreeSpec :: Specification ConwayFn ProposalTree
singleProposalTreeSpec = constrained $ \ppupTree ->
[ wellFormedChildren (lit SNothing) ppupTree
, allGASInTree ppupTree $ \gas ->
Expand All @@ -38,7 +39,7 @@ stsBenchmarks =
where
govPropSpec = govProposalsSpec @ConwayFn govEnv

benchSpec :: (HasSpec fn a, NFData a) => Int -> Int -> String -> Spec fn a -> Benchmark
benchSpec :: (HasSpec fn a, NFData a) => Int -> Int -> String -> Specification fn a -> Benchmark
benchSpec seed size nm spec =
bench (unlines [nm, show (genFromSpecWithSeed seed size spec)]) $
nf (genFromSpecWithSeed seed size) spec
8 changes: 4 additions & 4 deletions libs/constrained-generators/src/Constrained/Base.hs
Expand Up @@ -2340,9 +2340,9 @@ genNumList elemSIn foldSIn = do
normFoldS <- normalize foldSIn
explain
[ "Can't generate list of ints with fold constraint"
, show $ " elemSpec =" <+> pretty elemSIn
, show $ " normElemSpec =" <+> pretty normElemS
, show $ " foldSpec =" <+> pretty foldSIn
, " elemSpec = " ++ show elemSIn
, " normElemSpec = " ++ show normElemS
, " foldSpec = " ++ show foldSIn
]
$ gen (narrowFoldSpecs (normElemS, normFoldS)) 50 [] >>= pureGen . shuffle
where
Expand Down Expand Up @@ -2376,7 +2376,7 @@ genNumList elemSIn foldSIn = do
, not $ 0 `conformsToSpec` foldS =
genError
[ "Ran out of fuel in genNumList"
, " " ++ show ("elemSpec =" <+> pretty elemSIn)
, " elemSpec =" ++ show elemSIn
, " foldSpec = " ++ show foldSIn
, " lst = " ++ show lst
]
Expand Down

0 comments on commit 1949a6e

Please sign in to comment.