[Attempto] ACE Wiki questions: How to represent plans, possible extensions to punctuation and API, and implementing non-OWL rules

Tobias Kuhn t.kuhn at gmx.ch
Thu Oct 22 10:27:47 CEST 2009


Bill,

> 1. I cannot seem to enter a name like A/1-75 Ranger Company since the 
> “/” character is not allowed in names. Could it be added
> or would that cause a clash somewhere else? Then I tried 1-75 Rangers, A 
> Company and got caught again as “,” isn’t allowed in
> names. And... Rangers (A/1-75) which also fails. Could one or more of 
> slash, comma, or both parentheses be added?

Right, words in ACE are allowed to consist only of numbers 0-9, letters a-zA-Z, hypens -,
underscores _, dollar signs $, and degree signs °.

AceWiki is more restrictive in the sense that dollar and degree signs are not supported. In contrast
to ACE, AceWiki has support for blank spaces within user defined words which are represented
internally as underscores.

It has been on our todo list for ACE to be more liberal in this respect. However, I don't know
whether we will have time to implement this in the near future.

> 2. I would like to represent a plan in ACE. Suppose I use a STRIPS-like 
> representation where each operator has preconditions and
> postconditions. Now suppose I have a simple three-step plan P, e.g.,
> 
>      OP-1 OP-2 OP-3
> 
> where each OP-i is an operator that is a plan step in plan P:
> 
>     OP-1 is an operator.
>     OP-2 is an operator.
>     OP-3 is an operator.
> 
> and add a new verb “assume” for each precondition...
> 
>    OP-1 assumes resource X is available.
>    OP-2 assumes resource Y is available.
>    OP-3 assumes resource Z is available.
> 
> and then add a rule like this
> 
>    If a plan step O assumes a resource J is available and resource J is 
> not available
>    then plan step O fails.
> 
> and overall rules so that any step of the plan failing causes the whole plan
> to fail...
> 
>   If a plan K has a plan step that fails then plan K fails.
>   If there is no plan step of K that fails then plan K succeeds.
> 
> I don’t know if this is the right approach and would like other suggestions.

AceWiki does not support intransitive verbs like "fails" and intransitive adjectives like
"available" at the moment. For that reason, I would model it this way:

   OP-1 is an operator.
   OP-2 is an operator.
   OP-3 is an operator.

   RX is a resource.
   RY is a resource.
   RZ is a resource.

   OP-1 requires RX.
   OP-2 requires RY.
   OP-3 requires RZ.

   Every operator is a plan-step.

   If a plan-step requires a resource that is not an available-resource
     then the plan-step is not a viable-plan-step.

   If a plan has a plan-step that is not a viable-plan-step
     then the plan is not a viable-plan.

   If every plan-step of a plan is a viable-plan-step
     then the plan is a viable-plan.

Admittedly, this is not the nicest represententation. AceWiki should have support for intransitive
verbs and adjectives.

> The first problem I run into is trying to represent the availability of 
> resources:
> 
>    Resource X is available for OP-1.
> 
> The best I could come up with are these two statements (rules):
> 
> where X would be a plan step and Y the overall plan and Z some resource 
> required for plan step X.
> 
> Do you have any better suggestions? If I stay with this will SWRL rules 
> be produced when I export
> the code or do I have to handcode them?

Export of SWRL rules is not possible at the moment. However, this would not be hard to implement. I
take it onto my todo list for AceWiki.

> 3. How do I make statements that describe things? E.g., “Ranger Company 
> A is available.”
> 
> It would seem that “available” is a non-transitive adjective and I don’t 
> see how to enter that as a new word.
> 
> It seems only adjectives between nouns can be entered so I ended up with 
> “available for” above.
> 
> But sometimes it would seem you’d simply need to save <noun> is 
> <adjective>, e.g., “the
> terrain is rough” or “the input is even”. How do you do that in ACE Wiki?
> 
> 4. Similarly, how do I enter standalone (intransitive) verbs? E.g., 
> “OP-1 fails” and “Plan P fails.”

Right, I see the problem.

Intransitive verbs and adjectives are already on the todo list for AceWiki. However, these features
had relatively low priority because I did not consider them crucial. However, looking at your
example I think that it would be important for AceWiki to support these word classes.

> 5. I’m wondering how to use ACE grammar to represent events in time and 
> space:
> 
> Does ACE allow describing the location and time of events, and what is 
> the best way to
> do this? I’d like to be able to have two statements such as “Ranger 
> Company A is at Kandahar
> at time T” and “Ranger Company A is at Melbourne at time T” and conclude 
> there is a contradiction.
> 
> But I fear these kind of statements would not be in the ACE grammar and 
> in general I’d need a constraint checker
> to see if two locations are too far apart for the unit to move between 
> in the time specified. Something
> like a tie-in to CHR would be nice.

In ACE, there is no problem to say things like

   A ranger-company is at Kandahar at a time T.

However, no special kind of time semantics is added to the prepositional phrase "at a time T". Thus,
it is up to the application developer to come up with a proper set of axioms (and probably some
transformations on the logical structure) that enable reasoning in the desired way.

In OWL, the problem is that there is no support for n-ary relations which makes it more complicated
to attach time information to certain actions or relations.

In your concrete example, however, I see a possibility how to do this in AceWiki:

   If a plan-step requires a resource that is not available-at a time T
     then the plan-step is not viable-at the time T.

   If a plan has a plan-step that is not viable-at a time T
     then the plan is not viable-at the time T.

   If every plan-step of a plan is viable-at a time T
     then the plan is viable-at the time T.

> 6. Is there a way I can tie into the ACE Wiki API so that when a 
> contradiction is signaled I can run
> some code of my own? It seems wherever you decide to display 
> contradictions in red you could also
> dispatch to user code via an ACE Wiki hook and that would be very 
> useful. In my case I’d record
> the contradiction, attempt to have it resolved in dialog with the user, 
> and then try to withdraw the
> contradictory statement or add a new plan.

Well, there is actually no AceWiki API. And I don't think that there will be one in the near future.

Thus, to change the behavior of AceWiki (apart from the things you can change in the web.xml file)
you need to go into the code and change it.


I hope that these answers are useful to you. As you can see, AceWiki is not a finished tool but 
still in a relatively early stage of development. Contributions to the AceWiki code base would be 
appreciated, by the way.


Tobias


More information about the attempto mailing list