1RESTRICTBDDNODE(3) BDD FUNCTIONS RESTRICTBDDNODE(3)
2
3
4
6 restrictbddnode - substitutes a variable by a zero or one, in a bdd.
7
8
10 #include "bdd101.h"
11 bddnode ∗restrictbddnode( BddSystem, BddNode, Variable, BddSubst )
12 bddsystem ∗BddSystem;
13 bddnode ∗BddNode;
14 bddvar Variable;
15 bddnode ∗BddSubst;
16
18 BddSystem The bdd system.
19
20 BddNode The bdd node.
21
22 Variable The variable to find.
23
24 BddSubst The bdd to substitute with.
25
27 restrictbddnode substitutes all the occurency of the variable Variable
28 in the bdd node BddNode by the bdd node BddSubst, in the bdd system
29 BddSystem. If a null pointer is given, the default bdd system is used.
30 The BddSubst must be a the node BddSystem->ONE or BddSystem->ZERO.
31
33 restrictbddnode returns the resulting bdd node.
34
36 "variable xxx out of range, error !"
37 The Variable parameter must be less or equal to the BddSys‐
38 tem->NUMBER_VAR field.
39 "index xxx out of range, error !"
40 The BddSubst parameter must have its index less than
41 BDD_INDEX_MIN.
42
44 #include "bdd101.h"
45 bddsystem ∗BddSystem;
46 bddcircuit ∗BddCircuit;
47 bddnode ∗BddVariable;
48 bddnode ∗BddNode;
49 bddnode ∗BddSubst;
50 chain_list ∗Expr;
51 bddvar Variable;
52 BddSystem = createbddsystem( 100, 1000, 100, 50000 );
53 BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem );
54 Expr = createablbinexpr( ABL_OR,
55 createablatom( "i0" ),
56 createablatom( "i1" ) );
57 BddNode = addbddcircuitabl( BddCircuit, Expr );
58 freeablexpr( Expr );
59 BddSubst = BddSystem->ONE;
60 BddVariable = searchbddcircuitin( (bddcircuit ∗)0, "i0" );
61 Variable = getbddvarbyindex( (bddsystem ∗)0, BddVariable->INDEX );
62 BddNode = restrictbddnode( (bddsystem ∗)0, BddNode, Variable, BddSubst );
63 Expr = convertbddcircuitabl( BddCircuit, BddNode );
64 /* displays '1' */
65 viewablexpr( Expr, ABL_VIEW_VHDL );
66 freeablexpr( Expr );
67 destroybddsystem( (bddsystem ∗)0 );
68 destroybddcircuit( (bddcircuit ∗)0 );
69
71 bdd(1)
72
73
74
75
76
77
78ASIM/LIP6 October 1, 1997 RESTRICTBDDNODE(3)