Skip to content

Commit

Permalink
in Presentation, rename eqs0 to eqs and fully qualify as IP.eqs. #148
Browse files Browse the repository at this point in the history
  • Loading branch information
epost committed Aug 21, 2019
1 parent e3347fa commit 2aec6fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/Language/CQL/Instance.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ import Data.Typeable hiding (typeOf)
import Data.Void
import Language.CQL.Collage (Collage(..), assembleGens, attsFrom, fksFrom, typeOf)
import Language.CQL.Common (elem', intercalate, fromListAccum, mapl, section, toMapSafely, Deps(..), Err, Kind(INSTANCE), MultiTyMap, TyMap, type (+))
import Language.CQL.Instance.Presentation (Presentation(..), presToCol, eqs0)
import qualified Language.CQL.Instance.Presentation as IP (typecheck)
import Language.CQL.Instance.Presentation (Presentation(..), presToCol)
import qualified Language.CQL.Instance.Presentation as IP (typecheck, Presentation(eqs))
import Language.CQL.Mapping as Mapping
import Language.CQL.Options
import Language.CQL.Prover
Expand Down Expand Up @@ -140,7 +140,7 @@ satisfiesSchema
=> Instance var ty sym en fk att gen sk x y
-> Err ()
satisfiesSchema (Instance sch pres' dp' alg) = do
mapM_ (\(EQ (l, r)) -> if hasTypeType l then report (show l) (show r) (instEqT l r) else report (show l) (show r) (instEqE l r)) $ Set.toList $ eqs0 pres'
mapM_ (\( EQ (l, r)) -> if hasTypeType l then report (show l) (show r) (instEqT l r) else report (show l) (show r) (instEqE l r)) $ Set.toList $ IP.eqs pres'
mapM_ (\(en'', EQ (l, r)) -> report (show l) (show r) (schEqT l r en'')) $ Set.toList $ obs_eqs sch
mapM_ (\(en'', EQ (l, r)) -> report (show l) (show r) (schEqE l r en'')) $ Set.toList $ path_eqs sch
where
Expand Down Expand Up @@ -348,7 +348,7 @@ initialInstance p dp' sch = Instance sch p dp'' $ initialAlgebra
repr'''' (MkTalgGen (Right (x, att))) = Att att $ upp x

teqs'' = concatMap (\(e, EQ (lhs,rhs)) -> fmap (\x -> EQ (nf'' this $ subst' lhs x, nf'' this $ subst' rhs x)) (Set.toList $ en' e)) $ Set.toList $ obs_eqs sch
teqs' = Set.union (Set.fromList teqs'') (Set.map (\(EQ (lhs,rhs)) -> EQ (nf'' this lhs, nf'' this rhs)) (Set.filter hasTypeType' $ eqs0 p))
teqs' = Set.union (Set.fromList teqs'') (Set.map (\(EQ (lhs,rhs)) -> EQ (nf'' this lhs, nf'' this rhs)) (Set.filter hasTypeType' $ IP.eqs p))

-- | Assemble Skolem terms (labeled nulls).
assembleSks
Expand Down Expand Up @@ -525,7 +525,7 @@ evalInstanceRaw' sch (InstExpRaw' _ gens0 eqs' _ _) is = do
let gensX = concatMap (Map.toList . gens) is ++ gens'''
sksX = concatMap (Map.toList . sks ) is ++ sks'''
eqs'' <- transEq gensX sksX eqs'
pure $ Presentation (Map.fromList gensX) (Map.fromList sksX) $ Set.fromList $ (concatMap (Set.toList . eqs0) is) ++ (Set.toList eqs'')
pure $ Presentation (Map.fromList gensX) (Map.fromList sksX) $ Set.fromList $ (concatMap (Set.toList . IP.eqs) is) ++ (Set.toList eqs'')
where
keys' = map fst

Expand Down
6 changes: 0 additions & 6 deletions src/Language/CQL/Instance/Presentation.hs
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ typecheck
-> Err ()
typecheck sch p = typeOfCol $ presToCol sch p

--created as an alias because of name clashes
eqs0
:: Presentation var ty sym en fk att gen sk
-> Set (EQ Void ty sym en fk att gen sk)
eqs0 (Presentation _ _ x) = x

-- | Converts a presentation to a collage.
presToCol
:: (MultiTyMap '[Show, Ord, NFData] '[var, ty, sym, en, fk, att, gen, sk])
Expand Down

0 comments on commit 2aec6fb

Please sign in to comment.