Commit 05bd3571 authored by dterei's avatar dterei

Fixup Hackage benchmarks.

parent 559e77a8
......@@ -277,7 +277,7 @@ wrt p h sexpr =
writeLnSEexpr h (margin p) sexpr
-- A labeled and linked preskeleton
data Algebra t p g s e c => LPreskel t p g s e c
data LPreskel t p g s e c
= LPreskel { content :: Preskel t p g s e c,
label :: Int,
parent :: Maybe (LPreskel t p g s e c) }
......@@ -298,7 +298,7 @@ wasSeen g (g', _) = g == g'
-- A seen history as a list.
newtype Algebra t p g s e c => Seen t p g s e c = Seen [IPreskel t p g s e c]
newtype Seen t p g s e c = Seen [IPreskel t p g s e c]
-- Create a singleton seen history
hist :: Algebra t p g s e c => IPreskel t p g s e c -> Seen t p g s e c
......@@ -326,7 +326,7 @@ merge (Seen xs) (Seen ys) = Seen (xs ++ ys)
-- Contains the result of applying the cohort reduction rule. The
-- last position is used to hold the reverse of the labels of the
-- seen children
data Algebra t p g s e c => Reduct t p g s e c =
data Reduct t p g s e c =
Reduct !(LPreskel t p g s e c) !Int !Bool ![Preskel t p g s e c] ![Int]
seqList :: [a] -> [a]
......
......@@ -35,7 +35,7 @@ addVars ts t = foldVars (flip adjoin) ts t
-- Message events and traces
data Algebra t p g s e c => Event t p g s e c
data Event t p g s e c
= In !t -- Inbound message
| Out !t -- Outbound messasge
deriving (Show, Eq, Ord)
......@@ -149,7 +149,7 @@ comb f g x =
S.fold h S.empty (g x)
where h a s = S.union (f a) s
data Algebra t p g s e c => Role t p g s e c = Role
data Role t p g s e c = Role
{ rname :: !String,
rvars :: ![t], -- Set of role variables
-- Events in causal order
......@@ -207,7 +207,7 @@ mkRole name vars trace non unique comment =
-- Protocols
data Algebra t p g s e c => Prot t p g s e c
data Prot t p g s e c
= Prot { pname :: !String, -- Name of the protocol
alg :: !String, -- Name of the algebra
pgen :: !g, -- Initial variable generator
......@@ -221,3 +221,4 @@ mkProt :: Algebra t p g s e c => String -> String ->
mkProt name alg gen roles comment =
Prot { pname = name, alg = alg, pgen = gen,
roles = roles, pcomment = comment }
......@@ -83,7 +83,7 @@ useCheckVars = False
type Sid = Int -- Strand Identifier
data Algebra t p g s e c => Instance t p g s e c = Instance
data Instance t p g s e c = Instance
{ role :: Role t p g s e c, -- Role from which this was
-- instantiated
......@@ -316,7 +316,7 @@ graphClose orderings =
-- Preskeltons
data Algebra t p g s e c => Preskel t p g s e c = Preskel
data Preskel t p g s e c = Preskel
{ gen :: !g,
protocol :: Prot t p g s e c,
insts :: ![Instance t p g s e c],
......@@ -356,13 +356,13 @@ type Edge t p g s e c
-- Data structure for tracking the causes for the creation of
-- preskeletons.
data Algebra t p g s e c => Cause t p g s e c
data Cause t p g s e c
= Cause Direction Node t (Set t)
deriving Show
data Direction = Encryption | Nonce deriving Show
data Algebra t p g s e c => Method t p g s e c
data Method t p g s e c
= Deleted Node
| Weakened Pair
| Separated t
......@@ -372,7 +372,7 @@ data Algebra t p g s e c => Method t p g s e c
-- the loader, a contraction, a regular augmentation, a listener
-- augmentation, or a mininization. The augmentation includes a role
-- name and instance height.
data Algebra t p g s e c => Operation t p g s e c
data Operation t p g s e c
= New
| Contracted s (Cause t p g s e c)
| Displaced Int Int String Int (Cause t p g s e c)
......@@ -620,7 +620,7 @@ roleOrigCheck k =
-- frequently, so an specialized data structure is used. The gist of
-- a skeleton is all that is needed for the test for equivalence.
data Algebra t p g s e c => Gist t p g s e c = Gist
data Gist t p g s e c = Gist
{ ggen :: g,
gtraces :: [(Int, Trace t p g s e c)],
gorderings :: [Pair],
......
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Codec.Encryption.AES
......
......@@ -19,7 +19,7 @@ module Data.Graph.Inductive.Internal.FiniteMap(
import Data.Maybe (isJust)
data Ord a => FiniteMap a b =
data FiniteMap a b =
Empty | Node Int (FiniteMap a b) (a,b) (FiniteMap a b)
deriving (Eq)
......
......@@ -29,27 +29,10 @@ module Data.Generics (
module Data.Generics.Text, -- generic read and show
module Data.Generics.Twins, -- twin traversal, e.g., generic eq
module Data.Generics.Builders, -- term builders
#ifdef __GLASGOW_HASKELL__
#ifndef __HADDOCK__
-- Data types for the sum-of-products type encoding;
-- included for backwards compatibility; maybe obsolete.
(:*:)(..), (:+:)(..), Unit(..)
#endif
#endif
) where
------------------------------------------------------------------------------
#ifdef __GLASGOW_HASKELL__
#ifndef __HADDOCK__
-- Data types for the sum-of-products type encoding;
-- included for backwards compatibility; maybe obsolete.
import GHC.Base ( (:*:)(..), (:+:)(..), Unit(..) )
#endif
#endif
import Data.Data
import Data.Generics.Instances ()
import Data.Generics.Aliases
......
{-# OPTIONS_GHC -cpp #-}
{-# LANGUAGE CPP, StandaloneDeriving #-}
-----------------------------------------------------------------------------
-- |
......
......@@ -23,7 +23,7 @@ encodeUnicode enc s =
where
translate cod cbuf
| i < w = do bbuf <- newByteBuffer 128 WriteBuffer
(cbuf,bbuf) <- cod cbuf bbuf
(_, cbuf,bbuf) <- cod cbuf bbuf
if isEmptyBuffer bbuf
then ioe_invalidCharacter
else do let bs = PS (bufRaw bbuf) (bufL bbuf) (bufR bbuf-bufL bbuf)
......@@ -46,7 +46,7 @@ decodeUnicode enc (PS fptr l len) =
return s
where
translate cod bbuf cbuf
| i < w = do (bbuf,cbuf) <- cod bbuf cbuf
| i < w = do (_, bbuf,cbuf) <- cod bbuf cbuf
if isEmptyBuffer cbuf
then ioe_invalidCharacter
else unpack cod bbuf cbuf
......
......@@ -23,8 +23,8 @@ import PGF.Type
import Data.Char
import Data.Maybe
import Data.List as List
import Data.Map as Map hiding (showTree)
import Data.List as List hiding (foldl', foldl, foldr)
import Data.Map as Map hiding (showTree, foldl, foldr)
import Control.Monad
import qualified Text.PrettyPrint as PP
import qualified Text.ParserCombinators.ReadP as RP
......
......@@ -174,7 +174,7 @@ followed by a special identifier.
This has to match for @}@ that are {\em not} in strings. The code
here is a bit tricky, but should work in most cases.
> lexReadCode :: Num a
> lexReadCode :: (Num a, Eq a)
> => String -> a -> String -> (Token -> P b) -> Int
> -> ParseResult b
> lexReadCode s n c = case s of
......
......@@ -16,8 +16,8 @@ where
import GA
import Control.Monad.State.Strict
import List
import Random
import Data.List
import System.Random
-- |An Artificial Neural Network
type ANN = [Layer]
......
......@@ -8,8 +8,8 @@ module Chromosome.Bits (mutateBits,
config)
where
import List
import Random
import Data.List
import System.Random
import Control.Monad.State.Strict
import GA
......@@ -50,4 +50,4 @@ mutateBit r b = do
bits2int :: [Bool] -> Int
bits2int bs =
sum [ x | (x, b) <- zip _2pwrs bs, b ]
where _2pwrs = 1 : map (*2) _2pwrs
\ No newline at end of file
where _2pwrs = 1 : map (*2) _2pwrs
......@@ -10,10 +10,10 @@ module Chromosome.GP (Op (..),
config)
where
import Array
import Data.Array
import qualified GA
import Control.Monad.State.Strict
import List
import Data.List
-- The config for the GP chromosome model. mutate, cross, and fitness must be defined.
config = GA.ChromosomeConfig {
......
......@@ -16,8 +16,8 @@ module GA (Config (..),
isDone)
where
import Maybe
import Random
import Data.Maybe
import System.Random
import Control.Monad.State.Strict
type GAState c p = State (Config c p)
......
(* (- (+ x x) 1) x)
(* 1 (+ 1 (+ (* x (+ x x)) (* x x))))
(- 1 (- (- 1 1) (* x (+ (+ x x) x))))
......@@ -5,5 +5,5 @@ SRCS = GA.hs \
Chromosome/GP.hs \
examples/GPTest.hs
PROG_ARGS += 1000
HC_OPTS += -i. -package array -package base -package haskell98 -package mtl
HC_OPTS += -i. -package array -package base -package mtl -package random
include $(TOP)/mk/target.mk
......@@ -8,7 +8,7 @@ import GA
import Data.Array.Diff
import Control.Monad
import Control.Monad.State.Strict
import List
import Data.List
-- |The type used to represent population arrays; is a diff array.
type PArray c = DiffArray Int c
......@@ -98,4 +98,4 @@ afoldl p seed arr =
foldl p seed $ elems arr
afoldl1 p arr =
foldl1 p $ elems arr
\ No newline at end of file
foldl1 p $ elems arr
......@@ -9,8 +9,8 @@ import GA
import Control.Monad
import Control.Monad.State.Strict
import Random
import List
import System.Random
import Data.List
-- |Config for use of lists as the population model. Lists are deprecated in favor of arrays.
config :: PopulationConfig c [c]
......@@ -78,4 +78,4 @@ selectDistribution xs =
test <- gaRand (0,1.0)
if test < p / (1 - acc)
then return a
else select (p + acc) xs
\ No newline at end of file
else select (p + acc) xs
import GA
import qualified Population.List as L
import Random
import System.Random
import Control.Monad.State.Strict
import List
import Data.List
import qualified Chromosome.ANN as ANN
import Control.Monad
......
import GA
import qualified Population.List as L
import Random
import System.Random
import Control.Monad.State.Strict
import List
import Data.List
import qualified Chromosome.Bits as B
import Control.Monad
......
import GA
import qualified Population.List as L
import Random
import System.Random
import Control.Monad.State.Strict
import List
import Data.List
import qualified Chromosome.GP as GP
import Control.Monad
import System.Environment
......
......@@ -4,5 +4,5 @@ SRCS = src/Pos.hs \
src/Parse.hs \
java-parser/JavaMonad.hs
PROG_ARGS += Scar.java SPEED.java Blowfish.java CAST5.java DES.java TestRijndael.java
HC_OPTS += -isrc -ijava-parser -package base -package haskell98
HC_OPTS += -isrc -ijava-parser -package base
include $(TOP)/mk/target.mk
module Main where
import Char
import List
import Data.Char
import Data.List
import Pos
import Parse
......
module Parse where
import Char
import List
import Data.Char
import Data.List
import Pos
......
......@@ -40,7 +40,7 @@ newtype Str = MkStr String
instance Show Str where
show (MkStr s) = s
ranges :: Integral a => a -> a -> Str
ranges :: (Show a, Integral a) => a -> a -> Str
ranges k n = MkStr (show n' ++ " -- " ++ show (n'+k-1))
where
n' = k * (n `div` k)
......
......@@ -30,7 +30,7 @@ SRCS = parsec-2/Text/ParserCombinators/Parsec/Pos.hs \
mersenne-random-pure64/cbits/mt19937-64-unsafe.c \
mersenne-random-pure64/cbits/mt19937-64.c
PROG_ARGS += oregonator.sgl
HC_OPTS += -isrc -igenerated -iparsec-2 -imersenne-random-pure64 -package base -package containers -package haskell98 -package mtl -package old-time -package random -XExistentialQuantification -XPolymorphicComponents
HC_OPTS += -isrc -igenerated -iparsec-2 -imersenne-random-pure64 -package base -package containers -package mtl -package old-time -package random -XExistentialQuantification -XPolymorphicComponents
CC_OPTS += $(CONF_CC_OPTS_STAGE2) -Imersenne-random-pure64/include
CLEAN_FILES += oregonator_output.dat mersenne-random-pure64/System/Random/Mersenne/Pure64/Base.hs mersenne-random-pure64/System/Random/Mersenne/Pure64/Base_hsc.c
include $(TOP)/mk/target.mk
This is simgi v0.3 (c) 2009-2010 Markus Dittrich
-------- Simulation parameters ----------
rng seed : 1
max time : 15.0 s
system volume : nil
data output frequency : 50000
log output frequency : 50000
output filename : oregonator_output.dat
-----------------------------------------
starting simulation ...
iteration: 1 --> time: 0.00000 s
iteration: 50000 --> time: 0.23476 s
iteration: 100000 --> time: 0.68849 s
iteration: 150000 --> time: 1.32624 s
iteration: 200000 --> time: 1.41014 s
iteration: 250000 --> time: 2.07497 s
iteration: 300000 --> time: 2.36863 s
iteration: 350000 --> time: 2.79856 s
iteration: 400000 --> time: 3.45897 s
iteration: 450000 --> time: 3.53978 s
iteration: 500000 --> time: 4.21014 s
iteration: 550000 --> time: 4.73332 s
iteration: 600000 --> time: 4.90471 s
iteration: 650000 --> time: 5.56812 s
iteration: 700000 --> time: 5.66185 s
iteration: 750000 --> time: 6.33115 s
iteration: 800000 --> time: 6.91990 s
iteration: 850000 --> time: 7.03911 s
iteration: 900000 --> time: 7.66548 s
iteration: 950000 --> time: 7.80602 s
iteration: 1000000 --> time: 8.37098 s
iteration: 1050000 --> time: 8.99979 s
iteration: 1100000 --> time: 9.09234 s
iteration: 1150000 --> time: 9.75003 s
iteration: 1200000 --> time: 9.96604 s
iteration: 1250000 --> time: 10.46699 s
iteration: 1300000 --> time: 11.13416 s
iteration: 1350000 --> time: 11.22317 s
iteration: 1400000 --> time: 11.88750 s
iteration: 1450000 --> time: 12.42168 s
iteration: 1500000 --> time: 12.60482 s
iteration: 1550000 --> time: 13.30166 s
iteration: 1600000 --> time: 13.41285 s
iteration: 1650000 --> time: 14.00190 s
iteration: 1700000 --> time: 14.64748 s
iteration: 1750000 --> time: 14.74625 s
Done
......@@ -29,7 +29,8 @@ module CommandLine ( process_commandline
-- imports
import Data.Word
import Prelude
import System
import System.IO
import System.Exit
import System.Console.GetOpt
-- local imports
......
......@@ -355,8 +355,6 @@ create_initial_state state@(ModelState { seed = theSeed}) out =
-- | routine for writing basic accounting info to stdout
write_info :: Output -> IO ()
write_info (Output {iteration = it, time = t}) =
putStrLn $ printf "iteration: %-10d --> time: %6.5g s" it t
write_info (Output {iteration = it, time = t}) = it `seq` t `seq` return ()
-- putStrLn $ printf "iteration: %-10d --> time: %6.5g s" it t
......@@ -77,10 +77,13 @@ main =
>>= \handle ->
-- print initial startup info
startup_message initialState
-- startup_message initialState
-- ready to run the simulation
>> gillespie_driver handle totalTime dataDumpIter
gillespie_driver handle totalTime dataDumpIter
initialState
>> putStrLn "Done"
>> close_handle handle
......@@ -23,7 +23,7 @@ module Cluster (Cluster,cluster_single,cluster_simple,cluster_all
import Indexed
import EST(EST(..),mkshowlist,mkshowlist',label)
import Pairs(SMPair, Pair(..),direction,elim_bs)
import Data.Set hiding (insert)
import Data.Set hiding (insert,foldl')
import qualified Data.Set
import Data.List(intersperse,sortBy)
import qualified Data.List as L
......
......@@ -32,7 +32,7 @@ import System.Cmd (system)
import System.Directory(doesFileExist,renameFile)
import System.Posix.Files(getFileStatus,fileSize)
import Data.List(sort,sortBy,partition,groupBy)
import Data.Map hiding (map,insert,(!),filter,null,partition,adjust)
import Data.Map hiding (map,insert,(!),filter,null,partition,adjust,foldl')
import System.IO(hPutStrLn,stderr,openFile,IOMode(ReadMode),hIsEOF)
import Control.Monad(mapM,when)
import System.IO.Unsafe(unsafePerformIO,unsafeInterleaveIO)
......
......@@ -4,7 +4,7 @@ module Stats (UniVar(..),uniVar
,Quantiles(..),quantiles,histogram,display) where
import Data.List (sort,sortBy,group)
import Data.Map hiding (adjust, map)
import Data.Map hiding (adjust, map, foldl)
class Statistic s where
samples :: s -> Int
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment