How to convert this
fact( [a,b,c], [d,e,f], ..., [p, q, r] )
to the list of these items?
Result:
[[a,b,c], [d,e,f], ..., [p, q, r]]
list_fact_args(Fact,List) :- Fact =.. [fact|List].
=..- a convenient predicate that converts the predicate on the left to a list with the name of the predicate as the first member and its arguments as the last members. Or the list to the right of the predicate to the left. This factmeans that it lists only predicates with the name "fact".
=..
fact
Get your Prolog tutorial or tutorial and look up = .. / 2.