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

Added command line input functionality #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rohanahuja4
Copy link

Description:
This pull request introduces the addition of command line input functionality.

  1. Command Line Input:

    • Added a new function, dpll(cnf_argument), to solve a single CNF formula when called from the command line.
    • The function accepts a CNF formula as an argument preceded by a “solve” argument (e.g., python3 SATSolver.py solve [formula] allowing users to input formulas directly in the command line.
    • The input format slightly modifies the original CNF syntax, where variables are represented by uppercase letters and negation is denoted by the tilde (~) symbol. This is to avoid a misinterpretation of “!” as a special character.
  2. Error Handling:

    • Implemented input validation to ensure that the CNF formula provided via the command line is in the correct format.
    • If the input format is invalid, an error message is displayed, guiding the user to submit a valid CNF formula.

These updates improve the usability of the SAT Solver, enabling users to solve individual CNF formulas conveniently from the command line. The error handling ensures that only valid formulas are processed.

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.

None yet

1 participant