Skip to content
/ logic Public

Java libary, which allows you to use propositional logic in an OO and simple way.

License

Notifications You must be signed in to change notification settings

Raboro/logic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logic

Quality Gate Status Coverage Lines of Code Code Smells

Bugs Vulnerabilities Security Rating Maintainability Rating Reliability Rating


This is a library to work with logic. Right now only propositional logic is implemented, but more will come. You can use this library to make your logical code more OOP like and readable. For example instead of writing something's like this:

private boolean evaluate() {
    return (!this.a || this.b) || ((this.c && this.b) || (!this.c && !this.b)) || 
        ((this.a && !this.b) || (!this.a && this.b));
}

You can do this instead:

private boolean evaluate() {
    return or(implication(this.a, this.b), xnor(this.c, this.b), xor(this.a, this.b));
}

Features

  • Symbols right now are:
    • ∧: AND
    • ∨: OR
    • ⊼: NAND
    • ⊽: NOR
    • ⟷: XNOR
    • ⊻: XOR
    • ⟶: IMPLICATION
  • You can just use the static functionalities of the logical Symbols
  • You can have multiple input arguments for the symbol
  • You can get the value or compare logical values with Booleans
  • You can get the value or compare logical values as binary String input
  • You can see the truth table of the symbols

Future plans

Not only implement propositional logic but also predicate logic. Then you will create your own predicates and define your own rules to evaluate logical problems.

Then not only Boolean or binary String inputs can be compared but all you could imagine.

About

Java libary, which allows you to use propositional logic in an OO and simple way.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages