Re: Floyd warshall



On 31 Ago, 09:17, Bart Demoen <b...@xxxxxxxxxxxxxxxxx> wrote:
andrea wrote:
I tried with a very small example

prova(X,Y) :-
dist(X,Y,Z), Z > 2 ->
write('maggiore'); write('minore'),write(Z).

?- prova(0,1).
minore_L136

So in the "else branch" Z is not unified anymore, why?? I dont' find a
suitable explanation..
How can I translate this little piece of code?

Suppose you had written (sorry for my indentation, I hope it is still readable to you)

f(X) :-
(test(X) ->
true
;
write(X)
).

test(foo) :- fail.

What value would you like to see on the output ?

Cheers

Bart Demoen

In this case nothing, but my test is not true, so it should enter in
the else branch, am I missing something??

.



Relevant Pages

  • Re: Floyd warshall
    ... suitable explanation.. ... How can I translate this little piece of code? ... Suppose you had written (sorry for my indentation, I hope it is still readable to you) ... what do you want to be output in my f/1? ...
    (comp.lang.prolog)
  • Re: Floyd warshall
    ... suitable explanation.. ... How can I translate this little piece of code? ... Suppose you had written (sorry for my indentation, I hope it is still readable to you) ... So I don't understand why mine was not working, when the test fails it ...
    (comp.lang.prolog)
  • Re: Skolems Paradox
    ... And I can't see why you don't consider it an explanation. ... by relating it to old terminology that presumably you ... shown how to translate a sentence of the form "S is true ... and logical concepts: quantifiers, set membership, comparisons. ...
    (sci.logic)
  • Re: Machine-translated spam
    ... >>> I've recently received a number of advertisements for ... I should have included the explanation. ... could translate this manual back into English would receive a prize. ...
    (sci.lang.translation)
  • RE: File Creator under WIN32 environment
    ... Here is an explanation in Perl: ... use strict; ...
    (perl.beginners)