Term.VTerm

tamarin-prover-term-1.2.2: Term manipulation library for the tamarin prover.

Copyright | (c) 2010-2012 Benedikt Schmidt & Simon Meier
License | GPL v3 (see LICENSE)
Maintainer | Benedikt Schmidt <beschmi@gmail.com>
Safe Haskell | None
Language | Haskell98

Term.VTerm

Contents

- Terms with constants and variables
  - Destructors
  - Pretty printing and query functions.
  - Smart constructors
  - Destructors and classifiers
- AC, C, and NonAC funcion symbols
  - Signatures
  - concrete symbols strings
  - Function symbols
  - concrete signatures
- Terms
- Diff Type
  - Standard function
  - Smart constructors

Description

Terms with variables and constants.

Synopsis

- data Lit c v
  - = Con c
  - | Var v
- type VTerm c v = Term (Lit c v)
- varTerm :: v -> VTerm c v
- constTerm :: c -> VTerm c v
- varsVTerm :: Ord v => VTerm c v -> [v]
- occursVTerm :: Eq v => v -> VTerm c v -> Bool
- constsVTerm :: IsConst c => VTerm c v -> [c]
- isVar :: VTerm c v -> Bool
- termVar :: VTerm c v -> Maybe v
- termVar' :: (Show c, Show v) => VTerm c v -> v
- class (Ord v, Eq v, Show v) => IsVar v
- class (Ord c, Eq c, Show c, Data c) => IsConst c
- prettyTerm :: (Document d, Show l) => (l -> d) -> Term l -> d
- showFunSymName :: FunSym -> String
- lits :: Term a -> [a]
- fAppOne :: Term a
- fAppDiff :: (Term a, Term a) -> Term a
- fAppExp :: (Term a, Term a) -> Term a
- fAppInv :: Term a -> Term a
- fAppPMult :: (Term a, Term a) -> Term a
- fAppEMap :: Ord a => (Term a, Term a) -> Term a
- fAppPair :: (Term a, Term a) -> Term a
- fAppFst :: Term a -> Term a
- fAppSnd :: Term a -> Term a
- isPair :: Show a => Term a -> Bool
- isDiff :: Show a => Term a -> Bool
- isInverse :: Show a => Term a -> Bool
- isProduct :: Show a => Term a -> Bool
- isUnion :: Show a => Term a -> Bool
- isEMap :: Show a => Term a -> Bool
- isNullaryPublicFunction :: Term a -> Bool
- isPrivateFunction :: Term a -> Bool
- getLeftTerm :: Term a -> Term a
- getRightTerm :: Term a -> Term a
- data FunSym
  - = NoEq NoEqSym
  - | AC ACSym
  - | C CSym
  - | List
- data ACSym
  - = Union
  - | Mult
- data CSym = EMap
- data Privacy
  - = Private
  - | Public
- type NoEqSym = (ByteString, (Int, Privacy))
- type FunSig = Set FunSym
- type NoEqFunSig = Set NoEqSym
- diffSymString :: ByteString
- expSymString :: ByteString
- invSymString :: ByteString
- pmultSymString :: ByteString
- emapSymString :: ByteString
- unionSymString :: ByteString
- diffSym :: NoEqSym
- expSym :: NoEqSym
- pmultSym :: NoEqSym
- dhFunSig :: FunSig
- bpFunSig :: FunSig
- msetFunSig :: FunSig
- pairFunSig :: NoEqFunSig
- dhReducibleFunSig :: FunSig
- bpReducibleFunSig :: FunSig
- implicitFunSig :: FunSig
- class Sized a where
- data Term a
  - = LIT a
  - | FAPP FunSym [Term a]
- data TermView a
  - = Lit a
  - | FApp FunSym [Term a]
- viewTerm :: Term a -> TermView a
- data TermView2 a
  - = FExp (Term a) (Term a)
  - | FInv (Term a)
  - | FMult [Term a]
  - | One
  - | FPMult (Term a) (Term a)
  - | FEMap (Term a) (Term a)
  - | FUnion [Term a]
  - | FPair (Term a) (Term a)
  - | FDiff (Term a) (Term a)
  - | FAppNoEq NoEqSym [Term a]
  - | FAppC CSym [Term a]
  - | FList [Term a]
  - | Lit2 a
- viewTerm2 :: Show a => Term a -> TermView2 a
- termViewToTerm :: TermView a -> Term a
- data DiffType
  - = DiffLeft
  - | DiffRight
  - | DiffNone
  - | DiffBoth
- traverseTerm :: (Applicative f, Ord a, Ord b) => (a -> f b) -> Term a -> f (Term b)
- fmapTerm :: Ord b => (a -> b) -> Term a -> Term b
- bindTerm :: Ord b => Term a -> (a -> Term b) -> Term b
- lit :: a -> Term a
- fApp :: Ord a => FunSym -> [Term a] -> Term a
- fAppAC :: Ord a => ACSym -> [Term a] -> Term a
- fAppC :: Ord a => CSym -> [Term a] -> Term a
- fAppNoEq :: NoEqSym -> [Term a] -> Term a
- fAppList :: [Term a] -> Term a
- unsafefApp :: FunSym -> [Term a] -> Term a

# Terms with constants and variables

data Lit c v #

A Lit is either a constant or a variable. (`Const` is taken by Control.Applicative)

Constructors

Con c |
Var v |

Instances

Apply BLTerm # |
Methods apply :: LNSubst -> BLTerm -> BLTerm #
Apply LNTerm # |
Methods apply :: LNSubst -> LNTerm -> LNTerm #
Monad (Lit c) # | Monad instance in the variable
Methods (>>=) :: Lit c a -> (a -> Lit c b) -> Lit c b # (>>) :: Lit c a -> Lit c b -> Lit c b # return :: a -> Lit c a # fail :: String -> Lit c a #
Functor (Lit c) # | Functor instance in the variable.
Methods fmap :: (a -> b) -> Lit c a -> Lit c b # (<$) :: a -> Lit c b -> Lit c a #
Applicative (Lit c) # | Applicative instance in the variable.
Methods pure :: a -> Lit c a # (<*>) :: Lit c (a -> b) -> Lit c a -> Lit c b # (*>) :: Lit c a -> Lit c b -> Lit c b # (<*) :: Lit c a -> Lit c b -> Lit c a #
Foldable (Lit c) # | Foldable instance in the variable.
Methods fold :: Monoid m => Lit c m -> m # foldMap :: Monoid m => (a -> m) -> Lit c a -> m # foldr :: (a -> b -> b) -> b -> Lit c a -> b # foldr' :: (a -> b -> b) -> b -> Lit c a -> b # foldl :: (b -> a -> b) -> b -> Lit c a -> b # foldl' :: (b -> a -> b) -> b -> Lit c a -> b # foldr1 :: (a -> a -> a) -> Lit c a -> a # foldl1 :: (a -> a -> a) -> Lit c a -> a # toList :: Lit c a -> [a] # null :: Lit c a -> Bool # length :: Lit c a -> Int # elem :: Eq a => a -> Lit c a -> Bool # maximum :: Ord a => Lit c a -> a # minimum :: Ord a => Lit c a -> a # sum :: Num a => Lit c a -> a # product :: Num a => Lit c a -> a #
Traversable (Lit c) # | Traversable instance in the variable.
Methods traverse :: Applicative f => (a -> f b) -> Lit c a -> f (Lit c b) # sequenceA :: Applicative f => Lit c (f a) -> f (Lit c a) # mapM :: Monad m => (a -> m b) -> Lit c a -> m (Lit c b) # sequence :: Monad m => Lit c (m a) -> m (Lit c a) #
(Eq v, Eq c) => Eq (Lit c v) # |
Methods (==) :: Lit c v -> Lit c v -> Bool # (/=) :: Lit c v -> Lit c v -> Bool #
(Data v, Data c) => Data (Lit c v) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Lit c v -> c (Lit c v) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Lit c v) # toConstr :: Lit c v -> Constr # dataTypeOf :: Lit c v -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Lit c v)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Lit c v)) # gmapT :: (forall b. Data b => b -> b) -> Lit c v -> Lit c v # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Lit c v -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Lit c v -> r # gmapQ :: (forall d. Data d => d -> u) -> Lit c v -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Lit c v -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Lit c v -> m (Lit c v) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Lit c v -> m (Lit c v) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Lit c v -> m (Lit c v) #
(Ord v, Ord c) => Ord (Lit c v) # |
Methods compare :: Lit c v -> Lit c v -> Ordering # (<) :: Lit c v -> Lit c v -> Bool # (<=) :: Lit c v -> Lit c v -> Bool # (>) :: Lit c v -> Lit c v -> Bool # (>=) :: Lit c v -> Lit c v -> Bool # max :: Lit c v -> Lit c v -> Lit c v # min :: Lit c v -> Lit c v -> Lit c v #
(Show v, Show c) => Show (Lit c v) # |
Methods showsPrec :: Int -> Lit c v -> ShowS # show :: Lit c v -> String # showList :: [Lit c v] -> ShowS #
Generic (Lit c v) # |
Associated Types type Rep (Lit c v) :: * -> * # Methods from :: Lit c v -> Rep (Lit c v) x # to :: Rep (Lit c v) x -> Lit c v #
(Binary v, Binary c) => Binary (Lit c v) # |
Methods put :: Lit c v -> Put # get :: Get (Lit c v) # putList :: [Lit c v] -> Put #
(NFData v, NFData c) => NFData (Lit c v) # |
Methods rnf :: Lit c v -> () #
Sized (Lit c v) # |
Methods size :: Lit c v -> Int #
HasFrees v => HasFrees (Lit c v) # |
Methods foldFrees :: Monoid m => (LVar -> m) -> Lit c v -> m # foldFreesOcc :: Monoid m => (Occurence -> LVar -> m) -> Occurence -> Lit c v -> m # mapFrees :: Applicative f => MonotoneFunction f -> Lit c v -> f (Lit c v) #
type Rep (Lit c v) # |
type Rep (Lit c v) = D1 (MetaData "Lit" "Term.VTerm" "tamarin-prover-term-1.2.2-AAX5pCkSPqj7TesI35mR1r" False) ((:+:) (C1 (MetaCons "Con" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 c))) (C1 (MetaCons "Var" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 v))))

type VTerm c v = Term (Lit c v) #

A VTerm is a term with constants and variables

varTerm :: v -> VTerm c v #

`varTerm v` is the `VTerm` with the variable `v`.

constTerm :: c -> VTerm c v #

`constTerm c` is the `VTerm` with the const `c`.

varsVTerm :: Ord v => VTerm c v -> [v] #

`vars t` returns a duplicate-free list of variables that occur in `t`.

occursVTerm :: Eq v => v -> VTerm c v -> Bool #

`occurs v t` returns `True` if `v` occurs in `t`

constsVTerm :: IsConst c => VTerm c v -> [c] #

`constsVTerm t` returns a duplicate-free list of constants that occur in `t`.

isVar :: VTerm c v -> Bool #

`isVar t returns` True`if` t@ is a variable.

## Destructors

termVar :: VTerm c v -> Maybe v #

Extract just the variable from a term that may be variable.

termVar' :: (Show c, Show v) => VTerm c v -> v #

Extract just the variable from a term that must be variable, throw an error if this fails.

class (Ord v, Eq v, Show v) => IsVar v #

collect class constraints for variables

Instances

IsVar LVar # |

class (Ord c, Eq c, Show c, Data c) => IsConst c #

collect class constraints for constants

Instances

IsConst Name # |

## Pretty printing and query functions.

prettyTerm :: (Document d, Show l) => (l -> d) -> Term l -> d #

Pretty print a term.

showFunSymName :: FunSym -> String #

Convert a function symbol to its name.

lits :: Term a -> [a] #

`lits t` returns all literals that occur in term `t`. List can contain duplicates.

## Smart constructors

fAppOne :: Term a #

Smart constructors for one, zero.

fAppDiff :: (Term a, Term a) -> Term a #

Smart constructors for diff, pair, exp, pmult, and emap.

fAppExp :: (Term a, Term a) -> Term a #

Smart constructors for diff, pair, exp, pmult, and emap.

fAppInv :: Term a -> Term a #

Smart constructors for inv, fst, and snd.

fAppPMult :: (Term a, Term a) -> Term a #

Smart constructors for diff, pair, exp, pmult, and emap.

fAppEMap :: Ord a => (Term a, Term a) -> Term a #

fAppPair :: (Term a, Term a) -> Term a #

Smart constructors for diff, pair, exp, pmult, and emap.

fAppFst :: Term a -> Term a #

Smart constructors for inv, fst, and snd.

fAppSnd :: Term a -> Term a #

Smart constructors for inv, fst, and snd.

## Destructors and classifiers

isPair :: Show a => Term a -> Bool #

`True` iff the term is a well-formed pair.

isDiff :: Show a => Term a -> Bool #

`True` iff the term is a well-formed diff term.

isInverse :: Show a => Term a -> Bool #

`True` iff the term is a well-formed inverse.

isProduct :: Show a => Term a -> Bool #

`True` iff the term is a well-formed product.

isUnion :: Show a => Term a -> Bool #

`True` iff the term is a well-formed union.

isEMap :: Show a => Term a -> Bool #

`True` iff the term is a well-formed emap.

isNullaryPublicFunction :: Term a -> Bool #

`True` iff the term is a nullary, public function.

isPrivateFunction :: Term a -> Bool #

getLeftTerm :: Term a -> Term a #

getRightTerm :: Term a -> Term a #

# AC, C, and NonAC funcion symbols

data FunSym #

Function symbols

Constructors

NoEq NoEqSym | a free function function symbol of a given arity
AC ACSym | an AC function symbol, can be used n-ary
C CSym | a C function symbol of a given arity
List | a free n-ary function symbol of TOP sort

Instances

Eq FunSym # |
Methods (==) :: FunSym -> FunSym -> Bool # (/=) :: FunSym -> FunSym -> Bool #
Data FunSym # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FunSym -> c FunSym # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FunSym # toConstr :: FunSym -> Constr # dataTypeOf :: FunSym -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c FunSym) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunSym) # gmapT :: (forall b. Data b => b -> b) -> FunSym -> FunSym # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunSym -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunSym -> r # gmapQ :: (forall d. Data d => d -> u) -> FunSym -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FunSym -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FunSym -> m FunSym # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FunSym -> m FunSym # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FunSym -> m FunSym #
Ord FunSym # |
Methods compare :: FunSym -> FunSym -> Ordering # (<) :: FunSym -> FunSym -> Bool # (<=) :: FunSym -> FunSym -> Bool # (>) :: FunSym -> FunSym -> Bool # (>=) :: FunSym -> FunSym -> Bool # max :: FunSym -> FunSym -> FunSym # min :: FunSym -> FunSym -> FunSym #
Show FunSym # |
Methods showsPrec :: Int -> FunSym -> ShowS # show :: FunSym -> String # showList :: [FunSym] -> ShowS #
Generic FunSym # |
Associated Types type Rep FunSym :: * -> * # Methods from :: FunSym -> Rep FunSym x # to :: Rep FunSym x -> FunSym #
Binary FunSym # |
Methods put :: FunSym -> Put # get :: Get FunSym # putList :: [FunSym] -> Put #
NFData FunSym # |
Methods rnf :: FunSym -> () #
type Rep FunSym # |
type Rep FunSym = D1 (MetaData "FunSym" "Term.Term.FunctionSymbols" "tamarin-prover-term-1.2.2-AAX5pCkSPqj7TesI35mR1r" False) ((:+:) ((:+:) (C1 (MetaCons "NoEq" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 NoEqSym))) (C1 (MetaCons "AC" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ACSym)))) ((:+:) (C1 (MetaCons "C" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CSym))) (C1 (MetaCons "List" PrefixI False) U1)))

data ACSym #

AC function symbols.

Constructors

Union |
Mult |

Instances

Eq ACSym # |
Methods (==) :: ACSym -> ACSym -> Bool # (/=) :: ACSym -> ACSym -> Bool #
Data ACSym # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ACSym -> c ACSym # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ACSym # toConstr :: ACSym -> Constr # dataTypeOf :: ACSym -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ACSym) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ACSym) # gmapT :: (forall b. Data b => b -> b) -> ACSym -> ACSym # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ACSym -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ACSym -> r # gmapQ :: (forall d. Data d => d -> u) -> ACSym -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ACSym -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ACSym -> m ACSym # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ACSym -> m ACSym # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ACSym -> m ACSym #
Ord ACSym # |
Methods compare :: ACSym -> ACSym -> Ordering # (<) :: ACSym -> ACSym -> Bool # (<=) :: ACSym -> ACSym -> Bool # (>) :: ACSym -> ACSym -> Bool # (>=) :: ACSym -> ACSym -> Bool # max :: ACSym -> ACSym -> ACSym # min :: ACSym -> ACSym -> ACSym #
Show ACSym # |
Methods showsPrec :: Int -> ACSym -> ShowS # show :: ACSym -> String # showList :: [ACSym] -> ShowS #
Generic ACSym # |
Associated Types type Rep ACSym :: * -> * # Methods from :: ACSym -> Rep ACSym x # to :: Rep ACSym x -> ACSym #
Binary ACSym # |
Methods put :: ACSym -> Put # get :: Get ACSym # putList :: [ACSym] -> Put #
NFData ACSym # |
Methods rnf :: ACSym -> () #
type Rep ACSym # |
type Rep ACSym = D1 (MetaData "ACSym" "Term.Term.FunctionSymbols" "tamarin-prover-term-1.2.2-AAX5pCkSPqj7TesI35mR1r" False) ((:+:) (C1 (MetaCons "Union" PrefixI False) U1) (C1 (MetaCons "Mult" PrefixI False) U1))

data CSym #

C(ommutative) function symbols

Constructors

EMap |

Instances

Eq CSym # |
Methods (==) :: CSym -> CSym -> Bool # (/=) :: CSym -> CSym -> Bool #
Data CSym # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> CSym -> c CSym # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c CSym # toConstr :: CSym -> Constr # dataTypeOf :: CSym -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c CSym) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c CSym) # gmapT :: (forall b. Data b => b -> b) -> CSym -> CSym # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> CSym -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> CSym -> r # gmapQ :: (forall d. Data d => d -> u) -> CSym -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> CSym -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> CSym -> m CSym # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> CSym -> m CSym # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> CSym -> m CSym #
Ord CSym # |
Methods compare :: CSym -> CSym -> Ordering # (<) :: CSym -> CSym -> Bool # (<=) :: CSym -> CSym -> Bool # (>) :: CSym -> CSym -> Bool # (>=) :: CSym -> CSym -> Bool # max :: CSym -> CSym -> CSym # min :: CSym -> CSym -> CSym #
Show CSym # |
Methods showsPrec :: Int -> CSym -> ShowS # show :: CSym -> String # showList :: [CSym] -> ShowS #
Generic CSym # |
Associated Types type Rep CSym :: * -> * # Methods from :: CSym -> Rep CSym x # to :: Rep CSym x -> CSym #
Binary CSym # |
Methods put :: CSym -> Put # get :: Get CSym # putList :: [CSym] -> Put #
NFData CSym # |
Methods rnf :: CSym -> () #
type Rep CSym # |
type Rep CSym = D1 (MetaData "CSym" "Term.Term.FunctionSymbols" "tamarin-prover-term-1.2.2-AAX5pCkSPqj7TesI35mR1r" False) (C1 (MetaCons "EMap" PrefixI False) U1)

data Privacy #

A function symbol can be either Private (unknown to adversary) or Public.

Constructors

Private |
Public |

Instances

Eq Privacy # |
Methods (==) :: Privacy -> Privacy -> Bool # (/=) :: Privacy -> Privacy -> Bool #
Data Privacy # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Privacy -> c Privacy # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Privacy # toConstr :: Privacy -> Constr # dataTypeOf :: Privacy -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c Privacy) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Privacy) # gmapT :: (forall b. Data b => b -> b) -> Privacy -> Privacy # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Privacy -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Privacy -> r # gmapQ :: (forall d. Data d => d -> u) -> Privacy -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Privacy -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Privacy -> m Privacy # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Privacy -> m Privacy # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Privacy -> m Privacy #
Ord Privacy # |
Methods compare :: Privacy -> Privacy -> Ordering # (<) :: Privacy -> Privacy -> Bool # (<=) :: Privacy -> Privacy -> Bool # (>) :: Privacy -> Privacy -> Bool # (>=) :: Privacy -> Privacy -> Bool # max :: Privacy -> Privacy -> Privacy # min :: Privacy -> Privacy -> Privacy #
Show Privacy # |
Methods showsPrec :: Int -> Privacy -> ShowS # show :: Privacy -> String # showList :: [Privacy] -> ShowS #
Generic Privacy # |
Associated Types type Rep Privacy :: * -> * # Methods from :: Privacy -> Rep Privacy x # to :: Rep Privacy x -> Privacy #
Binary Privacy # |
Methods put :: Privacy -> Put # get :: Get Privacy # putList :: [Privacy] -> Put #
NFData Privacy # |
Methods rnf :: Privacy -> () #
type Rep Privacy # |
type Rep Privacy = D1 (MetaData "Privacy" "Term.Term.FunctionSymbols" "tamarin-prover-term-1.2.2-AAX5pCkSPqj7TesI35mR1r" False) ((:+:) (C1 (MetaCons "Private" PrefixI False) U1) (C1 (MetaCons "Public" PrefixI False) U1))

type NoEqSym #

Arguments

= (ByteString, (Int, Privacy)) | operator name, arity, private

NoEq function symbols (with respect to the background theory).

## Signatures

type FunSig = Set FunSym #

Function signatures.

type NoEqFunSig = Set NoEqSym #

NoEq function signatures.

## concrete symbols strings

diffSymString :: ByteString #

expSymString :: ByteString #

invSymString :: ByteString #

pmultSymString :: ByteString #

emapSymString :: ByteString #

unionSymString :: ByteString #

## Function symbols

diffSym :: NoEqSym #

Diff.

expSym :: NoEqSym #

Exponentiation.

pmultSym :: NoEqSym #

Multiplication of points (in G1) on elliptic curve by scalars.

## concrete signatures

dhFunSig :: FunSig #

The signature for Diffie-Hellman function symbols.

bpFunSig :: FunSig #

The signature for the bilinear pairing function symbols.

msetFunSig :: FunSig #

The signature for the multiset function symbols.

pairFunSig :: NoEqFunSig #

The signature for pairing.

dhReducibleFunSig :: FunSig #

Reducible function symbols for DH.

bpReducibleFunSig :: FunSig #

Reducible function symbols for BP.

implicitFunSig :: FunSig #

Implicit function symbols.

class Sized a where #

Minimal complete definition

size

Methods

size :: a -> Int #

Instances

Sized a => Sized [a] # |
Methods size :: [a] -> Int #
Sized a => Sized (Term a) # |
Methods size :: Term a -> Int #
Sized (Lit c v) # |
Methods size :: Lit c v -> Int #
Sized (Subst c v) # |
Methods size :: Subst c v -> Int #
Sized (SubstVFresh c v) # |
Methods size :: SubstVFresh c v -> Int #

# Terms

data Term a #

A term in T(Sigma,a). Its constructors are kept abstract. Use `viewTerm` or `viewTerm2` to inspect it.

Constructors

LIT a | atomic terms (constants, variables, ..)
FAPP FunSym [Term a] | function applications

Instances

Foldable Term # |
Methods fold :: Monoid m => Term m -> m # foldMap :: Monoid m => (a -> m) -> Term a -> m # foldr :: (a -> b -> b) -> b -> Term a -> b # foldr' :: (a -> b -> b) -> b -> Term a -> b # foldl :: (b -> a -> b) -> b -> Term a -> b # foldl' :: (b -> a -> b) -> b -> Term a -> b # foldr1 :: (a -> a -> a) -> Term a -> a # foldl1 :: (a -> a -> a) -> Term a -> a # toList :: Term a -> [a] # null :: Term a -> Bool # length :: Term a -> Int # elem :: Eq a => a -> Term a -> Bool # maximum :: Ord a => Term a -> a # minimum :: Ord a => Term a -> a # sum :: Num a => Term a -> a # product :: Num a => Term a -> a #
Apply BLTerm # |
Methods apply :: LNSubst -> BLTerm -> BLTerm #
Apply LNTerm # |
Methods apply :: LNSubst -> LNTerm -> LNTerm #
Eq a => Eq (Term a) # |
Methods (==) :: Term a -> Term a -> Bool # (/=) :: Term a -> Term a -> Bool #
Data a => Data (Term a) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Term a -> c (Term a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Term a) # toConstr :: Term a -> Constr # dataTypeOf :: Term a -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Term a)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Term a)) # gmapT :: (forall b. Data b => b -> b) -> Term a -> Term a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Term a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Term a -> r # gmapQ :: (forall d. Data d => d -> u) -> Term a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Term a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Term a -> m (Term a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Term a -> m (Term a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Term a -> m (Term a) #
Ord a => Ord (Term a) # |
Methods compare :: Term a -> Term a -> Ordering # (<) :: Term a -> Term a -> Bool # (<=) :: Term a -> Term a -> Bool # (>) :: Term a -> Term a -> Bool # (>=) :: Term a -> Term a -> Bool # max :: Term a -> Term a -> Term a # min :: Term a -> Term a -> Term a #
Show a => Show (Term a) # |
Methods showsPrec :: Int -> Term a -> ShowS # show :: Term a -> String # showList :: [Term a] -> ShowS #
Generic (Term a) # |
Associated Types type Rep (Term a) :: * -> * # Methods from :: Term a -> Rep (Term a) x # to :: Rep (Term a) x -> Term a #
Binary a => Binary (Term a) # |
Methods put :: Term a -> Put # get :: Get (Term a) # putList :: [Term a] -> Put #
NFData a => NFData (Term a) # |
Methods rnf :: Term a -> () #
Sized a => Sized (Term a) # |
Methods size :: Term a -> Int #
(HasFrees l, Ord l) => HasFrees (Term l) # |
Methods foldFrees :: Monoid m => (LVar -> m) -> Term l -> m # foldFreesOcc :: Monoid m => (Occurence -> LVar -> m) -> Occurence -> Term l -> m # mapFrees :: Applicative f => MonotoneFunction f -> Term l -> f (Term l) #
type Rep (Term a) # |
type Rep (Term a) = D1 (MetaData "Term" "Term.Term.Raw" "tamarin-prover-term-1.2.2-AAX5pCkSPqj7TesI35mR1r" False) ((:+:) (C1 (MetaCons "LIT" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a))) (C1 (MetaCons "FAPP" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FunSym)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Term a])))))

data TermView a #

View on terms that corresponds to representation.

Constructors

Lit a |
FApp FunSym [Term a] |

Instances

Eq a => Eq (TermView a) # |
Methods (==) :: TermView a -> TermView a -> Bool # (/=) :: TermView a -> TermView a -> Bool #
Ord a => Ord (TermView a) # |
Methods compare :: TermView a -> TermView a -> Ordering # (<) :: TermView a -> TermView a -> Bool # (<=) :: TermView a -> TermView a -> Bool # (>) :: TermView a -> TermView a -> Bool # (>=) :: TermView a -> TermView a -> Bool # max :: TermView a -> TermView a -> TermView a # min :: TermView a -> TermView a -> TermView a #
Show a => Show (TermView a) # |
Methods showsPrec :: Int -> TermView a -> ShowS # show :: TermView a -> String # showList :: [TermView a] -> ShowS #

viewTerm :: Term a -> TermView a #

Return the `TermView` of the given term.

data TermView2 a #

View on terms that distinguishes function application of builtin symbols like exp.

Constructors

FExp (Term a) (Term a) |
FInv (Term a) |
FMult [Term a] |
One |
FPMult (Term a) (Term a) |
FEMap (Term a) (Term a) |
FUnion [Term a] |
FPair (Term a) (Term a) |
FDiff (Term a) (Term a) |
FAppNoEq NoEqSym [Term a] |
FAppC CSym [Term a] |
FList [Term a] |
Lit2 a |

Instances

Eq a => Eq (TermView2 a) # |
Methods (==) :: TermView2 a -> TermView2 a -> Bool # (/=) :: TermView2 a -> TermView2 a -> Bool #
Ord a => Ord (TermView2 a) # |
Methods compare :: TermView2 a -> TermView2 a -> Ordering # (<) :: TermView2 a -> TermView2 a -> Bool # (<=) :: TermView2 a -> TermView2 a -> Bool # (>) :: TermView2 a -> TermView2 a -> Bool # (>=) :: TermView2 a -> TermView2 a -> Bool # max :: TermView2 a -> TermView2 a -> TermView2 a # min :: TermView2 a -> TermView2 a -> TermView2 a #
Show a => Show (TermView2 a) # |
Methods showsPrec :: Int -> TermView2 a -> ShowS # show :: TermView2 a -> String # showList :: [TermView2 a] -> ShowS #

viewTerm2 :: Show a => Term a -> TermView2 a #

Returns the `TermView2` of the given term.

termViewToTerm :: TermView a -> Term a #

Return the term of the given TermView.

# Diff Type

data DiffType #

Constructors

DiffLeft |
DiffRight |
DiffNone |
DiffBoth |

## Standard function

traverseTerm :: (Applicative f, Ord a, Ord b) => (a -> f b) -> Term a -> f (Term b) #

fmapTerm :: Ord b => (a -> b) -> Term a -> Term b #

bindTerm :: Ord b => Term a -> (a -> Term b) -> Term b #

## Smart constructors

lit :: a -> Term a #

`lit l` creates a term from the literal `l`.

fApp :: Ord a => FunSym -> [Term a] -> Term a #

`fApp fsym as` creates an application of `fsym` to `as`. The function ensures that the resulting term is in AC-normal-form.

fAppAC :: Ord a => ACSym -> [Term a] -> Term a #

Smart constructor for AC terms.

fAppC :: Ord a => CSym -> [Term a] -> Term a #

Smart constructor for C terms.

fAppNoEq :: NoEqSym -> [Term a] -> Term a #

Smart constructor for non-AC/C terms.

fAppList :: [Term a] -> Term a #

Smart constructor for list terms.

unsafefApp :: FunSym -> [Term a] -> Term a #

`unsafefApp fsym as` creates an application of `fsym` to as. The caller has to ensure that the resulting term is in AC-normal-form.