Hello. Please tell me why the program does not work, I am writing to Prolog 5.2. Condition: Create a predicate that calculates, by list and number, a sublist of the original list, starting with the item with the specified number.
domains list = integer* predicates sublist(integer,integer,list,list) clauses sublist(_,_,[],[]):-!. sublist(N,N,L,L):-!. sublist(M,N,[H|T],T1):- M<N, M1=M+1, sublist(M1,N,T,T1). goal write("N="), readint(N), write("L="), readterm(list,L), sublist(1,N,L,L1),write(L1),nl. Error after entering N and L:
PROGRAM ERROR. Module:OBJ\GOAL$000.PRO Pos:831 Message:1405 List start expected (during term reading or converting) Thank you in advance