>If I execute read(Term,Vars) and my input is: "X is Y.",
>Term = "X is Y" and Vars = [_15,_16].
>
>Is there anyway to get Vars=[X,Y]?
>I don't understand how to get the name of the Variable instead of its
>reference.
Actually, if I execute your code, I get
| ?- read(Term, Vars).
|: "X is Y".
Term = [88,32,105,115,32,89]
Vars = []
or, if the quotes were not meant to be there,
| ?- read(Term, Vars).
|: X is Y.
Term = _6 is _7
Vars = [_6,_7]
Most Prologs do not keep the names of variables in terms being read in.
The only exception is the top level loop, where usually a special predicate is used which returns variables together with their names as atoms. C-Prolog 1.5 has no such
predicate, the top-level answer is hard-wired. If you insist on C-Prolog, use ROK's public domain parser read.pl and rdtok.pl which gives you both the term and a list of