--%>

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 : Kernel Mode Illustrate what are the

    Illustrate what are the different functions of Kernel Mode, interrupts and system calls?

  • Q : What is Priority level Priority level :

    Priority level: Each and every thread has a priority level that point out to the scheduler where it must be placed in the pecking order for being run. The eligible un-blocked thread with a specific priority will always be run prior to an eligible thre

  • Q : Explain Right shift operator Right

    Right shift operator: Right shift operator (>>) is the bit manipulation operator. It shifts the bits in its left operand zero (0) or many places to the right, according to the value of its accurate operand. The most important bit from before the

  • Q : Define software Define the term

    Define the term software?

  • Q : Define Thread Thread : It is a

    Thread: It is a lightweight procedure which is managed by the Java Virtual Machine (abbreviated as JVM). Support for threads is given by the Thread class in java.lang package.

  • Q : Define Inner class Inner class : A

    Inner class: A class defined within an enclosing method or class. We use the word to refer to non-static nested classes.

  • Q : How can I get an exact image in a web

    How can I get an exact image in a web page?

  • Q : What are the applications of testing

    What are the applications of testing life cycle?

  • Q : State Sub type Sub type: It is a type

    Sub type: It is a type with a parent super type. The sub-type or super-type relationship is more common than the sub-class or super-class relationship. A class which implements an interface is a sub type of interface. An interface which expands the ot

  • Q : Define Unconditional Jumps

    Unconditional Jumps: Jumps which are not strictly upwards in the block hierarchy can require extensive control-flow manipulation, including creation of redundant code, and should be avoided if possible. Such jumps add considerable modeling overhead fo