I am trying to use SWI-Prolog simplex library to solve a linear system of equations with the set of real numbers as domain. Would anyone please have a clue why the following query does not succeed?
maximize(
[],
state(
0,
[],
[
c(0,
[- 0.95*x(3),0.05*x(0),0.05*x(1),0.05*x(2)],
=,
1479754163278877r9007199254740992),
c(0,
[0.95*x(2),- 0.05*x(0),- 0.05*x(1),- 0.05*x(3)],
=,
185786871969449310676024028079063r3975352282315727403093661252059136
),
c(0,
[0.95*x(1),- 0.05*x(0),- 0.05*x(2),- 0.05*x(3)],
=,
756128230024134313216574233897861r15901409129262909612374645008236544
),
c(0,
[0.95*x(0),- 0.05*x(1),- 0.05*x(2),- 0.05*x(3)],
=,
294112628726237r72057594037927936
)
],
[]
),
S).
The system I intend to solve is the following:
0.05*x(0)+0.05*x(1)+0.05*x(2)-0.95*x(3)
=
1479754163278877/9007199254740992
- 0.05*x(0)- 0.05*x(1)+0.95*x(2)- 0.05*x(3)
=
185786871969449310676024028079063/3975352282315727403093661252059136
- 0.05*x(0)+0.95*x(1)- 0.05*x(2)- 0.05*x(3)
=
756128230024134313216574233897861/15901409129262909612374645008236544
0.95*x(0)- 0.05*x(1)- 0.05*x(2)- 0.05*x(3)
=
294112628726237/72057594037927936
Alternatively, would you please know a better way to solve this in Prolog?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…