moltapContentsIndex
Moltap.Base.Agents
Portabilityportable
Stabilityexperimental
Maintainertwanvl@gmail.com
Contents
Agents
Agent sets
Construction
Basic properties
Set operations
Matching agent sets
Axioms for agents
Description
Agents, sets of agents and operations on these sets.
Synopsis
type Agent = String
data Agents
= Agents [Agent]
| ExcludeAgents [Agent]
listAgents :: [Agent] -> Agents
allAgents :: Agents
isNoAgents :: Agents -> Bool
isAllAgents :: Agents -> Bool
showAgents :: String -> Agents -> ShowS
unionAgents :: Agents -> Agents -> Agents
intersectAgents :: Agents -> Agents -> (Agents, Agents)
splitMatchingAgents :: Agents -> [(Agents, b)] -> [(Agents, [b])]
forMatchingAgents :: MonadPlus m => Agents -> [(Agents, c)] -> (Agents -> [c] -> m b) -> m b
data AxiomSet = AxiomSet {
axD, axT, ax4, ax5 :: Bool
}
axTD :: AxiomSet -> Bool
systemK :: AxiomSet
systemS4 :: AxiomSet
systemS5 :: AxiomSet
data Axioms
axioms :: AxiomSet -> Axioms
hasAxiom :: (AxiomSet -> Bool) -> Agents -> Axioms -> Bool
Agents
type Agent = String
An agent is represented as a string
Agent sets
data Agents
A set of agents
Constructors
Agents [Agent]include these agents (sorted list)
ExcludeAgents [Agent]exclude these agents, include all others
show/hide Instances
Construction
listAgents :: [Agent] -> Agents
Construct an agent set from a list of agents to include
allAgents :: Agents
The set of all agents
Basic properties
isNoAgents :: Agents -> Bool
Is a set of agents empty?
isAllAgents :: Agents -> Bool
Is a set of agents full?
showAgents :: String -> Agents -> ShowS
Set operations
unionAgents :: Agents -> Agents -> Agents
Give the union of two sets of agents
intersectAgents :: Agents -> Agents -> (Agents, Agents)

Give the intersection and difference of two sets of agents

 intersectAgents a b = (agents in both a and b, agents only in a)
Matching agent sets
splitMatchingAgents :: Agents -> [(Agents, b)] -> [(Agents, [b])]

Collect b values for matching agent sets, split the agent set a if necessary.

For example:

 splitMatchingAgents {w,x,y,z} [({w,x,y},A), ({y,z,v},B), ({u},C)]
  == [({w,x},[A]), ({y},[A,B]), ({z},[])]
forMatchingAgents
:: MonadPlus m
=> Agents
-> [(Agents, c)]Actions to match
-> (Agents -> [c] -> m b)Action to perform for each subset
-> m b
Collect c values for matching agent sets. Perform an action for each resuling subset.
Axioms for agents
data AxiomSet
Additional axioms that can hold
Constructors
AxiomSet
axD, axT, ax4, ax5 :: Bool
show/hide Instances
axTD :: AxiomSet -> Bool
systemK :: AxiomSet
Well know axiom systems
systemS4 :: AxiomSet
systemS5 :: AxiomSet
data Axioms
show/hide Instances
axioms :: AxiomSet -> Axioms
hasAxiom :: (AxiomSet -> Bool) -> Agents -> Axioms -> Bool
Does an axiom hold for an agent?
Produced by Haddock version 0.8