I decide to create another thread about nondet. functions. The Mozart support logic style of programming and this is very good. But it's luck of library support this style! Any logic or functional-logic language has predicate library for some that solves using logic propgramming principes. For example, parsing text - typycal problem for logic programming. I decide use 'choise' clause (in compliance with Peter Van Roy's advice). But I meet with some difficults.

First, there are know comfortable way for unification strings by pattern. For example, there no such function:

"1+1" = {AppendFull one sign two}

that bind variable one to '1', variable sign two '+' and variable two to '1'.

Writing this function very easy and it's difficult to understand, why it's not contained in Mozart libray:

proc {Append L1 L2 L3}
     choice
    L1 = nil L2 = L3
     [] X T1 T3 in
    L1 = X|T1 L3 = X|T3
    {Append T1 L2 T3}
     end
  end
proc {AppendFull Lists List}
     choice
    Lists = nil List = nil
     [] Y X|T = Lists in
    {Append X Y List}
    {AppendFull T Y}
     end
  end

Second, there is no nondet. functions for character analize. For example, the functions in module Char is deterministik, e.g. function isAlpha usable only in one direction:

{Char.isAlpha &a Result,}

but this is don't work:

{Char.isAlpha Ch true}.

Again, the realization of this functions is very easy and it's very strange, that Mozart having so powerful realization of logic paradigm luck of the library modules with set of nondeterministik functions.

PS Sorry for poor English, if some phrases don't understandable, I will try to build them more correct.
_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to