Design in logic Zsuzsanna Mfirkusz The structure of the paper is as follows: This paper presents a new technique for the solution of CA D problems. The technique is illustrated on an architectural example. The designing knowledge is represented in the form of axioms described in the language o f mathematical logic. The calculi o f logic which manipulate these axioms can be used to model designing processes. If Horn formulas are used the description of the technical problem can be considered as a program written in PROLOG. A new architectural application of PROLOG is introduced, in the form o f the design of a multistorey livinghouse. The first program generates different versions of ground-plans according to the special needs o f the customer. During the design o f the house those versions are selected which meet the functional requirements, the dimensions and the environmental data o f the building. Keywords: architectural design, mathematical logic, design process
Designing is one of the most important abilities of human creativity. It is a great challenge for computer scientists to formalize different design processes. Artificial intelligence research has as an aim the modelling and implementation of the process of human problem solving by computers. During a problem solving process, such as design, the following subtasks can be clearly separated : • accumulation and selection of the information that is necessary and sufficient to solve the problem • choosing an adequate knowledge representation for the computer • elaboration of new problem solving methods that can be mechanized (eg computer programs, deduction systems) This paper uses the discipline of logic that studies the regularities of human thinking. Mathematical logic and model theory started to develop at the beginning of the twentieth century and have been developing very rapidly since then. They define abstract structures that are suitable for modelling that part of the world which is currently of interest, ie which is relevant to the problem in hand. The aim of the present paper is to show that the models of classical mathematical logic, the t-type models, and their modification, the many-sorted models, can be applied almost directly to represent certain design tasks 1 . If a logic based programming system using a mechanized deduction system is available, the logic representation of the design task may yield the automated solution of our problem. The PROLOG programming system can be used for this purpose 2-4 .
Computer and Automation Institute, Hungarian Academy of Sciences, 1111 Budapest, Kende utca 13-17, Hungary
• We show a new application of PROLOG in the field of CAD. A previous architectural CAD application of PROLOG has been published elsewhere s . In the course of solving the problem posed there - namely the design of different ground-plans for large panel apartments - it turned out that PROLOG can be applied to the solution of architectural problems 6-1° . The program system presented here makes use of the experiments performed in the previous work; however it is also based on some other architectural concepts. Furthermore, this new program system does not only produce variants of apartment ground plans, but aims to contribute to the architectural design of complete dwelling houses. • We introduce many-sorted models and show how they can be applied to represent the given architectural CAD task in many-sorted logic. Afterwards we show a few fragments of a PROLOG program that solves the problem discussed above. The programs were tested and run on a Siemens 7.7.55 computer of the Institute for Coordination of Computer Technique and further adapted and modified on an IBM 3031 computer at the Hungarian Academy of Sciences. The PROLOG system was installed by P~ter K6ves 11 .
THE DESIGN SYSTEM FOR THE APARTMENT HOUSE In the program system basic building cells with given dimensions, measurements and functions serve as the basic elements for designing apartments. Three cells with different dimensions are included in the database: a narrow cell (2.4 x4.8 m), called A,B,C or D; a wide cell (4.2 x 4.8 m), called M; and a third cell (4.2 x 3.6 m), called N or L. Each apartment is constructed by joining 3 wide cells and 1 - 4 narrow cells. A general apartment is made up of a maximum of 7 cells and has the geometrical dimensions given in Figure 1. Depending on the size of the apartment, some of the narrow cells can be omitted. The functions of the cells are coded as follows: living room = 1, dining room = 2, bedroom = 3, entrance = 4, kitchen = 5 and bathroom = 6. One cell can serve two functions. Depending on the number and the position of the doors, cells with the same dimensions and functions can in fact be different versions. The number of versions is the last digit of the cell code contained in the database. There are as many as 18 cells with different codes involved in the present program system. (See Figure 2.) There are two digit and three digit codes depending on the functions of the cells. The last digit indicates the number of versions, while the first or the first two digits use the above functional codes.
volume 14 number 6 november 1982 0010--4485/82/060335-09 $03.00 © 1982 Butterworth & Co (Publishers) Ltd
335
the apartment contains less than 7 cells, a variable still remains in the unused part of the list. Two apartments and a staircase make up one section level. Horizontal placement of one or two section levels makes one dilatation unit level. The vertical placement of 2 - 4 section levels makes one section, while the vertical placement of 2 - 4 dilatation unit levels makes one dilatation unit. Any number of dilatation units joined horizontally make up one building. One building is represented by a compound list in which four different operators are present. The operators depend on the priority level as follows:
In the program one apartment is represented by a list as follows: *M. *N. *k;
*A. *B. *C. *D.
or
*MIDDLE; *OUTSIDE where *MIDDLE indicates the list of the middle wide cells, and *OUTSIDE indicates the list of the outside narrow cells. Asterisked symbols denote variables; unasterisked symbols denote constants. In the course of apartment design the constant values of the chosen cells are assigned to the variables of the list. If
! joins apartments (horizontally)
: joins section levels (horizontally) ;joinsdilatation levels (vertically) - joins dilatation units (horizontally) To set an example let us take a building with 4 levels and 3 dilatation units (Figure 3). In the Figure *D1, *D2, *D3 represent the particular dilatation units; *D1 is composed of the following levels: "54; "53; *52; "51; NIL and
4.8
M
C
4.8 1.2
"51 breaks down into apartments: 36
*A1 ! *B1 . *C1 ! *DI . NIL
2,~
The building is designed so that the list of constants of the finished apartments will replace the variables (*A 1, ...) representing the apartments.
D'
4.8
~6
PARTS OF THE PROGRAM
241
42
The program system is composed of the following four programs:
24
• FLAT, to design variations of ground-plans to meet individual demands
Figure 1. Out/ine of an apartment
T.i71
Living room
Twin
bedroo~
~-~
Double
Doublei
bedroom
39
35
Dining room
638
421
Twin bedroo
II
31
rance
436
j flble bedroo~m
32
430
or0rr LO Bo,hr/om e
461
Double bedroom
bedroo~
34
I ILoraer Bathroom
'I
33
v 452
I
657
I
' Dining I room/I
Dining room
Kitchen ~_]
Kitchen
I
Dinin~=l room
__/L_ 253
252
251
Figure 2. Database for the F L A T program
336
computer-aided design
• ORD, to decide the priority ordering of variations of apartments • BUILD, to create the vertical structure of the building to be designed • TOTAL, to design the arrangement of ground-plans of dwelling houses level by level
FLAT Taking into consideration the applicant's special demands, the FLAT program processes all the possible ground-plans of the apartment, associates the variants with the code of the applicant and stores them in a file. This program is run as many times as the number of applicants (Figure 4). The program input consists of the following:
Input of BUILD and TOTAL program: - BUILD/25.4.2, *S/ -TOTAL /*S/. Output of the BUILD program: THE BUILDING TO BE DESIGNED NUMBER OF FLATS: 25 NUMBER OF LEVELS:4
list of applicants • the personal demands of the applicants as follows: •
NUMBER OF SECTIONS IN A LEVEL UNIT: 2 NUMBER OF FLATS IN A SECTION: 2
o apart from the living room, the required number of double bedrooms (0-3) o the number of single bedrooms the applicant wishes to have o preference of functional combinations (one of the following): kitchen-dining room (code 1), living *$4
~A4
I*B4 . * C 4
I'D4
i
*$5
*A3
!~93
**C3
!*D5
*AB
!~B2
.*C2
I~D2
!
!
*Si
*AI
t~B]
.*C[
t*DI
!
!
!
"~DI
*D2
XX
XXXX XXXX
XXX XXXX
Figure 5. Perspective sketch of a building designed by TOTAL program, using the given input
i
*$2
XXXX XXXX
- ~
-
*D5
Nit
room-dining room (code 2) or living room-dining room-kitchen (code 3).
- Nil
Figure 3. Examp/e of a building with 4 levels and 3 dilatation units
• second choice (1,2, 3 or 0, if no second choice) o third solution? ( 1 , 2 , 3 or 0) o does he want a double bedroom for parents? (Yes or
No)
7
o does he agree to having a double bedroom opening into the living room? (Yes or No) o does he want a study? (Yes or No) The output is as follows: • the list of ground-plans fulfilling the input requirements (in a file) • the same list on the printer in the form of a matrix with data concerning area and other quantities: o the area of the whole apartment
LR
?
DB
D
o o o o
LR
E
ORD
B
The ORD program enables the applicant to order the apartments according to preference, that is, from the best choice to satisfactory in such a way that the applicant may exclude those versions which do not fulfil his needs. This is done by assigning a priority number to the apartments on the list. The input is the output of the F L A T program and the output is an ordering of the apartments in the file.
E
?
BUILD This program calculates the number of dilatation units the
Key: B D DB
living area number of beds the ratio of living area and the whole area area for each person
Bathroom Dining room Double bedroom
E K L
Entrance Kftchen Larder
LR Living room SB Single bedroom ST Study
Figure 4. Variants of an apartment
volume 14 number 6 november 1982
TB W
T w m bedroom WC
building will contain, as a function of the maximum number of levels of the building to be designed and the number of apartments. It designs the general and the last - maybe incomplete - d i l a t a t i o n unit's structure (sections, levels,
337
• the type of the right end of the dilatationunit • the connection of the firstapartment to the second in the firststaircasemay be shifted by half level (up or down) • similarly the second staircase apartments may be shifted • how many narrow cells should be there at the join of the first and second apartments? • similarly, for the second and third apartments, how many narrow cells? • similarly, for the third and fourth apartments, how many narrow cells? • should the two sections be pushed horizontally as compared to each other to the right or to the left?
L DB
D8
Level
L
L' E
E
[3
TB
I DB
L
B
B
T:
Level2
I.
L
SB~
.SE~
i
~
Program output consists of the ground-plan arrangement level by level of the whole building. The apartments arc given by the list of cell codes and the serial number of the applicants. The relations between the apartments inside the building are presented in Figure 6. In the figure where Knm/1-%~, m~<4/is an apartment K nm P, )Q K n m+l represents the horizontal joining of two apartments; for apartment K nm we select apartment K n m+l which meets requirements
P,O K n+l m
°\. Leve
"~ R,S Knm
I3
represents the vertical joining of two apartments; for apartment K nm we select apartment K n+l m, which meets requirements R and S.
The following procedures are used: E
D
B z
•
• Level
4
Key, [3 Bothroom D Diningroom DB Doublel~droom E Enl"rance K Kitchen
L LR SB TB W
[_order Livingroom Singlebedroom Twinbedroom WC
Figure 6. Relations between apartments inside the building
•
•
number of apartments). It elaborates the general outline of the building, to serve as input for the next program. Program input consists of: • • •
the number of apartments in the building to be designed the maximum number of levels number of sections in one dilatation unit
Program output includes a printout of the general outline of the whole building. (See Figure 5.)
• •
o the water-block of the chosen apartment is above the water-block of the lower apartment o the entrances and the cells for the staircase are above each other
TOTAL This program makes use of the results obtained from the previous three. It aims to fill the structure produced by BUILD and several runs of the FLAT program, taking into account the area and geometric requirements of tb~ building. The program places the apartments beside and above one another, selecting those which correspond to the horizontal and vertical geometric and functional connections. Input is as follows: •
338
the type of the left end of the dilation unit (open or closed)
SYMMETRY produces the symmetrical version with respect to the y axis, of an apartment designed by the FLAT program. STAIRCASE controls whether the staircase can be put between two apartments in a way that the entrances open off the staircase. HORIZONTAL checks whether the geometric structure of the cells on the right of the second apartment is suitable for connecting to the cells on the left of the third apartment. SUITABLE LEFT checks whether the cells on the right hand side of the first apartment on the first level of the left of the dilatation unit correspond to the type of the dilatation unit on their left. If this type is OPEN then it does not connect another dilatation unit, therefore the outline of the elements can be arbitrary. If it is CLOSED, the left side of the apartment's outline is allowed to contain only flat surfaces. SUITABLE RIGHT is similar to SUITABLE LEFT, for the right end of the dilatation unit. VERTICAL is necessary for selecting any apartments above the ground floor. It checks whether
•
•
SUPPORT is necessary for selecting the second and the third apartments on the levels above the ground floor. It checks whether there are cells under all cells. GEOMETRIC LEFT is necessary to choose apartments on the left side of the dilatation units above the ground floor. It checks whether the left element of the upper apartment corresponds to the type of the left side of the dilatation unit, and whether the geometry of the upper and lower apartments corresponds to each other.
computer-aided design
•
•
E
DB z' ! B
• SB i'du '
;~L~ ~u "~ UU
TB
Figures 7 and 8 represent the level by level ground-plan arrangement of the building designed by the TOTAL program and illustrated in Figure 5.
Level I LR
LR TB '
-B
Apartment K21 on the left side of the second level is chosen so that the respective vertical conditions are applied to the lower apartment K l l . The conditions for fitting the next (K22) apartment are determined by apartment K21 beside, and K12 below it. The other apartments (K23, K24) on the second level fit in the same way. The third and fourth floors are treated similarly to the second.
DB
~
MANY-SORTED MODELS A language L of the classical mathematical logic is a triple k t = < Ft, M t , ~ t >
D
SB
TB J
where F t is the syntax (set of well-formed formulae), M t is ' the class of models and l:z: t is the validity relation
Level 2, I DB
I
SB
I
LR 7 T ~
DB
( ~ t C Mt x Ft)
Key B D Bathroom Diningroom OB Doublebedroom E Entrance K Kitchen L Larder LR Livingroom SB Singlebedroom TB Twinbedroom W WC
The models are relational structures of a fixed type. The type is a pair of functions: t = < t R, tF>
where t R and tF define the number of arguments of the relation and function symbols, respectively 12 .
Level 3 Figure 7. Unit 1
Level 4
S,ST K41 - -
Level3
K31
K52
-K35
K54
Level 2
'
I V,GL S,ST K21
t
:
t
Level I
KII
I V, GL S,ST
I V,GL S,ST
HZ K42 , V,SU HZ
V, SU HZ K22 [ V, SU HZ
KI2
SL Key S Symmetry V Vertical ST Staircase
S,ST K45 t V,SU S, ST
V, SU S,ST K23 1 V, SU S,ST
Ki5
K44 ' V,GR
A ={Aai ,aieS }
V,GR
K24
FV,GR KI4 SR
HZ Horizontal SR Suitableright SL Suitable [eft
Many-sorted models are modifications of these t-type models. The fundamental difference between many-sorted models and t-type models is that the universe of the manysorted models is not homogeneous but consists of disjunct sets of different sorts. Thus, when defining the types of functions and relations, we have to give not only the number of arguments but also the sort of every argument. L e t s = {h i : i < co} be the set of sorts of the elements of the universe. Then the universe of the many-sorted model is
GR Geometric right GL Geometric left SU Support
To define the type (signature) of the many-sorted model we use the following terms 13 : • S = {hi : i < co} the set of sorts. • To every n-ary function symbol fn, n < co, a pair < fn, < hi, • •., an; an+l > > is assigned, where fn is the function symbol, < at . .., an; an+l > is the sequence of sorts, a l , • •., an are the sorts of the arguments of the function, and an+ 1 is the sort of the value of the function. •
Figure 8. Unit 2
• GEOMETRIC RIGHT is similar to GEOMETRIC LEFT but refers to the right apartments. Filling up the structure of the dilatation unit with apartments is performed in the following way: •
Applying the SUITABLE LEFT condition apartments K11 to the left side of the first level are chosen.
•
We fill up the first level with apartments in the order K12, K 1 3 , K14 taking into account the horizontal conditions indicated in Figure 6.
volume 14 number 6 november 1982
To every n-ary relation symbol rn, n < co, a pair, < r n , < a] . . . , a n > > is assigned, where r n is the relation symbol, and < a l , . . . , Xn > is the sequence of the sort of the arguments of the relation.
The t-type of a many-sorted model is a triple: t = < 5 ~ tR~ tF > where S is the set of sorts, t F is the type-function of the functions defined in the second point above, t R is the typefunction of the relations defined ]n the third point above. The syntax of many-sorted languages is basically the same as that of classical languages, with the following exception: the signature determines the sort of terms occurring as arguments of the relation or function symbols.
339
M O D E L L I N G OF C O N S T R U C T I O N A L DESIGN TASKS Let us consider a technical design task whose aim is to create a complex construction using basic units, according to a given set of rules: eg to compose multi-storey apartments. The basic units are represented by constants, while the partial constructions and the final construction are represented by compound expressions. Thus we can regulate the hierarchy that will constitute the final construction. by defining the type-function tF of the t-type model. We can attach conditions to every step of construction, ie the compound expression representing it. The connection between the parts of the construction is represented by relations. If at every stage of the design process all requirements of the construction are given by the corresponding relations, then the necessary knowledge is given, the world of the design is defined. The choice of these relations is but the definition of the type function tR. As a result, we can declare that the most important moment of modelling a constructional design task by classical many,sorted t-type structures is fixing the appropriate type t = < S , tR, t F >. Let us go back to describing the world of the design task. We aim not only at the representation of all requirements of the technical construction by mathematical relations, but also the creation of the given product by a computer system. To achieve this, we need to express the requirements in a specific form which can be used by an automatic mechanism. Since this specific form is nothing else than formulae of logic, the mechanism mentioned should be a certain kind of calculus. PROLOG is a computer system based on firstorder logic where the running of a program is controlled by a complete calculus present in the interpreter. PROLOG is based on a one-sorted language. However, this does not make any difference, since the pattern matching mechanism built into the deduction system of PROLOG automatically fulfils the requirement that only the terms of the corresponding sorts should be substituted for each other.
THE LOGICAL R E P R E S E N T A T I O N OF THE TASK
Sorts
The type-function t F is a set of pairs. Examples are given below. < f l , < f, vn ;nc ~>> where eg (see Figure 9) f is a bedroom (3), and vn represents a door is in the eastern wall and a window in the northern wall (4). < f2, < f, vw;wc > > where eg (see Figure 10) f is a bedroom (3) and vw represents two doors in the northern wall and two windows in the southern wall (1).
"( f3 ,
> where eg (see Figure 11) 34,253,436 are narrow cells, EMPTY is a constant of the sort nc and showsthat there is no cell on the corresponding place.
< f4, < wc, wc, wc;m > > where eg (see Figure 12) 11,461,31 are wide cells.
< fs, < m, o;a > > The linking of the middle and outside parts make up an apartment. (See Figure 13.)
< f6, < a, a;s >~> Two apartments and a staircase together make up a section level (See Figure 14.)
< fT, > The horizontal linking of two section levels make up a level. (See Figure 15.)
< fs, > The vertical linking of a level and a unit make up a new unit We denote the 'empty unit' by the constant zero. (See Figure 16.)
< fg, > By linking a unit and a building we can get a new building. Constructing a one-unit building we use the 'empty building' denoted by Nil. (See Figure 17.) Altogether the t F type-function is made of the following pairs: < f l , < f, vn; nc > >
<~
3
S = (f, vn, v% n G wc, o, m, a, s, /, u, b, co } where: f i s the function of a basic unit, iea cell vn is the variation of a narrow cell vw is the variation of a wide cell nc is a narrow cell wc is a wide cell o is the outside of an apartment m is the middle of an apartment a is an apartment s is a section / is a level u is a unit b is a building co is a non-negative integer
VW;WC >> 4
v
H
34
34
Figure 9. Narrow cell 3
I
Doub~ bedroom
31
31
Figure 10. Wide cell f. . . . ] 54
253
456
EMPTY
Functions The set of function symbols ~ is as follows:
= {rl ,f2/3 ,f4 ,h ,&,fT,h ,& }
34 253 4 3 6
EMPTY
Figure 11. Outside part o f the apartment
340
computer-aided design
II
461
< f3, < nc, nc, nc, nc; o > > < f4 < wc, wc, wc; m.>> > >
~1
.~461 11
461 3[
>
> >
Figure 12. Middle part of the apartment
Figure 18 shows these many-sorted functions on the manysorted universe. 11 46]
51
54 253 461.EMPTY
Twin bedroom
T
wng
The representation of functions in PROLOG
II 4BI 3I; 34253 461 EMPTY
Kilchen
~
I
ZJ Double bedroom
The functions defined in the previous section are represented in PROLOG using binary infix operators. The second and third arguments of the operator declarations are the direction of bracketing and the priority of bounding respectively: +OPERATOR +OPERATOR +OPERATOR +OPERATOR
Figure 13. Apartment ~i
(!, RL, 6) (., RL, 5) (;, RL, 4) (-, RL, 3)
k2
where RL means 'from right to left'. Let Ti its be a term of sort i. The representation of the terms will be as follows: sl
fl (~r, ~'..) : ~',,c
sl
Figure 14. Section level sl
s2
s2
f2 f3 f~ fs f6
(T~, T~w) = ~wc if.c, ~nc, r.c, ~.3 : ~o (~wc, rwc, ~w3 : ~,. ('rm, ~'o) = ~'a (~a,'ca):'rs
f7
(-rs, -rs) :
~
f~ ( % T.) : ~.
I
% ft., Tb) = ~b
Zero
dI
12
Tf ! "FVW
=
TWC
~.c-(~.c.(~nc.~.c))
= 1"o
~w~.(~w~.~'~) = ~
~'m ; ~'o =7"a Ta ! Ta = Ts
ra.Ts = "r~ ~£; ~'u = "ru Tu - 1-b = Tb
Note that certain operators were used to represent different functions (eg the operator ! represents f l , f2 and f6 functions). This does not disturb the running of the program because due to the peculiarities of PROLOG only expressions of the appropriate sort can be substituted for each other. The prefix representation of functions can also take place in PROLOG and this is more suitable in many cases.
Figure 15. Level of a unit /I
~f ! ~vn = "rnc
dI
d2
Relations
Figure 16. Unit of a two-storey building d2
N II
Wj
wl d2
d3
/I
d5
II
Figure 17. Building consisting o f two units
volume 14 number 6 november 1982
In the course of design the connections between the parts of the construction can be represented by logical relations. As an example, we examine the relations between apartments which determine the conditions for correct construction. The respective part of the type-function t R is the set of
pairs: > > < HZ, < ¢ a > > > < SR, < co, a > >
< V, > > < GL, < co, ¢ a > > < GR, >
where S, ST, HZ, SL, SR, V, SU, GL, GR are the relation symbols defined in Figure 8. These relations not only define connections, but as parts of the PROLOG program they are procedures with controlling or construction functions. We
341
Figure 18. Many-sorted functions examine the SYMMETRY and the VERTICAL relations procedures in detail.
The SYMMETRY relation has two conditions (see Figure 19):
SYMMETRY
• •
MIDDLE for the reflection of the wide cells OUTSIDE for the reflection of the narrow cells
The SYMMETRY relation constructs the symmetrical version, with respect to the y axis, of an apartment designed by the FLAT program.
VERTICAL
• •
Relation VERTICAL is needed in the selection of each apartment above ground floor. (See Figure 20.) It has two arguments
the apartment to be reflected *K1 ; *F1 the result of the reflection */<'2; *F2
Each argument is a compound term, where *El *El *F1 *F1
• •
represents the list of the wide cells = M1. *N1. * L I . represents the list of narrow cells = *A. *B. *C. *D. NIL
Four conditions are needed for its fulfilment: •
M2
f
ft
/VI
N2
LI
the lower apartment (*M1 ;*F1) the upper apartment (*M2;*F2)
L2
+ SYMMETRY (*K1; *F1, *L2; *F2)
-MIDDLE (*K1, *K2)
CENTRETYPE (*M1, *M2, *X) checks whether the middle wide cells of the two apartments are the same, and if yes, it gives their value to variable *X. • WATERBLOCK (*X, *F1, *F2). Variant *X already contains the value (with or without bathroom) of the middle cell. Depending on this value the relation checks whether the kitchens or the kitchens plus bathrooms are on top of each other in the two apartments. • ENTERING (*F1, *F2). If there is an entrance in both apartments this checks whether they are on top of each other. (The hall of the middle cell can also be the entrance, in this case there is no entrance in the narrow segments.) • VERSTAI R (*F1, *F2). If there is a segment of the staircase in both apartments this checks whether they are on top of each other.
- OUTSIDE (*F1, *F2). + MIDDLE (*MI. *N1. *L], *M1. *N2. *L2) - CENTRE (*N1, *N2) BEDROOM (*L1, *L2). + CENTRE (46!1,46!2). + CENTRE (42!1,42!2) + B E D R O O M (3!1,3!I). -
+ BEDROOM
(3!2, 2!6).
+ BEDROOM
(313, 3!3).
+ OUTSIDE (*A. *B. *C. *D.NIL, *C. *D. *A.. *B.NIL).
Figure 19. Symmetry
342
CONCLUSIONS This paper presents a formal means of modelling constructional design, where knowledge representation is the key problem. It is shown that the structures of classical mathematical logic, such as t-type many-sorted models, can be applied almost directly to represent the world of a certain design task. Using the PROLOG programming system, the logical representation of the task yields, at the same time, its automated solution. The most important factor in modelling a task of this kind is fixing the appropriate type of structure.
computer-aided design
illustrate the definition of the relations we have presented some fragments of the problem solving PROLOG program which was run on an~ IBM 3031. The CAD procedure laid out in this paper can be adapted to other architectural applications. To create a new design system, the redefinition of th:e buiLding's structure and the supporting database is necessary. The program level formalization of the design steps solved by this system can be further applied. For the time being the program system only serves our research goals. However, the system can be made suitable for any particular application by altering the datebase.
/
ACKNOWLEDGEMENTS //J/
f ~ E n t e r
+VERTICAL (*M1; *F1, *M2; *F2) -CENTRETYPE (*M1, *M2, *X) -WATERBLOCK (*X, *F1, *F2) -ENTERING (*F1, *F2) -VERSTAI R (*F1, *F2). +CENTRETYPE (*Q1. *N. *L1, *Q2. *N. *L2, *N). +WATERBLOCK (46!* V, *F1, *F2) -KITCHEN (*F1, *F2). +WATERBLOCK (42[* V, *F1, *F2) -KITCHEN (*F1, *F2) -BATH (*F1, *F2). +KITCHEN (*F1, *F2) -THESAME (*F1, *F2, 45, 25). +BATH (*F1, *F2) -THESAME (.F!, .F2, 63,63). +ENTERING (*F1, *F2) -EXISTENTER (*F1) -EXISTENTER (.F2) -THESAME (,F1, ,F2, 43,45). +ENTERING (.F1, .F2) -EXISTENTER (*FI) -NOT(EXtSTENTE R(,F2)). +ENTERING {.F1, .F2) -NOT(EXISTENTE R(.F1 )). +EXISTENTER (.F) -M EMBER (*F, *COD[*V) -ENTRANCE (*COD]*V). +VERSTAI R (.F1, .F2) -EXISTSTAI R (.F1) -EXISTSTAI R (.F2) -UNDER (.F1, .F2, L!L). +VERSTAI R (.F1, .F2) -EXISTSTAI R (.F1) -NOT(EXISTSTAI R (.F2)).
I would like to express my appreciation to Mr Mikl6s SzSts for the helpful and inspiring discussions we had about the topic. I would also like to express my thanks to Mr Istv~in R~ikossy for working out the architectural foundations of the program system.
REFERENCES 1 Mgrkusz, Z 'Knowledge representation of design in many-sorted logic' in Proc. 7th Int. Joint Conf. Art/f. Intell. Vancouver, Canada (1981 ) 2 Kowalski, R 'Predicate logic as a programming language' in Proc./FIP (1974) 3 Szeredi, P and Fut6, I PROLOG manual Sz~tmol6g@, 7. 3 - 4 sz. (1977) (in Hungarian) 4 Warren, D Irnp/ernenting PROLOG - compiling predicate logic programs Department of Artificial Intelligence, Edinburgh University, UK (1977) 5 M,irkusz, Z 'How to design variants of flats using programming language PROLOG based on mathematical logic' in Proc. IFIP, Toronto, Canada (1977) 6 M~rkusz, Z Logic basedprograrnrning methods and their applications to solve architectural CAD problems (1980) PhD. Thesis, University of Sciences, Budapest, Hungary (in Hungarian) 7 Pereira, L M 'Artificial intelligence techniques in automatic layout design' in Proc. AI PR CAD Grenoble, France (t978) 8 Swinson, P S G 'Prescriptive to descriptive programming - a way ahead for CAAD' in Proc. Logic Programming Workshop Debrecen, Hungary (1980) 9 Swinson, P S G 'Logic programming : a computing tool for the architect of the future' Cornput. AidedDes. Vo114 No 2 (March 1982) pp 9 7 - 1 0 4
+VERSTAI R (.F1, .F2) -NOT(EXISTSTAI R (.F1)). +EXISTSTAIR (.F1) -MEMBER (*F1, *COD[*V) -CONSTANT (.COD) -EQUAL (.COD[*!/; L[L).
10 Sfintha, E 'Application of PROLOG in Hungary' in T~rnlund, S-A (ed) Preprint of Logic Programming Workshop Debrecen, Hungary (1980)
I--igure 20. Illustration of the VER T/CA b relation between two apartments In relation to a constructional design task we have shown how the design of a multi-storey building can be represented in many-sorted logic. We have defined many-sorted functions that help tO construct buildings from basic units. To
12 Andreka, H, Gergely, T and Nemeti, 1 Easily comprehensible mathematical logic and its model theory Central Research Institute for Physics, Budapest, Hungary (1975)
volume 14 number 6 november 1982
11 K6ves, P BS 2000 PROLOG User's Manual, V2.4 SzKI (in Hungarian) (1978)
13 Monk, J D Mathematicallogic Springer Verlag (1976)
343