seeming nontermination in char_type/2
Thanks to #2322, char_type/2 now works when the first argument is not ground but the second is. However, I have noticed a couple odd sharp edges with this new feature. char_type(X, whitespace). works perfectly and generating all solutions terminates quickly, and even char_type(X, alnum). will spit out lots of output when enumerating all solutions. However, char_type(X, upper("A")). seems to not terminate after generating X = 'A' and X = a, and nonsensical queries such as char_type(X, upper("a")). likewise seem to not terminate.
I imagine that this intersects with #2328, as it is likely related to the sheer number of possible chars, but I figured it would be useful as a separate issue.
Yes, definitely worth filing!
I think the first thing here is to find out whether it indeed does not terminate, or is "only" very slow. I tried it now for an hour and then interrupted the search:
?- time(char_type(X, upper("A"))).
% CPU time: 0.000s, 503 inferences
X = 'A'
; % CPU time: 0.000s, 225 inferences
X = a
; ^C% CPU time: 3526.985s, 7_017_539 inferences
error('$interrupt_thrown',repl/0).
Scryer's toplevel once more comes in very handy: We can press a to get all answers!