Portability | unportable |
---|---|
Stability | unstable |
Maintainer | Martin Avanzini <martin.avanzini@uibk.ac.at> |
Safe Haskell | Safe-Infered |
This module gives the infrastructure for standard processors.
- data TheProcessor a = TheProcessor {
- processor :: a
- processorArgs :: Domains (ArgumentsOf a)
- class ComplexityProof (ProofOf proc) => Processor proc where
- type ArgumentsOf proc
- type ProofOf proc
- name :: proc -> String
- description :: proc -> [String]
- arguments :: proc -> ArgumentsOf proc
- instanceName :: TheProcessor proc -> String
- solve :: SolverM m => TheProcessor proc -> Problem -> m (ProofOf proc)
- solvePartial :: SolverM m => TheProcessor proc -> SelectorExpression -> Problem -> m (PartialProof (ProofOf proc))
- data StdProcessor a = StdProcessor a
- type ProcessorInstance a = InstanceOf (StdProcessor a)
- withArgs :: Processor a => StdProcessor a -> Domains (ArgumentsOf a) -> ProcessorInstance a
- modifyArguments :: Processor a => (Domains (ArgumentsOf a) -> Domains (ArgumentsOf a)) -> ProcessorInstance a -> ProcessorInstance a
- apply :: (SolverM m, Processor p, Arguments (ArgumentsOf p)) => StdProcessor p -> Domains (ArgumentsOf p) -> Problem -> m (Proof (StdProcessor p))
- mkParseProcessor :: ParsableArguments a => String -> a -> ProcessorParser (Domains a)
- theProcessorFromInstance :: ProcessorInstance p -> TheProcessor p
Defining new Processors
In order to define a new standard processor,
define an instance of Processor
.
data TheProcessor a
This datatype defines a specific instance of a standard processor
TheProcessor | |
|
class ComplexityProof (ProofOf proc) => Processor proc where
type ArgumentsOf proc
Arguments of the processor, cf. Tct.Processor.Args.
type ProofOf proc
Proof type of the transformation.
Unique name.
description :: proc -> [String]
Description of the processor.
arguments :: proc -> ArgumentsOf proc
Description of the arguments, cf. module Tct.Processor.Args.
instanceName :: TheProcessor proc -> String
Optional name specific to instances. Defaults to the processor name.
solve :: SolverM m => TheProcessor proc -> Problem -> m (ProofOf proc)
The solve method. Given an instance and a problem, it constructs a proof object.
solvePartial :: SolverM m => TheProcessor proc -> SelectorExpression -> Problem -> m (PartialProof (ProofOf proc))
Similar to solve
, but constructs a PartialProof
. At least all rules
in the additional paramter of type SelectorExpression
should be removed. Per default,
this method returns PartialInapplicable
.
Processor Open | |
Processor EmptyRules | |
Processor Success | |
Processor Fail | |
Processor PopStar | |
Processor Mpo | |
Processor NaturalMI | |
Processor ArcticMI | |
Processor NaturalPI | |
Processor Bounds | |
Processor Predicate | |
Processor p => Processor (Timeout p) | |
Processor p => Processor (OneOf p) | |
Processor p => Processor (Timed p) | |
(Transformer t, Processor sub) => Processor (Transformation t sub) | |
(Transformer g, Processor t, Processor e) => Processor (IteProgress g t e) | |
(Processor g, Processor t, Processor e) => Processor (Ite g t e) |
data StdProcessor a
type ProcessorInstance a = InstanceOf (StdProcessor a)
withArgs :: Processor a => StdProcessor a -> Domains (ArgumentsOf a) -> ProcessorInstance a
Constructor for instances.
modifyArguments :: Processor a => (Domains (ArgumentsOf a) -> Domains (ArgumentsOf a)) -> ProcessorInstance a -> ProcessorInstance a
Modifyer for arguments of instances.
apply :: (SolverM m, Processor p, Arguments (ArgumentsOf p)) => StdProcessor p -> Domains (ArgumentsOf p) -> Problem -> m (Proof (StdProcessor p))
mkParseProcessor :: ParsableArguments a => String -> a -> ProcessorParser (Domains a)