How do I rewrite the following so it uses if_?
问题 I am doing some easy exercises to get a feel for the language. is_list([]). is_list([_|_]). my_flatten([],[]). my_flatten([X|Xs],RR) :- my_flatten(Xs,R), (is_list(X), !, append(X,R,RR); RR = [X | R]). Here is a version using cut, for a predicate that flattens a list one level. my_flatten([],[]). my_flatten([X|Xs],RR) :- my_flatten(Xs,R), if_(is_list(X), append(X,R,RR), RR = [X | R]). Here is how I want to write it, but it does not work. Neither does is_list(X) = true as the if_ condition. How