Re: Bit-manipulation in ISO Prolog

From: Nameless (news.mail_at_chello.no)
Date: 08/17/04

  • Next message: Jens Kilian: "Re: Bit-manipulation in ISO Prolog"
    Date: Tue, 17 Aug 2004 15:13:48 +0200
    
    

    "Pere Montolio" wrote in message
    news:d0867bad.0408170058.5e355986@posting.google.com...
    > > "Nameless" <news.mail@chello.no> wrote in message
    > > ...
    >
    > I assume you know this answer for "xor":
    >
    > xor(X,Y,Z) :- Z is ( (\ X) /\ Y ) \/ ( (\ Y) /\ X ).
    >
    > (hope no typo mistakes).
    >
    > and pray that you compiler/interpreter of prolog has a good
    > optimizer.

    Right!

    > (note: in general I look always for compilers with and easy
    > interface to C, in order to be able to add small low level
    > functions).

    Pere, I think that's rather missing the point, namely the
    absence of (the very useful) 'xor' in ISO Prolog.

    >From a practical point of view, since most Prologs are
    actually implemented in C or a similar imperative language
    that has bit-meddling functions, it would be most
    surprising not to find matching Prolog predicates. Which is
    all the more reason to wonder why ISO Prolog lacks 'xor'.

    > I agree it is not a great answer, but it is all I have.

    I came up with the same solution too, but this seemed so
    clumsy I thought that there must be a better one. I guess
    not. Many thanks for confirming this, Pere. I'll be
    generous and thank Bart, too. ;)

    > PS: Do you known any good reason to do not post with a real
    > name?

    Yes. ;)

    -- 
    Mail sent to this email address is automatically deleted
    (unread) on the server. Send replies to the newsgroup.
    

  • Next message: Jens Kilian: "Re: Bit-manipulation in ISO Prolog"

    Relevant Pages

    • Re: Solving a set of boolean equations
      ... Languages I know are some ASMs, C, C++ and the excellent OCaml. ... I have looked a bit at Prolog more than 20 years ago and I now ... X xor Y xor Z = true ... over Z/2Z are solved (using bitwise operations to ...
      (comp.lang.prolog)
    • Re: output **no Whats wrong here?
      ... >>anyone else to simply decree that ISO Prolog is the best way to ... We can decree anything we ... newcomers to use ISO Prolog or who /mislead/ Prolog newcomers into ... Yet another decree in defense of the practice of requiring Prolog ...
      (comp.lang.prolog)
    • Re: Ensuring data is valid in Prolog
      ... > Each node is an algebraic equation in canonical form. ... Prolog is a very good choice for my application, ... ISO Prolog could not be expanded to include such things as domain ...
      (comp.lang.prolog)
    • Re: output **no Whats wrong here?
      ... > anyone else to simply decree that ISO Prolog is the best way to ... ultimate knowledge/fluency/grasp of Prolog (I mean ISO Prolog, ... (I don't mean to suggest that you needed 5 years of PDC-Prolog before ... the setting of the typical Prolog Programming Contest in which you ...
      (comp.lang.prolog)
    • Re: output **no Whats wrong here?
      ... >> with smart Prolog system such as DOS Turbo Prolog or DOS PDC ... anyone else to simply decree that ISO Prolog is the best way to ... Was the question of domain definitions and predicate declarations and ... Take a group of 500 students with ...
      (comp.lang.prolog)