Skip to content

Commit

Permalink
ogma-core: Translate MTL operators with number ranges. Refs nasa#101.
Browse files Browse the repository at this point in the history
The current translation module for SMV into Copilot does not support MTL
operators with number ranges, only those with comparison operators and a
numeric limit.

A prior commit has extended the grammar to support MTL operators with number
ranges. This commit extends the translation module from SMV to Copilot.
  • Loading branch information
ivanperez-keera committed Sep 22, 2023
1 parent 7cadbec commit 928b42f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ogma-core/src/Language/Trans/SMV2Copilot.hs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ ordOp2Copilot OrdOpGE = ">="
opOne2Copilot :: OpOne -> String
opOne2Copilot (Op1Alone x) = opOneAlone2Copilot x
opOne2Copilot (Op1MTL x op v) = opOneMTL2Copilot x op v
opOne2Copilot (Op1MTLRange op mn mx) = opOneMTLRange2Copilot op mn mx

-- | Return the Copilot representation of a unary logical non-MTL FRET
-- operator.
Expand All @@ -163,6 +164,15 @@ opOneMTL2Copilot operator _comparison number =
++ " " ++ "clock" ++ " "
++ show (1 :: Int)

-- | Return the Copilot representation of a unary logical MTL FRET operator
-- that uses an explicit range.
opOneMTLRange2Copilot :: Op1Name -> Number -> Number -> String
opOneMTLRange2Copilot operator mn mx =
opOneMTL2Copilot' operator ++ " " ++ number2Copilot mn
++ " " ++ number2Copilot mx
++ " " ++ "clock" ++ " "
++ show (1 :: Int)

-- | Return the Copilot representation of a unary logical possibly MTL FRET
-- operator.
opOneMTL2Copilot' :: Op1Name -> String
Expand Down

0 comments on commit 928b42f

Please sign in to comment.