From 9f376952d74e1637cbbcd27b997c412497c474d5 Mon Sep 17 00:00:00 2001 From: Marcellus Siegburg Date: Fri, 21 Jun 2024 12:17:38 +0200 Subject: [PATCH] fix excluding double inheritance on multiple inheritance (#183) - close #183 --- alloy/cd/generate.als | 2 +- test/Modelling/CdOd/GenerateSpec.hs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/alloy/cd/generate.als b/alloy/cd/generate.als index f4f0b34..836226f 100644 --- a/alloy/cd/generate.als +++ b/alloy/cd/generate.als @@ -178,7 +178,7 @@ pred classDiagram [ #{ c : compositions | not validLimitsComposition [c]} = wrongCompositions #{ r : nonInheritances | selfRelationship [r]} = selfRelationships #{ i : inheritances | selfRelationship [i]} = selfInheritances - no i : inheritances | not noDoubleRelationships [i] + noDoubleRelationships [inheritances] no i : inheritances, a : nonInheritances | sameDirection [i, a] or reverseRelationship [i, a] hasDoubleRelationships = True diff --git a/test/Modelling/CdOd/GenerateSpec.hs b/test/Modelling/CdOd/GenerateSpec.hs index 5dbe660..f9026c0 100644 --- a/test/Modelling/CdOd/GenerateSpec.hs +++ b/test/Modelling/CdOd/GenerateSpec.hs @@ -96,12 +96,10 @@ spec = hasReverseInheritances = False, hasReverseRelationships = Just False } - -- Disabled due to varying definitions of multiple inheritances: - {- generateProperty + generateProperty "multipleInheritances" (const $ not . null . multipleInheritances) defaultProperties { hasMultipleInheritances = Just True } - -} generateProperty "no multipleInheritances" (const $ null . multipleInheritances)