Skip to content

Iterator able to verify, but not able to compute #6

Answered by dirkschumacher
mfakaehler asked this question in Q&A
Discussion options

You must be logged in to vote

Something like that?
Two problems IMHO:

  • The siblings(X, Y) := siblings(Y, X) produces infinite many results. Not a problem per se, but you will never reach FALSE I think (in this implementation). Does SWI Prolog stop here at some point?
  • One solution is to split the fixed person_group relation and the query person_in_group in to parts and also to flip X with Y in the last clause, as you want the sibling and not the initial person.
library(logician)

# I want to solve a group allocation problem
# there are two groups "upper", "lower"
# group sizes should differ no more then 1 
# there are rules that must be obeyed, e.g.
# sibblings must be allocated to the same group

database <- logician…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mfakaehler
Comment options

Answer selected by mfakaehler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5 on November 20, 2021 22:37.