Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (deffacts initial
- (stiva)
- (pop)
- (stiva 123 13 4)
- (stiva 2)
- )
- (defrule pop-stiva-vida "ex1 pag 39 lab 4"
- ?adresa <- (pop)
- ?stiva <- (stiva)
- =>
- (retract ?adresa)
- (printout t "nu sunt elemente in stiva" crlf)
- )
- (defrule pop-stiva-plina "ex1 +2 pag 39 lab 4"
- ?adresa <- (pop)
- ?stiva <- (stiva ?valoare #?rest)
- =>
- (retract ?adresa ?stiva)
- (assert (stiva ?stiva $?rest)
- (printout t "Valoarea extrasa din stiva este " ?valoare crlf))
- )
- (defrule pop-stiva-untimul-element "ex2 pag 39 lab 4"
- ?adresa <- (pop)
- ?stiva <- (stiva ?valoare )
- =>
- (retract ?adresa ?stiva)
- (assert (stiva )
- (printout t "Ultima valoarea extrasa din stiva este " ?valoare crlf))
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement