Re: Getting status of a free variable.



Yes thank you very much, nonvar/1 was the answer :)

On 12 Dic, 14:01, "Mauro Di Nuzzo" <pico...@xxxxxxxxx> wrote:
I didnt read it carefully. So it seems that the only thing you need is the
predicate nonvar/1, that is

sillabo(Word,[H| T]) :-
nonvar(H), !, ...

sillabo(Word,[H|T]) :- ....

"Mauro Di Nuzzo" <pico...@xxxxxxxxx> ha scritto nel messaggionews:457ea77e$0$4251$4fafbaef@xxxxxxxxxxxxxxxxxxxxxx

I dont know if I understood exactly, but it seems to me that you have just
to invert clauses, that is:

sillabo(Word,[Last,Current | T]) :-
nonvar(Last), !, ...

sillabo(Word,[H|T]) :- ....

Cheers
/\/\

"andrea" <kerny...@xxxxxxxxx> ha scritto nel messaggio
news:1165924229.460939.58060@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello everyone,
Maybe it's very easy but I don't find anywhere a solution.

I need to know if a free variable is unified with any kind of value,
for example:

sillabo(Word,[H|T]) :- ....

sillabo(Word,[Last,Current | T]) :- ...

I want it to go to the second goal only if the actual list has already
a Last element that's unified with a value.
I'm sorry for my english and my prolog dictionary...
I'll try to be clearer if you don't understand my problem.

.



Relevant Pages

  • Re: Getting status of a free variable.
    ... I didnt read it carefully. ... predicate nonvar/1, that is ... to invert clauses, that is: ... I'll try to be clearer if you don't understand my problem. ...
    (comp.lang.prolog)
  • Re: Getting status of a free variable.
    ... I dont know if I understood exactly, but it seems to me that you have just ... to invert clauses, that is: ... I'm sorry for my english and my prolog dictionary... ... I'll try to be clearer if you don't understand my problem. ...
    (comp.lang.prolog)