BooleanVariables

BooleanVariables[expr]

gives a list of the Boolean variables in the Boolean expression expr.

BooleanVariables[bf]

gives the number of Boolean variables in the BooleanFunction object bf.

Details

  • In BooleanVariables[expr], the expression expr can involve any combination of Boolean functions such as And, Or, Not, as well as BooleanFunction and related functions.
  • In BooleanVariables[bf], the expression bf must be a single BooleanFunction object.
  • BooleanVariables[expr] gives a list of variables in the order returned by Sort.

Examples

open allclose all

Basic Examples  (2)

Find the variables in a Boolean expression:

Find the number of variables for a pure BooleanFunction object:

Scope  (2)

Find the Boolean variables in a Boolean expression:

Programmatically get the number of arguments to a pure Boolean function:

Properties & Relations  (2)

BooleanVariables is by default used as the list of variables for BooleanTable:

Use BooleanVariables to get a variable list for SatisfiabilityInstances:

FindInstance:

Conjunction and Disjunction:

Possible Issues  (1)

Anything that is not explicitly constructed using Boolean primitives and functions is variable:

Wolfram Research (2008), BooleanVariables, Wolfram Language function, https://reference.wolfram.com/language/ref/BooleanVariables.html.

Text

Wolfram Research (2008), BooleanVariables, Wolfram Language function, https://reference.wolfram.com/language/ref/BooleanVariables.html.

CMS

Wolfram Language. 2008. "BooleanVariables." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/BooleanVariables.html.

APA

Wolfram Language. (2008). BooleanVariables. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/BooleanVariables.html

BibTeX

@misc{reference.wolfram_2023_booleanvariables, author="Wolfram Research", title="{BooleanVariables}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/BooleanVariables.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_booleanvariables, organization={Wolfram Research}, title={BooleanVariables}, year={2008}, url={https://reference.wolfram.com/language/ref/BooleanVariables.html}, note=[Accessed: 19-March-2024 ]}