Ok I'm writing some code to go through a check each value by mutual recursion in Prolog. This is my code so far:
semestersok(SP) :-
[Prior|Tail] = SP,
sem1ok(SP).
%% sem1ok(SP) :- checks semester 1 of SP is ok
sem1ok(SP) :-
[Sem1|Tail] = SP,
sem2ok(Tail).
%% sem2ok(SP) :-
sem2ok(SP) :-
[Sem2|Tail] = SP,
sem1ok(Tail).
I haven't put any code in yet to do with checking (There's two relations as it has to check alternating values), I'm having a problem with the code cycling through until it has an empty list, then it fails and comes back with false (no). Since This code isn't manipulating any code I believe it should come back true as it stands right now. Why isn't it?