# SWI-Prolog

> free implementation of the programming language Prolog, commonly used for teaching and semantic web applications

**Wikidata**: [Q2665141](https://www.wikidata.org/wiki/Q2665141)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/SWI-Prolog)  
**Source**: https://4ort.xyz/entity/swi-prolog

## Summary
SWI-Prolog is a free, open-source implementation of the Prolog programming language, widely used for teaching, semantic web applications, and constraint logic programming. Developed by Jan Wielemaker in 1987, it runs on multiple operating systems, including BSD, macOS, Windows, and Android, and is maintained as both a compiler and interpreter.

## Key Facts
- **Created in 1987** by Dutch computer scientist **Jan Wielemaker**, a professor at Vrije Universiteit Amsterdam.
- **Open-source** under multiple licenses, primarily the **2-clause BSD License**, with additional components under GPL, public domain, and other permissive licenses.
- **Cross-platform**: Supports **BSD, macOS, Microsoft Windows, and Android**.
- **Latest stable version**: **9.2.2** (released **2024-02-29**), with prior stable releases including **9.0.4 (2023-01-27)** and **8.4.1 (2021-11-16)**.
- **Integrated with Emacs** via **Sweeprolog**, a development environment launched in **2022**.
- **Maintained by** Jan Wielemaker and **SWI-Prolog Solutions b.v.** (copyright holder since 2006).
- **Used for** logic programming, semantic web applications, and educational purposes.
- **Available in package managers** like Debian (`swi-prolog`), Homebrew (`swi-prolog`), and Arch Linux (`swi-prolog`).

## FAQs
### Q: What is SWI-Prolog used for?
A: SWI-Prolog is primarily used for **logic programming**, **teaching Prolog**, and **semantic web applications**. It supports constraint logic programming and is employed in AI, natural language processing, and rule-based systems.

### Q: Who created SWI-Prolog?
A: **Jan Wielemaker**, a Dutch computer scientist and professor at Vrije Universiteit Amsterdam, developed SWI-Prolog in **1987** and continues to maintain it.

### Q: Is SWI-Prolog free and open-source?
A: Yes, SWI-Prolog is **free software** released under multiple open-source licenses, including the **2-clause BSD License**, GPLv2, and others. The source code is available on [GitHub](https://github.com/SWI-Prolog).

### Q: What operating systems does SWI-Prolog support?
A: SWI-Prolog runs on **BSD, macOS, Microsoft Windows, and Android**, making it highly portable across desktop and mobile environments.

### Q: What is the latest version of SWI-Prolog?
A: The latest stable version is **9.2.2**, released on **2024-02-29**. Older stable versions include **9.0.4 (2023-01-27)** and **8.4.1 (2021-11-16)**.

## Why It Matters
SWI-Prolog is a cornerstone of **logic programming**, providing a robust, free, and widely accessible implementation of Prolog. Its significance lies in its role in **education**, where it serves as a standard tool for teaching declarative programming, and in **semantic web technologies**, where it powers rule-based reasoning and knowledge representation systems. Unlike proprietary Prolog implementations, SWI-Prolog’s open-source nature ensures transparency, community-driven development, and adaptability across platforms. It bridges theoretical computer science (e.g., AI, formal logic) with practical applications, such as natural language processing and database querying. By supporting **constraint logic programming**, it extends Prolog’s capabilities to solve complex optimization and decision problems, making it invaluable in both academic and industrial settings.

## Notable For
- **Pioneering open-source Prolog**: One of the most widely used free implementations of Prolog, with continuous development since **1987**.
- **Cross-platform compatibility**: Runs on **BSD, macOS, Windows, and Android**, ensuring broad accessibility.
- **Integration with Emacs**: **Sweeprolog** (2022) provides a dedicated development environment for SWI-Prolog within GNU Emacs.
- **Dual licensing**: Primarily under the **2-clause BSD License**, with flexibility for integration into proprietary and open-source projects.
- **Active maintenance**: Regular updates (e.g., **9.2.2 in 2024**) and a strong community, including an [IRC channel](irc://irc.libera.chat/prolog) and GitHub issue tracker.

## Body
### Overview
SWI-Prolog is a **free implementation** of the Prolog programming language, designed for **logic programming**, **constraint solving**, and **semantic web applications**. It functions as both a **compiler** and **interpreter**, supporting the **ISO/Edinburgh Prolog** standard while extending it with modern features.

### History and Development
- **Founded in 1987** by **Jan Wielemaker**, a computer scientist at Vrije Universiteit Amsterdam.
- **Copyright holder**: **SWI-Prolog Solutions b.v.** (since 2006), though the software remains open-source.
- **Maintained by** Jan Wielemaker, with contributions from the open-source community.

### Technical Features
- **Constraint Logic Programming (CLP)**: Combines logic programming with constraint solving for optimization problems.
- **Multi-paradigm**: Supports procedural, object-oriented, and functional programming styles alongside logic programming.
- **Extensible**: Offers interfaces to **Java (JPL)**, **ODBC databases**, and **Berkeley DB**.
- **Text Editing**: Includes built-in text editing capabilities.

### Platform Support
SWI-Prolog is highly portable, with official support for:
- **BSD** (including OpenBSD and NetBSD)
- **macOS** (since 2001)
- **Microsoft Windows** (since 1985)
- **Android** (since 2008)
- **Linux** (via Debian, Ubuntu, Arch Linux, Gentoo, and other distributions)

### Licensing
SWI-Prolog is distributed under multiple open-source licenses:
- **Primary license**: **2-clause BSD License** (most permissive).
- **Other licenses** in use:
  - **GPLv2** (for some components)
  - **3-clause BSD License**
  - **MIT/zlib License**
  - **Public Domain** (for certain parts)
  - **LaTeX Project Public License** (for documentation)

### Development Tools and Ecosystem
- **Sweeprolog**: An Emacs-based IDE for SWI-Prolog, released in **2022**, providing syntax highlighting, debugging, and REPL integration.
- **Package Managers**:
  - Debian/Ubuntu: `swi-prolog`, `swi-prolog-nox`, `swi-prolog-java`, etc.
  - Homebrew: `swi-prolog`
  - Arch Linux: `swi-prolog`
  - Gentoo: `dev-lang/swi-prolog`
- **Source Code**: Hosted on [GitHub](https://github.com/SWI-Prolog/swipl).
- **Community Support**:
  - [IRC channel](irc://irc.libera.chat/prolog) on Libera.Chat.
  - [Stack Overflow tag](https://stackoverflow.com/tags/swi-prolog).
  - [GitHub Issues](https://github.com/SWI-Prolog/swipl/issues) for bug tracking.

### Version History
Notable stable releases:
- **9.2.2** (2024-02-29)
- **9.0.4** (2023-01-27)
- **8.4.1** (2021-11-16)
- **8.3.17** (2021-01-08)
- **7.2.3** (2015-08-25)

### Use Cases
- **Education**: Standard tool for teaching Prolog and logic programming in universities.
- **Semantic Web**: Used in **RDF/OWL** reasoning and linked data applications.
- **Artificial Intelligence**: Rule-based systems, expert systems, and natural language processing.
- **Constraint Solving**: Applications in scheduling, planning, and optimization.

## Schema Markup
```json
{
  "@context": "https://schema.org",
  "@type": "SoftwareApplication",
  "name": "SWI-Prolog",
  "description": "Free implementation of the Prolog programming language, commonly used for teaching and semantic web applications.",
  "url": "https://www.swi-prolog.org/",
  "sameAs": [
    "https://www.wikidata.org/wiki/Q739507",
    "https://en.wikipedia.org/wiki/SWI-Prolog"
  ],
  "operatingSystem": [
    "BSD",
    "macOS",
    "Windows",
    "Android"
  ],
  "license": "https://spdx.org/licenses/BSD-2-Clause.html",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "Prolog"
  },
  "creator": {
    "@type": "Person",
    "name": "Jan Wielemaker"
  },
  "dateCreated": "1987",
  "version": "9.2.2",
  "softwareHelp": "https://www.swi-prolog.org/pldoc/",
  "codeRepository": "https://github.com/SWI-Prolog/swipl"
}

## References

1. Free Software Directory
2. [Source](https://github.com/SWI-Prolog/swipl/blob/master/LICENSE)
3. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L28)
4. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L67)
5. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L70)
6. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L74)
7. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L105)
8. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L111)
9. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L126)
10. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L150)
11. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L130)
12. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L141)
13. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L145)
14. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L155)
15. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L197)
16. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L159)
17. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L173)
18. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L177)
19. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L201)
20. [Source](https://salsa.debian.org/debian/swi-prolog/-/blob/master/debian/copyright#L222)
21. [The swi-prolog Open Source Project on Open Hub: Languages Page. Open Hub](https://www.openhub.net/p/swi-prolog/analyses/latest/languages_summary)
22. [Ann: SWI-Prolog 7.2.3. 2015](https://groups.google.com/g/swi-prolog/c/FjV_C5gV48g/m/wFgMaFd_BwAJ)
23. [Ann: SWI-Prolog 8.4.1 (stable). 2021](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-4-1-stable/4661)
24. [Download SWI-Prolog stable versions](https://www.swi-prolog.org/download/stable)
25. [2021](https://github.com/SWI-Prolog/swipl/releases/tag/V8.4.1)
26. [SWI-Prolog source for 9.0.4. 2023](https://www.swi-prolog.org/download/stable)
27. [Release V9.2.2](https://github.com/SWI-Prolog/swipl/releases/tag/V9.2.2)
28. [Release 8.3.12. 2020](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.12)
29. [Release 8.3.13. 2020](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.13)
30. [Release 8.3.14. 2020](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.14)
31. [Release 8.3.15. 2020](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.15)
32. [Release 8.3.16. 2020](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.16)
33. [Release 8.3.17. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.17)
34. [Release 8.3.18. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.18)
35. [Release 8.3.19. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.19)
36. [Release 8.3.20. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.20)
37. [Release 8.3.21. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.21)
38. [Release 8.3.22. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.22)
39. [Release 8.3.23. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.23)
40. [Release 8.3.24. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.24)
41. [Release 8.3.25. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.25)
42. [Release 8.3.26. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.26)
43. [Release 8.3.27. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.27)
44. [Release 8.3.28. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.28)
45. [Release 8.3.29. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.3.29)
46. [Release 8.4.0. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.4.0)
47. [Release 8.4.2. 2022](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.4.2)
48. [Release 8.4.3. 2022](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.4.3)
49. [Release 8.5.0. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.5.0)
50. [Release 8.5.1. 2021](https://github.com/SWI-Prolog/swipl-devel/releases/tag/V8.5.1)