Search code examples
prologinstantiation-error

Argument not sufficiently instantiated


So, I just started with Prolog, and I keep getting this error of Singleton variable (Quo,C) and Argumnets not substantially instantiated.

Quo:-
    read(A),
    read(B),
    C is A/B,
    write(C).

A simple code for finding the quotient of 2 numbers' division is made here.


Solution

  • Quo is a variable (since it starts with an uppercase letter). It cannot appear as the head of a clause (i.e., the thing that precedes the :-. Replacing Quo -> quo solves your problem.