-
Notifications
You must be signed in to change notification settings - Fork 73
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
Comments
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 :
Sent from my cellphone. Please excuse my brevity. |
OK, I've added in the master branch a new version of the update loop in DialogueSystem which should fix this infinite loop issue! |
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.
The text was updated successfully, but these errors were encountered: