-
Notifications
You must be signed in to change notification settings - Fork 7
Description
For and do loops in a semidet context conjoin the tests in the loop body (and see #492 for a proposal to allow them to disjoin the tests). When they terminate, they should allow the values of the variables at the point they terminate to be available in subsequent code. This would allow disjunctive loops to be used to search for a value that satisfies the condition.
For conjunctive loops, the aim is to be able to find the first value for which the condition fails. The complication is that the loop fails in this case, so it does not produce any values, so there will need to be some workaround to this. Using while on the condition may be a partial solution, since failing the while condition terminates the loop without failing it, but there will still need to be a way to determine whether the loop terminated prematurely.