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

Rule for collapsing and enhancing Boolean conditions #809

Closed
orchestr7 opened this issue Mar 23, 2021 · 1 comment · Fixed by #864
Closed

Rule for collapsing and enhancing Boolean conditions #809

orchestr7 opened this issue Mar 23, 2021 · 1 comment · Fixed by #864
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@orchestr7
Copy link
Member

Many developers are incorrectly using a Boolean logic in their programs and their conditions are becoming more and more complex. We need to detect such boolean conditions that can be simplified and automatically fix them.

There are different Java libraries for it, like: https://github.com/bpodgursky/jbool_expressions
But need to understand if we really need to simplify these conditions or not, so this is the plan:

  1. Find rules of the simplification that can be applied
  2. Support checkers that will raise a warning if a condition can be simplified (becomes shorter)
  3. Check libraries for the simplification and choose the best (or create your own libraries)
  4. Support autofixers
@orchestr7 orchestr7 added the enhancement New feature or request label Mar 23, 2021
@orchestr7 orchestr7 assigned aktsay6 and unassigned kgevorkyan Apr 28, 2021
@aktsay6
Copy link
Collaborator

aktsay6 commented Apr 30, 2021

In future we can consider simplifying boolean methods as well. Example: a.and(b)
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/

aktsay6 added a commit that referenced this issue Apr 30, 2021
### What's done:
  * Added rule logic
  * Added tests
  * Updated documentation
aktsay6 added a commit that referenced this issue May 11, 2021
### What's done:
  * Added tags
@petertrr petertrr added this to the 0.6.0 milestone May 11, 2021
aktsay6 added a commit that referenced this issue May 11, 2021
### What's done:
  * Added tests
  * Added distributive law supply
aktsay6 added a commit that referenced this issue May 14, 2021
### What's done:
  * Fixed bugs
aktsay6 added a commit that referenced this issue May 14, 2021
### What's done:
  * Fixed bugs
aktsay6 added a commit that referenced this issue May 14, 2021
### What's done:
  * Fixed bugs
aktsay6 added a commit that referenced this issue May 14, 2021
### What's done:
  * Fixed bugs
aktsay6 added a commit that referenced this issue May 14, 2021
### What's done:
  * Fixed bugs
aktsay6 added a commit that referenced this issue May 14, 2021
### What's done:
  * Fixed bugs
kentr0w added a commit that referenced this issue May 18, 2021
* feature/bool-expressions-simplifier(#809)

### What's done:
  * Added rule logic
  * Added tests
  * Updated documentation
  * Added distributive law supply

Co-authored-by: kentr0w <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants