mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-10 03:32:51 -06:00
the check for lincat C = <> is made more robust
This commit is contained in:
@@ -194,28 +194,28 @@ checkCompleteGrammar gr abs cnc = do
|
|||||||
CncCat _ _ _ -> True
|
CncCat _ _ _ -> True
|
||||||
_ -> False
|
_ -> False
|
||||||
checkOne js i@(c,info) = case info of
|
checkOne js i@(c,info) = case info of
|
||||||
AbsFun (Just ty) _ -> do mb_def <- checkErr $ do
|
AbsFun (Just ty) _ -> do let mb_def = do
|
||||||
(cxt,(_,i),_) <- typeForm ty
|
(cxt,(_,i),_) <- typeForm ty
|
||||||
info <- lookupIdent i js
|
info <- lookupIdent i js
|
||||||
info <- case info of
|
info <- case info of
|
||||||
(AnyInd _ m) -> do (m,info) <- lookupOrigInfo gr m i
|
(AnyInd _ m) -> do (m,info) <- lookupOrigInfo gr m i
|
||||||
return info
|
return info
|
||||||
_ -> return info
|
_ -> return info
|
||||||
case info of
|
case info of
|
||||||
CncCat (Just (RecType [])) _ _ -> return (Just (foldr (\_ -> Abs identW) (R []) cxt))
|
CncCat (Just (RecType [])) _ _ -> return (foldr (\_ -> Abs identW) (R []) cxt)
|
||||||
_ -> return Nothing
|
_ -> Bad "no def lin"
|
||||||
case lookupIdent c js of
|
case lookupIdent c js of
|
||||||
Ok (CncFun _ (Just _) _ ) -> return js
|
Ok (CncFun _ (Just _) _ ) -> return js
|
||||||
Ok (CncFun cty Nothing pn) ->
|
Ok (CncFun cty Nothing pn) ->
|
||||||
case mb_def of
|
case mb_def of
|
||||||
Just def -> return $ updateTree (c,CncFun cty (Just def) pn) js
|
Ok def -> return $ updateTree (c,CncFun cty (Just def) pn) js
|
||||||
Nothing -> do checkWarn $ "WARNING: no linearization of" +++ prt c
|
Bad _ -> do checkWarn $ "WARNING: no linearization of" +++ prt c
|
||||||
return js
|
return js
|
||||||
_ -> do
|
_ -> do
|
||||||
case mb_def of
|
case mb_def of
|
||||||
Just def -> return $ updateTree (c,CncFun Nothing (Just def) Nothing) js
|
Ok def -> return $ updateTree (c,CncFun Nothing (Just def) Nothing) js
|
||||||
Nothing -> do checkWarn $ "WARNING: no linearization of" +++ prt c
|
Bad _ -> do checkWarn $ "WARNING: no linearization of" +++ prt c
|
||||||
return js
|
return js
|
||||||
AbsCat (Just _) _ -> case lookupIdent c js of
|
AbsCat (Just _) _ -> case lookupIdent c js of
|
||||||
Ok (AnyInd _ _) -> return js
|
Ok (AnyInd _ _) -> return js
|
||||||
Ok (CncCat (Just _) _ _) -> return js
|
Ok (CncCat (Just _) _ _) -> return js
|
||||||
|
|||||||
Reference in New Issue
Block a user