1
//////////////////////////////////////////////////////////////////////////////////
2
// This file is part of Toolkit for Conceptual Modeling (TCM).
3
// (c) copyright 2001, Universiteit Twente.
4
// Author: Rik Eshuis (eshuis@cs.utwente.nl).
6
// TCM is free software; you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation; either version 2 of the License, or
9
// (at your option) any later version.
11
// TCM is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
16
// You should have received a copy of the GNU General Public License
17
// along with TCM; if not, write to the Free Software
18
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20
////////////////////////////////////////////////////////////////////////////////
21
#ifndef _ADSVALUATION_H
22
#define _ADSVALUATION_H
24
#include "atdactionstatenode.h"
31
#include "adsclockmanager.h"
37
enum StateType {unstable, stable}; // in unstable state an event has occurred
39
/// Class to model the valuation of the state variables (configuration, terminated action state nodes, variables, clocks)
40
class ADSValuation: public Node {
41
/*@Doc: {\large {\bf scope:} } */
44
ADSValuation(ADSCks *c,StateType s );
48
Subject *Clone(){return new ADSValuation(*this);}
50
ADSValuation(const ADSValuation ©);
52
ADSValuation(const ADSValuation ©,StateType s);
54
bool operator==( ADSValuation &comp);
56
void Write(OutputFile *f) ;
60
void GetConfig(Bag <Subject *> *);
62
void SetConfig(Bag <Subject *> c);
64
void GetPropList(List <PropVal *> *);
66
void SetPropList(List <PropVal *> p);
68
void GetQueue(List <PropVal *> *);
70
void SetQueue(List <PropVal *> p);
72
void GetTerminated(Bag <ATDActionStateNode *> *);
74
void AddTerminated(Bag <ATDActionStateNode *> t);
76
void GetQTerminated(Bag <ATDActionStateNode *> *);
78
void AddQTerminated(Bag <ATDActionStateNode *> t);
80
ClockManager GetClockManager();
82
void SetClockManager(ClockManager&);
84
void GetClockConstraints(List <ClockConstraint *> *);
86
void SetClockConstraints(List <ClockConstraint *> );
88
void GetQClockConstraints(List <ClockConstraint *> *);
90
void SetQClockConstraints(List <ClockConstraint *> );
92
bool HasClockConstraints(){return (clist.count()>0);}
93
/// set index for model checker input
95
/// get index for model checker input
98
bool isStable(){return (st==stable);}
100
void makeStable(){st=stable;}
104
bool hassameconfig( ADSValuation &comp);
108
/// Configuration (containing nodes only)
109
Bag <Subject *> cfg; //Nodes from hyperedge
110
/// Terminated action state nodes
111
Bag <ATDActionStateNode *> tlist; //Subbag from cfg
112
/// Boolean properties valuations
113
List <PropVal *> plist; // Abstraction from LVar + input
116
/// list of timeout events
117
List <ClockConstraint *> clist;
119
StateType st; // stable or unstable
121
int index; // index for for model checker input
123
int key; // key for hashtable
125
///queue (only for implementation level semantics
126
List <PropVal *> queue;
127
/// terminated activities (only for implementation level semantics)
128
Bag <ATDActionStateNode *> qtermlist; //Subbag from terminated
129
/// list of timeout events in ILS semantics
130
List <ClockConstraint *> qclist;