nasa / ogma

Generator of runtime monitors for flight and robotics applications.
Other
335 stars 25 forks source link

`ogma-core`: Spec2Copilot backend does not perform variable substitution in top-level property names #120

Closed ivanperez-keera closed 9 months ago

ivanperez-keera commented 9 months ago

Description

When using property names as arguments to trigger, the Spec2Copilot backend does not apply the same variable/name substitution that was applied in their definition, thus referring in the call to trigger to an undefined argument.

Type

Additional context

None.

Requester

Method to check presence of bug

Running the backend with one of the examples available in ogma produces code that does not compile.

$ ogma fret-component-spec --fret-file-name ogma-core/tests/fret_good.json  > Example.hs
$ runhaskell Example.hs
Example.hs:58:35: error:
    Variable not in scope: behnazOne :: Stream Bool
   |
58 |   trigger "handlerbehnazOne" (not behnazOne) []

Expected result

When executed, the code produced by the Spec2Copilot backend does not report to an error due to a trigger stream identifier being undefined.

Desired result

When executed, the code produced by the Spec2Copilot backend does not report to an error due to a trigger stream identifier being undefined.

Proposed solution

Modify the definition of Spec2Copilot backend to apply the name substitution function to trigger argument names.

Further notes

None.

ivanperez-keera commented 9 months ago

Change Manager: Confirmed that the issue exists.

ivanperez-keera commented 9 months ago

Technical Lead: Confirmed that the issue should be addressed.

ivanperez-keera commented 9 months ago

Technical Lead: Issue scheduled for fixing in Ogma 1.3.

Fix assigned to: @ivanperez-keera.

ivanperez-keera commented 9 months ago

Implementor: Solution implemented, review requested.

ivanperez-keera commented 9 months ago

Change Manager: Verified that:

ivanperez-keera commented 9 months ago

Change Manager: Implementation ready to be merged.