scryer-prolog
scryer-prolog copied to clipboard
... / 2 appears to run in O(N) when it could run in O(1)
?- use_module(library(iso_ext)), use_module(library(pio)), use_module(library(dcgs)), use_module(library(time)). true. ?- time(countall(phrase_from_file((...,[_],...),'scryer-prolog.wxs'),N)). % CPU time: 1.056s N = 2065.
I seems to me that ... / 2 does not yet quite exploit the properties of the internal partial string representation.
As long as #1714 is open,...
But at least you could consider '$max_skip_list'/3 for this purpose (of the last ... //0)
As long as #1714 is open,...
What happens as long as #1714 is open?
But at least you could consider
'$max_skip_list'/3for this purpose (of the last... //0)
That's up to the implementer of library(dcgs), not to a simple user of Scryer Prolog, wouldn't you agree?
As long as #1714 is open,...
What happens as long as #1714 is open?
... there is some space overhead just for reading a partial string with Prolog clauses. Any further consideration is moot.
Right.
Still, properly using '$max_skip_list'/3 in the implementation of ... /2 in library(dcgs) would not hurt though...