Term.Unification

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.Unification

Contents

- Unification modulo AC
- matching modulo AC
  - Constructing matching problems
  - Solving matching problems
- Handles to a Maude process
- Maude signatures
- Convenience exports

Description

AC unification based on maude and free unification.

Synopsis

- unifyLTerm :: (IsConst c, Show (Lit c LVar)) => (c -> LSort) -> [Equal (LTerm c)] -> WithMaude [SubstVFresh c LVar]
- unifyLNTerm :: [Equal LNTerm] -> WithMaude [SubstVFresh Name LVar]
- unifiableLNTerms :: LNTerm -> LNTerm -> WithMaude Bool
- unifyLTermFactored :: (IsConst c, Show (Lit c LVar)) => (c -> LSort) -> [Equal (LTerm c)] -> WithMaude (LSubst c, [SubstVFresh c LVar])
- unifyLNTermFactored :: [Equal LNTerm] -> WithMaude (LNSubst, [SubstVFresh Name LVar])
- matchLVar :: LVar -> LVar -> Match (LTerm c)
- solveMatchLTerm :: IsConst c => (c -> LSort) -> Match (LTerm c) -> WithMaude [Subst c LVar]
- solveMatchLNTerm :: Match LNTerm -> WithMaude [Subst Name LVar]
- data MaudeHandle
- type WithMaude = Reader MaudeHandle
- startMaude :: FilePath -> MaudeSig -> IO MaudeHandle
- getMaudeStats :: MaudeHandle -> IO String
- mhMaudeSig :: MaudeHandle -> MaudeSig
- mhFilePath :: MaudeHandle -> FilePath
- data MaudeSig
- enableDH :: MaudeSig -> Bool
- enableBP :: MaudeSig -> Bool
- enableMSet :: MaudeSig -> Bool
- enableDiff :: MaudeSig -> Bool
- minimalMaudeSig :: Bool -> MaudeSig
- enableDiffMaudeSig :: MaudeSig
- dhMaudeSig :: MaudeSig
- bpMaudeSig :: MaudeSig
- msetMaudeSig :: MaudeSig
- pairMaudeSig :: MaudeSig
- symEncMaudeSig :: MaudeSig
- asymEncMaudeSig :: MaudeSig
- signatureMaudeSig :: MaudeSig
- hashMaudeSig :: MaudeSig
- rrulesForMaudeSig :: MaudeSig -> Set (RRule LNTerm)
- stFunSyms :: MaudeSig -> Set NoEqSym
- funSyms :: MaudeSig -> FunSig
- stRules :: MaudeSig -> Set CtxtStRule
- irreducibleFunSyms :: MaudeSig -> FunSig
- noEqFunSyms :: MaudeSig -> NoEqFunSig
- addFunSym :: NoEqSym -> MaudeSig -> MaudeSig
- addCtxtStRule :: CtxtStRule -> MaudeSig -> MaudeSig
- module Term.Substitution
- module Term.Rewriting.Definitions

# Unification modulo AC

unifyLTerm :: (IsConst c, Show (Lit c LVar)) => (c -> LSort) -> [Equal (LTerm c)] -> WithMaude [SubstVFresh c LVar] #

`unifyLNTerm eqs` returns a complete set of unifiers for `eqs` modulo AC.

unifyLNTerm :: [Equal LNTerm] -> WithMaude [SubstVFresh Name LVar] #

`unifyLNTerm eqs` returns a complete set of unifiers for `eqs` modulo AC.

unifiableLNTerms :: LNTerm -> LNTerm -> WithMaude Bool #

`True` iff the terms are unifiable.

unifyLTermFactored :: (IsConst c, Show (Lit c LVar)) => (c -> LSort) -> [Equal (LTerm c)] -> WithMaude (LSubst c, [SubstVFresh c LVar]) #

`unifyLTerm sortOf eqs` returns a complete set of unifiers for `eqs` modulo AC.

unifyLNTermFactored :: [Equal LNTerm] -> WithMaude (LNSubst, [SubstVFresh Name LVar]) #

`unifyLTerm sortOf eqs` returns a complete set of unifiers for `eqs` modulo AC.

# matching modulo AC

## Constructing matching problems

matchLVar :: LVar -> LVar -> Match (LTerm c) #

Match an `LVar` term to an `LVar` pattern.

## Solving matching problems

solveMatchLTerm :: IsConst c => (c -> LSort) -> Match (LTerm c) -> WithMaude [Subst c LVar] #

`solveMatchLNTerm sortOf eqs` returns a complete set of matchers for `eqs` modulo AC.

solveMatchLNTerm :: Match LNTerm -> WithMaude [Subst Name LVar] #

`solveMatchLNTerm eqs` returns a complete set of matchers for `eqs` modulo AC.

# Handles to a Maude process

data MaudeHandle #

A handle to a Maude process. It requires the Maude path for Signatures to be serializable. If we also add the string for the Maude config file, then it would even be serializable on its own.

type WithMaude = Reader MaudeHandle #

Values that depend on a `MaudeHandle`.

startMaude :: FilePath -> MaudeSig -> IO MaudeHandle #

`startMaude` starts a new instance of Maude and returns a Handle to it.

getMaudeStats :: MaudeHandle -> IO String #

`getMaudeStats` returns the maude stats formatted as a string.

mhMaudeSig :: MaudeHandle -> MaudeSig #

mhFilePath :: MaudeHandle -> FilePath #

# Maude signatures

data MaudeSig #

The required information to define a `Maude functional module`.

Instances

Eq MaudeSig # |
Methods (==) :: MaudeSig -> MaudeSig -> Bool # (/=) :: MaudeSig -> MaudeSig -> Bool #
Ord MaudeSig # |
Methods compare :: MaudeSig -> MaudeSig -> Ordering # (<) :: MaudeSig -> MaudeSig -> Bool # (<=) :: MaudeSig -> MaudeSig -> Bool # (>) :: MaudeSig -> MaudeSig -> Bool # (>=) :: MaudeSig -> MaudeSig -> Bool # max :: MaudeSig -> MaudeSig -> MaudeSig # min :: MaudeSig -> MaudeSig -> MaudeSig #
Show MaudeSig # |
Methods showsPrec :: Int -> MaudeSig -> ShowS # show :: MaudeSig -> String # showList :: [MaudeSig] -> ShowS #
Generic MaudeSig # |
Associated Types type Rep MaudeSig :: * -> * # Methods from :: MaudeSig -> Rep MaudeSig x # to :: Rep MaudeSig x -> MaudeSig #
Monoid MaudeSig # | A monoid instance to combine maude signatures.
Methods mempty :: MaudeSig # mappend :: MaudeSig -> MaudeSig -> MaudeSig # mconcat :: [MaudeSig] -> MaudeSig #
Binary MaudeSig # |
Methods put :: MaudeSig -> Put # get :: Get MaudeSig # putList :: [MaudeSig] -> Put #
NFData MaudeSig # |
Methods rnf :: MaudeSig -> () #
type Rep MaudeSig # |
type Rep MaudeSig = D1 (MetaData "MaudeSig" "Term.Maude.Signature" "tamarin-prover-term-1.2.2-AAX5pCkSPqj7TesI35mR1r" False) (C1 (MetaCons "MaudeSig" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "enableDH") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "enableBP") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool))) ((:*:) (S1 (MetaSel (Just Symbol "enableMSet") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)) (S1 (MetaSel (Just Symbol "enableDiff") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Bool)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "stFunSyms") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set NoEqSym))) (S1 (MetaSel (Just Symbol "stRules") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set CtxtStRule)))) ((:*:) (S1 (MetaSel (Just Symbol "funSyms") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FunSig)) (S1 (MetaSel (Just Symbol "irreducibleFunSyms") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FunSig))))))

enableDH :: MaudeSig -> Bool #

enableBP :: MaudeSig -> Bool #

enableMSet :: MaudeSig -> Bool #

enableDiff :: MaudeSig -> Bool #

minimalMaudeSig :: Bool -> MaudeSig #

The minimal maude signature.

enableDiffMaudeSig :: MaudeSig #

Signature with enableDiff set to True

dhMaudeSig :: MaudeSig #

Maude signatures for the AC symbols.

bpMaudeSig :: MaudeSig #

Maude signatures for the AC symbols.

msetMaudeSig :: MaudeSig #

Maude signatures for the AC symbols.

pairMaudeSig :: MaudeSig #

Maude signatures for the default subterm symbols. pairMaudeSig :: Bool -> MaudeSig pairMaudeSig flag = maudeSig $ mempty {stFunSyms=pairFunSig,stRules=pairRules,enableDiff=flag}

symEncMaudeSig :: MaudeSig #

Maude signatures for the default subterm symbols. pairMaudeSig :: Bool -> MaudeSig pairMaudeSig flag = maudeSig $ mempty {stFunSyms=pairFunSig,stRules=pairRules,enableDiff=flag}

asymEncMaudeSig :: MaudeSig #

Maude signatures for the default subterm symbols. pairMaudeSig :: Bool -> MaudeSig pairMaudeSig flag = maudeSig $ mempty {stFunSyms=pairFunSig,stRules=pairRules,enableDiff=flag}

signatureMaudeSig :: MaudeSig #

Maude signatures for the default subterm symbols. pairMaudeSig :: Bool -> MaudeSig pairMaudeSig flag = maudeSig $ mempty {stFunSyms=pairFunSig,stRules=pairRules,enableDiff=flag}

hashMaudeSig :: MaudeSig #

Maude signatures for the default subterm symbols. pairMaudeSig :: Bool -> MaudeSig pairMaudeSig flag = maudeSig $ mempty {stFunSyms=pairFunSig,stRules=pairRules,enableDiff=flag}

rrulesForMaudeSig :: MaudeSig -> Set (RRule LNTerm) #

Returns all rewriting rules including the rules for DH, BP, and multiset.

stFunSyms :: MaudeSig -> Set NoEqSym #

function signature for subterm theory

funSyms :: MaudeSig -> FunSig #

function signature including the function symbols for DH, BP, and Multiset can be computed from enableX and stFunSyms

stRules :: MaudeSig -> Set CtxtStRule #

rewriting rules for subterm theory

irreducibleFunSyms :: MaudeSig -> FunSig #

irreducible function symbols (can be computed)

noEqFunSyms :: MaudeSig -> NoEqFunSig #

Non-AC function symbols.

addFunSym :: NoEqSym -> MaudeSig -> MaudeSig #

Add function symbol to given maude signature.

addCtxtStRule :: CtxtStRule -> MaudeSig -> MaudeSig #

Add subterm rule to given maude signature.

# Convenience exports

module Term.Substitution

module Term.Rewriting.Definitions