CLI Karnaugh Minimization

Phase 1 — CLI & Input Parsing

  • Implement a command-line interface allowing the user to:

    • Provide a boolean function as a string (sigma(...) / sigma(...)+sigma*(...))
    • Or provide a file containing multiple functions
  • Parse the input string(s) and validate syntax:

    • Correct sigma notation
    • Allow for 3–4 variables only
  • Display errors clearly if the input is invalid.

Functional result: user can run the program via CLI and provide functions directly or via file. Input validation and errors are clear and informative.


Phase 2 — Truth Table Generation

  • Convert parsed functions into a truth table.

  • Present the truth table nicely formatted in the console:

    • Columns aligned
    • Coloured output for 0/1 distinction
  • Save the truth table to a .txt or .csv file if requested.

Functional result: user sees a visually clear truth table and optionally saves it for reference.


Phase 3 — Karnaugh Map Minimization

  • Convert the truth table to a Karnaugh map.
  • Perform minimization to produce the simplest boolean expression.
  • Derive both FND (DNF) and FNC (CNF) forms.
  • Present the minimized forms clearly in the CLI output, highlighting the key terms.

Functional result: the program outputs a readable, concise minimized expression with both CNF/DNF forms.


Phase 4 — Robustness & Enhancements

  • Handle multiple functions in a single run.
  • Gracefully detect and report conflicting or impossible minterms.
  • Allow optional CLI flags for output style: text-only, colored, save to file, etc.

Functional result: users can process multiple functions, see properly formatted truth tables and minimized expressions, and interact easily via CLI.