--%>

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 : Program for Linux operating system that

    Write a program for Linux operating system that uses Posix threads to sort a large array.  Specifically, you should write a program to generate random numbers. Then create at least two threads, each of which sorts a portion of the array. After the thr

  • Q : How you can develop your capability in

    How you can develop your capability in test?

  • Q : What is Unique Identifier What is

    What is Unique Identifier and how do I determine one?

  • Q : Define Compiler Compiler : A program

    Compiler: A program that executes a process of compilation on a program written in the high level programming language.

  • Q : State Null character State Null

    State Null character: The \u0000 character. The care must be taken not to confuse this with null reference.

  • Q : State the term URL path State the term

    State the term URL path?

  • Q : Explain Look-and-feel Look-and-feel :

    Look-and-feel: The visual impression and interaction style given by a user interface. This is mainly the responsibility of the window manager (that is, in collaboration with the fundamental operating system) running on a specific computer. This refers

  • Q : What is an Anonymous class Anonymous

    Anonymous class: It is a class formed without a class name. Such a class will be a sub class or an implementation of an interface, and is generally formed as an actual argument or returned as a method outcome. For example:

    Q : Illustrations of XML DTDs or schemas

    Give some illustrations of XML DTDs or schemas which you have?

  • Q : What is an Instance variable Instance

    Instance variable: It is a non-static field of a class. Each and every individual object of a class has its own copy of this field. This is in contrary to a class variable that is shared by all instances of class. Instance variables are employed to mo