supports integer, Boolean and
integer arrays for the purpose of efficient verification.
However, advanced data structures (e.g., stack, queue, hashtable and so
on) are necessary for some models. To support arbitary data structures, PAT
provides an interface to create user defined data type by inheriting an
following is one simple example showing how to create a hashtable
//the namespace must be PAT.Lib, the class and method names can
public void Add(int
/// Return the
/// Return a deep
/// Return the
following requirements when you create your own data structure
namespace must be “PAT.Lib”, otherwise it will not be recognized. There is no
restriction for class names and method
- Importing the PAT Expression name
space using “using
public methods can be used in PAT models
parameters must be of type “bool”, “int”, “int” (int array) or object
(object type allow user to pass user defined data type as
number of parameters can be 0 or many.
return type must be of type “void”, “bool”, “int”, “int” (int
array) or user defined data type.
method names are case sensitive.
the compiled dlls in “Lib” folder of the PAT installation directory to make
the linking easy by using #import
methods need to handle exceptional cases, you can throw PAT runtime
exceptions as illustrated as the following example.
public static int StackPeek(int array)
//throw PAT Runtime
import the libraries in your model, users can using following
#import “PAT.Lib.Hashtable”; //to import a library under
Lib folder of PAT installation path
“C:Program FilesIntelHashtable.dll”; //to import a library using absolute
declar the user defined types in your models, please use the following
var<HashTable> table; //use the class name here
as the type of the varaible.
invoke the public methods in your models, please use the
- table.Add(10, 2);
Copyright © 2007-2009 School of Computing, National University of