Commit 5af155d7 authored by Matthias Böhm's avatar Matthias Böhm
Browse files

replaced keywords instance and class

parent 814c69f3
......@@ -919,8 +919,8 @@ msgT e f = (w:(subTerms sigma))++(subTerms theta)
computeMsg :: Expr -> Expr -> (Expr,Subst,Subst)
computeMsg e1 e2 = (w, sub1, sub2)
where (w,_) = msg e1 e2 (max (maxVarIndex e1) (maxVarIndex e2))
sub1 = instance e1 w
sub2 = instance e2 w
sub1 = instance0 e1 w
sub2 = instance0 e2 w
-- msg e1 e2 i = (w,i')
-- w is the msg of e1 and e2 and i' is the last number used in the
......@@ -2187,15 +2187,15 @@ existsRen :: [Expr] -> Expr -> Bool
existsRen [] _ = False
existsRen (e1:es) e =
if not (instance e1 e == FSub) &&
not (instance e e1 == FSub)
if not (instance0 e1 e == FSub) &&
not (instance0 e e1 == FSub)
then True
else existsRen es e
-- check whether one expression is an instance of another and compute
-- the corresponding substitution:
instance :: Expr -> Expr -> Subst
instance a b =
instance0 :: Expr -> Expr -> Subst
instance0 a b =
if a==b then Sub [] []
else if isVar b
then instanceVar a b
......@@ -2214,10 +2214,10 @@ instanceS (Comb c1 f1 e1) (Comb c2 f2 e2) =
if c1==c2 && f1==f2 then instanceL e1 e2 (Sub [] [])
else FSub
instanceS (Case c1 e1 ces1) (Case c2 e2 ces2) =
if c1==c2 then instanceCase ces1 ces2 (instance e1 e2)
if c1==c2 then instanceCase ces1 ces2 (instance0 e1 e2)
else FSub
instanceS (Constr _ e1) (Constr _ e2) = instance e1 e2
instanceS (Choice e1) (Choice e2) = instance e1 e2
instanceS (Constr _ e1) (Constr _ e2) = instance0 e1 e2
instanceS (Choice e1) (Choice e2) = instance0 e1 e2
instanceS (GuardedExpr _ c1 e1) (GuardedExpr _ c2 e2) =
instanceL [c1,e1] [c2,e2] (Sub [] [])
instanceS (Or e1 e2) (Or f1 f2) = instanceL [e1,e2] [f1,f2] (Sub [] [])
......@@ -2229,7 +2229,7 @@ instanceL (e1:es1) (e2:es2) subs
| newsub == FSub = FSub
| clash newsub subs = FSub
| otherwise = instanceL es1 es2 (composeSubs subs newsub)
where newsub = instance e1 e2
where newsub = instance0 e1 e2
--
clash (Sub vs es) sub2 = clash_ vs es sub2
......@@ -2259,10 +2259,10 @@ instanceCaseL (e1:es1) (e2:es2) subs
instanceCaseBranch :: BranchExpr -> BranchExpr -> Subst
instanceCaseBranch (Branch (Pattern c1 _) e1) (Branch (Pattern c2 _) e2) =
if c1 == c2 then instance e1 e2
if c1 == c2 then instance0 e1 e2
else FSub
instanceCaseBranch (Branch (LPattern c1) e1) (Branch (LPattern c2) e2) =
if c1 == c2 then instance e1 e2
if c1 == c2 then instance0 e1 e2
else FSub
-- composition of substitutions:
......@@ -2305,7 +2305,7 @@ search_instance _ [] = (FSub, Var (-1))
search_instance e (e1:es) =
if sub==FSub then search_instance e es
else (sub,e)
where sub = instance e e1
where sub = instance0 e e1
--printSubs FSub = "FSub"
--printSubs (Sub vars exps) =
......@@ -2319,7 +2319,7 @@ searchInstance _ [] = (FSub, Var (-1))
searchInstance e ((e1,e2):es) =
if sub /= FSub then (sub, e2)
else searchInstance e es
where sub = instance e e1
where sub = instance0 e e1
--searchInstance e (_:es) = searchInstance e es
--deterministic version follows:
-- if sub==FSub
......@@ -2337,7 +2337,7 @@ searchConstrInstance funs e ((e1,e2):es) =
if (sub /= FSub) && (isConstructor funs sub)
then (sub,e2)
else searchConstrInstance funs e es
where sub = instance e e1
where sub = instance0 e e1
--used to pretty print a list of expressions:
concatBlank [] = []
......
......@@ -103,7 +103,7 @@ defaultHandler cmd = Handler DefaultEvent (Cmd cmd)
-------------------------------------------------------------------------------
addStyle :: Widget r a1 a2 -> StyleClass -> Widget r a1 a2
addStyle widget class = addStyles widget [class]
addStyle widget class0 = addStyles widget [class0]
addStyles :: Widget r a1 a2 -> [StyleClass] -> Widget r a1 a2
addStyles (Widget str mblabel mbref handlers styleClasses ws) classes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment