AsToLe.hs revision e13ee09381f136f5eadaabdb9699773c0052cf3d
4d3f1471f9fc5ef08b7d49f2e70af7f327292952Christian MaederModule : $Header$
4d3f1471f9fc5ef08b7d49f2e70af7f327292952Christian MaederDescription : final static analysis
4d3f1471f9fc5ef08b7d49f2e70af7f327292952Christian MaederCopyright : (c) Christian Maeder and Uni Bremen 2003-2005
4d3f1471f9fc5ef08b7d49f2e70af7f327292952Christian MaederLicense : similar to LGPL, see HetCATS/LICENSE.txt or LIZENZ.txt
4d3f1471f9fc5ef08b7d49f2e70af7f327292952Christian MaederMaintainer : Christian.Maeder@dfki.de
4d3f1471f9fc5ef08b7d49f2e70af7f327292952Christian MaederStability : experimental
4d3f1471f9fc5ef08b7d49f2e70af7f327292952Christian MaederPortability : portable
4d3f1471f9fc5ef08b7d49f2e70af7f327292952Christian Maederconversion from As to Le
8878f7411a09d4dc54bf1941cc7a243e35ddb530Christian Maederimport qualified Data.Map as Map
8878f7411a09d4dc54bf1941cc7a243e35ddb530Christian Maederimport qualified Data.Set as Set
import HasCASL.Le
import HasCASL.TypeAna
import HasCASL.ClassAna
import HasCASL.VarDecl
import HasCASL.Unify
import HasCASL.OpDecl
import HasCASL.TypeDecl
import HasCASL.Builtin
import HasCASL.PrintLe
import HasCASL.Merge
import HasCASL.MapTerm
import HasCASL.FoldTerm
import HasCASL.TypeCheck
import Data.Maybe
type Ids = Set.Set Id
unite = Set.unions
_ -> Set.empty
TypeItems _ _ _ -> Set.empty
_ -> Set.empty
Pred -> Set.fromList [i, stripCompound i]
_ -> Set.empty
isEmptyEnv e = Map.null (classMap e)
&& Map.null (typeMap e)
&& Map.null (assumps e)
cm = Map.differenceWith diffClass (classMap e1) $ classMap e2
, assumps = Map.differenceWith (diffAss cm (filterAliases tm)
-> Maybe (Set.Set OpInfo)
if Set.null s3 then Nothing else Just s3
-> Set.Set OpInfo
diffOps cm tAs tm s1 s2 = if Set.null s1 then s1 else
let (o, os) = Set.deleteFindMin s1
then Set.insert n rs else rs
rels = Set.union preds newPreds
freeVars :: Term -> Set.Set VarDecl
{ foldQualVar = \ _ t -> Set.singleton t
, foldQualOp = \ _ _ _ _ _ _ -> Set.empty
, foldApplTerm = \ _ t1 t2 _ -> Set.union t1 t2
, foldTupleTerm = \ _ tts _ -> Set.unions tts
, foldAsPattern = \ _ t ts _ -> Set.insert t ts
, foldQuantifiedTerm = \ _ _ gvs ts _ -> Set.difference ts $
GenVarDecl t -> Set.insert t
_ -> id) Set.empty gvs
, foldCaseTerm = \ _ ts tts _ -> Set.difference
, foldLetTerm = \ _ _ tts ts _ -> Set.difference
, foldResolvedMixTerm = \ _ _ _ tts _ -> Set.unions tts
, foldTermToken = \ _ _ -> Set.empty
, foldMixTypeTerm = \ _ _ _ _ -> Set.empty
, foldMixfixTerm = \ _ tts -> Set.unions tts
, foldBracketTerm = \ _ _ tts _ -> Set.unions tts
let tys = Set.fromList $ map (fst . snd) $ concatMap (leaves (>= 0))
TypeArg i v vk rk c Other ps) $ Map.toList
vs = tyVs ++ map GenVarDecl (Set.toList $ freeVars t)