Make a duplicate of the Original engine by copying all its computational state (stacks, data, current point in execution) to the Clone engine. After cloning, Original and Clone have identical computational state, and can be independently resumed.
To allow cloning, the Original engine must exist and must have stopped, i.e. have a status other than 'running' or 'exited'. The Clone engine must be either newly created, or have stopped with status 'false' or 'exception'. After cloning, Clone is in the same state as Original.
No options are currently supported.
?- engine_create(Orig, []), engine_resume(Orig, (writeln(hello) ; writeln(world)), true), engine_create(Clone, []), engine_clone(Orig, Clone, []), engine_resume(Clone, fail, CloneStatus), engine_resume(Orig, fail, OrigStatus). hello world world Orig = $&(engine,"46445b") Clone = $&(engine,"464b9b") CloneStatus = true OrigStatus = true Yes (0.00s cpu)