triska / clpz

Constraint Logic Programming over Integers
https://www.metalevel.at/prolog/clpz
178 stars 14 forks source link

Verify propagation #2

Closed triska closed 7 years ago

triska commented 7 years ago

Verify the following propagation:

?- M #= 10^150, [B,E,P]ins 0..M, P #= B^E, B #>= 2, P #< E.
M = 1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,
clpz:(B^E#=P),
clpz:(P#=<E+ -1),
clpz:(P in 512..999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999),
clpz:(E in 513..1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000),
clpz:(B in 2..1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) ? 
yes

Is this correct? Can it be made stronger?

triska commented 7 years ago

With the latest update, this fails, which is correct.