Perhaps the place to ask this question is the Constantine Planning Wiki – but would it be difficult in the next version of Jess to implement a hierarchical template structure? For example, one could have templates like this:

 

(deftemplate LegalAgent

            (slot Name)

            (slot CreationDate)

            (slot AccountingMethod)

            (multislot EntitiesOwned)

            (slot Country))

 

(deftemplate Individual extends LegalAgent

            (slot State)

            (slot Sex)

            (slot Age)

            (slot Married))

 

(deftemplate OwnableEntity extends LegalAgent

            (multislot Equities))

 

(deftemplate Corporation extends OwnableEntity

            (slot CurrentEandP)

            (slot AccumulatedEandP)

            (slot CurrentIncome)

            (slot State)

 

(deftemplate SCorporation extends Corporation

            (slot DateSElectionEffective)

            (slot DateSElectionTerminated))

 

(deftemplate Partnership extends OwnableEntity

            …

            )

 

Then, a rule like the following would match against any LegalAgent including Individual, Corporation, SCorporation and Partnership:

 

(defrule PrintAgents

            (LegalAgent (Name ?name)

                        (Country USA))

            =>

            (printout t ?name “is a U.S. entity.” crlf)

)

 

Whereas a rule like this would match any corporation (both regular and S corporations) but not against Individuals or Partnerships:

 

(defrule PrintCorporation

            (Corporation (Name ?name)

                        (Country USA))

            =>

            (printout t ?name “is a U.S. corporation.” crlf)

)

 

Each subclass would automatically include the slots of all of the classes above it in the hierarchy.  If templates could be structured in this fashion, then the templates themselves could embody additional knowledge and facilitate categorical reasoning.

 

 

Reply via email to