Ciao Prolog and Yap

Post Reply
Message
Author
oui

Ciao Prolog and Yap

#1 Post by oui »

Hi

Both are very compact compared with SWI Prolog (Nederlands) and easy to install (Ciao: own depository / Yap: Debian or ubuntu)

Is someone knowing / using it? How to use words with Unicode characters (ñçãõ German ß, Turkish ı , French æ œ) as arguments?

bye

oui

#2 Post by oui »

Hi

I have a big part of the answer! I did ask the same or somewhat as the same at the blackboard of Ciao Prolog (Ciao invite you to subscribe to that list before you try to download the binaries if you are willing to communicate with the Ciao community),

I did receive today following very interesting answer:

On Fri, Jul 18, 2014 at 3:27 PM, oui wrote:

> Hi
>
> I am searching for exemples for using CIAO Prolog with unicode contents.
>
> Are they possible in atoms and variables or only in variables?
>
>
>
> How to elaborate unicode contents for HTML?
>
>
>
> Is there somewhere a bibliothek online for Proloog applications using both?

Hi,

You can use Unicode characters (UTF-8) in the code as long as it is
part of a string or a quoted atom. For example, the following code is
valid:

p(Z) :- X = '☆'('☀ ☆ ☂'), Y = '☆'(Z), X=Y.

q(Z) :- X = '☆'("☀ ☆ ☂"), Y = '☆'(Z), X=Y.

It is even possible to define operators:

:- op(100,xfy,'☆').

r(Z,M) :- X = '☀' '☆' '☂', Y = '☆'(Z,M), X=Y.

There are some limitations. First, unquoted characters cannot be used
neither as part of atoms nor variables names. Secnod, there is no
support for Unicode manipulation (unicode strings are represented as
code of 1-byte characters). You may translate the sequence of bytes in
UTF-8 to UTF-32. Ciao does not provide any functionality to do that,
but we may add it if there is interest.

However, if you only need to read and write back Unicode strings
without any manipulation, there should not be many problems.

Bests,

--
Jose

Post Reply