More Accesible Quad Module #3313
Open
constraintAutomaton wants to merge 8 commits into
Open
Conversation
added 6 commits
April 25, 2026 10:20
where ones can reason over the output.
Author
|
I will make the example more interesting and demonstrative of Scryer Prolog capability. |
Author
|
@UWN Do you think those examples and the new interface is representative of the intended usage of quads? |
triska
reviewed
May 1, 2026
|
|
||
| ## Errors | ||
|
|
||
| A goal that should throw an error can be exercised with `catch/3`. |
Contributor
There was a problem hiding this comment.
But why? The error can be directly used as answer description:
?- functor(X, F, A). error(instantiation_error,functor/3).
Author
There was a problem hiding this comment.
It seems like it is not currently supported.
If I do this
:- module(foo, [foo/1]).
foo(a) :- throw(custom_error(bar)).
foo(b).
?- foo(b).
true.
?- foo(a).
throw(custom_error(bar)).
and in my top-level
check_module_quads(foo, X).I get this
false.if I remove the quad then I get a valid answer,
Author
There was a problem hiding this comment.
If it is indeed a bug/unexpected behavior and not a mistake from my part, I can fix it with this PR. Given you think it is in scope for this PR.
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.
Description
This branch makes Scryer's quad-based testing easier to discover and easier to use programmatically.
The
quadtests,testutils, andspecial_functionsmodules move out ofsrc/lib/numerics/and into a newsrc/lib/testing/directory. I think they are not really numerics specific and the module name offuscate a bit the purpose of quads.evaluated_quads/2predicate created. This predicate return an termevaluation(passed(Passed), rejected(Rejected))and does not have a side effect of printing in the top level, to enable better reasoning over the quad answer.Documentation added for the module and in the
README.md.related to #3303 and #3301