How would you parallelize between(1,20,N), prime(N)?

The regular tabling algorithm (SLG resolution) does not guarantee a linear (prolog SLD-like) evaluation, so the results will be out of order compared to prolog’s SLD. There have been however other tabling algorithms proposed which allow linear results:

See Tabling: Linear Resolution (SLT)

1 Like