| 13196 | 13197 | thread_send_message(Return, '$lgt_ready'(Goal, This, Self, call(Tag))), |
| 13197 | 13198 | ( catch(Goal, Error, (thread_send_message(Return, '$lgt_reply'(Goal, This, Self, Tag, Error, NonDetId)), Flag = error)), |
| 13198 | | var(Flag), |
| 13199 | | thread_send_message(Return, '$lgt_reply'(Goal, This, Self, Tag, success, NonDetId)), |
| 13200 | | thread_get_message(Message), |
| 13201 | | ( Message == '$lgt_next' -> |
| 13202 | | fail % backtrack to the catch(Goal, ...) to try to find an alternative solution |
| 13203 | | ; true % otherwise assume Message = '$lgt_exit' and terminate thread |
| | 13199 | ( var(Flag) -> |
| | 13200 | thread_send_message(Return, '$lgt_reply'(Goal, This, Self, Tag, success, NonDetId)), |
| | 13201 | thread_get_message(Message), |
| | 13202 | ( Message == '$lgt_next' -> |
| | 13203 | fail % backtrack to the catch(Goal, ...) to try to find an alternative solution |
| | 13204 | ; true % otherwise assume Message = '$lgt_exit' and terminate thread |
| | 13205 | ) |
| | 13206 | ; % Goal generated an exception, which was already reported |
| | 13207 | true |