This repository contains homework and practice tasks written in Prolog and Haskell.
Each folder corresponds to one language, and each subfolder/task demonstrates a specific non-procedural programming concept.
Work in progress — learning and experimenting with declarative programming paradigms.
Non-procedural (declarative) programming focuses on what should be computed rather than how to compute it.
Instead of specifying step-by-step control flow, the programmer defines rules, relations, expressions, and constraints.
The runtime or language engine determines the execution strategy.
Non-procedural paradigms include:
- Logic programming (e.g., Prolog)
- Functional programming (e.g., Haskell)
- Constraint-based programming
- Query languages / rule systems (SQL, Datalog)
Key ideas:
- Describe properties and relationships.
- Let the language evaluate or search for results.
- Programs look like math definitions, not algorithms.
- Focus on reasoning, correctness, and immutability.
/Prolog/ # Logic programming tasks ├── task1/ ├── task2/ └── ...
/Haskell/ # Functional programming tasks ├── task1/ ├── task2/ └── ...
markdown Copy code
Each task folder contains:
- Source files in the language of the directory
- Problem statement or comments explaining the goal
- My solution to the assignment
- Code expresses facts, rules, and queries
- Execution resolves goals via unification and backtracking
- Good for search, symbolic reasoning, and constraints
- Pure functions, immutability, and strong static typing
- Evaluates expressions rather than executing commands
- Uses algebraic data types and recursion as core tools
Requires SWI-Prolog (or similar):
swipl file.pl
?- query_here.
Haskell
Requires GHC / GHCi:
bash
Copy code
ghci file.hs
> main