aterm-utils-0.2.0.0: Utility functions for working with aterms as generated by Minitermite

Safe HaskellNone

ATerm.Matching

Contents

Synopsis

Types

data Binding Source

Binding type gives you back the parts of the ATerm that that match.

Constructors

BoundTerm Int

The index into the ATermTable of the matching ATerm

BoundList [Int]

The list of indexes into the ATermTable that match

BoundInt Integer

The matching Integer

BoundStr String

The matching String

BoundAppl Int

The index into the ATermTable for the ShAAppl term

Combinators

exactlyS :: MonadPlus m => String -> ATermTable -> m ()Source

Matches exactly the string s within the ATerm

exactlyI :: MonadPlus m => Integer -> ATermTable -> m ()Source

Matches exactly the integer i within the ATerm

exactlyL :: MonadPlus m => [ATermTable -> m a] -> ATermTable -> m [a]Source

Matches exactly the list xs within the ATerm

exactlyA :: MonadPlus m => String -> [ATermTable -> m a] -> ATermTable -> m [a]Source

Matches the string exactly

exactlyNamed :: MonadPlus m => String -> ATermTable -> m ()Source

Looks for an Appl with name s and any children

contains :: [ATermTable -> a] -> ATermTable -> [a]Source

Matches a partial specification against the children. The matching is maximised so that if the pattern occurs more than once it is matched each time it appears.

containsL :: [ATermTable -> a] -> ATermTable -> [a]Source

Matches a partial specification of a sub aterm List. The matching is maximised so that if the pattern occurs more than once it is matched each time it appears.

containsA :: String -> [ATermTable -> a] -> ATermTable -> [a]Source

Matches a partial specification of an Appl. The matching is maximised so that if the pattern occurs more than once it is match each time it appears.

containsChildren :: Monad m => m (ATermTable -> b) -> m Int -> ATermTable -> m bSource

bindT :: MonadPlus m => ATermTable -> m BindingSource

Matches any ATerm and generates a binding to that term

bindL :: MonadPlus m => ATermTable -> m BindingSource

Matches any list and generates a binding to that list

bindI :: MonadPlus m => ATermTable -> m BindingSource

Matches any integer and generates a binding to that integer

bindS :: MonadPlus m => ATermTable -> m BindingSource

Matches any string and generates a binding to that string Strings have the form (Appl somestring [] []). Not to be confused with matching the the string part of an Appl.

bindA :: MonadPlus m => ATermTable -> m BindingSource

Matches any Appl and generates a binding to that Appl