Panic! - GHC 6.2.2 - the 'impossible' happened

dead greay deadgrey19 at hotmail.com
Sun Mar 27 10:24:14 EST 2005


ERROR MESSAGE:

Prelude> :r
Compiling BookData         ( ./BookData.hs, interpreted )
ghc-6.2.2: panic! (the `impossible' happened, GHC version 6.2.2):
        mkProtoBCO: stack use won't fit in 16 bits 79141

Please report it as a compiler bug to glasgow-haskell-bugs at haskell.org,
or http://sourceforge.net/projects/ghc/.

CODE:
-- BookData
-- The Grosvenor Test Suite v3.0
-- 27 March 2005
-- A comprehensive test modeule for task 1

-- With many thanks this unit is
-- Based on the layout in:
--    Comprehensive test data
--         Sam Gentle
--         27 March 2005

module BookData (PageID, ChoiceID, next, choiceCount, success) where

-- some useful types
type PageID = Int
type ChoiceID = Int

--Wrapper functions
choiceCount :: PageID -> Int
choiceCount page = (length (choice page))

next :: PageID -> ChoiceID -> PageID
next page choiceID = (choice page) !! (choiceID - 1)

--Return list of linked pages for a given PageID
choice :: PageID -> [PageID]					-- SOLN

{- Test Numbers are detrermined as follows:
   - First digit is the test level  ie 1
   - Second Digit is the test sub level ie A =1
   - Digit 3 & 4 is the test no
   - Digit 5 - 7 is the page no in the test -}


-- Level 1A Tests -- No success, loops and multi loops
choice 1101000 = []						-- []
choice 1102000 = [1101000]					-- []
choice 1103000 = [1102000,1102000]				-- []
choice 1104000 = [1103000,1103000,1103000,1103000]		-- []


-- Level 1B Tests -- Success, loops, dead ends, and Multi loops
choice 1201000 = []						-- []
choice 1202000 = [1202001]					-- []
choice 1203000 = [1203001, 1203002]				-- []
choice 1204000 = [1204001, 1204002, 1204003, 1204004]		-- []
choice 1205000 = [1205000] 					-- []
choice 1206000 = [1206000, 1206001]				-- []
choice 1207000 = [1207000, 1207000, 1207000, 12007000, 		-- []
                  1207001, 1207002, 1207003, 12007004]


-- Level 2A1 Tests -- Two levels deep, only 1 choice,
                   -- dead ends, children hace loop backs,
		   -- and muli loops
		   -- All links are too level 1A pages
choice 2101000 = [1101000]					-- []
choice 2102000 = [1102000]					-- []
choice 2103000 = [1103000]					-- []
choice 2104000 = [1104000]					-- []


-- Level 2A2 Tests -- Two levels deep, only 1 choice,
                   -- dead ends, children hace loop backs,
		   -- and muli loops
		   -- All links are too level 1B pages
choice 2105000 = [1201000]					-- [1]
choice 2106000 = [1202000]					-- [1]
choice 2107000 = [1203000]					-- [1]
choice 2108000 = [1204000]					-- [1]
choice 2109000 = [1205000]					-- [1]
choice 2110000 = [1206000]					-- [1]
choice 2111000 = [1207000]					-- [1]


-- Level 2B1 Tests -- Two levels deep, only 1 choice,
                   -- dead ends, loop backs, muli loops to parent
-- Test 1
choice 2201000 = [2201001]					-- []
choice 2201001 = [2201000]

-- Test 2
choice 2202000 = [2202001]					-- []
choice 2202001 = [2202000, 2202000, 2202000]                    --

-- Test 3
choice 2203000 = [2203001]					-- [1]
choice 2203001 = [2203000, 2203000, 2203000]


-- Level 2B2 Tests -- Two levels deep, only 1 choice,
                   -- dead ends, loop backs, muli loops to parent
-- Test 1
choice 2204000 = [2204001,2204001,2204001]			-- []
choice 2204001 = []

-- Test 2
choice 2205000 = [2205001,2205001,2205001]			-- []
choice 2205001 = [2205000,2205000,2205000]

-- Test 3
choice 2206000 = [2206001,2206001,2206001]			-- [1] or [2] or [3]
choice 2206001 = []

-- Test 4
choice 2207000 = [2207001,2207001,2207001]			-- [1] or [2] or [3]
choice 2207001 = [2207000,2207000,2207000]


-- Level 2B2 Tests
--Test 1
choice 2208000 = [2208001, 2208002]				-- []

-- Test 2
choice 2209000 = [2209001, 2209002]				-- [1]

-- Test 3							-- [2]
choice 2210000 = [2210001, 2210002]

-- Test 4
choice 2211000 = [2211000, 2211001, 2211002]			-- []
choice 2211001 = [2211000, 2211001, 2211002]
choice 2211002 = [2211000, 2211001, 2211002]

--Test 5
choice 2212000 = [2212000, 2212001, 2212002]			-- [2]
choice 2212001 = [2212000, 2212001, 2212002]
choice 2212002 = [2212000, 2212001, 2212002]

--Test 6
choice 2213000 = [2213000, 2213001, 2213002]			-- [3]
choice 2213001 = [2213000, 2213001, 2213002]
choice 2213002 = [2213000, 2213001, 2213002]

--Test 7
choice 2214000 = [2214000, 2214001, 2214002]			-- [2] or [3]
choice 2214001 = [2214000, 2214001, 2214002]
choice 2214002 = [2214000, 2214001, 2214002]

-- Level 2C1 Tests
-- 2 levels, only 3 page links, loops, multi loops
-- loop backs and multi successes
--Test 1
choice 2301000 = [2301001, 2301002, 2301003]			-- []

--Test 2
choice 2302000 = [2302001, 2302002, 2302003]			-- [2]

--Test 3
choice 2303000 = [2303001, 2303002, 2303003]			-- [1] or [3]

--Test 4
choice 2304000 = [230400, 2304001, 2304002, 2304003]		-- []
choice 2304001 = [230400, 2304001, 2304002, 2304003]
choice 2304002 = [230400, 2304001, 2304002, 2304003]
choice 2304003 = [230400, 2304001, 2304002, 2304003]

--Test 5
choice 2305000 = [230500, 2305001, 2305002, 2305003]		-- [3]
choice 2305001 = [230500, 2305001, 2305002, 2305003]
choice 2305002 = [230500, 2305001, 2305002, 2305003]
choice 2305003 = [230500, 2305001, 2305002, 2305003]

--Test 6
choice 2306000 = [230600, 2306001, 2306002, 2306003]		-- [2] or [4]
choice 2306001 = [230600, 2306001, 2306002, 2306003]
choice 2306002 = [230600, 2306001, 2306002, 2306003]
choice 2306003 = [230600, 2306001, 2306002, 2306003]


-- Level 2D1 Tests
-- 2 levels, multiple page links, loops, multi loops
-- loop backs and multi successes
--Test 1
choice 2401000 = [2401001, 2401002, 2401003, 2401004, 2401005]	-- []

--Test 2
choice 2402000 = [2402001, 2401002, 2402003, 2402004, 2402005]	-- [3]

--Test 3
choice 2403000 = [2403001, 2403002, 2403003, 2403004, 2403005]	-- [2] or [4]

--Test 4							-- [3]
choice 2404000 = [2404000, 2404001, 2404002, 2404003, 2404004, 2404005]
choice 2404001 = [2404000, 2404001, 2404002, 2404003, 2404004, 2404005]
choice 2404002 = [2404000, 2404001, 2404002, 2404003, 2404004, 2404005]
choice 2404003 = [2404000, 2404001, 2404002, 2404003, 2404004, 2404005]
choice 2404004 = [2404000, 2404001, 2404002, 2404003, 2404004, 2404005]
choice 2404005 = [2404000, 2404001, 2404002, 2404003, 2404004, 2404005]

-- Level 3A Tests
-- Deeper reaching tests, with sinle or multiple solutions
-- loop backs and multi loop backs
-- Test 1 							-- []
choice 3101000 = [3101001]
choice 3101001 = [3101002]
choice 3101002 = [3101003]
choice 3101003 = [3101004]
choice 3101004 = [3101005]

-- Test 2
choice 3102000 = [3102001]					-- [1,1,1,1,1]
choice 3102001 = [3102002]
choice 3102002 = [3102003]
choice 3102003 = [3102004]
choice 3102004 = [3102005]

-- Test 3
choice 3103000 = [3103001,3103002]				-- [1,1,1,1,1]
choice 3103001 = [3103003,3103004]
choice 3103003 = [3103005,3103006]
choice 3103005 = [3103007,3103008]
choice 3103007 = [3103009,3103010]

-- Test 4
choice 3104000 = [3104001,3104002]				-- [1,1,1,1,1] or --[1,1,1,1,2]
choice 3104001 = [3104003,3104004]
choice 3104003 = [3104005,3104006]
choice 3104005 = [3104007,3104008]
choice 3104007 = [3104009,3104010]

--Test 5
choice 3105000 = [3105001,3105002]				-- [2,1]
choice 3105001 = [3105003,3105004]
choice 3105002 = [3105005,3105006]

--Test 6
choice 3106000 = [3106001,3106002,3106003]			-- [2,3]
choice 3106001 = [3106004,3106005,3106006]
choice 3106002 = [3106007,3106008,3106009]
choice 3106003 = [3106010,3106011,3106012]

--Test 7
choice 3107000 = [3107001,3107002,3107003]			-- [2,3]
choice 3107001 = [3107004,3107005,3107006]
choice 3107002 = [3107007,3107008,3107009]
choice 3107003 = [3107010,3107011,3107012]
choice 3107004 = [3107013,3107014,3107015]
choice 3107007 = [3107016,3107017,3107018]
choice 3107010 = [3107019,3107020,3107021]

--Test 8
choice n
     |  (n == -3108000) = [-3108001,-3108002,-3108003]		-- [2,3]
     |  (n == -3108001) = [-3108004,-3108005,-3108006]
     |  (n == -3108002) = [-3108007,-3108008,-3108009]
     |  (n == -3108003) = [-3108010,-3108011,-3108012]
-- Test 9
     |  (n ==  0) = [-1,-2,-3]					-- [2,3]
     |  (n == -2) = [-4,-5,-6]
     |  (n == -4) = [-7,-8,-9]
     |  (n == -5) = [-10,-11,-12]



-- Level 4 Tests, Supper eveil tests, with multiple loops
--         multiple loop backs, large books and inifite solns.
-- Test 1				-- [1,1,1,1]
choice 4101000 = [4101001,4101002]
choice 4101001 = [4101003,4101004]
choice 4101002 = [4101000]
choice 4101003 = [4101005,4101006]
choice 4101004 = [4101002]
choice 4101005 = [4101007,4101008]
choice 4101006 = [4101004]
choice 4101007 = [4101009]
choice 4101008 = [4101006]
choice 4101009 = [4101008]

-- Test 2 				-- [1,1,2]
choice 4102000 = [4102001,4102002]
choice 4102001 = [4102003,4102004]
choice 4102002 = [4102000]
choice 4102003 = [4102005,4102006]
choice 4102004 = [4102002]
choice 4102005 = [4102007,4104008]
choice 4102006 = [4102004]
choice 4102007 = [4102009]
choice 4102008 = [4102006]
choice 4102009 = [4102008]

-- Test 3
choice 4103000 = 
[4103000,4103001,4103003,4103004,4103005,4103006,4103007,4103008]
choice 4103001 = 
[4103000,4103001,4103003,4103004,4103005,4103006,4103007,4103008]
choice 4103002 = 
[4103000,4103001,4103002,4103003,4103004,4103005,4103006,4103007,4103008]
choice 4103003 = 
[4103000,4103001,4103002,4103003,4103004,4103005,4103006,4103007,4103008]
choice 4103004 = 
[4103000,4103001,4103002,4103003,4103004,4103005,4103006,4103007,4103008]
choice 4103005 = 
[4103000,4103001,4103002,4103003,4103004,4103005,4103006,4103007,4103008]
choice 4103006 = 
[4103000,4103001,4103002,4103003,4103004,4103005,4103006,4103007,4103008]
choice 4103007 = 
[4103000,4103001,4103002,4103003,4103004,4103005,4103006,4103007,4103008]
choice 4103008 = 
[4103000,4103001,4103002,4103003,4103004,4103005,4103006,4103007,4103008]

--Test 4 -- *********** ERRROR DEPENDS ON THIS *********************
choice n
       | (n == 4104000) 		  = [4104001,4104002,4104003]
       | (n == 4104001) 		  = [4104004,4104005,4104006]
       | (n == 4104002) 		  = [4104007,4104008,4104009]
       | (n == 4104003) 		  = [4104001,4104002,4104003]
       | (n == 4104008) 		  = [4000000]
       | ((n > 4104000) && (n < 4104008)) = [(n+50)]
       | ((n > 4104008)) 		  = [(n+50)]
-- END ERROR ************************************************************

choice n = []
success :: PageID -> Bool
--Success values go here because GHCi can't handle mixing
--pattern matches
--success defaults to false

success (-6)		= True

success 1201000		= True
success 1202000		= True
success 1203000		= True
success 1204000		= True
success 1205000		= True
success 1206000		= True
success 1207000		= True

success 2203001		= True
success 2206001		= True
success 2207001		= True
success 2209001		= True
success 2210002		= True
success 2212001		= True
success 2213002		= True
success 2214001		= True
success 2214002		= True

success 2302002		= True
success 2303001		= True
success 2303003		= True
success 2305002		= True
success 2306001		= True
success 2306003		= True

success 2402003		= True
success 2403002		= True
success 2403004		= True
success 2404002		= True

success 3102005		= True
success 3103009		= True
success 3104009		= True
success 3104010		= True
success 3105005		= True
success 3106009		= True
success 3107009		= True
success 3107017		= True
success (-3108009)	= True

success 4101009		= True
success 4102006		= True
success 4103002		= True
success 4000000		= True

success _ = False

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the Glasgow-haskell-bugs mailing list