Closed ivanperez-keera closed 9 months ago
Change Manager: Confirmed that the issue exists.
Technical Lead: Confirmed that the issue should be addressed.
Technical Lead: Issue scheduled for fixing in Ogma 1.3.
Fix assigned to: @ivanperez-keera.
Implementor: Solution implemented, review requested.
Change Manager: Verified that:
Solution is implemented:
FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install --yes software-properties-common RUN add-apt-repository ppa:hvr/ghc RUN apt-get update
RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4 RUN apt-get install --yes libz-dev
ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
RUN cabal update RUN cabal v1-sandbox init RUN cabal v1-install alex happy RUN apt-get install --yes git
CMD git clone $REPO && \ cd $NAME && \ git checkout $COMMIT && \ cd .. && \ cabal v1-install $NAME/ogma-cli/ $NAME/ogma-core/ --enable-tests --constraint "ogma-language-fret-reqs -test" && \ cabal v1-install $NAME/ogma-cli/ $NAME/ogma-core/ --enable-tests --constraint "ogma-language-fret-reqs -test" --run-tests -j1
Command:
```sh
$ docker run -e "REPO=https://github.com/nasa/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=448465b5d5bdbb4d62f051d7a27a475e1bdbc417" -it ogma-test
--- Dockerfile
FROM ubuntu:trusty
RUN apt-get update
RUN apt-get install --yes software-properties-common RUN add-apt-repository ppa:hvr/ghc RUN apt-get update
RUN apt-get install --yes ghc-8.6.5 cabal-install-2.4 RUN apt-get install --yes libz-dev
ENV PATH=/opt/ghc/8.6.5/bin:/opt/cabal/2.4/bin:$PWD/.cabal-sandbox/bin:$PATH
RUN cabal update RUN cabal v1-sandbox init RUN cabal v1-install alex happy RUN apt-get install --yes git
ADD sample.json /tmp/
RUN cabal v1-install BNFC copilot-3.18.1
CMD git clone $REPO && \ cd $NAME && \ git checkout $COMMIT && \ cd .. && \ cabal v1-install $NAME/$PAT**/ && \ ogma fret-component-spec --fret-file-name /tmp/sample.json > sample.hs && \ cabal v1-exec -- runhaskell sample.hs && \ echo "Success"
-- sample.json { "RTSASpec": { "Internal_variables": [], "Other_variables": [ {"name":"param", "type":"bool"} ], "Requirements": [ { "name": "one", "CoCoSpecCode": "true", "ptLTL": "((H (param) ))", "fretish": "Meaning not specified" } ] } }
Command:
$ docker run -e "REPO=https://github.com/nasa/ogma" -e "NAME=ogma" -e PAT="ogma-" -e "COMMIT=448465b5d5bdbb4d62f051d7a27a475e1bdbc417" -it ogma-verify-120
Change Manager: Implementation ready to be merged.
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 totrigger
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.
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.