1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2 Final//EN">
3 <!--Converted with jLaTeX2HTML 2002-2-1 (1.70) JA patch-2.0
4 patched version by: Kenshi Muto, Debian Project.
5 * modified by: Shige TAKENO
6 LaTeX2HTML 2002-2-1 (1.70),
7 original version by: Nikos Drakos, CBLU, University of Leeds
8 * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
9 * with significant contributions from:
10 Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
13 <TITLE>The C++ Interface
</TITLE>
14 <META NAME=
"description" CONTENT=
"The C++ Interface">
15 <META NAME=
"keywords" CONTENT=
"cuddIntro">
16 <META NAME=
"resource-type" CONTENT=
"document">
17 <META NAME=
"distribution" CONTENT=
"global">
19 <META NAME=
"Generator" CONTENT=
"jLaTeX2HTML v2002-2-1 JA patch-2.0">
20 <META HTTP-EQUIV=
"Content-Style-Type" CONTENT=
"text/css">
22 <LINK REL=
"STYLESHEET" HREF=
"cuddIntro.css">
24 <LINK REL=
"next" HREF=
"node6.html">
25 <LINK REL=
"previous" HREF=
"node4.html">
26 <LINK REL=
"up" HREF=
"cuddIntro.html">
27 <LINK REL=
"next" HREF=
"node6.html">
31 <!--Navigation Panel-->
34 <IMG WIDTH=
"37" HEIGHT=
"24" ALIGN=
"BOTTOM" BORDER=
"0" ALT=
"next"
35 SRC=
"icons/next.png"></A>
37 HREF=
"cuddIntro.html">
38 <IMG WIDTH=
"26" HEIGHT=
"24" ALIGN=
"BOTTOM" BORDER=
"0" ALT=
"up"
39 SRC=
"icons/up.png"></A>
42 <IMG WIDTH=
"63" HEIGHT=
"24" ALIGN=
"BOTTOM" BORDER=
"0" ALT=
"previous"
43 SRC=
"icons/prev.png"></A>
46 <IMG WIDTH=
"43" HEIGHT=
"24" ALIGN=
"BOTTOM" BORDER=
"0" ALT=
"index"
47 SRC=
"icons/index.png"></A>
49 <B> Next:
</B> <A NAME=
"tex2html183"
50 HREF=
"node6.html">Acknowledgments
</A>
51 <B> Up:
</B> <A NAME=
"tex2html179"
52 HREF=
"cuddIntro.html">CUDD: CU Decision Diagram
</A>
53 <B> Previous:
</B> <A NAME=
"tex2html173"
54 HREF=
"node4.html">Programmer's Manual
</A>
55 <B> <A NAME=
"tex2html181"
56 HREF=
"node8.html">Index
</A></B>
59 <!--End of Navigation Panel-->
60 <!--Table of Child-Links-->
61 <A NAME=
"CHILD_LINKS"><STRONG>Subsections
</STRONG></A>
64 <LI><A NAME=
"tex2html184"
65 HREF=
"node5.html#SECTION00051000000000000000">Compiling and Linking
</A>
66 <LI><A NAME=
"tex2html185"
67 HREF=
"node5.html#SECTION00052000000000000000">Basic Manipulation
</A>
69 <!--End of Table of Child-Links-->
72 <H1><A NAME=
"SECTION00050000000000000000"></A>
73 <A NAME=
"sec:cpp"></A>
80 <H2><A NAME=
"SECTION00051000000000000000"></A>
81 <A NAME=
"sec:compileCpp"></A>
87 To build an application that uses the CUDD C++ interface, you should
92 to your source files. In addition to the normal CUDD libraries (see
93 Section
<A HREF=
"node3.html#sec:compileExt">3.1</A>) you should link
94 <code>libobj.a
</code><A NAME=
"1044"></A> to your executable. Refer to the
95 <TT>Makefile
<A NAME=
"1045"></A></TT> in the top level directory of the
96 distribution for further details.
100 <H2><A NAME=
"SECTION00052000000000000000"></A>
101 <A NAME=
"sec:basicCpp"></A>
107 The following fragment of code illustrates some simple operations on
108 BDDs using the C++ interface.
111 BDD x = mgr.bddVar();
112 BDD y = mgr.bddVar();
115 cout
<< "f is" << (f
<= g ?
"" :
" not")
116 << " less than or equal to g\n";
118 This code creates a manager called
<code>mgr
</code> and two variables in it.
119 It then defines two functions
<code>f
</code> and
<code>g
</code> in terms of the
120 variables. Finally, it prints a message based on the comparison of the
121 two functions. No explicit referencing or dereferencing is required.
122 The operators are overloaded in the intuitive way. BDDs are freed when
123 execution leaves the scope in which they are defined or when the
124 variables referring to them are overwritten.
128 <!--Navigation Panel-->
129 <A NAME=
"tex2html182"
131 <IMG WIDTH=
"37" HEIGHT=
"24" ALIGN=
"BOTTOM" BORDER=
"0" ALT=
"next"
132 SRC=
"icons/next.png"></A>
133 <A NAME=
"tex2html178"
134 HREF=
"cuddIntro.html">
135 <IMG WIDTH=
"26" HEIGHT=
"24" ALIGN=
"BOTTOM" BORDER=
"0" ALT=
"up"
136 SRC=
"icons/up.png"></A>
137 <A NAME=
"tex2html172"
139 <IMG WIDTH=
"63" HEIGHT=
"24" ALIGN=
"BOTTOM" BORDER=
"0" ALT=
"previous"
140 SRC=
"icons/prev.png"></A>
141 <A NAME=
"tex2html180"
143 <IMG WIDTH=
"43" HEIGHT=
"24" ALIGN=
"BOTTOM" BORDER=
"0" ALT=
"index"
144 SRC=
"icons/index.png"></A>
146 <B> Next:
</B> <A NAME=
"tex2html183"
147 HREF=
"node6.html">Acknowledgments
</A>
148 <B> Up:
</B> <A NAME=
"tex2html179"
149 HREF=
"cuddIntro.html">CUDD: CU Decision Diagram
</A>
150 <B> Previous:
</B> <A NAME=
"tex2html173"
151 HREF=
"node4.html">Programmer's Manual
</A>
152 <B> <A NAME=
"tex2html181"
153 HREF=
"node8.html">Index
</A></B>
154 <!--End of Navigation Panel-->