sleyzerzon / soar

Automatically exported from code.google.com/p/soar
1 stars 0 forks source link

Identical justification for an i-supported result does not provide new support #159

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When an identical justification already exists for an i-supported result, Soar 
does not create the second justification nor does it associate the new result 
with the original justification, which is necessary for it to persist past the 
existence of the support it receives in the substate, so the result is remove 
prematurely. (It's also possible that the existence of the previous 
justification short-circuits asserting the preferences for the new result 
entirely.)

What steps will reproduce the problem?

1. A rules fires in a substate producing a wme on the superstate, which creates 
a justification that provides i-support.
2. An o-supported rule later fires, removing that wme.
3. A substate produces the exact same wme in the same way, i.e. it produces the 
same justification. 
4. A new wme is created but loses support when the support from the substate 
goes away (such as when the substate terminates), it isn't linked to a 
justification.

What is the expected output? What do you see instead?

Expect to see WME retain support when substate is removed.  

Proposed Solution:

If no preference for that wme is being generated by the second firing at all, 
we need to stop whatever is short-circuiting the addition of the new 
preference.  If it is being generated, then we just need to do (2)
Link the preference generated by the new firing to the previous justification.

Another solution would be to just clean up the original justification when we 
remove the WME that it supports, but it may be possible that the justification 
may still be needed for other results it supports? [John: This might work, but 
I think the relinking is safer.]

Original issue reported on code.google.com by maz...@gmail.com on 30 May 2014 at 6:22