Skip to content

Instantly share code, notes, and snippets.

@tatut
Created October 12, 2023 11:52
Show Gist options
  • Save tatut/1e3c8cb9a2898209a3e3f5000b8aa2d1 to your computer and use it in GitHub Desktop.
Save tatut/1e3c8cb9a2898209a3e3f5000b8aa2d1 to your computer and use it in GitHub Desktop.
contiguous check
contiguous([_]).
contiguous([[_,E1],[E1,E2]|Segments]) :-
contiguous([[E1,E2]|Segments]).
% contiguous([[1,3],[3,10],[10,123]]). succeeds
% contiguous([[1,3],[420,666]]). fails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment