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

Issue 624 nonmodifiable contradiction #649

Merged
merged 5 commits into from
Oct 17, 2023

Conversation

Chase-Grajeda
Copy link
Collaborator

@Chase-Grajeda Chase-Grajeda commented Oct 10, 2023

Description

#624 notes that the board should not be modifiable when a contradictory node within the proof tree is selected. To fix this, the board modifiability upon rule application is set to false for the current contradiction transition. Allowing changes to previous nodes is okay since they will become erroneous and invalidate the proof.

Closes #624

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Enhancement (improvement to an already existing feature)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

The changes were tested by creating a new file and generating three branches in the proof tree: one of which is valid and the others are contradictory. The board should only be modifiable when a node from the yellow branch is selected. Otherwise, the selected node is part of a contradictory branch and the board should not be modifiable.

Attached is a testfile.zip for verifying the changes.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Made board unmodifiable when a selected tree node is part of a contradiction branch
Removed previous changes from TreeView

Added board modifiability update to TreeController for each mouse press on the proof tree: modifiability is determined by whether or not the current selected node is part of a contradiction branch
Added comments to TreeController
Copy link
Collaborator

@charlestian23 charlestian23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to work if I click off of the contradiction arrow and then click back into it. However, if I try changing the board before I click off, then I'm still able to make changes.

Set board modifiability of the current transition to false when a contradiction is applied in ValidateContradictionRuleCommand;
Removed previous change to TreeController.
@Chase-Grajeda
Copy link
Collaborator Author

Changed up the logic... when applying a contradiction, the current transition's board will be set to unmodifiable. This way the user can't try to force an "invalid" contradiction. However, the user can still modify previous transitions. If those transitions are modified, the associated rule is revaluated. If the change is no longer consistent with the rule, then the node will be invalidated and the proof becomes incorrect.

@charlestian23 charlestian23 self-assigned this Oct 17, 2023
Copy link
Collaborator

@charlestian23 charlestian23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes work, merging

@charlestian23 charlestian23 merged commit e05d8e5 into dev Oct 17, 2023
7 checks passed
@charlestian23 charlestian23 deleted the issue-624-nonmodifiable-contradiction branch November 13, 2023 16:42
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

Successfully merging this pull request may close these issues.

2 participants