                  Data Structures – Developer Information
                  ---------------------------------------
 
The following data structures are defined in fsm.h.
 
Transition information:
-----------------
The structure used to store information corresponding to the transitions of a state is shown below:
 
struct _trlist {
	char		*input;   
	struct _stlist  *next_state; 
	struct _trlist  *next;  
};

typedef struct _trlist TR_LIST;
 
input stores the name of the event triggering the transition. 
next_state is a pointer to the state to which this transition leads to.
All of the transitions allowed from a particular state are stored together in the
form of a linked list. next is a pointer to the next transition in this list.
 
State information:
-------------
 
The structure used to store information corresponding to the states of an FSM is shown below:
 
struct _stlist {
	char		*name;
	enum MRKD	marked;
	TR_LIST		*trans;
	struct _stlist  *next;
};

typedef struct _stlist ST_LIST;

name stores the name of the state.
marked determines whether this state is a final state
or not.  The MRKD enumeration is declared as enum MRKD {UNMKD, MKD};
trans is a pointer to the linked list of transitions allowed from this state
All of the states in an FSM are stored together in the form of a linked list.
next is a pointer to the next state in this list.

FSM information:
-------------
 
Currently the structure FSM show below is composed of just the ST_LIST linked list.
 
struct _fsm {
	ST_LIST		*states;
};

typedef struct _fsm FSM;
 
If future extensions of the library require more information pertaining to the FSM additional fields can be defined in the FSM structure.
 
Structure for storing names:
---------------------
Structure NAME_LIST shown below is used to create a linked list of character strings.  This could be names of states or names of transitions.  Currently it is only used by the reachability function. ???translist in fsmoperators is similar.
  
The structure used for this is shown below:
 
struct _namelist {
	char 		   name[MAX_LENGTH];
	struct _namelist   *next;
};

typedef struct _namelist NAME_LIST;
 
name is a character array used to store the name of the
state.  MAX_LENGTH is defined in the file fsm.h and refers to the maximum length of strings to be used in the program.  
next is a pointer to the next structure in this linked list.

Structures for Controllability and Masking information
------------------------------------------------------

The following structures are usually populated from information contained in the controllability/masking (_events) file.

MASK_LIST structure shown below is used for containing mask information for one supervisor. 

struct _masklist {
	char			original[MAX_LENGTH];
	char			masked[MAX_LENGTH];
	struct _masklist 	*next;
};

typedef struct _masklist MASK_LIST;

original stores the name of the event.
masked stores the name of the event as observed by the supervisor.
next is a pointer to the next structure in this linked list.
Through this linked list you can traverse through all of the events and determine their masked value.

MULT_MASKL structure shown below is used for containing mask information for multiple supervisors.

struct mult_masklists{
	MASK_LIST *masklist;
	struct mult_masklists *next;
};

typedef struct mult_masklists MULT_MASKL;

masklist is a pointer to a MASK_LIST structure.
next is a pointer to the next structure in this linked list.
Through this linked list you can traverse through all of the supervisors and determine their masking information.

CONT_LIST structure shown below is used for containing controllability information for one supervisor.

struct _contlist {
	char	event[MAX_LENGTH];
	enum TYPE type;
	struct _contlist	*next;
};

typedef struct _contlist CONT_LIST;

event stores the name of the event.
TYPE signifies if the event is controllable or uncontrollable for this supervisor.  The TYPE enumeration is declared as enum TYPE {UNCONT, CONT};
next is a pointer to the next structure in this linked list.
Through this linked list you can traverse through all of the events and determine their controllability value.

MULT_CONTL structure shown below is used for containing controllability information for multiple supervisors.

struct mult_contlists{
	CONT_LIST *contlist;
	struct mult_contlists *next;
};

typedef struct mult_contlists MULT_CONTL;

contlist is a pointer to a CONT_LIST structure.
next is a pointer to the next structure in this linked list.
Through this linked list you can traverse through all of the supervisors and determine their controllability information.