Giter VIP home page Giter VIP logo

logic's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.