Académique Documents
Professionnel Documents
Culture Documents
discussions, stats, and author profiles for this publication at: http://www.researchgate.net/publication/272340385
DOWNLOADS
VIEWS
39
14
4 AUTHORS, INCLUDING:
Houda Chanti
Laurent Thiry
Universit de Haute-Alsace
Universit de Haute-Alsace
2 PUBLICATIONS 0 CITATIONS
30 PUBLICATIONS 34 CITATIONS
SEE PROFILE
SEE PROFILE
Michel Hassenforder
Universit de Haute-Alsace
28 PUBLICATIONS 80 CITATIONS
SEE PROFILE
KEYWORDS
Domain Specific Language (DSL), algebra, functional
programming, fire safety.
ABSTRACT
The certification of fire safety systems requires the intervention of many specialists. Each one uses his own language and tools. In order to model such systems, many
models/languages should be formalized and integrated.
In this context, the paper proposes to use algebraic specifications to model, transform and compose the required
Domain Specific Languages (DSLs) required. The various DSLs (architectural, material, simulation, interval,
etc.) required to model the fire safety of a building are
described, combined and illustrated by an example from
a real case.
INTRODUCTION
&SBO
The block &MISC describes the global simulation properties. This one is filled by a fire safety engineer. The
block &REAC is obtained from a chemist, and consists
on the parameters of the combustion model. The
block &LOC describes the geometry of one local in a
building and the characteristics of it construction
materials and fire resistance. These parameters are
obtained respectively from an architect and a fire safety
engineer. The &OUV block gives mainly architectural
information, but also leakage (physics) when the
opening is closed. The &SBO block gives information
about the location of the fireplace and also the parameters of the combustion curve based on the fuel material.
The problem is that architects, chemists or fire safety
engineers should use their own (specific) languages, but
they have to follow an error prone complicated language.
A tool making the automatic translation and composition of they own language will be really helpful to generate the initial configuration of the fire simulator. In computer science, languages used by specialists are called
Domain Specific Languages (DSLs): see (Van Deursen
et al. (2000)) for a more precise definition of the concept
and examples. These languages are: 1) based on concepts and features of a domain, and 2) used to describe
and generate programs in a specific field. The use of
DSLs offers the possibility for analysis, optimization and
transformation of models, and has the advantage to enable the reuse of software artifacts, (Biggerstaff (1998);
Fowler (2010)).
Computer science proposes concepts and tools to
specify, transform or compose specific languages. In
particular, a term (or a textual representation of a
model) is simply a sequence of characters that is split
and analyzed to build a value of a particular datatype.
This value is then used for instance to compute another
value or to generate another term for another language
(this is called the interpretation of the term or its
projection to a semantic domain).
As an illustration of a simple DSL, a simple language
for elementary relational expressions is defined by a
comparison (using a lower symbol) between two expressions <Exp> "<" <Exp>, a sequence of two expressions
<Exp> "&&" <Exp>, a string or just a value Val. This
little language can be formalized by the data type Exp.
To manipulate the datatype, some functions must be
defined.
One of the aims of a parser is to store the information analyzed by using a specific datatype. The final
questions that may arise after this presentation are: 1)
how to reason about languages and how to manipulate
them? and 2) what are the concepts, formalisms and
data Exp =
|
|
|
Inf(Exp,Exp)
And(Exp,Exp)
Symb String
Val Int
--inf :
--and :
--symb:
--val :
Exp x Exp
Exp x Exp
String
Int
->
->
->
->
Exp
Exp
Exp
Exp
The simulation is then sent to the generator which generates several configurations. Theses latest are processed by the simulator which generates physical quantities. The simulation results are controlled to check
if some conditions (the definition of undesired events)
has been reached or not (figure 3). More precisely, the
evaluation of the safety level in a building is based on
the frequency occurrence of the U E. The checker is in
charge of this task.
The architectural model
Based on a digital map, information concerning the geometry of the building, dimension and position of the
different openings are extracted from an IFC (IFC: Industry Foundation Classes, is a standard which allows
building simulation software to automatically acquire
building geometry and other building data from project
models) format (Spearpoint (2006); Martens and Herbert (2004)), one of the specific languages used by architects. An example of an IFC file is:
#9512= c(3y21AUC9X4yAqzLGUny16E,
#16,Story,$,$,
#9509,
$,$,.ELEMENT.,6200.);
#9509= IFCLOCALPLACEMENT(#115,#9506);
#9506= IFCAXIS2PLACEMENT3D(#9502,#9498,#9494);
#9502= IFCCARTESIANPOINT((0.,0.,6200.));
#9498= IFCDIRECTION((0.,0.,1.));
#9494= IFCDIRECTION((1.,0.,0.));
data Ifc = Ifc [(Int, String, Value)]
Ifc
-> [String]
(Ifc, String) -> [Int]
(Ifc, Int)
-> (String,[Value])
(Ifc, String) -> (String,[Value])
[]
f
cs
([], t)
(f, t)
=
=
=
=
=
[]
map (snd
[c where
[]
map (fst
and
and
f where snd(a,b,c) = b)
(k, c, v)<- cs]
f where (t== snd f
fst (a,b,c) = a
snd (a,b,c) = b ))
data
data
data
data
SBO = Sbo[(String,Params)]
MAT = Mat[(String,Params)]
Params = Par[(String, Value)]
Value = R Real | S String
::
::
::
::
::
::
String
(SBO, String)
(String, Params)
String
(SBO, String)
(String, Params)
->
->
->
->
->
->
SBO
[Params]
SBO
MAT
[Params]
MAT
= []
= filter (par lb)
where par l = (fst l ==id)
insertSbo Sbo(s,p)[] = [(s, p)]
insertSbo Sbo(s,p) lb = lb ++ [(s, p)]
The function filter process on the library lib by applaying the function par which returns the list of parameters
corresponding to a specific identifier (id). The insertSbo
insert a new component in a library by concatenating
(at the end of the list) the existing library with the new
element (++).
The Undesired Event (UE)
An undesired event (UE) is defined by some safety properties. It is specified as the last event in a chain of
events with devastating impact on one or more individuals, ecosystems or materials. It is strongly correlated
to the thermal conditions, the amount of toxic gases and
smokes, and the pressure in a local. It is considered as
Factor)]
String
Params
Float | Room Int
[]
ev++[(o,s,v)]
[]
filter (rm u)
where rm (o,s,v) = (s=="Room" && v ==i)
local []
= []
local u
= filter (ro u)
where ro (o,s,v) = (s=="Room")
eval(Inf(i,s,v),c,t)
= c(t,s) < v
eval(Sup(i,s,v),c,t)
= c(t,s) > v
eval(Amp(i,e1,e2),c,t) = eval(e1,c,t) && eval(e2,c,t)
Simulation
type Time
= Integer
type Context = (Time, String) -> Float
::
::
::
::
::
String
-> UE
(UE, Context, Time)
-> Bool
(Time, Factor, Factor, UE) -> UE
(UE, Int)
-> [Params]
UE
-> [int]
coded and attached to a datatype Simu, which is abstracted by a list of a string for the component identifier (e.g. MISC, LOC,OUV), and a list of properties.
Each property is made by a couple of property identifiers abstracted by a string (e.g. ID, PLAN, GEO) and
the value of that identifier. The formalization of the
datatype Simu leads to the set of sorts S specifying a
simulation S = {Simu, P rop, V alue}. The definition of
a simulation is coded with Haskell as follow:
data Simu
data Prop
data Value
= Simu[(String, [Prop])]
= Prop(String, Value)
= V String | IS Float | I Int
[]
map (snd(s,p) where snd(a,x:xs)=xs)
[]
map (fst(a,p) where fst(s,x:xs)=s)
REFERENCES
Van Deursen A.; Klint P.; and Visser J., 2000. DomainSpecific Languages: an annotated bibliography. SIGPLAN Not, 35, no. 6, 2636. ISSN 0362-1340.