Skip to content

Instantly share code, notes, and snippets.

@sjkillen
Created April 1, 2025 18:50
Show Gist options
  • Save sjkillen/1f0c6c1438ef40df3cc87bb07005a655 to your computer and use it in GitHub Desktop.
Save sjkillen/1f0c6c1438ef40df3cc87bb07005a655 to your computer and use it in GitHub Desktop.
Notes on CLPFD
  1. Problem Mapping
  • Think about how to express problem as numbers with constraints
  • Write code to map into domain and map from domain
  1. Rely on the constraint solver
  • Avoid using is/2 entirely
  • Implictly using =/2 through predicate calls
  • Use #= instead of is/2 and =/2
  • Verify that solver was used by printing variables before calling label - if the variables all have concrete values, then you are not relying on the solver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment