domains
    A,B,C = symbol
    N,P = integer

predicates
    tower(integer,symbol,symbol,symbol,integer)

    go

clauses
    go :- clearwindow,
          write("enter value of N (For Transfering from A To B)"),
          readint(N),
          tower(N,'a','b','c',N).

    tower(N,A,B,C,P):-
        N > 1,
        P is N-1
        tower(P,A,C,B,P),
        write([move , A,B]),nl,
        tower(P,C,B,A,P).

        tower(0,_,_,_):- !.
3

There are 3 best solutions below

0
Fred Foo On

You're missing a comma after P is N-1.

0
hardmath On

Also, your domain declarations don't make sense. The syntax is not for associating variables with domains (symbol and integer are predefined for you), but rather for creating specialized domains from the predefined ones. It doesn't appear that your program needs any domain declarations.

Tutorials for domains, etc. in Turbo Prolog are rather scarce online, due to the passage of time, so your best bet (if you lack original documentation) may be to look at one of Visual Prolog tutorials.

0
Urjit Mehta On

Try replacing is with = [Like: P = N-1]