ApCoCoA-1:GLPK.IPCSolve

From ApCoCoAWiki
Revision as of 13:24, 27 April 2011 by 132.231.10.53 (talk) (New page: <command> <title>GLPK.IPCSolve</title> <short_description>Solve a system of polynomial equations over <tt>F_2</tt> for one solution in <tt>F_2^n</tt>.</short_description> <syntax> GLPK.IPC...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GLPK.IPCSolve

Solve a system of polynomial equations over F_2 for one solution in F_2^n.

Syntax

GLPK.IPCSolve(F:LIST, QStrategy:INT, CStrategy:INT, MinMax:STRING)

Description

Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.

This function finds one solution in F_2^n of a system of polynomial equations over the field F_2. It uses Integer Polynomial Conversion (IPC) along with some strategies from propositional logic to model a mixed integer linear programming problem. Then the modeled mixed integer linear programming problem is solved using glpk.


  • @param F: A List containing the polynomials of the given system.

  • @param QStrategy: Strategy for quadratic substitution. 0 - Standard; 1 - Linear Partner; 2 - Double Linear Partner; 3 - Quadratic Partner;

  • @param CStrategy: Strategy for cubic substitution. 0 - Standard; and 1 - Quadratic Partner;

  • @param MinMax: Optimization direction i.e. minimization ("Min") or maximization ("Max").

Example

Use Z/(2)[x[1..4]];
F:=[
    x[1]x[2] + x[2]x[3] + x[2]x[4] + x[3]x[4] + x[1] + x[3] + 1, 
    x[1]x[2] + x[1]x[3] + x[1]x[4] + x[3]x[4] + x[2] + x[3] + 1, 
    x[1]x[2] + x[1]x[3] + x[2]x[3] + x[3]x[4] + x[1] + x[4] + 1, 
    x[1]x[3] + x[2]x[3] + x[1]x[4] + x[2]x[4] + 1
    ];

QStrategy:=0;
CStrategy:=0;
MinMax:=<quotes>Max</quotes>;

-- Then we compute the solution with

GLPK.IPCSolve(F, QStrategy, CStrategy, MinMax);

-- The result will be the following:

[0, 1, 0, 1]
-------------------------------


Example

Use S::=Z/(2)[x[1..5]];
F:=[
 x[1]x[5] + x[3]x[5] + x[4]x[5] + x[1] + x[4],
 x[1]x[2] + x[1]x[4] + x[3]x[4] + x[1]x[5] + x[2]x[5] + x[3]x[5] + x[1] + x[4] + x[5] + 1,
 x[1]x[2] + x[4]x[5] + x[1] + x[2] + x[4],
 x[1]x[4] + x[3]x[4] + x[2]x[5] + x[1] + x[2] + x[4] + x[5] + 1,
 x[1]x[4] + x[2]x[4] + x[3]x[4] + x[2]x[5] + x[4]x[5] + x[1] + x[2] + x[4] + x[5]
];


QStrategy:=1;
CStrategy:=0;
MinMax:=<quotes>Max</quotes>;

-- Then we compute the solution with

GLPK.IPCSolve(F, QStrategy, CStrategy, MinMax);

-- The result will be the following:

[1, 1, 1, 1, 0]
-------------------------------

Example

Use ZZ/(2)[x[1..3]];
F := [ x[1]x[2]x[3] + x[1]x[2] + x[2]x[3] + x[1] + x[3] +1,
       x[1]x[2]x[3] + x[1]x[2] + x[2]x[3] + x[1] + x[2],
       x[1]x[2] + x[2]x[3] + x[2]
     ];


QStrategy:=0;
CStrategy:=1;
MinMax:=<quotes>Max</quotes>;

-- Then we compute the solution with

GLPK.IPCSolve(F, QStrategy, CStrategy, MinMax);

-- The result will be the following:

[0, 0, 1]
-------------------------------