solutii

(defrule buzunar1. (timbru ?t ?l). =>. (assert (lung-part ?t ?l)). ; un fapt lung-part
contine o lista de indecsi de timbre si lungimea. ; totala a lor, pe ultima pozitie. ) (
defrule buzunar2. (lung-part $?lt ?lp). (timbru ?t ?l). (test (not (member$ ?t $?lt))).
=>. (assert (lung-part $?lt ?t (+ ?lp ?l))). ) (defrule termina. (declare (salience 10)).

Part of the document