# jot1x4k/mecaniza architecture

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

- Interactive diagram: https://gitdiagram.com/jot1x4k/mecaniza
- Repository: https://github.com/jot1x4k/mecaniza

## Overview

MECANIZA is a Prolog expert system for interactive diagnosis of common vehicle faults. The documented workflow starts in either graphical or console mode; the README says loading `main.pl` opens the XPCE interface and documents a console invocation. The tree identifies separate reasoning, diagnosis, question, and knowledge-base modules, but no source excerpts show their calls or data flow, so those relationships are omitted rather than inferred.

Main entry points: [`main.pl`](https://github.com/jot1x4k/mecaniza/blob/main/main.pl) (Prolog entry), [`src/gui.pl`](https://github.com/jot1x4k/mecaniza/blob/main/src/gui.pl) (XPCE interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_main["Prolog entry<br/>[main.pl]"]
end

subgraph group_interaction["User interaction"]
  node_gui["XPCE interface<br/>[gui.pl]"]
  node_console["Console mode<br/>[main.pl]"]
end

subgraph group_reasoning["Diagnostic reasoning"]
  node_engine["Expert engine<br/>[motor.pl]"]
  node_diagnosis["Fault diagnosis<br/>[diagnostico.pl]"]
  node_questions["Diagnostic questions<br/>[preguntas.pl]"]
  node_knowledge[("Vehicle knowledge base<br/>[base.pl]")]
end

node_user(("Vehicle owner"))

node_user -->|"launches"| node_main
node_main -->|"opens by default"| node_gui
node_main -->|"starts console mode"| node_console

click node_main "https://github.com/jot1x4k/mecaniza/blob/main/main.pl"
click node_gui "https://github.com/jot1x4k/mecaniza/blob/main/src/gui.pl"
click node_console "https://github.com/jot1x4k/mecaniza/blob/main/main.pl"
click node_engine "https://github.com/jot1x4k/mecaniza/blob/main/src/motor.pl"
click node_diagnosis "https://github.com/jot1x4k/mecaniza/blob/main/src/diagnostico.pl"
click node_questions "https://github.com/jot1x4k/mecaniza/blob/main/src/preguntas.pl"
click node_knowledge "https://github.com/jot1x4k/mecaniza/blob/main/src/base.pl"

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_main toneBlue
class node_gui,node_console toneAmber
class node_engine,node_diagnosis,node_questions,node_knowledge toneMint
class node_user toneIndigo
```

## Components

### Application entry

- [Prolog entry](https://github.com/jot1x4k/mecaniza/blob/main/main.pl): `main.pl`

### User interaction

- [XPCE interface](https://github.com/jot1x4k/mecaniza/blob/main/src/gui.pl): `src/gui.pl`
- [Console mode](https://github.com/jot1x4k/mecaniza/blob/main/main.pl): `main.pl`

### Diagnostic reasoning

- [Expert engine](https://github.com/jot1x4k/mecaniza/blob/main/src/motor.pl): `src/motor.pl`
- [Fault diagnosis](https://github.com/jot1x4k/mecaniza/blob/main/src/diagnostico.pl): `src/diagnostico.pl`
- [Diagnostic questions](https://github.com/jot1x4k/mecaniza/blob/main/src/preguntas.pl): `src/preguntas.pl`
- [Vehicle knowledge base](https://github.com/jot1x4k/mecaniza/blob/main/src/base.pl): `src/base.pl`

### Other components

- **Vehicle owner**

## Connections

- Vehicle owner → Prolog entry: launches (evidence: `README.md`)
- Prolog entry → XPCE interface: opens by default (evidence: `README.md`)
- Prolog entry → Console mode: starts console mode (evidence: `README.md`)
