Skip to content

Answer depends on a clause position - is that acceptable? #3004

Answered by hurufu
Kapelianovych asked this question in Q&A
Discussion options

You must be logged in to vote

In a pure Prolog program order of clause can only influence termination properties or order of solutions. Generally it is a bad idea to rely on it. Also you are using once/1 that means that your grammar is ambiguous and you just limiting yourself to the first solution which may or may not be what you want. Try to define unambiguous grammar.

Replies: 7 comments 23 replies

Comment options

You must be logged in to vote
5 replies
@UWN
Comment options

@hurufu
Comment options

@UWN
Comment options

@hurufu
Comment options

@UWN
Comment options

Answer selected by Kapelianovych
Comment options

You must be logged in to vote
3 replies
@haijinSk
Comment options

@Kapelianovych
Comment options

@haijinSk
Comment options

Comment options

You must be logged in to vote
3 replies
@hurufu
Comment options

@Kapelianovych
Comment options

@hurufu
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@UWN
Comment options

@haijinSk
Comment options

Comment options

You must be logged in to vote
7 replies
@UWN
Comment options

@Kapelianovych
Comment options

@haijinSk
Comment options

@hurufu
Comment options

@rotu
Comment options

Comment options

You must be logged in to vote
3 replies
@Kapelianovych
Comment options

@haijinSk
Comment options

@haijinSk
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants