I need to make complement and difference operations between two sets. I've a example, to do union between two sets, I can reuse this code to make these two other operations. The union example, that I've is: (deffacts datos-iniciales (conjunto B C A D E E B C E) (conjunto E E B F D E)) (defrule inicio => (assert (union))) (defrule union ?h <- (union $?u) (conjunto ? $? ?e $?) (not (union $? ?e $?)) => (retract ?h) (assert (union ?e $?u))) Specifically, which part of the program should be changed?...
I need to make complement and difference operations between two sets. I've a example, to do union between two sets, I can reuse this code to make these two other operations. The union example, that I've is: (deffacts datos-iniciales (set-1 B C A D E E B C E) (set-2 E E B F D E)) (defrule union (union $?) ?set-2 <- (set-2 ?e $?r-2) (set-1 $? ?e $?) => (retract ?set-2) (assert (set-2 ?r-2))) (defrule union-con-primero-no-compartido ?union <- (union $?u) ?set-2 <- (set-2 ?e $?r-2) (not (set-1 $? ?e...