If you want to add X
to the front of the list:
add(X, LL) :-
( retract(list(Prev))
-> LL = [X|Prev]
; LL = [X]
),
asserta(list(LL)).
But I agree with @jschimpf's advice. Assert/retract should only be used under certain circumstances as may be quite in efficient in some applications.