IME 1960 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986. 1.075
LINGUISTIC DYNAMIC MODELLING USING LOGIC PROGRAMMING
A. Camara, P. Antunes, M. Pinheiro and J. Seixas
Environmental Systems Analysis Group
College of Sciences and Technology
New University of Lisbon
2825 Monte da Caparica, Portugal
Abstract. A new dynamic modelling methodology, SLIN, allowing for the
analysis of systems defined in qualitative or quantitative terms is
presented. Simulation of qualitative characteristics is performed by
applying a set of logical rules which include base, tactical, strategic and
structural change rules. Quantitative simulation applies traditional
system dynamics concepts. To make the transition from qualitative into
quantitative modes, logical rules are also used. SLIN is advantageously
implemented on a very high level language such as PROLOG, as shown in
this paper. To illustrate its potential applications, simple water quality
models are included.
INTRODUCTION
The qualitative component of reality has been traditionally neglected by
modeilers. As a result modeis have widen the gap between qualitative and
quantitative worlds. They usually are incompiete and of no practical
application whenever quantitative information is missing.
In the field of dynamic modelling, Wenstop (1976) among others proposed
fuzzy set theoretic based concepts to model qualitative systems. Ten
years have past however without significant applications of Wenstop
method, maybe due to the little appeal fuzzy set theory has for
practitioners.
Camara et al. (1985) presented a new linguistic dynamic simulation
methodology, named SLIN (after Simulagao LINguistica), which attempts to
model qualitative phenomena: using simple logical rules. In this paper, a
new improved version of SLIN is presented. Its implementation on a very
1,076 THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986.
high level language such as PROLOG is also discussed. Simple water
quality models are included to illustrate its potential applications.
SLIN THEORETICAL PRINCIPLES
SLIN is a fuzzy simulation methodology which is not patterned after fuzzy
set theory but applies instead simple logic concepts. SLIN has two
modules: an operational module and a support module. The oj-erctiona
module consists of a modelling methodology that allows for quz:litative
and quantitative simulation. The support module is a knowledge base
Operational Module
The. quantitative dynamic modelling in SLIN is made using traditional
system dynamics. Herein, attention. will be focused on SLIN's linguistic
modelling capabilities. SLIN allows for qualitative modelling through
semantics and a particular syntax. The model semantics consists of
defining the meaning of the system characteristics and their degrees. The
syntax relies upon a set of logical rules.
Characteristics can be either qualitative or quantitative. They are grouped
in layers with degrees evolving through time. A characteristic belongs to
the base layer if its degree at time t does not depend on the degree of any
other base characteristic at t. A characteristic belongs to a hisher order
layer if its degree at a given instant may be inferred from the degree or
degrees assumed by lower order characteristics at that instant. A higher
order characteristic is defined always using a higher.level of aggregation.
Degrees are associated with qualitative scales (i.e., high, medium, low) or
quantitative metrics, depending on the nature of the characteristic
The main objective of SLIN is to determine the degrees associa!ed with
the system base characteristics at time t+dt, where dt is the simulation
step, knowing the degrees assumed by those characteristics at time t. This
process is called the "horizontal" simulation step. The "vertical" step
consists of defining the degrees of characteristics belonging to higher
order layers, knowing the degrees of base characteristics and occurs at a
precise point in time: the end of each simulation step.
HME 1980 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986. 1.077
SLIN allows for simulation when all the characteristics are qualitative or
quantitative but also accomodates information flows between qualitative
and quantitative characteristics.
Simulation of Qualitative Characteristics
The key element in the dynamic simulation of qualitative characteristics
is a set of rules which include: base, tactical, strategic and structural
change rules. Another important component is the consideration of
uncertainty.
Base rules. Base rules are lower level rules that allow one to obtain the
degrees of the system characteristics at time t+dt given their degrees at t
(horizontal simulation), and the degrees of characteristics of layer i+1
given the degrees of characteristics belonging to layer i (vertical
simulation).
To perform the horizontal simulation operations, one considers the
following generic representation for each equation:
{Action Op1 Memory Op2] Xtedt
The component "Action" is similar to the rate terms in the level equations
of traditional system dynamics. This component provides a "preliminary"
degree for x;, 4}, taking into acount the degrees of x and other independe=*
variables at time t, that is:
Action={ a,* by“... ® 24}
To determine this contribution, one may define trees enumerating all
possible combinations of degrees for the independent characteristics and
the resulting degrees for the dependent characteristic such as in Fig. 1.
Feasibility considerations should be used to eliminate branches in trees to
improve computational efficiency.
Another alternative, which is less explicit but much more efficient
consists of a set of built in operators that allow one to automatically
1.078 THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986,
simulate. These operators are defined as follows:
ap © bp * Of % . * 2, Opt (xt, q))prelim
If charac’ ristics a, b, c, ..., z have a similar influence on the degree of x,
typical o-.erators Op1 are the majority rule operator, the average rule
charact 1, * charact 2, Opt charact 3 4, 4¢
_ AN Ts fy
|
L M
==
Kid L
Strat
H—High; M—Medium; L—Low
Ficure 1. Example of a tree defining the action contribution
operator anc the additive rule operator, depending on the type of operation
on ‘Fz degrees of the independent characteristics.
If a, b, c, ..., z have a different influence on x, then one selects the most
influent characteristic of the set {a, b, c, ..., z} as the dominant
characteristic "dom". The degree of x will be equal to the degree of "dom"
more or less a number of degrees which depends on the relative dominance
of "dom" cver the other independent characteristics. Operators Op1 are in
this case, named after the degree of dominance, i.e., superdominance,
overdominance or dominance rule operators. .
The final degree for Xt, gt depends however on another term which may
called the "memory" of the equation. This component attempts to reproduce
the accumulation process present in typical finite difference calculus and
neglected in previous qualitative dynamic simulation methods (Wenstop
(1976), Camara et al. (1985)}). The memory includes:
THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986. 1.079
Memory= { Xto-p Actionig.- Threshold rate }
where:
Xto-t= set of degrees of the dependent variable x from intial time to
up tot
Action to-t= Set of degrees representing the action component
contributions from to up to t
Threshold rate= a term that taking into account the degree of x;, previous
action contributions Action to-t 2nd the current action
contribution (xt,.q) prelim, determines the final degree of xXi4.q¢
This threshold rate term enables Xtyat t0 assume a different (or similar)
degree from x;, by considering that the accumulation of the contributions
of a certain action during a number of integration steps is higher (or
lower) than a given threshold limit.
Note that: in typical upward or downward x trajectories, the influence of
the action and the memory are identical (Fig. 2 (a) (b)); in oscillating
modes, every saddle point, represents the superiority of the action over
the memory (Fig.2 (c)); and in stable trajectories, memory prevails over
net action contributions (Fig. 2 (d)).
To perform vertical simulation operations similar processes to the ones
used to determine the action component contribution are applied.
1.080 THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986.
A 4
x _ XhK—
{____ er
@ ' o) |
r\
it xX
——EE ——
© ' @ |
Fig. 2 Trajectories for dependent characteristics x: (a) upward;
(b) downward); (c) oscillating; (d) stable
Tactical rules. Tactical rules are divided into “tic-tactical" and
"metatactical". rules. The latter direct the simulation, by assigning the
characteristics for which one wants to obtain degrees at the end of each
simulation step ("destinies"). The former define for each equation the
simulation step dt to be used which varies with the nature of the
dependent characteristics. Resulting synchronization problems are
identified by using a timed Petri net construct and solved subsequently
using PERT.
Strategic rules. While base and tactical rules apply within the simulation
step, strategic rules intend to coordinate the simulation process during
the whole simulation period. Strategic rules may be applied to connect
simulation objectives set by the modeller to the "destinies" to be defined
at the tactical level.
Strategic rules can also be used to guide backtrack searches to explain the
THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986. 1.081
degrees of characteristics of high order layers in terms of base
characteristics.
Structural change rules. Structural change rules are designed to
accomodate the possibility of eliminating or _incoprporating
characteristics and changing rules at a given time t during the simulation
process, taking into account the trajectories defined by the same
characteristics up to that time.
The adoption of PROLOG to implement SLIN will greatly facilitate the
creation of learning capabilities in the simulation models, following the
Al tradition (Carbonnel (1983)). The implementation of these capabilities
will provide the methodology with automatic structural change
mechanisms.
Uncertainty considerations. Uncertainty may also be incorporated in the
simulation of qualitative characteristics. Uncertainty can be due to
randomness (hard uncertainty) or lack of knowledge (soft uncertainty).
The consideration of hard uncertainty applies to each simulation step dt
and may be dealt with Monte Carlo methods. Soft uncertainty conditions
are more relevant if one considers several simulation steps n.dt. The
method proposed, in this case, consists of an analysis of the model output.
If discrepancies between obtained and expected results are considered to
be significant, then the model is restructured; otherwise, the information
produced should be incorporated into the support base. Note that this
approach is intimately connected to the model verification and structural
change.
Quantitative- Qualitative Information Flows
Quantitative-qualitative information flows in any layer may be considered
by a number of methods.
In the first case, one can easily transform a quantitative into a qualitative
characteristic by applying a value function. From then on, one may proceed
as described for the simulation of qualitative characteristics.
The transformation of qualitative into quantitative flows may also use the
1.082 THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986.
value function method. Other aproaches include the definition of logical
rules and the application of fuzzy set theoretic concepts. The most
promising of these is the adoption of logical rules. Suppose that one wants
to perform an operation of the type:
qual. characti, * quant. charact.j, Op quant. charact. k ty¢t
This means that qualitative characteristic i has a quantitative influence
on the quantitative characteristic j in terms of quantitative
characteristic k. For instance if:
citizen information , * pollution load , Op pollution load 4,44
where “pollution load" and "citizen information" are quantitative and
qualitative characteristics, respectively, one may perform operation Op by
establishing rules of the type:
if citizen information is [high medium low] then pollution load at t+dt
will be a X% of pollution load at t.
Support Module
The support module consists of a knowledge base which includes a
dictionary with the characteristics, qualitative scale and quantitative
metrics, the built in operators, the tree rules, and the "memory" terms for
each equation-- all the valid information produced by each simulation step
in terms of dependent characteristics and action contributions and the
threshold rates.
IHE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986. 1.083
SLIN-IMPLEMENTATION
A simplified version of the SLIN methodology was implemented in PROLOG
on a VAX 11/780 system. Table 1 shows a portion of a PROLOG program
illustrating the main procedures of SLIN and also the definition of the
majority rule operator (named "freq" in the program).
The major problem with the application of this version lies on its user
"unfriendliness". In order to make query, the user has to introduce N (the
number of desired iterations); a list containing the initial degrees of the
characteristics; and another list indicating, for each characteristic, which
are the characteristic it depends on and also which is the operator to be
used. Some of the operators (like the majority rule in the sample program)
are already “pre-defined”, but the user can introduce his own operators as
clauses added to the program.
PROLOG is highly suitable to implement a logical rule based methodology
such as SLIN. "Friendly" interfaces will have to be developed however to
use it in practical applications.
SLIN--APPLICATION
To illustrate SLIN applications, let us consider a simple estuarine water
quality management case. The estuary has a bivalve zone which suffers
impacts from agriculture runoff and domestic effluents discharged
upstream.
The system is described by the following characteristics: precipitation;
runoff (measured by its inorganic suspended solids content), domestic
effluents (measured by its organic suspended solids content), habitat
substrate (measured by both organic and inorganic solids content), bivalve
diversity, productivity and quality. These characteristics may be assessed
in quantitative or qualitative scales depending on their nature.
A model using SLIN can be developed for this system with design
objectives such as: determine the most appropriate time of the year to
catch bivalves, under a fuzzy information state; define domestic effluent
discharge patterns to minimize impacts upon the bivalve populations; to
1.084 THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986.
TABLE 1 Sample Listing of a PROLOG Program for SLIN
sim (O, O, V) :- escreve(V).
sim (N,"O, V) :- N1 is N - 4, iterar(O, V, NV), escreve(V), n1, sim(N1, O, NV).
iterar ({], _, []).
iterar ([Op|Pos]|B], V, [Variavel|NV1]}) :- corresp(1, Pos, V, Lista),
oper (Op, Lista, Variavel),
iterar (B,V, NV1).
corresp (, [], _, 0).
corresp (N, [N|R], [A1|R1], [A1|R2]) :- N1 is N+1, corresp(N1, R, R1, R2).
corresp (N, [K|R], [A1|R1], R2) + N14 is N +1, corresp(N1,[K|R], R1, R2).
oper(freq, Lista, Result) :- freq(Lista, AuxLista), maxfreq(AuxLista, Faq,
Result).
frea(], ).
freq([AIR],K) :- freq(R,K1), ins(A,K1,K).
ins(A, [),{(A,1])-
ins(A,[A,PIXL[A,QIIX]) = Q is P+t.
ins(A, [[B,P]IX1,[[B,PIIY]) = ins(A,X,Y).
maxfreq([],O,_).
maxfreq([[A,P]|R],P,A) :- maxfreq(R,Q,V), P>= Q.
maxfreq([[A,P]|R],Q,V) :- maxfreq(R,Q,V), P<Q.
escreve({]).
escreve([A|R]) :- write(A), tab(2), escreve(R).
‘THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986. 1.085
maintain a sustainable ecosystem with high long term levels of bivalve
Productivity and quality.
To operate such a model a number of rules have to be formulated. At the
base level, dependent characteristics of interest are the bivalve diversity,
productivity and quality. Independent characteristics representing the
action component of the model equations include precipitation, runoff and
domestic effluents. The memory component of each -equation consists of
dependent characteristic and action component trajectories, and a
threshold rate term. An example of a base rule for this system is:
Action Memory
{[runoff * domestic effluents] Op1 [bivalve quality tg.4, action to.4,
threshold rate term] Op2} bivalve quality tedt
In this equation, Op 1 could be a dominance rule type operator, and the
threshold rate term could mean, for instance, that if the action
contribution is medium twice in a row, the bivalve quality at t+dt is one
degree higher than at t. The impacts upon bivalve quality over time could
be divided into five categories depending upon the relative dominance of
runoff and domestic effluents influence as shown in Fig. 3.
1,086 THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY, SEVILLA, OCTOBER, 1986.
Bivalve * 7 Bivalve t..
Quality oni Quality —_
pe 7
t t
(a) (b)
4 4
Bivalve Bivalve
Quality Quality i
a a
Bivalve
Quality
Figure 3 Evolution of bivalve quality: (a) maintained dominance of runoff;
(b) maintained dominance of domestic effluents; (c) maintained
balance; (d) dominance of runoff followed by domestic effluents
dominance; (e) dominance of domestic effluents followed by
runoff dominance
THE 1986 INTERNATIONAL CONFERENCE OF THE SYSTEM DINAMICS SOCIETY. SEVILLA, OCTOBER, 1986. 1.087
SUMMARY AND CONCLUSIONS
A new linguistic dynamic methodology using logic programing, SLIN, was
introduced in this paper. SLIN models systems defined by characteristics,
which may be qualitative or quantitative, grouped in layers, and with
degrees evolving through time.
Simulation of qualitative characteristics is performed by applying a set of
logical rules which include base, tactical, strategic and structural change
rules. To make the transition from qualitative into quantitative modes,
logical rules are also used. SLIN is the first qualitative modelling
methodology to have "memory" in the model equations by applying simple
threshold logic concepts.
SLIN is adequately implemented on PROLOG, although some problems
remain to create a user-friendly environment.
Qualitative dynamic modelling has many applications in many areas. One of
these, is certainly environmental engineering as shown herein with simple
water quality management models.
REFERENCES
Camara, A., J. Seixas, M. Pinheiro and P. Antunes (1985). Linguistic
Simulation--Theory and Practice. The 1985 International
Conference of the System Dynamics Society, Keystone, Colorado.
Carbonell, J. et al. (1983). Machine Learning, Part |: A Historical and
Methodological Analysis. Report CMU-CS-8B-135, Carnegie Mellon
U., Pittsburgh, Penn.
Wenstop, F. (1976). How Can One Explicitly Represent the Fuzzy Nature
of Social Causal Relations in Formal Models? Fuzzy Set
Simulation Models. Proceedings of the 1976 International
Conference of the 1976 International Conference on System
Dynamics, Geilo, Norway.