Commit 584b5ea8 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢

Rename MA to Copar in module hierarchy

parent a7c3133f
......@@ -2,19 +2,19 @@ module Main where
import Criterion.Main
import qualified MA.Coalgebra.BenchParser
import qualified MA.Functors.BenchGroupValued
import qualified MA.Parser.BenchLexer
import qualified Copar.Coalgebra.BenchParser
import qualified Copar.Functors.BenchGroupValued
import qualified Copar.Parser.BenchLexer
import qualified Data.List.BenchUtils
import qualified MA.Algorithm.BenchInitialize
import qualified Copar.Algorithm.BenchInitialize
import qualified Data.BenchRefinablePartition
main :: IO ()
main = defaultMain
[ MA.Coalgebra.BenchParser.benchmarks
, MA.Functors.BenchGroupValued.benchmarks
, MA.Parser.BenchLexer.benchmarks
[ Copar.Coalgebra.BenchParser.benchmarks
, Copar.Functors.BenchGroupValued.benchmarks
, Copar.Parser.BenchLexer.benchmarks
, Data.List.BenchUtils.benchmarks
, MA.Algorithm.BenchInitialize.benchmarks
, Copar.Algorithm.BenchInitialize.benchmarks
, Data.BenchRefinablePartition.benchmarks
]
module MA.Algorithm.BenchInitialize (benchmarks) where
module Copar.Algorithm.BenchInitialize (benchmarks) where
import Criterion
......@@ -8,14 +8,14 @@ import qualified Data.Vector as V
import Data.MorphismEncoding (Encoding, State)
import qualified Data.MorphismEncoding as Encoding
import MA.Functors.Powerset
import Copar.Functors.Powerset
import Data.Partition.Common
import MA.Algorithm.Types
import MA.Algorithm.Initialize
import Copar.Algorithm.Types
import Copar.Algorithm.Initialize
benchmarks :: Benchmark
benchmarks = bgroup "MA.Algorithm.Initialize"
benchmarks = bgroup "Copar.Algorithm.Initialize"
[ noEdges
, withEdges
]
......
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module MA.Coalgebra.BenchParser
module Copar.Coalgebra.BenchParser
( benchmarks
, benchParser
) where
......@@ -12,14 +12,14 @@ import qualified Data.List.NonEmpty as NonEmpty
import Data.Text (Text)
import Control.DeepSeq
import MA.Coalgebra.Parser
import MA.Coalgebra.RefinementTypes
import MA.FunctorExpression.Sorts
import MA.FunctorExpression.Type
import MA.FunctorExpression.Parser
import MA.Functors.Polynomial
import MA.Functors
import MA.FunctorDescription
import Copar.Coalgebra.Parser
import Copar.Coalgebra.RefinementTypes
import Copar.FunctorExpression.Sorts
import Copar.FunctorExpression.Type
import Copar.FunctorExpression.Parser
import Copar.Functors.Polynomial
import Copar.Functors
import Copar.FunctorDescription
benchmarks :: Benchmark
benchmarks = bgroup "Morphism Parser"
......
......@@ -2,7 +2,7 @@
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
module MA.Functors.BenchGroupValued (benchmarks) where
module Copar.Functors.BenchGroupValued (benchmarks) where
import Criterion
......@@ -13,13 +13,13 @@ import Text.Megaparsec
import Text.Megaparsec.Char
import Control.Monad.State.Strict
import MA.Coalgebra.Parser
import MA.Coalgebra.Parser.Internal
import MA.Coalgebra.RefinementTypes
import MA.Functors.GroupValued
import Copar.Coalgebra.Parser
import Copar.Coalgebra.Parser.Internal
import Copar.Coalgebra.RefinementTypes
import Copar.Functors.GroupValued
benchmarks :: Benchmark
benchmarks = bgroup "MA.Functors.Group"
benchmarks = bgroup "Copar.Functors.Group"
[ benchIntValued
]
......
{-# LANGUAGE FlexibleContexts #-}
module MA.Parser.BenchLexer (benchmarks) where
module Copar.Parser.BenchLexer (benchmarks) where
import Criterion
......@@ -8,11 +8,11 @@ import Text.Megaparsec
import Data.Text (Text)
import Control.DeepSeq (NFData)
import MA.Parser.Types
import qualified MA.Parser.Lexer as L
import Copar.Parser.Types
import qualified Copar.Parser.Lexer as L
benchmarks :: Benchmark
benchmarks = bgroup "MA.Parser.Lexer"
benchmarks = bgroup "Copar.Parser.Lexer"
[ benchColon
, benchDecimal
, benchFloat
......
-- Initial ma.cabal generated by cabal init. For further documentation,
-- see http://haskell.org/cabal/users-guide/
name: copar
version: 0.1.0.0
-- synopsis:
......@@ -35,38 +32,38 @@ library
, Data.OpenUnion
, Data.Float.Utils
, Data.List.Utils
, MA.RefinementInterface
, MA.Functors
, MA.FunctorDescription
, MA.Functors.Powerset
, MA.Functors.Bag
, MA.Functors.GroupValued
, MA.Functors.MonoidValued
, MA.Functors.Distribution
, MA.Functors.Polynomial
, MA.Functors.AbsorbingPolynomial
, MA.Functors.SomeFunctor
, MA.Parser
, MA.Parser.Lexer
, MA.Parser.Types
, MA.Algorithm
, MA.Algorithm.Types
, MA.Algorithm.Initialize
, MA.Algorithm.Split
, MA.FunctorExpression.Type
, MA.FunctorExpression.Parser
, MA.FunctorExpression.Pretty
, MA.FunctorExpression.Sorts
, MA.FunctorExpression.Desorting
, MA.FunctorExpression.Transform
, MA.Coalgebra.Parser
, MA.Coalgebra.Parser.Class
, MA.Coalgebra.Parser.Internal
, MA.Coalgebra.RefinementTypes
, MA.PartitionPrinter
, MA.Dot
, MA.PrettyShow
, MA.RewriteFunctors
, Copar.RefinementInterface
, Copar.Functors
, Copar.FunctorDescription
, Copar.Functors.Powerset
, Copar.Functors.Bag
, Copar.Functors.GroupValued
, Copar.Functors.MonoidValued
, Copar.Functors.Distribution
, Copar.Functors.Polynomial
, Copar.Functors.AbsorbingPolynomial
, Copar.Functors.SomeFunctor
, Copar.Parser
, Copar.Parser.Lexer
, Copar.Parser.Types
, Copar.Algorithm
, Copar.Algorithm.Types
, Copar.Algorithm.Initialize
, Copar.Algorithm.Split
, Copar.FunctorExpression.Type
, Copar.FunctorExpression.Parser
, Copar.FunctorExpression.Pretty
, Copar.FunctorExpression.Sorts
, Copar.FunctorExpression.Desorting
, Copar.FunctorExpression.Transform
, Copar.Coalgebra.Parser
, Copar.Coalgebra.Parser.Class
, Copar.Coalgebra.Parser.Internal
, Copar.Coalgebra.RefinementTypes
, Copar.PartitionPrinter
, Copar.Dot
, Copar.PrettyShow
, Copar.RewriteFunctors
default-extensions: GADTs
, StandaloneDeriving
, DeriveFunctor
......@@ -134,20 +131,20 @@ test-suite spec
, Data.OpenUnionSpec
, Data.List.UtilsSpec
, Data.Float.UtilsSpec
, MA.Functors.PowersetSpec
, MA.Functors.GroupValuedSpec
, MA.Functors.BagSpec
, MA.Functors.DistributionSpec
, MA.Functors.PolynomialSpec
, MA.Functors.MonoidValuedSpec
, MA.Functors.AbsorbingPolynomialSpec
, MA.FunctorExpression.ParserSpec
, MA.FunctorExpression.PrettySpec
, MA.FunctorExpression.SortsSpec
, MA.Coalgebra.ParserSpec
, MA.Parser.LexerSpec
, MA.Algorithm.InitializeSpec
, MA.Algorithm.SplitSpec
, Copar.Functors.PowersetSpec
, Copar.Functors.GroupValuedSpec
, Copar.Functors.BagSpec
, Copar.Functors.DistributionSpec
, Copar.Functors.PolynomialSpec
, Copar.Functors.MonoidValuedSpec
, Copar.Functors.AbsorbingPolynomialSpec
, Copar.FunctorExpression.ParserSpec
, Copar.FunctorExpression.PrettySpec
, Copar.FunctorExpression.SortsSpec
, Copar.Coalgebra.ParserSpec
, Copar.Parser.LexerSpec
, Copar.Algorithm.InitializeSpec
, Copar.Algorithm.SplitSpec
default-language: Haskell2010
default-extensions: GADTs
, StandaloneDeriving
......@@ -202,11 +199,11 @@ benchmark bench
type: exitcode-stdio-1.0
hs-source-dirs: bench
main-is: BenchMain.hs
other-modules: MA.Coalgebra.BenchParser
, MA.Functors.BenchGroupValued
, MA.Parser.BenchLexer
other-modules: Copar.Coalgebra.BenchParser
, Copar.Functors.BenchGroupValued
, Copar.Parser.BenchLexer
, Data.List.BenchUtils
, MA.Algorithm.BenchInitialize
, Copar.Algorithm.BenchInitialize
, Data.BenchRefinablePartition
default-extensions: GADTs
, StandaloneDeriving
......
module MA.Algorithm
module Copar.Algorithm
( refine
, AlgoStatistics(..)
, refineWithStats
......@@ -18,11 +18,11 @@ import qualified Data.BlockQueue as Queue
import Data.MorphismEncoding
import Data.Partition (Partition)
import qualified Data.RefinablePartition as Partition
import MA.RefinementInterface (RefinementInterface)
import MA.Coalgebra.RefinementTypes
import MA.Algorithm.Types
import MA.Algorithm.Initialize
import MA.Algorithm.Split
import Copar.RefinementInterface (RefinementInterface)
import Copar.Coalgebra.RefinementTypes
import Copar.Algorithm.Types
import Copar.Algorithm.Initialize
import Copar.Algorithm.Split
-- | Metrics about the algorithm's execution.
data AlgoStatistics = AlgoStatistics
......
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE BangPatterns #-}
module MA.Algorithm.Initialize
module Copar.Algorithm.Initialize
( initialize
) where
......@@ -15,10 +15,10 @@ import qualified Data.Vector.Mutable as VM
import Data.MorphismEncoding
import Data.RefinablePartition (Block)
import MA.RefinementInterface (RefinementInterface)
import qualified MA.RefinementInterface as RI
import MA.Algorithm.Types
import MA.Coalgebra.RefinementTypes
import Copar.RefinementInterface (RefinementInterface)
import qualified Copar.RefinementInterface as RI
import Copar.Algorithm.Types
import Copar.Coalgebra.RefinementTypes
import qualified Data.RefinablePartition as Partition
-- returns (initial queue content, algo state)
......
{-# LANGUAGE BangPatterns #-}
module MA.Algorithm.Split
module Copar.Algorithm.Split
(
-- * Main interface
SplitM
......@@ -9,7 +9,7 @@ module MA.Algorithm.Split
-- * Internal functions
-- | These are mainly exported for testing and benchmarking. Use 'split' or
-- even better: 'MA.Algorithm.refine'.
-- even better: 'Copar.Algorithm.refine'.
, collectTouchedBlocks
, updateBlock
......@@ -41,10 +41,10 @@ import qualified Data.BlockQueue as Queue
import Data.MorphismEncoding
import Data.RefinablePartition (Block)
import qualified Data.RefinablePartition as Partition
import MA.RefinementInterface (RefinementInterface)
import qualified MA.RefinementInterface as RI
import MA.Coalgebra.RefinementTypes
import MA.Algorithm.Types
import Copar.RefinementInterface (RefinementInterface)
import qualified Copar.RefinementInterface as RI
import Copar.Coalgebra.RefinementTypes
import Copar.Algorithm.Types
type SplitM s h = ReaderT (AlgoState s h, BlockQueue s) (ST s)
......
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TemplateHaskell #-}
module MA.Algorithm.Types
module Copar.Algorithm.Types
( AlgoState(..)
-- * Lenses
, toSubL
......@@ -21,7 +21,7 @@ import Lens.Micro.TH
import Data.MorphismEncoding
import Data.RefinablePartition ( RefinablePartition )
import MA.Coalgebra.RefinementTypes
import Copar.Coalgebra.RefinementTypes
data AlgoState s h = AlgoState
{ toSub :: {-# UNPACK #-} (MVector s [EdgeRef])
......
......@@ -6,11 +6,11 @@
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE ScopedTypeVariables #-}
module MA.Coalgebra.Parser
module Copar.Coalgebra.Parser
( parseMorphisms
, morphismsParser
, SymbolTable(..)
, module MA.Coalgebra.Parser.Class
, module Copar.Coalgebra.Parser.Class
) where
import Control.Monad (void, forM_)
......@@ -30,14 +30,14 @@ import Control.DeepSeq (NFData)
import Data.MorphismEncoding (Encoding, State)
import qualified Data.MorphismEncoding as Encoding
import MA.Coalgebra.Parser.Internal
import MA.Coalgebra.RefinementTypes
import MA.FunctorExpression.Sorts (Sort, Sorted(..))
import MA.FunctorExpression.Type
import MA.FunctorExpression.Desorting (Desorted, mkDesortedLabel)
import qualified MA.Parser.Lexer as L
import MA.Parser.Types
import MA.Coalgebra.Parser.Class
import Copar.Coalgebra.Parser.Internal
import Copar.Coalgebra.RefinementTypes
import Copar.FunctorExpression.Sorts (Sort, Sorted(..))
import Copar.FunctorExpression.Type
import Copar.FunctorExpression.Desorting (Desorted, mkDesortedLabel)
import qualified Copar.Parser.Lexer as L
import Copar.Parser.Types
import Copar.Coalgebra.Parser.Class
newState :: MorphParser l h1 State
newState = nextState <<%= succ
......
module MA.Coalgebra.Parser.Class
module Copar.Coalgebra.Parser.Class
( MorphParser
, ParseMorphism(..)
) where
......@@ -6,9 +6,9 @@ module MA.Coalgebra.Parser.Class
import Data.Vector (Vector)
import Control.Monad.State.Strict (StateT)
import MA.Coalgebra.Parser.Internal
import MA.Coalgebra.RefinementTypes
import MA.Parser.Types
import Copar.Coalgebra.Parser.Internal
import Copar.Coalgebra.RefinementTypes
import Copar.Parser.Types
type MorphParser l h1 = StateT (ParserState l h1) Parser
......
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE StrictData #-}
module MA.Coalgebra.Parser.Internal
module Copar.Coalgebra.Parser.Internal
( ParserState(..)
, graph
, h1Map
......@@ -17,7 +17,7 @@ import Data.Vector (Vector)
import Lens.Micro.Platform
import Data.MorphismEncoding (State, Edge)
import MA.FunctorExpression.Sorts (Sorted)
import Copar.FunctorExpression.Sorts (Sorted)
data Symbol = Defined | Undefined
deriving (Eq)
......
module MA.Coalgebra.RefinementTypes
module Copar.Coalgebra.RefinementTypes
( Label
, Weight
, H1
......
module MA.Dot
module Copar.Dot
( printDot
, writeDot
, DotConfig(..)
......@@ -17,9 +17,9 @@ import qualified Data.HashMap.Strict as HM
import Data.MorphismEncoding (Encoding)
import qualified Data.MorphismEncoding as Encoding
import MA.Coalgebra.Parser (SymbolTable(..))
import MA.FunctorExpression.Sorts (Sort, Sorted(..))
import MA.PrettyShow
import Copar.Coalgebra.Parser (SymbolTable(..))
import Copar.FunctorExpression.Sorts (Sort, Sorted(..))
import Copar.PrettyShow
import Data.Partition (Partition)
import qualified Data.Partition as Part
......
{-# LANGUAGE FlexibleContexts #-}
module MA.FunctorDescription
module Copar.FunctorDescription
( FunctorParser(..)
, FunctorDescription(..)
) where
import Data.Text (Text)
import MA.FunctorExpression.Parser
import Copar.FunctorExpression.Parser
data FunctorDescription f = FunctorDescription
{ name :: Text
......
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE CPP #-}
module MA.FunctorExpression.Desorting
module Copar.FunctorExpression.Desorting
( Desorted
, Sorted(..)
, desort
......@@ -10,11 +10,11 @@ module MA.FunctorExpression.Desorting
import Prelude hiding (init)
import MA.FunctorExpression.Type
import MA.FunctorExpression.Sorts
import MA.RefinementInterface
import MA.Coalgebra.RefinementTypes
import MA.Functors.SomeFunctor
import Copar.FunctorExpression.Type
import Copar.FunctorExpression.Sorts
import Copar.RefinementInterface
import Copar.Coalgebra.RefinementTypes
import Copar.Functors.SomeFunctor
data Desorted f a = Desorted (FunctorExpression f Sort) a
deriving (Functor, Foldable, Traversable, Show)
......
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
module MA.FunctorExpression.Parser
module Copar.FunctorExpression.Parser
( FunctorParser(..)
, prefix
, postfix
......@@ -15,9 +15,9 @@ module MA.FunctorExpression.Parser
import Text.Megaparsec
import Data.Text (Text)
import MA.FunctorExpression.Type
import qualified MA.Parser.Lexer as L
import MA.Parser.Types
import Copar.FunctorExpression.Type
import qualified Copar.Parser.Lexer as L
import Copar.Parser.Types
data FunctorParser f where
FunctorParser :: (forall a m. MonadParser m => m a -> m (Either a (f a))) -> FunctorParser f
......
module MA.FunctorExpression.Pretty
module Copar.FunctorExpression.Pretty
( PrettyPrint(..)
, pretty
) where
......@@ -7,8 +7,8 @@ import Data.Text.Lazy (Text)
import qualified Data.Text.Lazy.Builder as Build
import Data.Text.Lazy.Builder (Builder)
import MA.FunctorExpression.Parser (Precedence)
import MA.FunctorExpression.Type
import Copar.FunctorExpression.Parser (Precedence)
import Copar.FunctorExpression.Type
class PrettyPrint f where
prettyPrint :: f Builder -> Builder
......
......@@ -4,7 +4,7 @@
{-# LANGUAGE DerivingStrategies #-}
-- | Assignment and handling of "sorts" for nested functor expressions
module MA.FunctorExpression.Sorts
module Copar.FunctorExpression.Sorts
( Sort
, Sorted(..)
-- * Annotation of functor expressions
......@@ -32,9 +32,9 @@ import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import Control.DeepSeq (NFData)
import MA.FunctorExpression.Type
import MA.FunctorExpression.Pretty
import MA.PrettyShow
import Copar.FunctorExpression.Type
import Copar.FunctorExpression.Pretty
import Copar.PrettyShow
-- | Sorts are basically unique integers for every sub-expression in a functor
-- expression.
......
module MA.FunctorExpression.Transform (transform) where
module Copar.FunctorExpression.Transform (transform) where
import MA.FunctorExpression.Type
import Copar.FunctorExpression.Type
-- | Apply a bottom-up transformation all functors in the expression.
--
......
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE PolyKinds #-}
module MA.FunctorExpression.Type
module Copar.FunctorExpression.Type
( FunctorExpression(..)
) where
......
{-# LANGUAGE PolyKinds #-}
module MA.Functors
module Copar.Functors
( registeredFunctors
) where
import Prelude hiding (product)
import MA.FunctorDescription
import MA.Functors.Bag (bag)
import MA.Functors.Distribution (distribution)
import MA.Functors.GroupValued (intValued, realValued, complexValued)
import MA.Functors.Polynomial (polynomial)
import MA.Functors.Powerset (powerset)
import MA.Functors.MonoidValued (maxIntValued, maxRealValued)
import MA.Functors.SomeFunctor
import Copar.FunctorDescription
import Copar.Functors.Bag (bag)
import Copar.Functors.Distribution (distribution)
import Copar.Functors.GroupValued (intValued, realValued, complexValued)
import Copar.Functors.Polynomial (polynomial)
import Copar.Functors.Powerset (powerset)
import Copar.Functors.MonoidValued (maxIntValued, maxRealValued)
import Copar.Functors.SomeFunctor
registeredFunctors :: [[FunctorDescription SomeFunctor]]
registeredFunctors =
......
......@@ -7,7 +7,7 @@
{-# LANGUAGE BangPatterns #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module MA.Functors.AbsorbingPolynomial
module Copar.Functors.AbsorbingPolynomial
( AbsorbingPolynomial(..)
, absorbInnerFunctors
-- * Exported for easier testing
......@@ -43,14 +43,14 @@ import Lens.Micro.Platform
import Data.Text ( Text )
import Text.Megaparsec
import MA.Coalgebra.Parser
import qualified MA.Parser.Lexer as L
import MA.RefinementInterface
import MA.Functors.SomeFunctor
import MA.Coalgebra.RefinementTypes
import MA.Functors.Polynomial hiding ( PolyH1(..) )
import MA.FunctorExpression.Type
import MA.Parser.Types
import Copar.Coalgebra.Parser
import qualified Copar.Parser.Lexer as L
import Copar.RefinementInterface
import Copar.Functors.SomeFunctor
import Copar.Coalgebra.RefinementTypes
import Copar.Functors.Polynomial hiding ( PolyH1(..) )
import Copar.FunctorExpression.Type
import Copar.Parser.Types
import qualified Data.Vector.Utils as V
import Data.Primitive.SmallArray
......
......@@ -10,7 +10,7 @@
--
-- Coalgebras for this functor correspond to nondeterministic (unlabeled)
-- transition systems.
module MA.Functors.Bag
module Copar.Functors.Bag
( Bag(..)
, bag
) where
......@@ -22,13 +22,13 @@ import Text.Megaparsec
import Data.Eq.Deriving (deriveEq1)
import Text.Show.Deriving (deriveShow1)
import MA.RefinementInterface
import qualified MA.Parser.Lexer as L
import MA.FunctorExpression.Parser
import MA.Coalgebra.RefinementTypes
import MA.Coalgebra.Parser
import MA.Functors.GroupValued
import MA.FunctorDescription
import Copar.RefinementInterface
import qualified Copar.Parser.Lexer as L
import Copar.FunctorExpression.Parser
import Copar.Coalgebra.RefinementTypes
import Copar.Coalgebra.Parser
import Copar.Functors.GroupValued
import Copar.FunctorDescription
newtype Bag a = Bag a
deriving (Functor,Foldable,Traversable)
......
......@@ -3,7 +3,7 @@
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE BangPatterns #-}
module MA.Functors.Distribution
module Copar.Functors.Distribution
( distribution
, Distribution(..)
) where
......@@ -16,13 +16,13 @@ import Data.Eq.Deriving (deriveEq1)
import Text.Show.Deriving (deriveShow1)