RESTRICTBDDNODE(3)

๐Ÿ“ฆ version 5.1.1-unstable-2025-02, in nixos 26.05, nixpkgs unstable

๐Ÿ’… RESTRICTBDDNODE(3) ๐Ÿ’…

ok so this is a section-3 manpage from BDD FUNCTIONS and honestly? it's a little baddie. it swaps a variable out for a zero or a one inside a bdd. let's get into it bestie ๐Ÿซถ


โœจ NAME โœจ

restrictbddnode โ€” substitutes a variable by a zero or one, in a bdd.


๐ŸŒธ ORIGIN ๐ŸŒธ

ok so this software belongs to the ALLIANCE CAD SYSTEM, which was developed by the ASIM team at the LIP6 laboratory of Universitรฉ Pierre et Marie CURIE, in Paris, France. iconic lineage tbh ๐Ÿ‡ซ๐Ÿ‡ทโœจ

like if u need to reach them, that's how ๐Ÿ’Œ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

#include "bdd101.h"
bddnode โˆ—restrictbddnode( BddSystem, BddNode, Variable, BddSubst )
  bddsystem โˆ—BddSystem;
  bddnode   โˆ—BddNode;
  bddvar     Variable;
  bddnode   โˆ—BddSubst;

๐Ÿฆ‹ PARAMETERS ๐Ÿฆ‹

  • BddSystem โ€” the bdd system. ur whole lil universe of nodes lives here.
  • BddNode โ€” the bdd node. the one we're doing surgery on ๐Ÿ”ช
  • Variable โ€” the variable to find. we're hunting for this one, bestie.
  • BddSubst โ€” the bdd to substitute with. what we're swapping it out for.

๐Ÿ’– DESCRIPTION ๐Ÿ’–

so restrictbddnode substitutes all the occurency of the variable Variable in the bdd node BddNode by the bdd node BddSubst, in the bdd system BddSystem. it's giving find-and-replace but make it โœจboolean algebraโœจ

if a null pointer is given, the default bdd system is used. convenient, no cap.

๐Ÿšจ important vibe check: the BddSubst must be the node BddSystem->ONE or BddSystem->ZERO. like. those are the only two options. don't try anything else, we're not doing that today ๐Ÿ™ˆ

โญ RETURN VALUE โญ

restrictbddnode returns the resulting bdd node. that's the glow-up version of what you passed in ๐Ÿ’ซ


๐Ÿ’€ ERRORS ๐Ÿ’€

  • "variable xxx out of range, error !" โ€” the Variable parameter must be less or equal to the BddSystem->NUMBER_VAR field. stay in ur lane, variable.
  • "index xxx out of range, error !" โ€” the BddSubst parameter must have its index less than BDD_INDEX_MIN. out of bounds = not the move ๐Ÿ˜ญ

๐Ÿ”ฅ EXAMPLE ๐Ÿ”ฅ

here's the whole thing in action, copy-paste energy:

#include "bdd101.h"
   bddsystem  โˆ—BddSystem;
   bddcircuit โˆ—BddCircuit;
   bddnode    โˆ—BddVariable;
   bddnode    โˆ—BddNode;
   bddnode    โˆ—BddSubst;
   chain_list โˆ—Expr;
   bddvar         Variable;
   BddSystem  = createbddsystem( 100, 1000, 100, 50000 );
   BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem );
   Expr = createablbinexpr( ABL_OR,
                            createablatom( "i0" ),
                            createablatom( "i1" ) );
   BddNode = addbddcircuitabl( BddCircuit, Expr );
   freeablexpr( Expr );
   BddSubst = BddSystem->ONE;
   BddVariable = searchbddcircuitin( (bddcircuit โˆ—)0, "i0" );
   Variable = getbddvarbyindex( (bddsystem โˆ—)0, BddVariable->INDEX );
   BddNode = restrictbddnode( (bddsystem โˆ—)0, BddNode, Variable, BddSubst );
   Expr = convertbddcircuitabl( BddCircuit, BddNode );
   /* displays '1' */
   viewablexpr( Expr, ABL_VIEW_VHDL );
   freeablexpr( Expr );
   destroybddsystem( (bddsystem โˆ—)0 );
   destroybddcircuit( (bddcircuit โˆ—)0 );

and yeah, the /* displays '1' */ comment is real โ€” that's the actual output. ate and left no crumbs ๐Ÿ’…


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

bdd(1)


๐ŸŒˆ BUG REPORT ๐ŸŒˆ

this tool is under development at the ASIM department of the LIP6 laboratory. they literally say: we need your feedback to improve documentation and tools. so likeโ€ฆ spill, bestie ๐Ÿ“


that's the whole page!! mwah ๐Ÿ’–

ASIM/LIP6 ยท October 1, 1997 ยท RESTRICTBDDNODE(3) โ€” ok that's a wrap, go restrict some nodes responsibly ๐Ÿงšโ€โ™€๏ธโœจ

๐Ÿ“ฆ where this page comes from