Skip to content

Commit

Permalink
matrices can be indexed by other matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurakgun committed Feb 16, 2025
1 parent 7aa2134 commit 6b3ae55
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Conjure/Language/Domain.hs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ isPrimitiveDomain :: Domain r x -> Bool
isPrimitiveDomain DomainBool{} = True
isPrimitiveDomain DomainIntE{} = True
isPrimitiveDomain DomainInt{} = True
isPrimitiveDomain (DomainMatrix index inner) = and [isPrimitiveDomain index, isPrimitiveDomain inner]
isPrimitiveDomain (DomainMatrix index inner) = isPrimitiveDomain index && isPrimitiveDomain inner
isPrimitiveDomain _ = False

getIndices :: Domain r x -> ([Domain () x], Domain r x)
Expand All @@ -298,6 +298,7 @@ domainCanIndexMatrix DomainBool{} = True
domainCanIndexMatrix DomainInt {} = True
domainCanIndexMatrix DomainIntE{} = True
domainCanIndexMatrix DomainEnum{} = True
domainCanIndexMatrix (DomainMatrix index inner) = domainCanIndexMatrix index && domainCanIndexMatrix inner
domainCanIndexMatrix _ = False

expandDomainReference :: Data r => Data x => Domain r x -> Domain r x
Expand Down Expand Up @@ -613,7 +614,7 @@ instance Semigroup BinaryRelationAttrs where
(<>) (BinaryRelationAttrs a) (BinaryRelationAttrs b) = BinaryRelationAttrs (S.union a b)
instance Monoid BinaryRelationAttrs where
mempty = BinaryRelationAttrs def



data BinaryRelationAttr
Expand Down

0 comments on commit 6b3ae55

Please sign in to comment.