CancelledEvents is the list of after events that have been cancelled. Each element of CancelledEvents is of the form of an event specified in Events of events_after / 1. As a result, CancelledEvents can be reposted using events_after(CancelledEvents). If there was no event to cancel, CancelledEvents will be bound to the empty list.
Note that the processing of an already raised, but as yet unprocessed event will not be cancelled by this predicate (but you can use event_disable/1 to achieve this).
% setup an after event and cancel immediatedly ?- event_create(writeln(hi), [], E), event_after(E, 3.2), cancel_after_event(E, Cancelled). E = $&(event,"36nz3f") Cancelled = [$&(event,"36nz3f") - 3.1999999999999886] Yes (0.00s cpu) % no after-event requested, nothing to cancel ?- event_create(writeln(hi), [], E), cancel_after_event(E, Cancelled). E = $&(event,"36nz07") Cancelled = [] Yes (0.00s cpu) % setup an after event and cancel immediatedly ?- event_create(writeln(hi), [], E1), event_after_every(E1, 1), event_create((cancel_after_event(E1, C1), writeln(cancelled(C1))), [], E2), event_after(E2, 5), repeat, fail. hi hi hi hi cancelled([$&(event,"36nyxj") - every(1)])