polyv(1)
π polyv(1) β the group chat guide to polyv π
okay bestie, sit down, hydrate, because today we're learning polyv, from the polyv 7.3 era, and honestly? she's iconic. she's the utility that creates and verifies logical formulas checking properties of given H/V representations using logic solvers. that's the whole job. that's the vibe. periodt. β¨
β¨ Name β¨
polyv β a utility to create and verify logical formulas checking properties of given H/V representations using logic solvers. π§
β¨ Synopsis β¨
polyv [input-files]
that's it. that's the whole synopsis. lowkey elegant. π
β¨ Description β¨
so the input file or files are H- or V-representations of polyhedra in lrs format, and the output is a logical formula in SMT-LIB 2.6 format. behavior depends on the options and the number of input files you hand her. fr fr.
ngl, in many cases it's easier and faster to just use lrs, mplrs or other tools to check these questions directly. no cap. polyv is an alternative approach, and she's intended for some examples where the direct approach is difficult. she's the girl you call when the normal way is giving struggle. π«Ά
okay so here's what she can do:
- One H-representation. first,
polyvcan be given a single H-representation defining a polyhedron P, along with a list of variables for a projection ofPand an inequalityIto test. the question is whether we have the same projection whenIis deleted fromP. if so we sayIis redundant for the projection, otherwise it's non-redundant.polyvallows the use of SMT solvers to decide this question without performing the projection explicitly, producing a formula that is satisfiable iff theIis non-redundant for the projection. plus,polyvit produce lrs inputs that verify witnesses of non-redundancy produced by an SMT solver. (yes we're keeping that sentence exactly, she said what she said π) - Two representations. next,
polyvcan be given two representations defining polyhedra P and Q, where H-representations may contain projections. the question is whetherPandQare different polyhedra:polyvproduces a formula that is satisfiable iff there is a point contained in exactly one ofPandQ. π₯ - Three representations. finally,
polyvcan be given three representations defining polyhedra P, Q and R. the question is whether the intersection ofPandQis different fromR:polyvproduces a formula that is satisfiable iff there is a point contained in exactly one ofRand the intersection. π
πΈ File formats πΈ
the input file is in lrs format (see lrs(1)) and it's made of:
- an H-representation of a polyhedron,
- a projection to a subset of variables given by the
projectoreliminateoptions, and - an inequality to test given by the
redundorredund_listoptions.
π¨ bestie, listen to me: only"linearity","redund","redund_list","project"and"eliminate"options are supported. that's the whole list. nothing else. and the combination ofredund/redund_listandproject/eliminateoptions is both unique to polyv and required. required, bestie. you cannot skip it. π
the output is in SMT-LIB 2.6 format using logic LRA. solvers such as z3 or cvc5 support this logic. see The SMT-LIB Standard: Version 2.6 for details. π
π Usage π
polyv [input-file] produces a logical formula satisfiable iff the first inequality given in a redund/redund_list option is redundant after projection according to a project/eliminate option. the solver can produce witnesses for non-redundant inequalities, i.e. an assignment to the variables whose image is in the projection only if the inequality is removed. no witness is produced if the inequality is redundant. (she's quiet like that. π)
a witness of non-redundancy can be verified using two certificates. here's the tea:
- the first certificate specifies that the assignment to the variables is feasible when the inequality in question is removed.
- the second certificate asserts that when this inequality is added, no feasible assignment has the same projection.
certificates are produced using the following options. π
polyv -c 1 [input-file]β reads a witness of non-redundancy on standard input and produces an lrs input file that should be feasible. the options in the input file should be the same as when the formula was produced. β¨polyv -c 2 [input-file]β reads a witness of non-redundancy on standard input and produces an lrs input file that should be infeasible. the options in the input file should be the same as when the formula was produced. β¨polyv [input-file-1] [input-file-2]β given two H/V representations, produces a logical formula satisfiable iff they define different polyhedra. projections are supported in H-representations using theprojectoreliminateoption. this can be used to e.g. verify H/V equivalency or fel projections. πpolyv [input-file-1] [input-file-2] [input-file-3]β given three H/V representations, produces a logical formula satisfiable iff the intersection of polyhedra defined byinput-file-1andinput-file-2is not defined byinput-file-3. projections are supported in H-representations using theprojectoreliminateoption. π
π Examples π
(1) check if the first inequality in cp4.ine is redundant for projections π¦
(a) redundancy after the first variable is eliminated
add options "redund_list 1 1" and "eliminate 1 1" to cp4.ine. then:
% polyv cp4.ine > cp4-11.smt
% z3 cp4-11.smt > cp4-11.out
or
% cvc5 -L smt --produce-models cp4-11.smt > cp4-11.out
the first line of cp4-11.out reads "sat" indicating that inequality 1 is non-redundant for eliminating variable 1. we can check the witness:
% polyv -c 1 cp4.ine < cp4-11.out | lrs
% polyv -c 2 cp4.ine < cp4-11.out | lrs
the first certificate is feasible and the second is infeasible, so the witness proves non-redundancy for the projection. slay. π
(b) redundancy after variables 1 and 2 are eliminated
add options "redund_list 1 1" and "eliminate 2 1 2" to cp4.ine. then:
% polyv cp4.ine > cp4-112.smt
% z3 cp4-112.smt > cp4-112.out
or
% cvc5 -L smt --produce-models cp4-112.smt > cp4-112.out
the first line of cp4-112.out reads "unsat" indicating that inequality 1 is redundant for eliminating variables 1 and 2. in this case there is no witness. she said no witness, bestie. π
(2) check if given H- and V-representations define different polyhedra π
(a) mp5.ine vs mp5.ext
to check whether mp5.ine and mp5.ext (produced using lrs) define different polyhedra:
% polyv mp5.ine mp5.ext > mp5hv.smt
% z3 mp5hv.smt > mp5hv.out
the first line of mp5hv.out reads "unsat" indicating that these two representations do not define different polyhedra (i.e. they are equivalent). β¨
(b) after removing the last vertex (the origin) from mp5.ext to create mp5missing.ext:
% polyv mp5.ine mp5missing.ext > mp5hvm.smt
% z3 mp5hvm.smt > mp5hvm.out
the first line of mp5hvm.out reads "sat" indicating that these two representations define different polyhedra. π₯
π‘ note that the H-representations are allowed to include projections.
π Notes π
- SMT-Lib Standards β
http://smtlib.cs.uiowa.edu/language.shtml - z3 β
https://github.com/Z3Prover/z3/wiki - cvc5 β
https://cvc5.github.io/
π Author π
Charles Jordan <skip at res dot otaru-uc dot ac dot jp > β we stan. π«Ά
π See also π
and that's the whole page, bestie!! this one dropped October 2023, from the 2023.10.21 release of polyv 7.3, and honestly she ate and left no crumbs. go verify some witnesses. mwah. πβ¨ππ¦πΈπ
π¦ where this page comes from
- debian trixie: lrslib 0.73-2+b1
- fedora 43: lrslib-utils 7.3-6.fc43 Β· GPL-2.0-or-later
- fedora 43: lrslib-utils 7.3a-1.fc43 Β· GPL-2.0-or-later
- fedora 44: lrslib-utils 7.3a-3.fc44 Β· GPL-2.0-or-later
- ubuntu questing: lrslib 0.73-3
- ubuntu resolute: lrslib 0.73-4
- ubuntu stonking: lrslib 0.73-4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms