prologswi-prologstack-size

Increase stack size in runtime in Swi-prolog


I used set_prolog_flag(stack_limit, 5000000000). in my code.

But then i got the following error:

ERROR: No permission to modify static procedure "set_prolog_flag/2"

It seem that i don't have persmission to modify stack_size.Is there a solution to this?


Solution

  • Emolai, it seems that you consulted info out of date. You need to set the stack limits this way:

    :- set_prolog_stack(stack, limit(5000000000)).

    See the colon+minus? This signify that the goal set_prolog_stack/2 is to be executed and not defining a new clause set_prolog_stack/2. This explains the error you got.

    You are now good to go. Is your question solved ?