Add element to list depending on rule?
===

I am newcomer to prolog. I understand it allows many facts to be written and a tree created- is it possible to do this

i would like to add value to a list depending whether rule returns true or false?

could some person please show me some small code which can explain this?

thank