Rusreg wrote:
Hello.

The functions in list module are determinstic. For example I want to use the List.append function as nondeterministic for parsing string, but it don't work:

Str in
List = {List.append "(" Str}

I found the nondet. realization of this function in Internet:

proc {Append L1 L2 L3}
  dis L1=nil L2=L3
  [] X M1 M3 in
     L1=X|M1 L3=X|M3 {Append M1 L2 M3}
  end
end

and it work fine. Why the functions in List is deteministik? E.g. the same function (append) of Curry language is nondetermenistik.
You should read chapter 9 of CTM. A list function with a given logical semantics can have different operational semantics. We can have a functional (deterministic) list function and a relational (nondeterministic) list function. It's a good idea to provide these separately, to control the use of nondeterminism. Usually, you *don't* want nondeterminism. In those cases when you do want it, it should be specified by the programmer.

Peter

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to