According to the standard, this should not parse. It doesn’t in SWI-Prolog. It does in SICStus, which performs more elaborative search to find legal interpretations by dropping the operator property of some atoms. Given the infix operators = and ,, the only way out is to pretend table is not an operator. SWI-Prolog does similar reasoning, but more limited, e.g.,
?- T = table.
works as expected while this too fails in e.g. GNU-Prolog if we define table using ?- op(1150, fx, table).
Anyway, the way out is to write it as below.
?- T = (table), atom(T).
If you have a lot of table and no intend to use tabling, you can also use this to kill the operator property for table.
Thanks for the explanation!
I stumbled across it when porting an application from an older version of SWI-Prolog, but of course it’s not a show stopper.