# priyam-gandhi/dm-cp architecture

> Architecture diagram of the GitHub repository priyam-gandhi/dm-cp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/priyam-gandhi/dm-cp
- Repository: https://github.com/priyam-gandhi/dm-cp

## Overview

The product is a command-line propositional-argument validity analyzer. A user supplies variables, premises, and a conclusion; the program evaluates every truth assignment, displays a truth table, then reports validity or a counterexample. The parser implements expression evaluation for the supported logical operators. Source excerpts show the main routine invoking both analysis routines and each analysis routine invoking the parser; unsampled executable files are excluded.

Main entry points: [`main.c`](https://github.com/priyam-gandhi/dm-cp/blob/main/main.c) (Input and dispatch), [`truth_table.c`](https://github.com/priyam-gandhi/dm-cp/blob/main/truth_table.c) (Truth-table generation), [`validity.c`](https://github.com/priyam-gandhi/dm-cp/blob/main/validity.c) (Validity and counterexamples), [`parser.c`](https://github.com/priyam-gandhi/dm-cp/blob/main/parser.c) (Expression evaluator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["CLI interaction"]
  node_cli["Input and dispatch<br/>[main.c]"]
end

subgraph group_evaluation["Expression evaluation"]
  node_parser["Expression evaluator<br/>[parser.c]"]
end

subgraph group_analysis["Argument analysis"]
  node_truth_table["Truth-table generation<br/>[truth_table.c]"]
  node_validity["Validity and counterexamples<br/>[validity.c]"]
end

node_user(("User"))

node_user -->|"enters argument"| node_cli
node_cli -->|"generates table"| node_truth_table
node_cli -->|"checks validity"| node_validity
node_truth_table -->|"evaluates expressions"| node_parser
node_validity -->|"evaluates expressions"| node_parser

click node_cli "https://github.com/priyam-gandhi/dm-cp/blob/main/main.c"
click node_parser "https://github.com/priyam-gandhi/dm-cp/blob/main/parser.c"
click node_truth_table "https://github.com/priyam-gandhi/dm-cp/blob/main/truth_table.c"
click node_validity "https://github.com/priyam-gandhi/dm-cp/blob/main/validity.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_user toneBlue
class node_parser toneAmber
class node_truth_table,node_validity toneMint
```

## Components

### CLI interaction

- [Input and dispatch](https://github.com/priyam-gandhi/dm-cp/blob/main/main.c): `main.c`

### Expression evaluation

- [Expression evaluator](https://github.com/priyam-gandhi/dm-cp/blob/main/parser.c): `parser.c`

### Argument analysis

- [Truth-table generation](https://github.com/priyam-gandhi/dm-cp/blob/main/truth_table.c): `truth_table.c`
- [Validity and counterexamples](https://github.com/priyam-gandhi/dm-cp/blob/main/validity.c): `validity.c`

### Other components

- **User**

## Connections

- User → Input and dispatch: enters argument (evidence: `main.c`)
- Input and dispatch → Truth-table generation: generates table (evidence: `main.c`)
- Input and dispatch → Validity and counterexamples: checks validity (evidence: `main.c`)
- Truth-table generation → Expression evaluator: evaluates expressions (evidence: `truth_table.c`)
- Validity and counterexamples → Expression evaluator: evaluates expressions (evidence: `validity.c`)
