Talk:Nondeterministic programming

Latest comment: 7 years ago by 122.57.250.105 in topic Limited number of alternatives?

Please move this article to Nondeterministic programming (note the lower-case in the second word.) -- 192.250.34.161 15:53, 22 June 2007 (UTC)Reply

The title of the article doesn't make it obvious that this is talking about a nondeterministic programming paradigm. Is this different than behavior that is non-deterministic? If so, the article should make some mention and contrast the two. E.g. a multi-threaded or multi-process program that shares state, but doesn't do anything to synchronize reads/writes. —Preceding unsigned comment added by 131.107.0.77 (talk) 23:41, 16 December 2009 (UTC)Reply

As an example, I'd cite "Select" in Go language. Permit me to quote extensively from the language spec[1]:
A "select" statement chooses which of a set of possible communications will proceed. It looks similar to a "switch" statement but with the cases all referring to communication operations.
For all the send and receive expressions in the "select" statement, the channel expressions are evaluated in top-to-bottom order, along with any expressions that appear on the right hand side of send expressions. A channel may be nil, which is equivalent to that case not being present in the select statement except, if a send, its expression is still evaluated. If any of the resulting operations can proceed, one of those is chosen and the corresponding communication and statements are evaluated. [snip]
If multiple cases can proceed, a pseudo-random fair choice is made to decide which single communication will execute.
Here the Go language explicitly specifies a non-determinism in program flow, requiring the runtime to make a psuedo-random fair choice pick of which communication to proceed with: mandated, specified nondeterminism.
--Rektide (talk) 02:31, 5 October 2010 (UTC)Reply
See also [2] for a Scala implementation and Nondeterministic algorithm for an algorithmic understanding.
--Rektide (talk) 18:49, 1 December 2010 (UTC)Reply

Limited number of alternatives? edit

A programmer specifies a limited number of alternatives, but the program must later choose between them.

Isn't it possible for there to be an infinite number of alternatives? Like this

(define (natural-number)
  (let loop ((n 1))
    (amb n (loop (+ n 1)))))

(natural-number) ===> 1
(amb) ===> 2
(amb) ===> 3
(amb) ===> 4
(amb) ===> 5
(amb) ===> 6
;;; and so on...

122.57.250.105 (talk) 22:14, 28 July 2016 (UTC)Reply