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

time/1 with number of inferences #1039

Open
UWN opened this issue Aug 24, 2021 · 4 comments
Open

time/1 with number of inferences #1039

UWN opened this issue Aug 24, 2021 · 4 comments

Comments

@UWN
Copy link

UWN commented Aug 24, 2021

Currently time/1 only shows

% CPU time: 13.900 seconds

Ideally, also the number of inferences would be ideal. Often time complexity then becomes much easier to estimate.

@triska
Copy link
Contributor

triska commented Feb 18, 2023

On the WAM level, is the number of inferences equivalent to the number of call and execute instructions that have been interpreted?

@UWN
Copy link
Author

UWN commented Feb 19, 2023

More or less, built-in calls need to be added, probably.

A property, that I would love to be observed exactly is that failure-slices do indeed have less or equal as many inferences as the original program.

@UWN
Copy link
Author

UWN commented Aug 24, 2023

There is already call_with_inference_limit/3, so it should not be that difficult.

@triska
Copy link
Contributor

triska commented Sep 5, 2023

I have filed #1999 for this. However, it does not yet show the inferences when the goal fails. Would it still be useful to add it like this?

triska added a commit to triska/scryer-prolog that referenced this issue Nov 21, 2023
Example:

    ?- time(member(X, "abc")).
       % CPU time: 0.000s, 1 inference
       X = a
    ;  % CPU time: 0.000s, 3 inferences
       X = b
    ;  % CPU time: 0.000s, 3 inferences
       X = c.

This is an initial step towards addressing mthom#1039.
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