Size via attributed variables #3261
Replies: 2 comments
-
|
Definitely an interesting idea, thank you for sharing this! Currently, nothing is pruned because the How two different constraint solvers should work together is an open question, we currently have no dedicated formalism for it. I would therefore recommend, at least for an initial implementation, to express what you need in the module you are currently writing. The important—and currently missing—step is the propagation starting from constraints on the sizes. Maybe this could be a good starting point: term_sizes_different(Term1, Term2) :- ... This predicate is also an opportunity to attach an attribute on the involved sizes that pertains to the solver you are writing, and triggers the propagation you want when that size changes. |
Beta Was this translation helpful? Give feedback.
-
|
Maybe look at https://github.com/bakaq/constrained.pl and consider |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I was interested in defining a declarative notion of term size on the road to defining a declarative notion of term ordering based on Knuth Bendix Ordering, but am a bit confused if I'm doing things right.
The thinking was I could attach an attribute to each variable X holding a clpz variable N representing the size that can be refined when the variable X is unified.
It seems like the resulting constraints are roughly right, but they don't prune that this is impossible?
I could also perhaps freeze a size predicate until it is ground, but this wouldn't be able to do early pruning for comparison of sizes or even notice that two calls to size must be equal.
Am I missing something?
Thanks,
Phil
Beta Was this translation helpful? Give feedback.
All reactions