satisfiable(e) returns a model (a named list of logical values) making
e true, or FALSE, as SymPy's satisfiable(). algorithm picks the
method: "dpll2" (the default; "pycosat", "minisat22" and "z3"
fall back to it as in SymPy when those libraries are absent, except that
an explicit "pycosat" is an ImportError) or "dpll" (see
dpll_satisfiable()). With all_models = TRUE the result is the list
of all models, or list(FALSE). A tautology without symbols has the
model list(True = TRUE). valid() tests whether e is a tautology.
Usage
satisfiable(
e,
algorithm = NULL,
all_models = FALSE,
minimal = FALSE,
use_lra_theory = FALSE
)
valid(e)Examples
a <- Symbol("a"); b <- Symbol("b")
satisfiable(And(a, Not(b)))
#> $a
#> [1] TRUE
#>
#> $b
#> [1] FALSE
#>
satisfiable(And(a, Not(a)))
#> [1] FALSE
satisfiable(Equivalent(a, b), all_models = TRUE)
#> [[1]]
#> [[1]]$b
#> [1] FALSE
#>
#> [[1]]$a
#> [1] FALSE
#>
#>
#> [[2]]
#> [[2]]$a
#> [1] TRUE
#>
#> [[2]]$b
#> [1] TRUE
#>
#>