next up previous contents
Next: The selection function Up: Implementation Previous: Representation of grammar and

Representation of item sets

The structure of an item is represented as a record structure using the defstruct construct of Common Lisp in the following way:

(defstruct item
  clause           ;; internal representation of a definite clause
  selected-element ;; the selected element
  position         ;; its position
  unit             ;; T if clause is unit otherwise NIL
  in-set           ;; the index of the item set item is a member of
  from-set         ;; the backward pointer
  number           ;; the number of the item
  ignore           ;; indicates whether the item should be ignored or not
   )

The inference rules only use the value of the slot selected-element. We explicitly represent the position for efficient reduction of a clause.

The structure of an item set is a record of the following form:

(defstruct item-set
  index          ;; the index of the item set
  active-items   ;; a hash table that keeps active items
  passive-items  ;; a hash table that keeps passive items 
  number)        ;; the number of the item set

A global list is then used to store the several item sets.



Guenter Neumann
Mon Oct 5 14:01:36 MET DST 1998