home *** CD-ROM | disk | FTP | other *** search
-
- data_base
- |
- |
- V
- |----------|
- ⁿ cons ⁿ
- |----------|
- | -------> pointer to first rule
- |----------|
- | |
- |----|-----|
- |
- V
- |----------| |----------| |----------|
- ⁿ cons ⁿ ⁿ cons ⁿ ⁿ cons ⁿ
- |----------| |----------| |----------|
- | -------> | -------------------------------------------> | --------> NIL
- |----------| |----------| |----------|
- | | | | | |
- |----|-----| |----|-----| |----|-----|
- | | |
- V V V
- |----------| |----------| |----------| |----------| |----------| |----------|
- rest of ⁿ cons ⁿ ⁿ cons ⁿ ⁿ cons ⁿ ⁿ cons ⁿ ⁿ cons ⁿ ⁿ cons ⁿ ì
- data base |----------| |----------| |----------| |----------| |----------| |----------| ì
- | --------->| --------> | ----->NIL | --------->| -------> | ----->NIL ì
- |----------| |----------| |----------| |----------| |----------| |----------| ì
- | | | | | | | | | | | | ì
- |----|-----| |----|-----| |----|-----| |----|-----| |----|-----| |----|-----| ì
- | | | | | | ì
- V V V V V V ì
- |----------| |----------| |----------| |----------| |----------| |----------| ì
- ⁿ func ⁿ ⁿ constant ⁿ ⁿ variable ⁿ ⁿ func ⁿ ⁿ variable ⁿ ⁿ constant ⁿ ì
- |----------| |----------| |----------| |----------| |----------| |----------| ì
- | likes | | paul | | X | | likes | | X | | wine | ì
- |----------| |----------| |----------| |----------| |----------| |----------|
-
- Figure 8 - The structure of "likes(paul,X) :- likes(X,wine) ."
- This is the second sentence in the data base.