You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The section on integer arithmetic and constraint programming at https://www.metalevel.at/prolog/clpz explains that the list_length/2 predicate does not terminate when asked to find a list that has a specified length.
?- list_length(Ls, 3), false.
nontermination
"It takes only a single additional goal to make this query terminate. This is left as an exercise."
I have struggled to find what this single additional goal is. I have tried days of reading popular texts on prolog, googling and even asking on stackexchange.
I would love an answer or a link to an answer.
The text was updated successfully, but these errors were encountered:
Repository owner
locked and limited conversation to collaborators
Oct 25, 2022
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The section on integer arithmetic and constraint programming at https://www.metalevel.at/prolog/clpz explains that the list_length/2 predicate does not terminate when asked to find a list that has a specified length.
"It takes only a single additional goal to make this query terminate. This is left as an exercise."
I have struggled to find what this single additional goal is. I have tried days of reading popular texts on prolog, googling and even asking on stackexchange.
I would love an answer or a link to an answer.
The text was updated successfully, but these errors were encountered: