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

In abduce, allow switching to SIM_MANDATORY not at the sim root #214

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

jefft0
Copy link
Collaborator

@jefft0 jefft0 commented Feb 16, 2022

Currently, during simulated backward chaining, it is possible for a goal to have an "opposite" match to a RHS. In this case, the abduce method sets the simulation mode to SIM_MANDATORY:

case SIM_ROOT:
  sub_sim = new Sim(opposite ? SIM_MANDATORY : SIM_OPTIONAL, sim_thz, super_goal, opposite, ...);

Note that it does this when backward chaining first begins at the root. But it is possible to have an opposite match at later steps in the backward chaining, for example to match the anti-fact RHS of a strong requirement. We want this to create a mandatory solution also.

This pull request updates the logic in abduce to allow the simulation mode to switch to mandatory at steps other than the simulation root. If the simulation mode is SIM_OPTIONAL, it means that backward chaining has not previously had an opposite match, so we switch to SIM_MANDATORY if the current match is opposite, similar to the case for SIM_ROOT. If the simulation mode is already SIM_MANDATORY and the current match is not an opposite match, then abduce simply continues with the backward chaining.

However, if the simulation mode is already SIM_MANDATORY and the current match is opposite, then it means that backward chaining would have two opposite matches. We don't have a use case for this yet and it is not clear what the logic should be, so we don't allow this case.

@jefft0 jefft0 merged commit e54c3b5 into dev Feb 17, 2022
@jefft0 jefft0 deleted the switch-to-SIM_MANDATORY branch February 17, 2022 14:26
@jefft0 jefft0 added the bug Something isn't working label Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant