diff --git a/src/WLP/ProgramPath.hs b/src/WLP/ProgramPath.hs index f8e1d29556c61ad4da040966cb4d2dee6a6728cc..d36df2d3403d5b754682796e0b9e0fbce324dab0 100644 --- a/src/WLP/ProgramPath.hs +++ b/src/WLP/ProgramPath.hs @@ -2,6 +2,7 @@ module WLP.ProgramPath ( ProgramPath , getProgramPaths , PathLength + , normalizeProgramPath ) where @@ -159,3 +160,13 @@ unrollWhile g ml s = uw' g ml s [] [] -> [] xs -> (xs ++ uw' g ml s xs) +-- | Normalizes a program path. This changes all instances of `Seq (Seq s1 s2) +-- s3` into `Seq s1 (Seq s2 s3)`, which should avoid a bunch of error later on. +normalizeProgramPath :: ProgramPath -> ProgramPath +normalizeProgramPath (Seq (Seq s1 s2) s3) + = let n1 = normalizeProgramPath s1 + n2 = normalizeProgramPath s2 + n3 = normalizeProgramPath s3 + in Seq n1 (Seq n2 n3) +normalizeProgramPath x = x +