Hi,
Before you work too hard on this, ask yourself whether you really need
to do this with Jess facts. Although it's certainly possible, it will
be difficult and awkward. If, on the other hand, the tree nodes were
Bean-like Java objects, with useful methods like equals(),
removeChild(), addChild(), etc., then writing the transformation rules
in Jess, using the tree nodes as definstances, would be pretty
easy. The rules could call the member functions on both RHSs and LHSs
to do the hard work.
I think Dhananjay Makwana wrote:
> hi,
> I am using jess to express a tree structure as shown below:
>
> (deftemplate node
> "a node"
> (slot parent)
> (slot name (type STRING))
> (multislot children))
>
> I want to define rules which can "simplify" the tree. For instance, if
> two siblings have the same name, and have the "same" children structure, one
> of them can be removed from the tree.
>
> e.g.
> root
> / \
> a a
>
> on transformation should give
>
> root
> |
> a
>
> Ultimately, my nodes will be more expressive and there will be various
> transformation rules to simplify the tree.
>
> I am a bit stuck and would appreciate any help which points me into the
> right direction.
>
> Thanks in advance,
>
> -- Dhananjay
>
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------