SWI-PROLOG

edvan
09 de Noviembre del 2005
a ver quien puede ayudarme con este código, se lo agradeceria mucho. Es un SE (Sisteme Experto), y me salen estos errores(nose pq?):
==============
ERROR: c:/mis documentos/prolog/perros.pl:4: Syntax error: Operator expected
ERROR: c:/perros.pl:21: Syntax error: Operator expected
Warning: (c:/perros.pl:52):
Clauses of it_is/1 are not together in the source-file
========================
EL CÓDIGO ES:
----------------------------
Domains
Database
xpositive(symbol,symbol)
xnegative(symbol,symbol)
Predicates
do_expert_job
do_consulting
ask(symbol,symbol)
dog_is(symbol)
it_is(symbol)
positive(symbol,symbol)
negative(symbol,symbol)
remember(symbol,symbol,symbol)
clear_facts
Goal
do_expert_job.
Clauses
do_expert_job:-makewindow(1,7,7,"Sistema Experto",1,16,22,58),nl,
write("Responda con 'yes' o 'no'"),nl,do_consulting,
write("Presione alguna tecla "),readchar(_),clearwindow,exit.

do_consulting:-dog_is(X),!,nl,write("Tu perro es un ",X," ."),clear_facts.
do_consulting:-nl,write("Lo siento, no puedo determinar nada."),clear_facts.

ask(X,Y):-write("Pregunta: ",X," ",Y,"? "),readln(Reply),remember(X,Y,Reply).

positive(X,Y):-xpositive(X,Y),!.
positive(X,Y):-not(negative(X,Y)),!,ask(X,Y).
negative(X,Y):-xnegative(X,Y),!.

remember(X,Y,yes):-asserta(xpositive(X,Y)).
remember(X,Y,no):-asserta(xnegative(X,Y)),fail.

clear_facts:-retract(xpositive(_,_)),fail.
clear_facts:-retract(xnegative(_,_)),fail.

it_is(X):-positive(it_is,X).

dog_is("English Bulldog"):-it_is("short haired dog"),
positive(has,"height under 22 inches"),positive(has,"low set tail"),
positive(has,"good nature personality"),!.

dog_is("Bad Bulldog"):-it_is("short haired dog"),
positive(has,"height under 22 inches"),positive(has,"low set tail"),!.

dog_is("Beagle"):-it_is("short haired dog"),positive(has,"low set tail"),positive(has,"long ears"),positive(has,"good nature personality"),!.

it_is("short haired dog"):-positive(has,"short haired"),!.
-----------------