SUBSTBDDNODEASSOC(3)

πŸ“¦ version 5.1.1-unstable-2025-02, in nixos 26.05, nixpkgs unstable

✨ SUBSTBDDNODEASSOC(3) β€” the BDD functions era ✨

okay so bestie, we're deep in the BDD FUNCTIONS part of the SUBSTBDDNODEASSOC(3) manual page and honestly? this one is kind of a serve πŸ’… it's a C function, it's got pointers, it's got a whole example program β€” buckle up πŸŽ€


🌸 ORIGIN 🌸

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

like, real ones know 😌


πŸ¦‹ SYNOPSIS πŸ¦‹

#include "bdd101.h"
bddnode βˆ—substbddnodeassoc( BddSystem, BddNode, BddAssoc )
  bddsystem βˆ—BddSystem;
  bddnode   βˆ—BddNode;
  bddassoc  βˆ—BddAssoc;

no cap, that's the whole signature 🫢


πŸ’– PARAMETERS πŸ’–

  • BddSystem β€” the bdd system. yep. that's the vibe.
  • BddNode β€” the bdd node to treat. this is the main character we're doing surgery on πŸ”₯
  • BddAssoc β€” the variable association. the lil lookup table of who becomes what πŸ‘‘

🌈 DESCRIPTION 🌈

so substbddnodeassoc substitutes, in the bdd node BddNode, all the variables associated to something in the variable association BddAssoc, with the corresponding bdd node, in the bdd system BddSystem. πŸ’«

and here's the lil plot twist: if a null pointer is given, the default bdd system is used. the way that's just the fallback bestie 😭🫢


⭐ RETURN VALUE ⭐

substbddnodeassoc returns the computed bdd node. that's it, that's the return. iconic behavior ngl πŸ‘‘


πŸŽ€ ERRORS πŸŽ€

  • "variable xxx out of range, error !" β€” The Variable parameter must be less or equal to the BddSystem->NUMBER_VAR field. so like, stay in your lane bestie 🚧
  • "bad variable association xxx, error !" β€” The BddAssoc parameter must a valid variable association. (yes, that's the original wording, fr fr β€” we don't fix it, we respect it πŸ’€)
⚠️ lowkey important: hit either of these and you get an error, so double-check your variable index against BddSystem->NUMBER_VAR and make sure BddAssoc is actually a valid variable association. no vibes-only debugging πŸ™ˆ

🧚 EXAMPLE 🧚

this is the whole thing, character for character, do not touch πŸ”’

#include "bdd101.h"
   bddsystem  βˆ—BddSystem;
   bddcircuit βˆ—BddCircuit;
   bddnode    βˆ—BddNode;
   bddnode    βˆ—BddSubst;
   bddnode    βˆ—BddVariable;
   bddassoc   βˆ—Assoc;
   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 );
   Assoc = addbddassoc( (bddsystem βˆ—)0 );
   addbddnodeassoc( (bddsystem βˆ—)0, Assoc, Variable, BddSubst );
   BddNode = substbddnodeassoc( (bddsystem βˆ—)0, BddSubst, Assoc );
   Expr = convertbddcircuitabl( BddCircuit, BddNode );
   /* displays ((i3 or i2) and i1) */
   viewablexpr( Expr, ABL_VIEW_VHDL );
   freeablexpr( Expr );
   destroybddassoc( (bddsystem βˆ—)0 );
   destroybddsystem( (bddsystem βˆ—)0 );
   destroybddcircuit( (bddcircuit βˆ—)0 );

and bestie, notice the comment in there β€” it displays ((i3 or i2) and i1) β€” that's the payoff, that's the moment πŸ’…βœ¨


πŸ” SEE ALSO πŸ”

  • bdd(1) β€” 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... send feedback?? they're literally asking πŸ₯ΊπŸ«Ά it's giving collaborative open source energy and we love that for them.


🌟 that's the page!! go substitute some variables, bestie, you got this πŸ’œ

ASIM/LIP6 Β· October 1, 1997 Β· mwah πŸ’‹ this lil rewrite was brought to you by the SUBSTBDDNODEASSOC(3) era of BDD functions, and honestly? a moment in history πŸŽ€βœ¨

πŸ“¦ where this page comes from