(deffacts date (stiva A) ) (deftemplate nod (slot nume) (multislot fii) (slot tata) ) (deffacts arbore (nod (nume A) (fii B C D)) (nod (nume B) (fii H I) (tata A)) (nod (nume C) (fii E F) (tata A)) (nod (nume D) (fii G) (tata A)) (nod (nume E) (tata C)) (nod (nume F) (tata C)) (nod (nume G) (tata D)) (nod (nume H) (tata B)) (nod (nume I) (fii J) (tata B)) (nod (nume J) (tata I)) ) (defrule dfs ?s <- (stiva ?top $?rest) (nod (nume ?top) (fii $?fii)) => (printout t "vizitat " ?top crlf) (retract ?s) (assert (stiva $?fii $?rest)) )