2:-include(library('ec_planner/ec_test_incl')). 3%
4%;
5%; Copyright (c) 2005 IBM Corporation and others.
6%; All rights reserved. This program and the accompanying materials
7%; are made available under the terms of the Common Public License v1.0
8%; which accompanies this distribution, and is available at
9%; http://www.eclipse.org/legal/cpl-v10.html
10%;
11%; Contributors:
12%; IBM - Initial implementation
13%;
14%; The SpeechAct representation deals with a few speech acts
15%; \fullcite{Searle:1969}.
16%;
17%; @book{Searle:1969,
18%; author = "John R. Searle",
19%; year = "1969",
20%; title = "Speech Acts: An Essay in the Philosophy of Language",
21%; address = "Cambridge",
22%; publisher = "Cambridge University Press",
23%; }
24%;
25%; We handle
26%; the illocutionary acts of
27%; inviting someone into one's house (a form of request) and
28%; greeting someone,
29%; and the expressive speech act of crying for joy.
30%;
31% ecnet/SpeechAct.e:28
32%
33%; inviting in
34%
35%; agent1 invites agent2 into room.
36% event InviteIn(agent,agent,room)
37 /*
38.
39*/
40.
41
42%; agent1 is invited into room by agent2.
43% ecnet/SpeechAct.e:34
44% fluent InvitedIn(agent,room,agent)
45 /*
46.
47*/
48.
49
50%
51%; A precondition axiom states that for
52%; an agent to invite another agent into a room,
53%; the first agent must be in the room and
54%; there must be an outside area such that
55%; the second agent is at the outside area and
56%; the outside area is adjacent to the room:
57% ecnet/SpeechAct.e:42
58% [agent1,agent2,room,time]%
59% Happens(InviteIn(agent1,agent2,room),time) ->
60% HoldsAt(At(agent1,room),time) &
61% ecnet/SpeechAct.e:45
62% {outside}%
63% HoldsAt(At(agent2,outside),time) &
64% Adjacent(room,outside).
65 /*
66exists([Outside], (happens(inviteIn(Agent1, Agent2, Room), Time)->holds_at(at(Agent1, Room), Time), holds_at(at(Agent2, Outside), Time), adjacent(Room, Outside))).
67*/
68.
69
70%
71%
72%; An effect axiom states that if
73%; an agent invites another agent into a room,
74%; the second agent will be invited into the room by the first agent:
75% ecnet/SpeechAct.e:52
76% [agent1,agent2,room,time]%
77% Initiates(InviteIn(agent1,agent2,room),
78% InvitedIn(agent2,room,agent1),
79% time).
80 /*
81.
82*/
83.
84
85%
86%
87%; agent intends to walk into room.
88% ecnet/SpeechAct.e:58
89% event IntendToWalkIn(agent,room)
90 /*
91.
92*/
93.
94
95%; agent has the intention to walk into room.
96% fluent IntentionToWalkIn(agent,room)
97 /*
98.
99*/
100.
101
102%; agent acts on the intention to walk into room.
103% fluent ActOnIntentionToWalkIn(agent,room)
104 /*
105.
106*/
107.
108
109% noninertial ActOnIntentionToWalkIn
110 /*
111.
112*/
113.
114
115% ecnet/SpeechAct.e:64
116%
117%; A trigger axiom states that
118%; if an agent is invited into a room by another agent,
119%; the first agent likes the second agent, and
120%; the first agent does not already have the intention to
121%; walk into the room,
122%; the first agent intends to walk into the room:
123% ecnet/SpeechAct.e:71
124% [agent1,agent2,room,time]%
125% HoldsAt(InvitedIn(agent1,room,agent2),time) &
126% HoldsAt(Like(agent1,agent2),time) &
127% !HoldsAt(IntentionToWalkIn(agent1,room),time) ->
128% Happens(IntendToWalkIn(agent1,room),time).
129 /*
130holds_at(invitedIn(Agent1, Room, Agent2), Time), holds_at(like(Agent1, Agent2), Time), not(holds_at(intentionToWalkIn(Agent1, Room), Time)) ->
131 happens(intendToWalkIn(Agent1, Room), Time).
132*/
133.
134
135%
136%
137%; An effect axiom states that
138%; if an agent intends to walk into a room,
139%; the agent will have the intention to walk into the room:
140% ecnet/SpeechAct.e:80
141% [agent,room,time]%
142% Initiates(IntendToWalkIn(agent,room),
143% IntentionToWalkIn(agent,room),
144% time).
145 /*
146.
147*/
148.
149
150%
151%
152%; Two trigger axioms state that
153%; if an agent has the intention to walk into a room,
154%; the agent acts on the intention to walk into the room,
155%; the agent is at a location,
156%; side one (two) of a door is the room,
157%; side two (one) of the door is the location,
158%; agent will walk through side two (one) of the door:
159% ecnet/SpeechAct.e:92
160% [agent,room,location,door,time]%
161% HoldsAt(IntentionToWalkIn(agent,room),time) &
162% HoldsAt(ActOnIntentionToWalkIn(agent,room),time) &
163% HoldsAt(At(agent,location),time) &
164% Side1(door)=room &
165% Side2(door)=location ->
166% Happens(WalkThroughDoor21(agent,door),time).
167 /*
168holds_at(intentionToWalkIn(Agent, Room), Time), holds_at(actOnIntentionToWalkIn(Agent, Room), Time), holds_at(at(Agent, Location), Time), side1(Door)=Room, side2(Door)=Location ->
169 happens(walkThroughDoor21(Agent, Door), Time).
170*/
171.
172
173% ecnet/SpeechAct.e:98
174%
175%
176% ecnet/SpeechAct.e:100
177% [agent,room,location,door,time]%
178% HoldsAt(IntentionToWalkIn(agent,room),time) &
179% HoldsAt(ActOnIntentionToWalkIn(agent,room),time) &
180% HoldsAt(At(agent,location),time) &
181% Side2(door)=room &
182% Side1(door)=location ->
183% Happens(WalkThroughDoor12(agent,door),time).
184 /*
185holds_at(intentionToWalkIn(Agent, Room), Time), holds_at(actOnIntentionToWalkIn(Agent, Room), Time), holds_at(at(Agent, Location), Time), side2(Door)=Room, side1(Door)=Location ->
186 happens(walkThroughDoor12(Agent, Door), Time).
187*/
188.
189
190% ecnet/SpeechAct.e:106
191%
192%
193%; Two effect axioms state that
194%; if side one (two) of a door is a room and
195%; an agent walks through side two (one) of the door,
196%; the agent will no longer have the intention to
197%; walk into the room:
198% ecnet/SpeechAct.e:113
199% [agent,room,door,time]%
200% Side1(door)=room ->
201% Terminates(WalkThroughDoor21(agent,door),
202% IntentionToWalkIn(agent,room),
203% time).
204 /*
205side1(Door)=Room ->
206 terminates(walkThroughDoor21(Agent, Door),
207 intentionToWalkIn(Agent, Room),
208 Time).
209*/
210.
211
212%
213%
214% ecnet/SpeechAct.e:119
215% [agent,room,door,time]%
216% Side2(door)=room ->
217% Terminates(WalkThroughDoor12(agent,door),
218% IntentionToWalkIn(agent,room),
219% time).
220 /*
221side2(Door)=Room ->
222 terminates(walkThroughDoor12(Agent, Door),
223 intentionToWalkIn(Agent, Room),
224 Time).
225*/
226.
227
228%
229%
230%; agent greets object.
231% ecnet/SpeechAct.e:126
232% event Greet(agent,object)
233 /*
234.
235*/
236.
237
238%
239% event SayPleasedToMeet(agent,agent)
240 /*
241.
242*/
243.
244
245%
246%; agent says goodbye to object.
247% event SayGoodbye(agent,object)
248 /*
249.
250*/
251.
252
253% ecnet/SpeechAct.e:132
254%
255% event TalkAbout(agent,content)
256 /*
257.
258*/
259.
260
261%
262% event Converse(agent,agent)
263 /*
264.
265*/
266.
267
268%
269% ecnet/SpeechAct.e:137
270% [agent1,agent2,time]%
271% Happens(Converse(agent1,agent2),time) ->
272% ecnet/SpeechAct.e:139
273% {location}%
274% HoldsAt(At(agent1,location),time) &
275% HoldsAt(At(agent2,location),time).
276 /*
277exists([Location], (happens(converse(Agent1, Agent2), Time)->holds_at(at(Agent1, Location), Time), holds_at(at(Agent2, Location), Time))).
278*/
279.
280
281%
282%
283%; A precondition axiom states that for
284%; an agent to greet an object,
285%; there must be a location such that
286%; the agent is at the location and
287%; the object is at the location:
288% ecnet/SpeechAct.e:148
289% [agent,object,time]%
290% Happens(Greet(agent,object),time) ->
291% ecnet/SpeechAct.e:150
292% {location}%
293% HoldsAt(At(agent,location),time) &
294% HoldsAt(At(object,location),time).
295 /*
296exists([Location], (happens(greet(Agent, Object), Time)->holds_at(at(Agent, Location), Time), holds_at(at(Object, Location), Time))).
297*/
298.
299
300%
301%
302% ecnet/SpeechAct.e:154
303% [agent,object,time]%
304% Happens(SayGoodbye(agent,object),time) ->
305% ecnet/SpeechAct.e:156
306% {location}%
307% HoldsAt(At(agent,location),time) &
308% HoldsAt(At(object,location),time).
309 /*
310exists([Location], (happens(sayGoodbye(Agent, Object), Time)->holds_at(at(Agent, Location), Time), holds_at(at(Object, Location), Time))).
311*/
312.
313
314%
315%
316%; speech: expression of emotions
317%
318%; agent cries for joy.
319% ecnet/SpeechAct.e:163
320% event CryForJoy(agent)
321 /*
322.
323*/
324.
325
326%
327%; A precondition axiom states that for
328%; an agent to cry for joy,
329%; the agent must be happy:
330% ecnet/SpeechAct.e:168
331% [agent,time]%
332% Happens(CryForJoy(agent),time) ->
333% HoldsAt(Happy(agent),time).
334 /*
335happens(cryForJoy(Agent), Time) ->
336 holds_at(happy(Agent), Time).
337*/
338.
339
340%
341%
342% event Threaten(agent,agent,weapon)
343 /*
344.
345*/
346.
347
348%
349% ecnet/SpeechAct.e:174
350% event ReleaseFromThreat(agent,agent)
351 /*
352.
353*/
354.
355
356%
357% fluent ThreatenedBy(agent,agent)
358 /*
359.
360*/
361.
362
363%
364% ecnet/SpeechAct.e:178
365% [agent1,agent2,weapon,time]%
366% Happens(Threaten(agent1,agent2,weapon), time) ->
367% HoldsAt(Holding(agent1,weapon),time) &
368% ecnet/SpeechAct.e:181
369% {location}%
370% HoldsAt(At(agent1,location),time) &
371% HoldsAt(At(agent2,location),time).
372 /*
373exists([Location], (happens(threaten(Agent1, Agent2, Weapon), Time)->holds_at(holding(Agent1, Weapon), Time), holds_at(at(Agent1, Location), Time), holds_at(at(Agent2, Location), Time))).
374*/
375.
376
377%
378%
379% ecnet/SpeechAct.e:185
380% [agent1,agent2,weapon,time]%
381% Happens(Threaten(agent1,agent2,weapon), time) ->
382% Happens(BecomeAngryAt(agent2,agent1),time).
383 /*
384happens(threaten(Agent1, Agent2, Weapon), Time) ->
385 happens(becomeAngryAt(Agent2, Agent1), Time).
386*/
387.
388
389%
390%
391% ecnet/SpeechAct.e:189
392% [agent1,agent2,weapon,time]%
393% Initiates(Threaten(agent1,agent2,weapon),
394% ThreatenedBy(agent2,agent1),
395% time).
396 /*
397.
398*/
399.
400
401%
402%
403% ecnet/SpeechAct.e:194
404% [agent1,agent2,time]%
405% Terminates(ReleaseFromThreat(agent1,agent2),
406% ThreatenedBy(agent2,agent1),
407% time).
408 /*
409.
410*/
411.
412
413%
414%
415% event Order(agent,agent,physobj)
416 /*
417.
418*/
419.
420
421% ecnet/SpeechAct.e:200
422%
423% fluent KnowOrder(agent,agent,physobj)
424 /*
425.
426*/
427.
428
429%
430% ecnet/SpeechAct.e:203
431% [agent1,agent2,physobj,time]%
432% Initiates(Order(agent1,agent2,physobj),
433% KnowOrder(agent2,agent1,physobj),
434% time).
435 /*
436.
437*/
438.
439
440%
441%
442% ecnet/SpeechAct.e:208
443% [agent1,agent2,physobj,time]%
444% Happens(Order(agent1,agent2,physobj),time) ->
445% ecnet/SpeechAct.e:210
446% {location}%
447% HoldsAt(At(agent1,location),time) &
448% HoldsAt(At(agent2,location),time).
449 /*
450exists([Location], (happens(order(Agent1, Agent2, Physobj), Time)->holds_at(at(Agent1, Location), Time), holds_at(at(Agent2, Location), Time))).
451*/
452.
453
454%
455%
456% event Request(agent,agent,physobj)
457 /*
458.
459*/
460.
461
462%
463% ecnet/SpeechAct.e:216
464% fluent KnowRequest(agent,agent,physobj)
465 /*
466.
467*/
468.
469
470%
471% ecnet/SpeechAct.e:218
472% [agent1,agent2,physobj,time]%
473% Initiates(Request(agent1,agent2,physobj),
474% KnowRequest(agent2,agent1,physobj),
475% time).
476 /*
477.
478*/
479.
480
481%
482%
483% ecnet/SpeechAct.e:223
484% [agent1,agent2,physobj,time]%
485% Happens(Request(agent1,agent2,physobj),time) ->
486% ecnet/SpeechAct.e:225
487% {location}%
488% HoldsAt(At(agent1,location),time) &
489% HoldsAt(At(agent2,location),time).
490 /*
491exists([Location], (happens(request(Agent1, Agent2, Physobj), Time)->holds_at(at(Agent1, Location), Time), holds_at(at(Agent2, Location), Time))).
492*/
493.
494