[Hugs] #59: missing and/or erroneous output in deteministic function run from WinHUGS cmd line!

Hugs trac at galois.com
Sun Mar 4 11:53:15 EST 2007


#59: missing and/or erroneous output in deteministic function run from WinHUGS
cmd line!
---------------------------------------------+------------------------------
  Reporter:  ettinger at elmgate.eclipse.co.uk  |       Owner:                                    
      Type:  defect                          |      Status:  new                               
  Priority:  critical                        |   Milestone:                                    
 Component:  hugs                            |     Version:  200609                            
Resolution:                                  |    Keywords:  inconsistent expression evaluation
---------------------------------------------+------------------------------
Old description:

> --(Output showing the bug is appended below.  It isn't part of the
> program).
>
> --PLEASE run the function called bug.  It will tell you to type a
> --short expression at the WinHUGS command line.
> --Retry the expression ten times.  I do not get the same result every
> time!
> --Do you find the same problem?  Please, please let me know either way.
> --See below for printout of my "impossible" results.
>
> --The functions os and s below will be used to demonstrate the WinHUGS
> bug:
> os :: Int -> Int -> Double
> os i j = -22.0/7.1
> s :: [[Int]] -> [[Double]]
> s dat = [[
>    sum [ fromIntegral (dat!!i!!j) * os i x * os j y
>                               | i <-[0..7] , j <-[0..7] ]
>               | x <- [0..7] ]
>               | y <- [0..7] ]
>
> -- The following functions produce the bug test data:
> insig :: [Int]
> insig = [0 | i <-[0..7]]
> signif :: [Int]
> signif = [ 1 ] ++ [0 | i <-[1..7]]
> i = [insig] ++ [signif | i <- [1..7]]
>
> --For instructions on demonstrating the bug, please run the function
> below:
> bug = "Please type the following to demonstrate the bug:    (take 4.s)i "
>
> Main> (take 4.s)i
> [[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703]]
> Main> (take 4.s)i
> [[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703]]
> Main>

New description:

 (Output showing the bug is appended below.  It isn't part of the program).

 PLEASE run the function called bug.  It will tell you to type a
 short expression at the WinHUGS command line.
 Retry the expression ten times.  I do not get the same result every time!
 Do you find the same problem?  Please, please let me know either way.
 See below for printout of my "impossible" results.

 The functions os and s below will be used to demonstrate the WinHUGS bug:
 {{{
 os :: Int -> Int -> Double
 os i j = -22.0/7.1
 s :: [[Int]] -> [[Double]]
 s dat = [[
    sum [ fromIntegral (dat!!i!!j) * os i x * os j y
                               | i <-[0..7] , j <-[0..7] ]
               | x <- [0..7] ]
               | y <- [0..7] ]
 }}}
 The following functions produce the bug test data:
 {{{
 insig :: [Int]
 insig = [0 | i <-[0..7]]
 signif :: [Int]
 signif = [ 1 ] ++ [0 | i <-[1..7]]
 i = [insig] ++ [signif | i <- [1..7]]
 }}}
 Type the following to demonstrate the bug: {{{(take 4.s)i}}}
 {{{
 Main> (take 4.s)i
 [[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703]]
 Main> (take 4.s)i
 [[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703],[67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703,67.2088871255703]]
 Main>
 }}}

Comment (by ross):

 I cannot replicate the misbehaviour with the Sep 2006 release under Linux
 (ix86).

-- 
Ticket URL: <http://hackage.haskell.org/trac/hugs/ticket/59>
Hugs <http://www.haskell.org/hugs/>
Hugs 98, an interpreter for Haskell


More information about the Hugs-Bugs mailing list