var searchIndex = {}; searchIndex["boolean_expression"] = {"doc":"# boolean\\_expression expression manipulation / BDD library","items":[[3,"BDD","boolean_expression","A `BDD` is a Binary Decision Diagram, an efficient way to represent a\nBoolean function in a canonical way. (It is actually a "Reduced Ordered\nBinary Decision Diagram", which gives it its canonicity assuming terminals\nare ordered consistently.)",null,null],[3,"PersistedBDD","","A `PersistedBDD` is a wrapper around a `BDD` and a `BDDOutput` that tracks\nhow much of the BDD has already been writen out, and writes out new nodes\nand labels as required when its `persist()` method is called.",null,null],[3,"Cube","","A `Cube` is one (multidimensional) cube in the variable space: i.e., a\nparticular set of variable assignments, where each variable is assigned\neither true, false, or "don't care".",null,null],[3,"CubeList","","A `CubeList` is a sum (OR'd list) of cubes. It represents a Boolean\nexpression in sum-of-products form, by construction.",null,null],[4,"Expr","","An `Expr` is a simple Boolean logic expression. It may contain terminals\n(i.e., free variables), constants, and the following fundamental operations:\nAND, OR, NOT.",null,null],[13,"Terminal","","A terminal (free variable). This expression node represents a value that\nis not known until evaluation time.",0,null],[13,"Const","","A boolean constant: true or false.",0,null],[13,"Not","","The logical complement of the contained expression argument.",0,null],[13,"And","","The logical AND of the two expression arguments.",0,null],[13,"Or","","The logical OR of the two expression arguments.",0,null],[4,"CubeVar","","A variable assignment in a cube.",null,null],[13,"False","","This variable must be false.",1,null],[13,"True","","This variable must be true.",1,null],[13,"DontCare","","This variable may be true or false.",1,null],[4,"CubeMergeResult","","The result of attempting to merge two cubes.",null,null],[13,"None","","The cubes could not be merged.",2,null],[13,"CancelLeft","","The left cube was canceled because it is completely covered by the right cube.",2,null],[13,"CancelRight","","The right cube was canceled because it is completely covered by the left cube.",2,null],[13,"Merge","","The two cubes merge into one.",2,null],[13,"ExpandLeft","","The left cube may be expanded (increase its number of `DontCare`s) by\noverlapping with the right cube.",2,null],[13,"ExpandRight","","The right cube may be expanded (increase its number of `DontCare`s) by\noverlapping with the left cube.",2,null],[11,"hash","","",0,null],[11,"cmp","","",0,null],[11,"partial_cmp","","",0,null],[11,"lt","","",0,null],[11,"le","","",0,null],[11,"gt","","",0,null],[11,"ge","","",0,null],[11,"eq","","",0,null],[11,"ne","","",0,null],[11,"fmt","","",0,null],[11,"clone","","",0,null],[11,"is_terminal","","Returns `true` if this `Expr` is a terminal.",0,null],[11,"is_const","","Returns `true` if this `Expr` is a constant.",0,null],[11,"is_not","","Returns `true` if this `Expr` is a NOT node.",0,null],[11,"is_and","","Returns `true` if this `Expr` is an AND node.",0,null],[11,"is_or","","Returns `true` if this `Expr` is an OR node.",0,null],[11,"not","","Builds a NOT node around an argument, consuming the argument\nexpression.",0,{"inputs":[{"name":"expr"}],"output":{"name":"expr"}}],[11,"and","","Builds an AND node around two arguments, consuming the argument\nexpressions.",0,{"inputs":[{"name":"expr"},{"name":"expr"}],"output":{"name":"expr"}}],[11,"or","","Builds an OR node around two arguments, consuming the argument\nexpressions.",0,{"inputs":[{"name":"expr"},{"name":"expr"}],"output":{"name":"expr"}}],[11,"evaluate","","Evaluates the expression with a particular set of terminal assignments.\nIf any terminals are not assigned, they default to `false`.",0,null],[11,"simplify_via_laws","","Simplify an expression in a relatively cheap way using well-known logic\nidentities.",0,null],[11,"simplify_via_bdd","","Simplify an expression via a roundtrip through a `BDD`. This procedure\nis more effective than `BDD::simplify_via_laws()`, but more expensive.\nThis roundtrip will implicitly simplify an arbitrarily complicated\nfunction (by construction, as the BDD is built), and then find a\nquasi-minimal set of terms using cubelist-based reduction. For example:",0,null],[11,"map","","Map terminal values using the specified mapping function.",0,null],[11,"fmt","","",3,null],[11,"clone","","",3,null],[11,"new","","Produce a new, empty, BDD.",3,{"inputs":[],"output":{"name":"bdd"}}],[11,"terminal","","Produce a function within the BDD representing the terminal `t`. If\nthis terminal has been used in the BDD before, the same `BDDFunc` will be\nreturned.",3,null],[11,"constant","","Produce a function within the BDD representing the constant value `val`.",3,null],[11,"not","","Produce a function within the BDD representing the logical complement\nof the function `n`.",3,null],[11,"and","","Produce a function within the BDD representing the logical AND of the\nfunctions `a` and `b`.",3,null],[11,"or","","Produce a function within the BDD representing the logical OR of the\nfunctions `a` and `b`.",3,null],[11,"from_expr","","Produce a function within the BDD representing the given expression\n`e`, which may contain ANDs, ORs, NOTs, terminals, and constants.",3,null],[11,"evaluate","","Evaluate the function `f` in the BDD with the given terminal\nassignments. Any terminals not specified in `values` default to `false`.",3,null],[11,"to_expr","","Convert the BDD to a minimized sum-of-products expression.",3,null],[11,"new","","Create a new `PersistedBDD` wrapping the given output.",4,{"inputs":[{"name":"bddoutput"}],"output":{"name":"persistedbdd"}}],[11,"bdd","","Return the inner BDD.",4,null],[11,"bdd_mut","","Return the inner BDD.",4,null],[11,"persist","","Persist (at least) all labels and nodes in the BDD necessary to fully\ndescribe BDD function `f`. More records than strictly necessary may be\nwritten out.",4,null],[11,"persist_all","","",4,null],[11,"cmp","","",1,null],[11,"partial_cmp","","",1,null],[11,"eq","","",1,null],[11,"fmt","","",1,null],[11,"clone","","",1,null],[11,"fmt","","",5,null],[11,"clone","","",5,null],[11,"eq","","",2,null],[11,"ne","","",2,null],[11,"fmt","","",2,null],[11,"clone","","",2,null],[11,"true_cube","","Construct an always-true cube (all variables are `DontCare`) for `vars`\nvariables.",5,{"inputs":[{"name":"usize"}],"output":{"name":"cube"}}],[11,"vars","","Return an iterator over variable assignments.",5,null],[11,"merge_with","","Attempt to merge this cube with another, which may cancel one or the\nother (if completely covered), expand one or the other (if possible, to\nincrease the number of `DontCare`s and thus simplify the final\nexpression), or merge the two into a single cube, or do nothing.",5,null],[11,"with_var","","Return a new cube equal to this cube, but with the particular variable",5,null],[11,"eq","","",5,null],[11,"partial_cmp","","",5,null],[11,"cmp","","",5,null],[11,"fmt","","",6,null],[11,"clone","","",6,null],[11,"eq","","",6,null],[11,"new","","Construct a new, empty, cube list (equivalent to a constant `false`).",6,{"inputs":[],"output":{"name":"cubelist"}}],[11,"from_list","","Construct a cube list from a list of `Cube` structs.",6,null],[11,"cubes","","Return an iterator over all cubes.",6,null],[11,"merge","","Merge this cube list with another, canceling or merging cubes where\npossible. The resulting cube list is not guaranteed to be minimal (that\nis the set-cover problem, which is NP-Complete), but is reduced somewhat\nby a very simple reduction/merging algorithm.",6,null],[11,"with_var","","",6,null],[6,"BDDFunc","","A `BDDFunc` is a function index within a particular `BDD`. It must only\nbe used with the `BDD` instance which produced it.",null,null],[17,"BDD_ZERO","","A special terminal `BDDFunc` which is constant `false` (zero).",null,null],[17,"BDD_ONE","","A special terminal `BDDFunc` which is constant `true` (one).",null,null],[8,"BDDOutput","","The `BDDOutput` trait provides an interface to inform a listener about new\nBDD nodes that are created. It allows the user to persist a BDD to a stream\n(e.g., a log or trace file) as a long-running process executes. A\n`BDDOutput` instance may be provided to all BDD operations.",null,null],[10,"write_label","","",7,null],[10,"write_node","","",7,null]],"paths":[[4,"Expr"],[4,"CubeVar"],[4,"CubeMergeResult"],[3,"BDD"],[3,"PersistedBDD"],[3,"Cube"],[3,"CubeList"],[8,"BDDOutput"]]}; initSearch(searchIndex);