Spaces
Explore
Communities
Statistics
Reports
Cluster
Status
Help
Haskell 2019-04-01 06.52 pair #433316455
details
property
value
status
complete
benchmark
FiniteMap_addListToFM_7.hs
ran by
Akihisa Yamada
cpu timeout
1200 seconds
wallclock timeout
300 seconds
memory limit
137438953472 bytes
execution host
n018.star.cs.uiowa.edu
space
full_haskell
run statistics
property
value
solver
AProVE
configuration
standard
runtime (wallclock)
106.441 seconds
cpu usage
139.109
user time
135.491
system time
3.61823
max virtual memory
1.8285568E7
max residence set size
6675004.0
stage attributes
key
value
starexec-result
MAYBE
output
135.82/105.48 MAYBE 137.94/106.12 proof of /export/starexec/sandbox/benchmark/theBenchmark.hs 137.94/106.12 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 137.94/106.12 137.94/106.12 137.94/106.12 H-Termination with start terms of the given HASKELL could not be shown: 137.94/106.12 137.94/106.12 (0) HASKELL 137.94/106.12 (1) LR [EQUIVALENT, 0 ms] 137.94/106.12 (2) HASKELL 137.94/106.12 (3) CR [EQUIVALENT, 0 ms] 137.94/106.12 (4) HASKELL 137.94/106.12 (5) BR [EQUIVALENT, 0 ms] 137.94/106.12 (6) HASKELL 137.94/106.12 (7) COR [EQUIVALENT, 18 ms] 137.94/106.12 (8) HASKELL 137.94/106.12 (9) LetRed [EQUIVALENT, 0 ms] 137.94/106.12 (10) HASKELL 137.94/106.12 (11) NumRed [SOUND, 0 ms] 137.94/106.12 (12) HASKELL 137.94/106.12 137.94/106.12 137.94/106.12 ---------------------------------------- 137.94/106.12 137.94/106.12 (0) 137.94/106.12 Obligation: 137.94/106.12 mainModule Main 137.94/106.12 module FiniteMap where { 137.94/106.12 import qualified Main; 137.94/106.12 import qualified Maybe; 137.94/106.12 import qualified Prelude; 137.94/106.12 data FiniteMap a b = EmptyFM | Branch a b Int (FiniteMap a b) (FiniteMap a b) ; 137.94/106.12 137.94/106.12 instance (Eq a, Eq b) => Eq FiniteMap b a where { 137.94/106.12 } 137.94/106.12 addListToFM :: Ord b => FiniteMap b a -> [(b,a)] -> FiniteMap b a; 137.94/106.12 addListToFM fm key_elt_pairs = addListToFM_C (\old new ->new) fm key_elt_pairs; 137.94/106.12 137.94/106.12 addListToFM_C :: Ord b => (a -> a -> a) -> FiniteMap b a -> [(b,a)] -> FiniteMap b a; 137.94/106.12 addListToFM_C combiner fm key_elt_pairs = foldl add fm key_elt_pairs where { 137.94/106.12 add fmap (key,elt) = addToFM_C combiner fmap key elt; 137.94/106.12 }; 137.94/106.12 137.94/106.12 addToFM_C :: Ord b => (a -> a -> a) -> FiniteMap b a -> b -> a -> FiniteMap b a; 137.94/106.12 addToFM_C combiner EmptyFM key elt = unitFM key elt; 137.94/106.12 addToFM_C combiner (Branch key elt size fm_l fm_r) new_key new_elt | new_key < key = mkBalBranch key elt (addToFM_C combiner fm_l new_key new_elt) fm_r 137.94/106.12 | new_key > key = mkBalBranch key elt fm_l (addToFM_C combiner fm_r new_key new_elt) 137.94/106.12 | otherwise = Branch new_key (combiner elt new_elt) size fm_l fm_r; 137.94/106.12 137.94/106.12 emptyFM :: FiniteMap a b; 137.94/106.12 emptyFM = EmptyFM; 137.94/106.12 137.94/106.12 findMax :: FiniteMap b a -> (b,a); 137.94/106.12 findMax (Branch key elt _ _ EmptyFM) = (key,elt); 137.94/106.12 findMax (Branch key elt _ _ fm_r) = findMax fm_r; 137.94/106.12 137.94/106.12 findMin :: FiniteMap a b -> (a,b); 137.94/106.12 findMin (Branch key elt _ EmptyFM _) = (key,elt); 137.94/106.12 findMin (Branch key elt _ fm_l _) = findMin fm_l; 137.94/106.12 137.94/106.12 mkBalBranch :: Ord b => b -> a -> FiniteMap b a -> FiniteMap b a -> FiniteMap b a; 137.94/106.12 mkBalBranch key elt fm_L fm_R | size_l + size_r < 2 = mkBranch 1 key elt fm_L fm_R 137.94/106.12 | size_r > sIZE_RATIO * size_l = case fm_R of { 137.94/106.12 Branch _ _ _ fm_rl fm_rr | sizeFM fm_rl < 2 * sizeFM fm_rr -> single_L fm_L fm_R 137.94/106.12 | otherwise -> double_L fm_L fm_R; 137.94/106.12 } 137.94/106.12 | size_l > sIZE_RATIO * size_r = case fm_L of { 137.94/106.12 Branch _ _ _ fm_ll fm_lr | sizeFM fm_lr < 2 * sizeFM fm_ll -> single_R fm_L fm_R 137.94/106.12 | otherwise -> double_R fm_L fm_R; 137.94/106.12 } 137.94/106.12 | otherwise = mkBranch 2 key elt fm_L fm_R where { 137.94/106.12 double_L fm_l (Branch key_r elt_r _ (Branch key_rl elt_rl _ fm_rll fm_rlr) fm_rr) = mkBranch 5 key_rl elt_rl (mkBranch 6 key elt fm_l fm_rll) (mkBranch 7 key_r elt_r fm_rlr fm_rr); 137.94/106.12 double_R (Branch key_l elt_l _ fm_ll (Branch key_lr elt_lr _ fm_lrl fm_lrr)) fm_r = mkBranch 10 key_lr elt_lr (mkBranch 11 key_l elt_l fm_ll fm_lrl) (mkBranch 12 key elt fm_lrr fm_r); 137.94/106.12 single_L fm_l (Branch key_r elt_r _ fm_rl fm_rr) = mkBranch 3 key_r elt_r (mkBranch 4 key elt fm_l fm_rl) fm_rr; 137.94/106.12 single_R (Branch key_l elt_l _ fm_ll fm_lr) fm_r = mkBranch 8 key_l elt_l fm_ll (mkBranch 9 key elt fm_lr fm_r); 137.94/106.12 size_l = sizeFM fm_L; 137.94/106.12 size_r = sizeFM fm_R; 137.94/106.12 }; 137.94/106.12 137.94/106.12 mkBranch :: Ord b => Int -> b -> a -> FiniteMap b a -> FiniteMap b a -> FiniteMap b a; 137.94/106.12 mkBranch which key elt fm_l fm_r = let { 137.94/106.12 result = Branch key elt (unbox (1 + left_size + right_size)) fm_l fm_r; 137.94/106.12 } in result where { 137.94/106.12 balance_ok = True; 137.94/106.12 left_ok = case fm_l of { 137.94/106.12 EmptyFM-> True; 137.94/106.12 Branch left_key _ _ _ _-> let { 137.94/106.12 biggest_left_key = fst (findMax fm_l); 137.94/106.12 } in biggest_left_key < key; 137.94/106.12 } ; 137.94/106.12 left_size = sizeFM fm_l; 137.94/106.12 right_ok = case fm_r of { 137.94/106.12 EmptyFM-> True; 137.94/106.12 Branch right_key _ _ _ _-> let { 137.94/106.12 smallest_right_key = fst (findMin fm_r); 137.94/106.12 } in key < smallest_right_key; 137.94/106.12 } ; 137.94/106.12 right_size = sizeFM fm_r; 137.94/106.12 unbox :: Int -> Int; 137.94/106.12 unbox x = x;
popout
output may be truncated. 'popout' for the full output.
job log
popout
actions
all output
return to Haskell 2019-04-01 06.52