Explain Primitive Type Abstractions

Primitive Type Abstractions: An effective way to reduce the state space of a program is to replace the primitive types with the corresponding abstractions that encapsulate all the possible operations that are performed on these types.

These abstractions allow us to replace the actual primitive variables or the operations involving those with the non-deterministic choices with restricted range of values. This can cut down the number of states that has to be covered by the model checker dramatically.

As an example, consider the following class which encapsulates different operations that can be carried out on doubles.

964_primitive abs1.jpg

Here is the implementation for the operator==() which implements the real behavior of the operator:

2156_primitive abs2.jpg

With this abstraction it would be easy to reduce the potentially infinite state space required to model check the equality operator “==” with a binary choice (true or false)—just replace the “m_value == value” with “chooseBoolean()” in the body of the method.

   Related Questions in Programming Languages

  • Q : Define the term Blank final variable

    Blank final variable: A final variable which is not initialized as portion of its declaration. This variable should be initialized in either an instance initialization block or every of the constructors for its class before it is employed. A static bl

  • Q : Explain While loop While loop: It is

    While loop: It is one of Java's three control structures employed for looping. The other two are: do loop and for loop. The while loop comprises of a Boolean expression and a loop body. The condition is tested prior to the loop body is entered for the

  • Q : State the term multi programming State

    State the term multi programming.

  • Q : State the term Win32 State the term

    State the term Win32. Answer: Win32 considers to Microsoft 32 bit Windows API. Applications of Win32 are programs that are built along with the Win32 API.

  • Q : What is Logical error Logical error :

    Logical error: It is an error in the logical of a class or method. Such an error may not lead to an instant runtime error, however could have a noteworthy impact on overall program exactness.

  • Q : Explain Global variable Global variable

    Global variable: It is a phenomenon which is more generally regarded as being a trouble in structured programming languages than in object-oriented languages. In structured programming language, like C or Pascal, a global variable is one stated outsid

  • Q : Model Java Interface applications What

    What wide range of applications are provided by Model Java Interface?

  • Q : Explain Throws clause Throws clause :

    Throws clause: It is a clause in a method header pointing that one or additional exceptions will be propagated from this technique. For example:    public int find(String s) throws NotFoundExc

  • Q : Define the term Punctuation Define the

    Define the term Punctuation: Symbols like commas and semicolons that a compiler employs to understand the structure of the program.

©TutorsGlobe All rights reserved 2022-2023.