Skip to content

Releases: sasagawa888/nprolog

N-Prolog Ver 5.18

04 May 04:44

Choose a tag to compare

N-Prolog Ver 5.18 Release Notes

Overview

N-Prolog Ver 5.18 is a maintenance release focused on bug fixes and stability improvements.
There are no major language changes, and compatibility with previous versions is preserved.


Fixes

Raspberry Pi compatibility

  • Fixed an issue where N-Prolog did not run correctly on Raspberry Pi environments
  • Improved portability and runtime stability on ARM platforms

case/1 bug fix

  • Fixed a bug in case/1 related to control flow handling
  • Corrected behavior of branching and nondeterminism
  • Ensures consistent behavior between interpreter and compiled code

Improvements

version/1 predicate added

  • New built-in predicate:
version(V).

N-Prolog v5.16

19 Apr 07:14

Choose a tag to compare

N-Prolog v5.16 has been released.

This update focuses on compiler improvements and robustness.

Through extensive stress testing, I found and fixed several subtle bugs related to:

  • if-then-else semantics
  • nested control structures
  • variable propagation across branches

A particularly complex “final boss” test case now behaves consistently between the interpreter and compiled code.

The system has become significantly more stable.

Please try it out and let me know your thoughts.

N-Prolog ver5.15

18 Apr 03:06

Choose a tag to compare

N-Prolog ver5.15

  • Improved compiler handling of if-then-else (A -> B ; C)
  • Introduced internal transformation to case/1 for nested conditions
  • Fixed several bugs in compiled code execution
  • Achieved consistency between interpreter and compiler
  • Verified with complex test cases including Lights Out

This version significantly improves reliability of compiled programs.

N-Prolog ver5.10

15 Apr 23:33

Choose a tag to compare

N-Prolog ver5.10 Release Notes

N-Prolog ver5.10 has been released.

This version focuses on compiler stabilization and robustness improvements achieved through extensive stress testing.

Highlights

Significant improvements to the compiler
Fixed numerous bugs discovered during repeated stress testing
Improved overall stability and reliability
Accurate handling of conditional constructs
Improved compilation of nested conditional expressions
More reliable support for A -> B ; C style control structures
Stable behavior even with deeply nested and complex conditions
Stress test validation
Verified that interpreter and compiled code produce identical results for:
stress1
stress2
stress3
stress4
Confirmed that stress5 also passes successfully

Improved semantic consistency

Reduced discrepancies between interpreter execution and compiled execution
Better handling of backtracking and variable bindings in compiled code

Notes

Integer division is currently supported using //
The div operator is not yet implemented

Overview

This release represents a major step toward a stable and reliable Prolog system suitable for learning, experimentation, and practical use.

The core architecture is now solid, and most typical Prolog programs can be compiled and executed correctly.

Further improvements will continue based on user feedback.

N-Prolog ver 5.00 Release Notes

13 Apr 06:40

Choose a tag to compare

N-Prolog ver 5.00 Release Notes
Overview

N-Prolog ver 5.00 has been released.

This version focuses on extensive improvements to the compiler, including major bug fixes and stability enhancements.
As a result, previously problematic control structures are now handled correctly and reliably.

Major Changes

  1. Significant Compiler Improvements
    Refactored and improved core parts of the compiler
    Fixed a wide range of bugs
    Performed repeated stress testing to ensure robustness
    Verified that all previously written example programs can now be compiled successfully
  2. Full Support for -> ; (if-then-else)
    Correct handling of:
    A -> B ; C
    Multi-branch conditions
    Nested structures

Previously, these patterns were a weak point of the compiler.
In this version, even deeply nested if-then-else constructs are compiled correctly and behave consistently with the interpreter.

  1. Introduction of case/1 Predicate
    Added a new predicate:
    case([Cond1 -> Body1,
    Cond2 -> Body2,
    ...
    | Else])
    Features
    Originally a standard predicate in ARITY/PROLOG
    Provides a clean way to express multi-branch and nested conditionals
    Internally used by the compiler to transform -> ; constructs
    Background

Although case/1 existed in ARITY/PROLOG, it had not been implemented before due to limited perceived use.
However, it turned out to be highly effective for:

Simplifying nested condition handling
Improving compiler reliability
Stability Improvements
Extensive stress testing was performed
Special focus on conditional branching logic
High success rate confirmed across practical code examples
Current Status

With this release:

The N-Prolog compiler has reached a near-complete and practical level of maturity.

Future Plans
Continue improving stability based on user feedback
Address edge cases and rare control-flow patterns
Further refine the compiler for reliability
Developer Notes

Handling -> ; and its nested forms correctly was one of the most challenging parts of the compiler.

With this milestone achieved, the compiler is now stable enough for practical use.
This release represents a significant step toward a robust and reliable Prolog system.

N-Prolog ver 4.93 Release Notes

04 Apr 07:34

Choose a tag to compare

N-Prolog ver 4.93 Release Notes

Overview

This release focuses on ongoing improvements to the N-Prolog compiler.

The compiler has reached a stage where it works correctly for most ordinary programs. While not yet fully complete, it is now usable in many practical situations.

Highlights

Compiler Improvements

  • Continued refinement of the compiler
  • Improved correctness for typical Prolog code
  • Better handling of common execution patterns

Current Status

  • Works well for standard, everyday programs
  • Suitable for practical use in many cases
  • Still under development and not fully complete

Known Limitations

  • Some complex or non-standard code may not compile or execute correctly
  • Stress tests can reveal remaining issues
  • Edge cases are still being addressed

Development Policy

N-Prolog follows a practical and incremental development approach:

  • Focus on correctness for commonly used code
  • Gradually improve edge case handling
  • Continue iterative refinement of the compiler

Future Plans

  • Further improvements to compiler stability
  • Expansion of test coverage
  • Continued work on handling complex and stress-test scenarios

Notes

The compiler is now suitable for experimentation and general use with typical programs.
For maximum reliability, the interpreter remains the recommended option in all cases.

N-Prolog Ver 4.90 Release Notes

31 Mar 07:43

Choose a tag to compare

N-Prolog Ver 4.90 Release Notes

N-Prolog ver4.90 has been released.

This release replaces the planned ver4.89 and focuses on restoring stable behavior for libraries that depend on embedded C functionality, such as tcltk and OpenGL.

What changed

During testing, problems were found in libraries that make use of C-language embedded features. In particular, some functionality related to libraries such as tcltk and OpenGL was not behaving reliably.

To address this, the affected parts were reverted to a safer implementation. As a result, these libraries have been confirmed to work again when used from the interpreter, as they did previously.

Current status
Libraries using embedded C functionality now work correctly again in the interpreter
Some cases may still fail when compiled
Compiler-side support for these libraries will require more careful work and will be improved gradually
Why this release was made

This is an urgent maintenance release.

The immediate goal of ver4.90 is to restore a usable and stable state for users who rely on these libraries from the interpreter. Rather than delaying the release until all compiler-related issues are solved, this version prioritizes restoring the existing practical functionality first.

Compiler compatibility for these features remains an open issue and will be addressed carefully over time.

Notes

If you use tcltk, OpenGL, or other libraries built on embedded C functionality, please use them from the interpreter in ver4.90.

Thank you for your continued support of N-Prolog.

N-Prolog Version 4.84 Release Notes

14 Mar 05:26

Choose a tag to compare

N-Prolog Version 4.84 Release Notes

This release introduces several improvements focused on usability and language stability, including new startup options, library additions, and simplification of the core language behavior.

New Startup Options

Two new command-line options have been added.

-d : Double-quote string output

When this option is specified, strings are printed using double quotes.

Example:

"hello"

By default, N-Prolog prints strings using the $ notation, which remains the standard behavior.


-f : Undefined predicate fails

With this option enabled, calling an undefined predicate will fail instead of raising an error.

Default behavior:

ERROR: undefined predicate

With -f:

fail

This option may be useful in exploratory or permissive execution environments.


Removal of set_prolog_flag

The predicate set_prolog_flag has been removed.

The reason is that such mechanisms allow the semantics of the language to change dynamically, which is undesirable for a simple and stable Prolog system.
N-Prolog aims to keep the language behavior consistent and predictable.


ISO Library Added

A new ISO library has been introduced.

  • Less frequently used ISO predicates are now provided in this library.
  • Most commonly used ISO predicates remain built-in and are available by default.

This keeps the core system compact while maintaining compatibility with the ISO standard.


Updates to the utils Library

The following predicates have been added to the utils library:

  • read_csv
  • writeln

These utilities provide convenient functionality frequently needed in practical programs.


Summary

Version 4.84 continues the goal of N-Prolog:

  • keep the core small and stable
  • avoid dynamic semantic changes
  • provide additional functionality through libraries

N-Prolog ver 4.83 Release Notes

28 Feb 09:22

Choose a tag to compare

N-Prolog ver 4.83 Release Notes
Overview

N-Prolog ver 4.83 has been released.

This version improves string handling while preserving compatibility with the original ARITY/PROLOG design philosophy.

The goal of this update is to maintain language consistency and simplicity while improving usability in modern Prolog environments.

✨ Major Improvements

  1. Extended String Syntax Support

Traditionally, N-Prolog followed ARITY/PROLOG-style string notation:

$abc$

Starting from version 4.83, N-Prolog also accepts modern double-quoted string notation:

"abc"

Both forms are parsed equivalently.

This allows users familiar with ISO-Prolog or SWI-Prolog to write code naturally without breaking compatibility with existing ARITY-style programs.

  1. Display Mode Option (-d)

Although both $abc$ and "abc" are accepted during parsing, the default output representation remains:

$abc$

When N-Prolog is started with the -d option:

nprolog -d

Strings are displayed in ISO-style format:

"abc"

This design preserves:

Backward compatibility

Language consistency

Clear distinction between atom and string

The display format is configurable, but the internal semantics remain consistent.

  1. Improved String Syntax Highlighting

The editable REPL syntax highlighting has been improved.

Enhancements include:

Better handling of escape sequences

Correct coloring when " or $ appear inside strings

More stable highlighting behavior in interactive editing

This improves readability and usability.

📚 ISO-Prolog Compatibility

N-Prolog already implements major ISO-Prolog built-in predicates.

For educational and learning purposes, N-Prolog provides:

A sufficiently modern Prolog environment

ISO-style programming capability

A consistent and compact implementation model

It is suitable for:

Teaching Prolog fundamentals

Learning logic programming

Understanding ARITY-style Prolog

Experimenting with modern Prolog features

🎯 Design Philosophy

N-Prolog maintains:

Clear separation between atoms and strings

Simplicity over excessive configurability

Static language behavior (no dynamic syntax switching)

The addition of "abc" syntax improves usability without sacrificing design integrity.

Summary

Version 4.83 modernizes string handling while preserving compatibility and language philosophy.

This release makes N-Prolog more accessible to contemporary Prolog users while maintaining its ARITY-compatible foundation.

N-Prolog 4.82 – DCG Stability Update

23 Feb 22:21

Choose a tag to compare

N-Prolog 4.82 – DCG Stability Update

Release Notes

Release Date: February 2026
Release Type: Bug Fix & Stability Improvements


🔧 Bug Fixes

Fix: DCG definitions not properly overwritten on reconsult/1

  • Fixed an issue where DCG rules were appended instead of being replaced when using reconsult/1.
  • Previously, this caused duplicated or inconsistent grammar behavior after reloading a file.
  • DCG definitions are now correctly abolished and reloaded.

Fix: Error handling for built-in predicates during reconsult/1

  • Improved error handling when a file loaded via reconsult/1 contained built-in predicates.
  • Prevents improper overwriting and ensures safer reload behavior.

➕ New Feature

Added: subsumes_term/2

  • Implemented ISO-compatible subsumes_term/2.
  • Fully integrated with DCG expansion.
  • Ensures consistent behavior in grammar processing and term generality checks.

🧠 DCG Improvements

  • Strengthened internal consistency of DCG expansion.
  • Improved interaction between DCG and subsumes_term/2.
  • Stabilized behavior under repeated reconsult/1.

These improvements significantly enhance reliability when using N-Prolog for parser and compiler construction.


📘 Documentation Updates

  • Fixed typos in the manual.
  • Clarified several explanations for better readability.
  • Improved overall documentation consistency.

🎯 Summary

Version 4.82 focuses on internal stability and correctness.

This release strengthens:

  • DCG reliability
  • Reload stability (reconsult/1)
  • ISO compatibility (subsumes_term/2)

This version is recommended for users developing parsers, compilers, and grammar-based systems in N-Prolog.