-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix_integrity: fixed name, added tests
- Loading branch information
Showing
4 changed files
with
66 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
{- | | ||
Module : NITTA.Model.IntegrityCheck | ||
Description : Tests vertical relations in PU | ||
Description : Module for checking model description consistency | ||
Copyright : (c) Artyom Kostyuchik, 2021 | ||
License : BSD3 | ||
Maintainer : [email protected] | ||
|
@@ -22,11 +22,10 @@ import NITTA.Utils | |
import Safe | ||
|
||
checkIntegrity pu = | ||
let pr = process pu | ||
getInterMap = | ||
let getInterMap = | ||
M.fromList | ||
[ (pID, f) | ||
| step@Step{pID, pDesc} <- steps pr | ||
| step@Step{pID, pDesc} <- steps $ process pu | ||
, isFB step | ||
, f <- case pDesc of | ||
(FStep f) -> [f] | ||
|
@@ -36,7 +35,7 @@ checkIntegrity pu = | |
M.fromListWith (++) $ | ||
concat | ||
[ concatMap (\v -> [(v, [(pID, ep)])]) $ variables ep | ||
| step@Step{pID, pDesc} <- steps pr | ||
| step@Step{pID, pDesc} <- steps $ process pu | ||
, isEndpoint step | ||
, ep <- case pDesc of | ||
(EndpointRoleStep e) -> [e] | ||
|
@@ -45,14 +44,12 @@ checkIntegrity pu = | |
getInstrMap = | ||
M.fromList | ||
[ (pID, pDesc) | ||
| Step{pID, pDesc} <- steps pr | ||
| Step{pID, pDesc} <- steps $ process pu | ||
, isInstruction pDesc | ||
] | ||
in and | ||
[ checkEndpointToIntermidiateRelation getEpMap getInterMap pr | ||
, checkInstructionToEndpointRelation getInstrMap getEpMap pr | ||
, True | ||
, True | ||
[ checkEndpointToIntermidiateRelation getEpMap getInterMap $ process pu | ||
, checkInstructionToEndpointRelation getInstrMap getEpMap $ process pu | ||
] | ||
|
||
checkEndpointToIntermidiateRelation eps ifs pr = S.isSubsetOf makeRelationList rels | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters