APPLYBDDNODEITE(3)
π applybddnodeite β the IF-THEN-ELSE baddie
okay so this is a page from BDD FUNCTIONS, specifically the applybddnodeite(3) one, and bestie it is so much less scary than it looks. it's literally just "if this then that else the other thing" but for BDD nodes. we love a logical queen. β¨
πΈ 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. π«π·π
- Web:
http://asim.lip6.fr/recherche/alliance/ - E-mail:
alliance-users@asim.lip6.fr
like, they're in Paris, the whole thing is giving main character energy fr fr.
β¨ SYNOPSIS β¨
#include "bdd101.h"
bddnode βapplybddnodeite( BddSystem, BddIf, BddThen, BddElse )
bddnode βBddSystem;
bddnode βBddIf;
bddnode βBddThen;
bddnode βBddElse;
π PARAMETERS π
BddSystemβ the bdd system. that's the whole universe this operation lives in.BddIfβ the IF bdd node. the vibe check, the condition, the "okay but *if*β¦"BddThenβ the THEN bdd node. what we do when the IF says yes.BddElseβ the ELSE bdd node. the backup plan, the "nvm we ball anyway" node.
π¦ DESCRIPTION π¦
so applybddnodeite computes this exact logical function:
(BddIf AND BddThen) OR ((NOT BddIf) AND BddElse)
in the bdd system BddSystem. it's giving classic mux energy, it's giving "choose your fighter", it's the whole IF-THEN-ELSE moment.
and here's the cute part: if a null pointer is given, the default bdd system is used. so you can literally just pass (bddsystem β)0 and the function will handle it. no cap, that's a slay. π«Ά
π RETURN VALUE π
applybddnodeite returns a pointer to the resulting bdd node, with its number of external reference incremented. so yeah, she comes with a ref count bump already attached. iconic behavior honestly. π
π₯ EXAMPLE π₯
okay so here's the whole thing, verbatim, because we do not play with code around here:
#include "bdd101.h"
bddsystem βBddSystem;
bddcircuit βBddCircuit;
bddnode βBddNode;
chain_list βExpr;
BddSystem = createbddsystem( 100, 1000, 100, 50000 );
BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem );
addbddcircuitin( (bddcircuit β)0, "i0", 0, BDD_IN_MODE_FIRST );
addbddcircuitin( (bddcircuit β)0, "i1", 0, BDD_IN_MODE_FIRST );
addbddcircuitin( (bddcircuit β)0, "i2", 0, BDD_IN_MODE_FIRST );
BddNode = applybddnodeite( (bddsystem β)0,
searchbddcircuitin( (bddcircuit β)0, "i0" ),
searchbddcircuitin( (bddcircuit β)0, "i1" ),
searchbddcircuitin( (bddcircuit β)0, "i2" ) );
Expr = convertbddcircuitabl( (bddcircuit β)0, BddNode );
/* displays ((i0 and i1) or ((not i0) and i2) */
viewablexpr( Expr, ABL_VIEW_VHDL );
freeablexpr( Expr );
destroybddsystem( (bddsystem β)0 );
destroybddcircuit( (bddcircuit β)0 );
see how it sets up i0, i1, i2 as inputs, then feeds them straight into applybddnodeite as the if / then / else trio? that comment at the bottom literally spells out the resulting expression: ((i0 and i1) or ((not i0) and i2). chef's kiss. π§ and then it cleans up after itself with freeablexpr, destroybddsystem and destroybddcircuit β we love a tidy bestie. π
π SEE ALSO π
π BUG REPORT π
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools.
bestie they are literally asking for your feedback. if something's weird, tell them. be the change etc. π
β and that's the whole page!! brought to you by ASIM/LIP6, dated October 1, 1997 β yes she's vintage, yes she still serves. mwah. ππ
π¦ where this page comes from
- nixos 26.05: alliance 5.1.1-unstable-2025-02-24
- nixpkgs unstable: alliance 5.1.1-unstable-2025-02-24
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms