COMPOSEBDDNODE(3)

πŸ“¦ version 5.1.1, in fedora 43, fedora 44

πŸ’– COMPOSEBDDNODE β€” the composebddnode(3) glow-up πŸ’–

okay bestie, sit down, hydrate, and let me tell you about a little function from the BDD FUNCTIONS corner of the manual. her name is composebddnode and she is, lowkey, the plug for variable substitution. πŸ¦‹


🌸 NAME 🌸

composebddnode β€” substitutes a variable by a bdd in another bdd.

like. she swaps a variable out and drops a whole bdd in its place. iconic behavior honestly. πŸ’…


🌈 ORIGIN 🌈

This software belongs to the ALLIANCE CAD SYSTEM, developed by the ASIM team at the LIP6 laboratory of UniversitΓ© Pierre et Marie CURIE, in Paris, France. πŸ‡«πŸ‡·βœ¨

ngl, Paris LIP6 team really said "we're building CAD tooling" and then did exactly that. periodt.


✨ SYNOPSIS ✨

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

four args, one bdd node back, no cap. 🫢


πŸŽ€ PARAMETERS πŸŽ€

  • BddSystem β€” the bdd system. the whole vibe container.
  • BddNode β€” the bdd node. the main character we're editing.
  • Variable β€” the variable to find. the one we're hunting for, fr fr.
  • BddSubst β€” the bdd to substitute with. the replacement glow-up.

πŸ’œ DESCRIPTION πŸ’œ

composebddnode substitutes all the occurency of the variable Variable in the bdd node BddNode by the bdd node BddSubst, in the bdd system BddSystem.

so basically: every single time Variable shows up in BddNode? gone. replaced. swapped for BddSubst. the way that it just does the whole thing in one call is giving efficiency. πŸ’…

and listen β€” if a null pointer is given, the default bdd system is used. convenient? yes. ✨


πŸ‘‘ RETURN VALUE πŸ‘‘

composebddnode returns the resulting bdd node.

that's it, that's the return. she gives you back the new node and you say thank you. πŸ™ˆ


πŸ’€ ERRORS πŸ’€

"variable xxx out of range, error !" The Variable parameter must be less or equal to the BddSystem->NUMBER_VAR field.

okay so this one matters: keep your Variable less or equal to BddSystem->NUMBER_VAR. go over it and the function is gonna yell that exact string at you. not me finding out the hard way. 😭


πŸ”₯ EXAMPLE πŸ”₯

here's the whole thing in action, bestie. copy it, run it, live your truth:

#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_AND,
                            createablatom( "i0" ),
                            createablatom( "i1" ) );
   BddNode = addbddcircuitabl( BddCircuit, Expr );
   freeablexpr( Expr );
   Expr = createablbinexpr( ABL_OR,
                            createablatom( "i2" ),
                            createablatom( "i3" ) );
   BddSubst = addbddcircuitabl( BddCircuit, Expr );
   freeablexpr( Expr );
   BddVariable = searchbddcircuitin( (bddcircuit βˆ—)0, "i0" );
   Variable = getbddvarbyindex( (bddsystem βˆ—)0, BddVariable->INDEX );
   BddNode = composebddnode( (bddsystem βˆ—)0, BddNode, Variable, BddSubst );
   Expr = convertbddcircuitabl( BddCircuit, BddNode );
   /* displays (i1 and (i2 or i3)) */
   viewablexpr( Expr, ABL_VIEW_VHDL );
   freeablexpr( Expr );
   destroybddsystem( (bddsystem βˆ—)0 );
   destroybddcircuit( (bddcircuit βˆ—)0 );

and yes, that comment line is the receipts β€” it displays (i1 and (i2 or i3)). i0 got fully replaced by (i2 or i3), and what's left is i1 hanging out with the substitute. ate. πŸ”₯


🧚 SEE ALSO 🧚

go read it. iykyk. ✨


πŸ“ BUG REPORT πŸ“

This tool is under development at the ASIM department of the LIP6 laboratory.

We need your feedback to improve documentation and tools.

so like. tell them things. they're literally asking. be the feedback you wanna see in the world. 🫢


and that's the whole page, bestie!! πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

this lil gem is from ASIM/LIP6, dated October 1, 1997, and it lives in section COMPOSEBDDNODE(3) β€” go forth and compose responsibly. πŸ‘‘πŸ’œ