Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some top-level goodies maybe? #54

Open
Jean-Luc-Picard-2021 opened this issue Jul 11, 2022 · 7 comments
Open

Some top-level goodies maybe? #54

Jean-Luc-Picard-2021 opened this issue Jul 11, 2022 · 7 comments

Comments

@Jean-Luc-Picard-2021
Copy link

Jean-Luc-Picard-2021 commented Jul 11, 2022

In another ticket it was stated:

Note that atoms are still not quoted properly in the output. We'll fix that soon too.
#53

I got more ideas, like suppressing variables that did not get instantiated.
Currently I get in the Ciao WASM Playground:

?- forall(member(X,[1,4,3]), X > 0).
X=_8862 ? 
yes
?- forall(member(X,[1,4,3]), X > 1).
no

Many Prolog systems only show, like SWI-Prolog, which also
uses true/false instead yes/no, but the later doesn't matter:

?- forall(member(X,[1,4,3]), X > 0).
true.

?- forall(member(X,[1,4,3]), X > 1).
false.
@Jean-Luc-Picard-2021
Copy link
Author

Jean-Luc-Picard-2021 commented Jul 11, 2022

A further goody that is missing, determinism detection in the top-level.
I think Tau Prolog can already do it. Currently the Ciao WASM Playground shows me:

?- X=1;X=2.

X=1 ? ;

X=2 ? ;

no

But already in SWI-Prolog I get the following shorter result. SWI-Prolog
famous for introducing the period to indicate that the top-level
detected success without any further choice points:

?- X=1;X=2.
X = 1 ;
X = 2.

@mherme
Copy link

mherme commented Jul 11, 2022

Thanks! Regarding the comments on the top level, the one in the standard distribution of Ciao Prolog also has most of those classic features of course. The issue here is that, for technical reasons, the playground currently only has a simplified top level. What we meant when we said it would be fixed soon is that we are planning on replacing that specialized top level with the full, standard one shortly, and hopefully all the classic features will come about automatically.

@jfmc
Copy link
Member

jfmc commented Jul 11, 2022

We've just updated the playground with the changes mentioned by Manuel. The toplevel reuses more code from the standard toplevel and most of the features are magically in:

  • suppressing variables that did not get instantiated

Regarding these two:

  • more compact layout, true/false vs yes/no
  • avoid '?' when there are no more choice points (automatic determinism detection)

we'll consider them. We played with more compact layouts in the past (and had some flags to enable them) and it looks nice but we must make sure that nothing breaks.

@Jean-Luc-Picard-2021
Copy link
Author

Jean-Luc-Picard-2021 commented Jul 11, 2022

Thanks! Regarding the comments on the top level

I am afraid, I don't see your internal todo lists, or understand what you
are writing. So I am using GitHub as a dump whenever I see something
while playing or using Ciao WASM Playground. The primary fear I

have is, that what I record is already in the GitHub issue list, so
that it is a duplicate entry. But there could be labels or mechanism
in GitHub issue management system for that?

Concerning iternal todo lists I am rather helpless in this respect.
But anyway thanks for bringing Ciao WASM to the public!

@mherme
Copy link

mherme commented Jul 11, 2022

Thanks to you for the very useful feedback, please keep it up!

@jfmc
Copy link
Member

jfmc commented May 3, 2024

Summary of pending tasks in issue:

  • implement forall/2
  • detect determinism (w.r.t. choicepoint) in toplevel queries

@jfmc jfmc reopened this May 3, 2024
@Jean-Luc-Picard-2021
Copy link
Author

Jean-Luc-Picard-2021 commented May 4, 2024

If I am not mistaken forall/2 has a quite trivial realization
via negation as failure (\+)/2:

forall(A, B) :- \+ (A, \+ B).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants