Could someone tell me what's wrong in my If else in my search, in the sublist.
Because when the size is 0, the conditional works, but if the value becomes 1,2 and 3 it presents an error, but the relational operators are not correct?
If the variable length has size = 0, the condition works, but if the variable length has size 3 it has an error.
Error is:
Exception: >=/2: Arguments are not sufficiently instantiated.
subList([], []).
subList(List1,List2):-
concatenate(List1,List2,Result1),
equalelements(Result1,Result2),
counting(Result2,Length),
Length =< 2
-> false
; Length >= 3
-> true.
searchdisease([],_).
searchdisease(Symptoms,Disease) :-
disease(Ls, Disease),
subList(Symptoms, Ls).
counting([ ],0).
counting([_| T], N) :-
counting(T, N1),
N is N1 + 1.
concatenate(L1, L2, NL) :-
append(L1, L2, L12),
msort(L12, NL).
Lengthis uninstantiated forLength >= 3- false