CurryInfo: call-analysis-3.2.0 / Analysis.matchCTerms

definition: Info
 
matchCTerms :: [Term] -> [CTerm] -> Maybe (Sub CTerm)
matchCTerms []     []     = Just []
matchCTerms []     (_:_)  = Nothing
matchCTerms (_:_)  []     = Nothing
matchCTerms (x:xs) (y:ys) = combineSubst (match x y) (matchCTerms xs ys)
 where
  combineSubst Nothing   _         = Nothing
  combineSubst (Just _ ) Nothing   = Nothing
  combineSubst (Just s1) (Just s2) = Just (s1++s2)

  -- match a linear pattern against a term with disjoint variables:
  match :: Term -> CTerm -> Maybe (Sub CTerm)
  match (Var v) t = Just [(v,t)]
  match (Func _ pf pargs) t = case t of
    CBot           -> Nothing
    CVar _         -> Nothing
    CCons tf targs -> if pf==tf then matchCTerms pargs targs else Nothing
demand: Info
 arguments 1 2
deterministic: Info
 deterministic operation
documentation: Info
 
pairwise matching of a list of patterns against a list of terms
failfree: Info
 (_, _)
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {({[]},{[]}) |-> {Just} || ({[]},{:}) |-> {Nothing} || ({:},{[]}) |-> {Nothing} || ({:},{:}) |-> {Just,Nothing}}
name: Info
 matchCTerms
precedence: Info
 no precedence defined
result-values: Info
 {Just,Nothing}
signature: Info
 [TRS.Term] -> [CTerm] -> Prelude.Maybe [(Prelude.Int, CTerm)]
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 reducible on all ground data terms