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

Porting library(diadem) to Scryer Prolog #840

Open
triska opened this issue Feb 28, 2021 · 4 comments
Open

Porting library(diadem) to Scryer Prolog #840

triska opened this issue Feb 28, 2021 · 4 comments

Comments

@triska
Copy link
Contributor

triska commented Feb 28, 2021

I am trying to port Ulrich Neumerkel's library(diadem) to Scryer Prolog for declarative debugging. The current state of the port is in the diadem branch at:

https://github.com/triska/scryer-prolog/tree/diadem

See specifically diadem.pl for the source.

So far, loading the library works:

?- use_module(library(diadem)).
   true.

However, trying the example from the source file, I get:

?- "caenum" = "caelum".?X.
caught: error(existence_error(procedure,limes/4),limes/4)

Why? limes/4 is defined in the file, so this should work. (Update: resolved by adding a meta_predicate/1 declaration)

Update:

The current state of the issue is:

?- "caenum" = "caelum".?X.
caught: error(existence_error(procedure,'$free_variable_set'/3),'$free_variable_set'/3)

@UWN: Could you please advise what is needed here, and what should be added to Scryer Prolog to emulate '$free_variable_set'/3 in a conforming system?

I see also that numbervars/4 is used by the library, should that be added to Scryer Prolog or is it possible to solve this differently?

@mthom
Copy link
Owner

mthom commented Feb 28, 2021

I'm pretty sure limes/4 can't be found because if/3 isn't declared as a meta-predicate.

triska added a commit to triska/scryer-prolog that referenced this issue Feb 28, 2021
@triska
Copy link
Contributor Author

triska commented Feb 28, 2021

Ah yes, thank you a lot!

triska added a commit to triska/scryer-prolog that referenced this issue Feb 28, 2021
@triska
Copy link
Contributor Author

triska commented Dec 18, 2023

I now get:

$ scryer-prolog -f diadem.pl
?- "caenum" = "caelum".?X.
thread 'main' panicked at 'Out of bounds access', src/machine/compile.rs:1666:41
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Update: The crash is now resolved.

@triska
Copy link
Contributor Author

triska commented Dec 18, 2023

Thank you, I have updated the initial description with the current state of the issue:

?- "caenum" = "caelum".?X.
   error(existence_error(procedure,'$free_variable_set'/3),'$free_variable_set'/3).

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

No branches or pull requests

2 participants