Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Updates
This pull request prepares the repository for a new release and incorporates the following improvements:
Fix for
stacked_output_streams(close #14):Corrected the defective handling of stacked output streams. Previously, nested tell/told calls could fail on some Prolog systems. The fix ensures that streams are properly closed, reused, or garbage-collected as needed, preventing any unnecessary resource consumption.
Optimized Transitive Closure (dynamic visited-set backend):
Added an alternative transitive-closure backend that tracks visited nodes using a dynamic visited/1 predicate. On Prolog systems with well-indexed dynamic predicates (amortized O(1) lookup/assert), the closure traversal runs in O(E+V) for the reachable subgraph; result collection and cleanup add O(V), so overall remains O(E+V).
This is compared against the existing ordered-list visited-set approach based on ord_memberchk/2 + ord_insert/3 (from utils.pl portability code / ordsets). For list-based ordsets, membership and insertion are O(|Visited|) worst-case (with early cutoff due to ordering), giving worst-case O(E·V + V²) per closure, though it can still be faster in practice on some systems (notably SWI and Trealla) due to dynamic database overheads.
SPDX File Headers for Licensing Compliance:
Introduced machine-readable SPDX identifiers at the top of all source files to explicitly declare their licensing terms. This change clarifies downstream compliance requirements and aligns with modern practices for open-source repositories.