Embedding C Code-Promela

Embedding C Code: Promela supports the use of embedded C code fragments inside the models through the use of the c_code primitive.

12_c code.jpg

For example:

2413_c code2.jpg

If the logical expression is specified, its value is evaluated before the c_code fragment inside the curly braces is executed. If the result of the assessment is non-zero, the c_code fragment is executed. If the outcome of the evaluation is zero, the code between curly braces is ignored, and the statement is treated as an assertion violation. The example above adds checks for null pointers and bounds on array indices.

Many other code verifiers which do not necessarily use Promela as their modeling language use SPIN as a back-end verifier.

   Related Questions in Programming Languages

  • Q : Define Short-circuit operator

    Short-circuit operator: It is an operator in which only as a lot of operands are computed as are required to determine the final outcome of the operation. The logical-and (&&) and logical-or (||) operators are most general illustration, though

  • Q : What is Central Processing Unit Central

    Central Processing Unit: The Central Processing Unit (that is, CPU) is the heart of a computer as it is the portion that includes the computer's capability to follow instructions. Each kind of CPU has its own instruction set.

  • Q : Define the term Interprocess

    Define the term Interprocess communication: It is the ability of two or more separate processes to communicate with each other.

  • Q : ArrayLists I. The Assignment The

    I. The Assignment The Bashemin Parking Garage contains a single lane that can hold up to ten cars.  Arriving cars enter the garage at the rear and are parked in the empty space nearest to the front.  Departing cars exit only from the front.  If a cu

  • Q : Differences between XHTML and HTML

    Explain the differences between XHTML and HTML?

  • Q : What is a Pipe Pipe : It is a linkage

    Pipe: It is a linkage between the two program components. One component responds as a source of data, and writes into the pipe. The second components act as a receiver (that is, sink) for the data and reads from pipe.

  • Q : Explain the segmentation with paging

    Explain the segmentation with paging.

  • Q : Walk through the steps essential to

    How can you walk through the steps essential to parse XML documents?

  • Q : Search and Partial Coverage of Java

    Search and Partial Coverage: JPF supports well-known search strategies such as BFS and DFS as well as various heuristic-based searches such as A*, Best-First, and Beam Search. You can sum a number of heuristics during the search, and set search depth

  • Q : What is First in-first out First in,

    First in, first out: It is FIFO semantics of the queue data structure. Items are eliminated in the order in which they arrived in the queue; therefore older items are always eliminated before newer ones.

©TutorsGlobe All rights reserved 2022-2023.