Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some rules can produce infinite looping #12

Closed
bakuzen opened this issue Jul 22, 2015 · 2 comments
Closed

Some rules can produce infinite looping #12

bakuzen opened this issue Jul 22, 2015 · 2 comments

Comments

@bakuzen
Copy link

bakuzen commented Jul 22, 2015

Consider the following rule in a domain file (model is triggered by "Speech"):

<rule id="rule1"> <case> <condition> <if var="Speech" value="okay"/> </condition> <set var="System_Speech" value="excellent"/> <set var="Speech" value="okay"/> </effect> </case> </rule>

While this is a poorly constructed rule (obviously, the second "set" line was leftover or copied from something), it will cause an infinite loop in opendial, as setting Speech to "okay" triggers the speech, and the contents satisfies the rule, which then runs again. Either this potentially common error could be documented (it may already be, I admit I haven't been through everything), or perhaps a check within opendial could be thrown that a rule shouldn't set variables with values that are already set in the condition.

@plison
Copy link
Owner

plison commented Jul 23, 2015

Yes, you are completely right - such types of rules can indeed produce infinite update loops. It's something that has bothered me for a while, but I have not yet found a satisfying, principled solution to it. Simply forbidding rules to have variables present in both the conditions and the effects would of course do the trick, but it seems to me a bit too extreme, as there are cases where such types of rules can be genuinely useful (if designed carefully to avoid never-ending loops).

Maybe a better solution would be to check at runtime whether an update leads to a recursive loop, and stop the loop in such a case, together with a warning message to the user to inform her/him that the domain likely contains a design error.

I'll have a closer look at this next week. Will keep you posted!

Le 22 juillet 2015 09:09:23 GMT+02:00, bakuzen notifications@github.com a écrit :

Consider the following rule in a domain file (model is triggered by
"Speech"):

While this is a poorly constructed rule (obviously, the second "set"
line was leftover or copied from something), it will cause an infinite
loop in opendial, as setting Speech to "okay" triggers the speech, and
the contents satisfies the rule, which then runs again. Either this
potentially common error could be documented (it may already be, I
admit I haven't been through everything), or perhaps a check within
opendial could be thrown that a rule shouldn't set variables with
values that are already set in the condition.


Reply to this email directly or view it on GitHub:
#12

Sent from my cellphone. Please excuse my brevity.

plison pushed a commit that referenced this issue Jul 25, 2015
@plison
Copy link
Owner

plison commented Jul 25, 2015

OK, I've added in the master branch a new version of the update loop in DialogueSystem which should fix this infinite loop issue!

@plison plison closed this as completed Jul 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants