I have a function that takes the first item from a list, and checks if that item is one of several items, executes some functions accordingly and recursively executes on the next items on the list.
My trouble is that in line 6, the variable instantiated as the first item of the list is no longer defined, and I have trouble figuring out why.
I just started working with KBSs' so forgive me if my language is incorrect.
1 f(L) :-
2 [F|Ls] = L,
3 (
4 (F = value1 -> ...);
5 (F = value2 -> ...)
6 ) -> f(Ls); format('~w is not a valid action', [F]).