Re: SatisfiabilityInstances[] how to put variables
- To: mathgroup at smc.vnet.net
- Subject: [mg128370] Re: SatisfiabilityInstances[] how to put variables
- From: Bob Hanlon <hanlonr357 at gmail.com>
- Date: Wed, 10 Oct 2012 01:26:33 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
- References: <20121009044008.1114F68DF@smc.vnet.net>
eqns = {x^2 + Pi*y^2 + z^2 == -1, z^2 == 2 x*E - 5 y}; var = Cases[eqns, x_Symbol?(! NumericQ[#] &), Infinity] // Union {x, y, z} Bob Hanlon On Tue, Oct 9, 2012 at 12:40 AM, <info at dvholten.de> wrote: > folks, > i am playing with the satisfiability-support in Mathematica. > SatisfiabilityInstances[] gives me the settings of the variables, which return true for the whole formula. However, the input is a little uncomfortable: > SatisfiabilityInstances[ formulaCNF, { v1, v2, v3, v4, v5 } ] > needs to be called for a formula with the 5 variabled v1..v5. For a formula with 400 variables this is not practical. > is there short way to extract a list of variables from the formula? > is there a short way to build a list of variables names? > (assuming the variables are named as a sequence like x1, x2...x77 or var1...var999). > or is there a way to implictily tell SatisfiabilityInstances[] or one of his brothers what the variables are in the formula so that they dont have to be given one by one? > > thanks > DvH >
- References:
- SatisfiabilityInstances[] how to put variables
- From: info@dvholten.de
- SatisfiabilityInstances[] how to put variables