Following some learning exercises/tutorials online I encounter the bellow error when running my simple prolog program.
testReverse :-
transImage(reserseList,'imageIN.pgm','imageOUT.pgm').
transImage(R,In,Out) :-
read_pgm(In,PGM),
transf_pgm(R,PGM,PGM2),
write_pgm(Out,PGM2).
transf_pgm(R, pgm(A,B,H,W,M,L), pgm(A,B,H,W,M,L2)) :-
Term =.. [R,L,L2],
call(Term).
reserseList([],[]).
reserseList([X|R],Reversed):-
reserseList(R, RevList),
append(RevList,[X],Reversed).
And the runtime error am getting in SWI-Prolog is
10 ?- testReverse
| .
ERROR: read_pgm/2: Undefined procedure: fread/4
ERROR: However, there are definitions for:
ERROR: read/1
ERROR: read/2
Any ideas why? Am very new to prolog, literally 2 days from online tutorials, so accept my apologies in advance If i make you further questions regarding your answer. Thank you.