23.08.2015 Views

Here - Agents Lab - University of Nottingham

Here - Agents Lab - University of Nottingham

Here - Agents Lab - University of Nottingham

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

* error: wrong type for the param value speed */startCooling (speed: "fast") on condThe target <strong>of</strong> an operation (e.g., on cond) can be omitted (as it happens in somepoints in plans <strong>of</strong> ACMEThermostat shown in Fig. 3) when there is no ambiguitywith respect to the target <strong>of</strong> the artifacts that are currently used by the agent(specified in the using: attribute).On the event/percept side, we can check beliefs representing artifact observableproperties in the event template <strong>of</strong> rules and in any expression appearingeither in the context or in action rule body, containing such beliefs.For what concerns event templates, given an action rule: updated Prop inTarget : Context => Action , where the event concerns the update <strong>of</strong> thebelief about an observable property P rop in the artifact <strong>of</strong> type I denoted byT arget, then the following checks apply:– there must exist an observable property defined in I which matches P rop;– the action rule must appear in an action rule block (or in any <strong>of</strong> its parentblock) where T arget has been explicitly listed among the artifacts used bythe agent through the using: attribute.As in the case <strong>of</strong> operations, in Target can be omitted if there is no ambiguityabout the artifact which is referred and its type.Examples <strong>of</strong> checks follow, supposing to have a fragment <strong>of</strong> a script withbeliefs cond: Conditioner and therm: Thermometer about a conditioner andthermometer artifact:/* compilation ok */updated currentTemp => println(msg: "the temperature has changed")updated currentTemp : isHeating=> println(msg: "the temperature has changed while heating...")sum: double = currentTemp in therm + 1/* error: unknown obs property isHeating in Thermometer type */updated isHeating in therm => .../* error: wrong type */bak: boolean = currentTemp in thermOn the environment side the definition <strong>of</strong> the interface as a type allows forchecking the conformance <strong>of</strong> artifact templates that declare to implement thatinterface, so that:– for each operation signature Op declared in any <strong>of</strong> the interfaces I implementedby the template, the template must contain the implementation <strong>of</strong>the operation;– for any observable property P rop that appears in expressions or assignmentsin operation implementation, then the declaration <strong>of</strong> the observable propertymust appear in one <strong>of</strong> the interfaces implemented by the template and thecorresponding type expression must be compatible.144

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!