How to find out if Prolog performs Tail Call Optimization
问题 Using the development version of SWI Prolog (Win x64), I wrote a DCG predicate for a deterministic lexer (hosted on github) (thus all external predicates leave no choice points): read_token(parser(Grammar, Tables), lexer(dfa-DFAIndex, last_accept-LastAccept, chars-Chars0), Token) --> ( [Input], { dfa:current(Tables, DFAIndex, DFA), char_and_code(Input, Char, Code), dfa:find_edge(Tables, DFA, Code, TargetIndex) } -> { table:item(dfa_table, Tables, TargetIndex, TargetDFA), dfa:accept(TargetDFA,