Constant folding for SWI-Prolog (is)/2?

Now I wonder whether it would be possible that
SWI-Prolog does constant folding. Recently it had
introduced macros via (#)/1, but all the constants that

then enter into expressions, can they also be evaluated
at compile time to shorten the expressions, aka constant
folding
? My test case was this little clause:

test :- _ is 1/3.

If find that set_prolog_flag(optimize, true) doesn’t do
constant folding, the 1/3 is not precomputed:

?- vm_list(test/0).
========================================================================
test/0
========================================================================
       0 s_virgin
       1 i_exit
----------------------------------------
clause 1 (<clause>(0000016890eb1e00)):
----------------------------------------
       0 i_enter
       1 b_void
       2 a_enter
       3 a_integer(3)
       5 a_integer(1)
       7 a_func2((/)/2)
       9 a_is
      10 i_exit
true.

What are the pros and cons if a Prolog system would do that,
like for example SWI-Prolog?

I can only see pros. Well, I don’t know how easy it is. One issue are Prolog flags that affect runtime behavior (e.g., prefer_rationals turning 1/3 in 0.333… or 1r3). Otherwise evaluating ground sub expressions is easy. Harder are mathematically correct rewrites of the expression to bring distributed constants together. Notably for floats that is probably not trivial. The safe and simple constant expression I can think of are integer expressions holding +, - and *. These are probably also the most useful as we most people like to write e.g., seconds in a week as 3600*24*7.