[Haskell-cafe] Re: Purely logical programming language

2009-05-27 Thread Sebastian Fischer


On May 27, 2009, at 1:01 AM, Ahn, Ki Yung wrote:

By the way, did Curry solved the problem of how to deal with IO and  
backtracking issues? (where and  where not should IO happen kind of  
a thing)


Curry uses the IO monad to specify where IO actions may happen. Non- 
determinism is not excluded statically from IO actions but usually  
leads to a run-time error (see Section 7.1 of [1]). For example the  
Curry systems PAKCS [2] and MCC [3] show the following behaviour (the  
infix operator (?) denotes non-deterministic choice):


  $ pakcs
  Prelude print (1?2)
  1
  2
  ERROR: non-determinism in I/O actions occurred!
  Prelude :q
  $ cyi
  Prelude print (1?2)
  Error: cannot duplicate the world
  Prelude :q

In order to use non-deterministic operations in an IO context, their  
results need to be *encapsulated*, i.e., collected in a data structure  
(e.g. a list). See [4,5] for recent research on encapsulated search.


The Curry System KiCS [6] uses encapsulated search implicitly in IO  
operations and uses the first result if there is one and only yields  
an error otherwise:


  $ kicsi
  Prelude print (1?2)
  1
  Prelude print (1=:=2)
  non-exhaustive patterns in function Prelude._case_1
  interactive: program error
  Prelude :q

Cheers,
Sebastian

[1]: http://www.informatik.uni-kiel.de/~curry/report.html
[2]: http://www.informatik.uni-kiel.de/~pakcs/
[3]: http://danae.uni-muenster.de/~lux/curry/
[4]: http://www.informatik.uni-kiel.de/~mh/papers/JFLP04_findall.html
[5]: Computing with subspaces, 
http://web.cecs.pdx.edu/~antoy/homepage/publications.html
[6]: http://www.informatik.uni-kiel.de/prog/mitarbeiter/bernd-brassel/projects/


--
Underestimating the novelty of the future is a time-honored tradition.
(D.G.)



___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Purely logical programming language

2009-05-26 Thread Ahn, Ki Yung

Henning Thielemann wrote:


On Tue, 26 May 2009, Jan Christiansen wrote:


Hi,

On 26.05.2009, at 21:24, Lauri Alanko wrote:


Mercury also has type classes and other Haskellisms, so if you're
interested in doing Prolog the Haskell way, you should definitely
have a look at it.


I have to admit that I am not very familiar with Mercury. But if you 
are looking for doing Prolog the Haskell way advertiseyou can also 
have a look at Curry/advertise. Curry is a lazy functional logic 
programming language that has a Haskell like syntax 
(http://www.curry-language.org/).


You forgot to mention, that you will give a talk about Curry soon, where 
Matthias might want to attend:

  http://iba-cg.de/hal4.html

:-)


By the way, did Curry solved the problem of how to deal with IO and 
backtracking issues? (where and  where not should IO happen kind of a 
thing)  I haven't used Curry that much but I remember that there was an 
issue of IO and non-determinism.


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe