;;; OBJECT CLASSIFIER -- cyclic definition version
;;; SPECIFICATION [DOCUMENTATION]

#|
SPECIFICATION --- DESCRIPTION

1. Object Classifier is a black box for classifying objects.
   As I browse the classes with browsers, browse the objects with classifier.
   I can specify the structure of viewing. the structure is defined with 3 category.

2. The unit is a container of objects, that is called as partition.
@partition contains the objects which satisfy some constraint.


3. Structure
3.1 node

When the node is asked "Is this object registered to the node?",
the node check the constraint of the category of it, then execute the
representation of it  for makeing the partition.

and, query the partition "do you register the object in you?"
namely, constraints in category level, are join with conjunction.

The real constraint at the node n is like as

const(r) and const(n1) and ... and const(n)

where (r, n1, ..., n) is the path from t to n, and const(m) means for
constraint of node m.

The all node of the tree classifies objects (but there may be many path a-->b for any a,b),
has some state for classification procedure.
This state is specified by the function compass for every category user specified.
The state has a link to the parent node, the node must determin the self state
with dependent on it only.

* this mechanism like induction/recursion. but for correct function, the initial
state definition is required.


3.2 classifier has these items

   0) name
   1) slot definition
   2) category definition

name is identified for classifier.
slot defines the common state for every nodes.
parent* is added by system automatically, don't define it in here.
The category definition is as below.


category defines the structure betweeen the partitions.
in category definition.

   0) name                              the name of cateogory
   1) (constraint object partition)     the constraint of objects belong to theaint
                                        return value is any object
   2) (representation object partition) partition is sub group of the category.
                                        the condition for the partition is representation.
                                        return value is nil or t
   3) (compass partition object)        compass set the slots defined in classifier.
                                        compass may refer parent*.
                                        return value is anything.


   classifier defines an template by this category.
   same object can be classified in several classifier.
   classifier has not a object itself, but the name of it.

4.general procedure
   1) define a classifier.
   2) make an instance of the classifier. This is a container of objects.
   3) put objects into the classifier. classifier classifyes the objects with respect to
      the category definition, if needs, make appropriate partition contains the object.
   4) The object in the classifier can be get with specified the partition.
      partition is represented as the path from the t partition with representation..

5. future plan

   1) how to classify objects in graph structure ?
   2) What is mean the classification???


6. Interface


;;; definition of classifier
(defclassifier name . category-def*) => classifier

;;; make a instancd of the classifier
(make-classifier name)) => classifier instance

;;; put the objects into the classifier
(put-object ((cl classifier) object)) ==> object // place it in a fitting place
(put-object* ((cl classifier) object*)) ==> object* // place it in a fitting place

;;; refer the all objects in the classifier
(get-all-object* ((cl classifier))) ==> object* // all in cl

;;; refer the object in the partition and the childrens of it.
(get-all-object* ((pt partition))) ==> object* // all in pt

;;; refer the objects in the partition
(get-object* ((pt partition))) ==> object* // in pt


;;; in a classifier, there is only one t category, t partition.
;;; get the t from the classifier

(get-t-category ((cl classifier))) ==> category
(get-t-partition ((cl classifier))) ==> partition

;;; get the sub partition from the partition
;; every partitions are reachable from t partition by child*

(child* ((pt partition))) ==> partition*

;;; get the sub category from the category
;; every category are reachable from t category with child*

(child* ((ct category)) ==> category*


;;; get the partition from the classifier with partition path

(get-partition ((cl classifier) r-path)) ==> partition // is described by r-path


;;; path description
r-path

t is a unique partition of root category.

(t r1 r2 ...)

;;; show the every object and it's partition path in the classifier


(show ((cl classifier) method))  ;; the method is used for display the object.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|#
