Re: Lost in translation



Markus Triska wrote:
Damien Kick <dkixk@xxxxxxxxxxxxx> writes:

this "a / b / c" syntax.

That's infix syntax for the term /(/(a,b), c) (functor: /, arity: 2):

%?- a/b/c == /(/(a,b), c).
%@ Yes

Ah, I think that what I was forgetting is that '/' only acts as the operator for division in the context of 'is', i.e. "X is a/b". Outside of that context, it is a functor like any other. He could've used "a+b+c" just as well (or just as confusingly) as "a/b/c".

That's a bad choice to represent a tuple. It's clearer and cheaper to
use a term like flight(a,b,c).

Well, I was personally expecting to see something like flight(a,b,c) instead. Bratko seems to use this <http://tinyurl.com/2m335v> quite a bit, though. The trip planner <http://tinyurl.com/ysqygq> and an eight queens solver <http://tinyurl.com/2fded9> being just two examples. Is this not typical prolog style, then? Either way, it seems like my prolog-in-lisp translation indeed did not lose any semantics in the translation.

In your Prolog example, infix notation is used in yet another place:

%?- a:b == :(a, b).
%@ Yes

This didn't confuse me, I think, because ':' doesn't already have a predefined meaning in prolog.
.



Relevant Pages

  • WATCHING ATOMS MOVE
    ... Introductions to the Focus stories of the past week; ... WATCHING ATOMS MOVE ... COMPLETE Focus story and PHASE TRANSITION VIDEOS at ... NEW FOCUS POSTER: Go to http://focus.aps.org/poster.html to download the ...
    (sci.physics)
  • Re: Damn you, FEDEX! or Nikon D40 lost in Springfield, MO blackhole.
    ... the 2 mp Mavica he had been using with a Nikon D40. ... After shopping around, he got me to order one for him. ... The shipper had it insured, but from what I have read it could take weeks to sort this crap out. ... You may get your insurance from FedEx and a couple weeks later they find it and deliver it. ...
    (alt.photography)
  • Re: discovering predicate name
    ... > with gprolog to make a little and basic expert system. ... > if there's anyway I can check these predicates in order to taylor the ... context of facts by asking the user various questions. ... In Prolog, you don't have to go rummaging around in referenece ...
    (comp.lang.prolog)
  • Re: Are Logtalk objects "real" objects?...
    ... In the context of Prolog, both modules and objects share the ... property of encapsulating predicates. ... programming languages, one easily finds many variations (and ...
    (comp.lang.prolog)
  • Re: Are Logtalk objects "real" objects?...
    ... In the context of Prolog, both modules and objects share the ... materializations) of both concepts. ... Import is not inheritance - Why we need both: ...
    (comp.lang.prolog)