lincat index in CanonToGFCC decreased by 1

This commit is contained in:
aarne
2007-10-03 16:15:33 +00:00
parent 51fff6daed
commit db12154e76
2 changed files with 4 additions and 4 deletions

View File

@@ -96,7 +96,7 @@ mkCType t = case t of
TStr -> C.S [] TStr -> C.S []
where where
getI pt = case pt of getI pt = case pt of
C.C i -> i C.C i -> i + 1
C.RP i _ -> getI i C.RP i _ -> getI i
mkTerm :: Term -> C.Term mkTerm :: Term -> C.Term
@@ -268,7 +268,7 @@ type2type cgr env@(labels,untyps,typs) ty = case ty of
_ -> ty _ -> ty
where where
t2t = type2type cgr env t2t = type2type cgr env
look ty = TInts $ toInteger $ case Map.lookup ty typs of look ty = TInts $ (+ (-1)) $ toInteger $ case Map.lookup ty typs of
Just vs -> length $ Map.assocs vs Just vs -> length $ Map.assocs vs
_ -> trace ("unknown partype " ++ show ty) 1 ---- 66669 _ -> trace ("unknown partype " ++ show ty) 1 ---- 66669

View File

@@ -212,7 +212,7 @@ unifyPType nr path (C max_index) =
let (FCat _ _ _ tcs,_) = args !! nr let (FCat _ _ _ tcs,_) = args !! nr
case lookup path tcs of case lookup path tcs of
Just index -> return index Just index -> return index
Nothing -> do index <- member [0..max_index-1] Nothing -> do index <- member [0..max_index]
restrictArg nr path index restrictArg nr path index
return index return index
unifyPType nr path (RP alias _) = unifyPType nr path alias unifyPType nr path (RP alias _) = unifyPType nr path alias
@@ -306,7 +306,7 @@ genFCatArg ctype env@(FRulesEnv last_id fcatSet rules) m1@(FCat _ cat rcs tcs) =
case List.lookup path tcs of case List.lookup path tcs of
Just index -> return $! addConstraint path index acc Just index -> return $! addConstraint path index acc
Nothing -> do writeState True Nothing -> do writeState True
index <- member [0..max_index-1] index <- member [0..max_index]
return $! addConstraint path index acc return $! addConstraint path index acc
where where
addConstraint path0 index0 (c@(path,index) : cs) addConstraint path0 index0 (c@(path,index) : cs)