Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 583ffa4ba069126c3ba0bc565dc0485a > files > 1407

cvc3-doc-2.4.1-1.fc15.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>CVC3: main.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">CVC3&#160;<span id="projectnumber">2.4.1</span></div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">main.cpp</div>  </div>
</div>
<div class="contents">
<a href="main_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*****************************************************************************/</span><span class="comment"></span>
<a name="l00002"></a>00002 <span class="comment">/*!</span>
<a name="l00003"></a>00003 <span class="comment"> * \file main.cpp</span>
<a name="l00004"></a>00004 <span class="comment"> * \brief Main program for cvc3</span>
<a name="l00005"></a>00005 <span class="comment"> * </span>
<a name="l00006"></a>00006 <span class="comment"> * Author: Clark Barrett</span>
<a name="l00007"></a>00007 <span class="comment"> * </span>
<a name="l00008"></a>00008 <span class="comment"> * Created: Wed Dec  4 17:21:10 2002</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * &lt;hr&gt;</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * License to use, copy, modify, sell and/or distribute this software</span>
<a name="l00013"></a>00013 <span class="comment"> * and its documentation for any purpose is hereby granted without</span>
<a name="l00014"></a>00014 <span class="comment"> * royalty, subject to the terms and conditions defined in the \ref</span>
<a name="l00015"></a>00015 <span class="comment"> * LICENSE file provided with this distribution.</span>
<a name="l00016"></a>00016 <span class="comment"> * </span>
<a name="l00017"></a>00017 <span class="comment"> * &lt;hr&gt;</span>
<a name="l00018"></a>00018 <span class="comment"> * </span>
<a name="l00019"></a>00019 <span class="comment"> */</span>
<a name="l00020"></a>00020 <span class="comment">/*****************************************************************************/</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;signal.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;fstream&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;iomanip&gt;</span>
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;<a class="code" href="os_8h.html" title="Abstraction over different operating systems.">os.h</a>&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;<a class="code" href="vc_8h.html" title="Generic API for a validity checker.">vc.h</a>&quot;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="parser_8h.html">parser.h</a>&quot;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;<a class="code" href="vc__cmd_8h.html">vc_cmd.h</a>&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;<a class="code" href="command__line__flags_8h.html">command_line_flags.h</a>&quot;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;<a class="code" href="statistics_8h.html" title="Description: Counters and flags for collecting run-time statistics.">statistics.h</a>&quot;</span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#ifdef _MSC_VER</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#include &lt;windows.h&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#else</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="preprocessor">#include &lt;unistd.h&gt;</span>
<a name="l00037"></a>00037 <span class="preprocessor">#endif</span>
<a name="l00038"></a>00038 <span class="preprocessor"></span>
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="keyword">using namespace </span>std;
<a name="l00041"></a>00041 <span class="keyword">using namespace </span>CVC3;
<a name="l00042"></a>00042 
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#a02b40230ee387fc210cfd0c48b891604">parse_args</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv, <a class="code" href="classCVC3_1_1CLFlags.html">CLFlags</a> &amp;flags,
<a name="l00045"></a>00045            <span class="keywordtype">string</span>&amp; fileName);
<a name="l00046"></a>00046 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#a33de348acfed4f7c53c0834d445a18f6">printUsage</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1CLFlags.html">CLFlags</a>&amp; flags, <span class="keywordtype">bool</span> followDisplay);
<a name="l00047"></a>00047 
<a name="l00048"></a>00048 <span class="comment">// Our own name </span>
<a name="l00049"></a><a class="code" href="main_8cpp.html#a3f35d80d721a8d188637199028676715">00049</a> <span class="keyword">static</span> <span class="keywordtype">string</span> <a class="code" href="main_8cpp.html#a3f35d80d721a8d188637199028676715">programName</a>;
<a name="l00050"></a>00050 
<a name="l00051"></a><a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">00051</a> <span class="keyword">static</span> <a class="code" href="classCVC3_1_1ValidityChecker.html" title="Generic API for a validity checker.">ValidityChecker</a>* <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> = NULL;
<a name="l00052"></a>00052 <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(<span class="keyword">static</span> DebugTimer* pRuntime = NULL;)
<a name="l00053"></a>00053 
<a name="l00054"></a>00054 #ifndef _MSC_VER
<a name="l00055"></a><a class="code" href="main_8cpp.html#ae9fa379677100866fa335a0b8adf3ea2">00055</a> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#ae9fa379677100866fa335a0b8adf3ea2">sighandler</a>(<span class="keywordtype">int</span> signum) {
<a name="l00056"></a>00056   cerr &lt;&lt; <span class="stringliteral">&quot;\nInterrupted by signal &quot;</span> &lt;&lt; signum;
<a name="l00057"></a>00057   <span class="keywordflow">if</span>(signum == SIGALRM)
<a name="l00058"></a>00058     cerr &lt;&lt; <span class="stringliteral">&quot; (self-timeout)&quot;</span>;
<a name="l00059"></a>00059   cerr &lt;&lt; <span class="stringliteral">&quot;.  &quot;</span> &lt;&lt; <a class="code" href="main_8cpp.html#a3f35d80d721a8d188637199028676715">programName</a> &lt;&lt; <span class="stringliteral">&quot; is aborting.\n&quot;</span>;
<a name="l00060"></a>00060   <span class="comment">// Print the debugging info</span>
<a name="l00061"></a>00061   <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(<span class="keywordflow">if</span> (pRuntime != NULL) CVC3::debugger.setElapsed(*pRuntime);)
<a name="l00062"></a>00062   <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(debugger.printAll();)
<a name="l00063"></a>00063   <span class="keywordflow">if</span>(<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> != NULL &amp;&amp; <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>()[<span class="stringliteral">&quot;stats&quot;</span>].getBool())
<a name="l00064"></a>00064     cout &lt;&lt; <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#ae2b134cb3f8caf1d2bac8a257bc95819" title="Get statistics object.">getStatistics</a>() &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00065"></a>00065   <span class="keywordflow">if</span>(<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> != NULL) {
<a name="l00066"></a>00066     <span class="comment">// If deletion causes another signal, don&#39;t keep trying.</span>
<a name="l00067"></a>00067     <span class="comment">// This is here to ensure that logs are dumped, etc.</span>
<a name="l00068"></a>00068     <a class="code" href="classCVC3_1_1ValidityChecker.html" title="Generic API for a validity checker.">ValidityChecker</a>* toDelete = <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>;
<a name="l00069"></a>00069     <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> = NULL;
<a name="l00070"></a>00070     <span class="keyword">delete</span> toDelete;
<a name="l00071"></a>00071   }
<a name="l00072"></a>00072   abort();
<a name="l00073"></a>00073 }
<a name="l00074"></a>00074 <span class="preprocessor">#else</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span>DWORD WINAPI thread_timeout(PVOID timeout) {
<a name="l00076"></a>00076   Sleep((<span class="keywordtype">int</span>)timeout * 1000);
<a name="l00077"></a>00077   cerr &lt;&lt; <span class="stringliteral">&quot;(self-timeout).&quot;</span> &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00078"></a>00078   <span class="keywordflow">if</span>(<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> != NULL &amp;&amp; <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>()[<span class="stringliteral">&quot;stats&quot;</span>].getBool())
<a name="l00079"></a>00079     cout &lt;&lt; <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#ae2b134cb3f8caf1d2bac8a257bc95819" title="Get statistics object.">getStatistics</a>() &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00080"></a>00080   <span class="keywordflow">if</span>(<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> != NULL) {
<a name="l00081"></a>00081     <span class="comment">// If deletion causes another signal, don&#39;t keep trying.</span>
<a name="l00082"></a>00082     <span class="comment">// This is here to ensure that logs are dumped, etc.</span>
<a name="l00083"></a>00083     <a class="code" href="classCVC3_1_1ValidityChecker.html" title="Generic API for a validity checker.">ValidityChecker</a>* toDelete = <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>;
<a name="l00084"></a>00084     <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> = NULL;
<a name="l00085"></a>00085     <span class="keyword">delete</span> toDelete;
<a name="l00086"></a>00086   }
<a name="l00087"></a>00087   ExitProcess(1);
<a name="l00088"></a>00088 }
<a name="l00089"></a>00089 <span class="preprocessor">#endif</span>
<a name="l00090"></a>00090 <span class="preprocessor"></span>
<a name="l00091"></a>00091 
<a name="l00092"></a><a class="code" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">00092</a> <span class="keywordtype">int</span> <a class="code" href="main_8cpp.html#a3c04138a5bfe5d72780bb7e82a18e627">main</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv)
<a name="l00093"></a>00093 {
<a name="l00094"></a>00094   <a class="code" href="classCVC3_1_1CLFlags.html">CLFlags</a> flags(ValidityChecker::createFlags());
<a name="l00095"></a>00095   <a class="code" href="main_8cpp.html#a3f35d80d721a8d188637199028676715">programName</a> = string(argv[0]);
<a name="l00096"></a>00096   <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(DebugTimer runtime(CVC3::debugger.timer(<span class="stringliteral">&quot;total runtime&quot;</span>));)
<a name="l00097"></a>00097   <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(pRuntime = &amp;runtime;)
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 #ifndef _MSC_VER
<a name="l00100"></a>00100   signal(SIGINT, <a class="code" href="main_8cpp.html#ae9fa379677100866fa335a0b8adf3ea2">sighandler</a>);
<a name="l00101"></a>00101   signal(SIGTERM, <a class="code" href="main_8cpp.html#ae9fa379677100866fa335a0b8adf3ea2">sighandler</a>);
<a name="l00102"></a>00102   signal(SIGQUIT, <a class="code" href="main_8cpp.html#ae9fa379677100866fa335a0b8adf3ea2">sighandler</a>);
<a name="l00103"></a>00103   signal(SIGALRM, <a class="code" href="main_8cpp.html#ae9fa379677100866fa335a0b8adf3ea2">sighandler</a>);
<a name="l00104"></a>00104   signal(SIGSEGV, <a class="code" href="main_8cpp.html#ae9fa379677100866fa335a0b8adf3ea2">sighandler</a>);
<a name="l00105"></a>00105 <span class="preprocessor">#endif</span>
<a name="l00106"></a>00106 <span class="preprocessor"></span>  
<a name="l00107"></a>00107   <span class="keywordtype">string</span> fileName(<span class="stringliteral">&quot;&quot;</span>);
<a name="l00108"></a>00108 
<a name="l00109"></a>00109   <span class="keywordflow">try</span> {
<a name="l00110"></a>00110     <a class="code" href="main_8cpp.html#a02b40230ee387fc210cfd0c48b891604">parse_args</a>(argc, argv, flags, fileName);
<a name="l00111"></a>00111   } <span class="keywordflow">catch</span>(<a class="code" href="classCVC3_1_1Exception.html">Exception</a>&amp; e) {
<a name="l00112"></a>00112     cerr &lt;&lt; <span class="stringliteral">&quot;*** &quot;</span> &lt;&lt; e;
<a name="l00113"></a>00113     cerr &lt;&lt; <span class="stringliteral">&quot;\n\nRun with -help option for usage information.&quot;</span> &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00114"></a>00114     exit(1);
<a name="l00115"></a>00115   }
<a name="l00116"></a>00116 
<a name="l00117"></a>00117   <span class="comment">// In SMT-LIBv2, don&#39;t save the model between distinct check-sats</span>
<a name="l00118"></a>00118   <span class="comment">// (unless user specifically requested it)</span>
<a name="l00119"></a>00119   <span class="keywordflow">if</span>(flags[<span class="stringliteral">&quot;lang&quot;</span>].getString() != <span class="stringliteral">&quot;&quot;</span> &amp;&amp;
<a name="l00120"></a>00120      <a class="code" href="namespaceCVC3.html#aac47d390dde36b9c597d428cb149bee7">getLanguage</a>(flags[<span class="stringliteral">&quot;lang&quot;</span>].getString()) == <a class="code" href="namespaceCVC3.html#a3aaaf7bc1fc47a4860ef6e59ddb0db0eaed2643c62e36b9b222804a1ab5b4809e" title="SMT-LIB v2 format.">SMTLIB_V2_LANG</a> &amp;&amp;
<a name="l00121"></a>00121      !flags[<span class="stringliteral">&quot;internal::userSetNoSaveModel&quot;</span>].getBool()) {
<a name="l00122"></a>00122     flags.<a class="code" href="classCVC3_1_1CLFlags.html#a20dee56b9b946d73421253eb99e434e3">setFlag</a>(<span class="stringliteral">&quot;no-save-model&quot;</span>, <span class="keyword">true</span>);
<a name="l00123"></a>00123   }
<a name="l00124"></a>00124 
<a name="l00125"></a>00125   <span class="comment">// Set the timeout, if given in the command line options</span>
<a name="l00126"></a>00126   <span class="keywordtype">int</span> timeout = flags[<span class="stringliteral">&quot;timeout&quot;</span>].getInt();
<a name="l00127"></a>00127   <span class="keywordflow">if</span>(timeout &gt; 0) {
<a name="l00128"></a>00128 <span class="preprocessor">#ifndef _MSC_VER</span>
<a name="l00129"></a>00129 <span class="preprocessor"></span>    alarm(timeout);
<a name="l00130"></a>00130 <span class="preprocessor">#else</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span>    <span class="comment">// http://msdn2.microsoft.com/en-us/library/ms682453.aspx</span>
<a name="l00132"></a>00132     CreateThread(NULL, 0, thread_timeout, (PVOID)timeout, 0, NULL);
<a name="l00133"></a>00133 <span class="preprocessor">#endif</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span>  }
<a name="l00135"></a>00135 
<a name="l00136"></a>00136   <span class="comment">/*</span>
<a name="l00137"></a>00137 <span class="comment">   * Create and run the validity checker</span>
<a name="l00138"></a>00138 <span class="comment">   */</span> 
<a name="l00139"></a>00139 
<a name="l00140"></a>00140   <span class="comment">// Debugging code may throw an exception</span>
<a name="l00141"></a>00141   <span class="keywordflow">try</span> {
<a name="l00142"></a>00142     <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> = ValidityChecker::create(flags);
<a name="l00143"></a>00143   } <span class="keywordflow">catch</span>(<a class="code" href="classCVC3_1_1Exception.html">Exception</a>&amp; e) {
<a name="l00144"></a>00144     cerr &lt;&lt; <span class="stringliteral">&quot;*** Fatal exception: &quot;</span> &lt;&lt; e &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00145"></a>00145     exit(1);
<a name="l00146"></a>00146   }
<a name="l00147"></a>00147 
<a name="l00148"></a>00148   <span class="comment">// -h flag sets &quot;help&quot; to false (+h would make it true, but that&#39;s</span>
<a name="l00149"></a>00149   <span class="comment">// not what the user normally types in).</span>
<a name="l00150"></a>00150   <span class="keywordflow">if</span>(!<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>()[<span class="stringliteral">&quot;help&quot;</span>].getBool()) {
<a name="l00151"></a>00151     <a class="code" href="main_8cpp.html#a33de348acfed4f7c53c0834d445a18f6">printUsage</a>(<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>(), <span class="keyword">true</span>);
<a name="l00152"></a>00152     <span class="keywordflow">return</span> 0;
<a name="l00153"></a>00153   }
<a name="l00154"></a>00154   <span class="keywordflow">if</span>(!<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>()[<span class="stringliteral">&quot;unsupported&quot;</span>].getBool()) {
<a name="l00155"></a>00155     <a class="code" href="main_8cpp.html#a33de348acfed4f7c53c0834d445a18f6">printUsage</a>(<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>(), <span class="keyword">false</span>);
<a name="l00156"></a>00156     <span class="keywordflow">return</span> 0;
<a name="l00157"></a>00157   }
<a name="l00158"></a>00158 <span class="preprocessor">#ifndef VERSION</span>
<a name="l00159"></a>00159 <span class="preprocessor"></span><span class="preprocessor">#define VERSION &quot;unknown&quot;</span>
<a name="l00160"></a>00160 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00161"></a>00161 <span class="preprocessor"></span>  <span class="comment">// Similarly, -version sets the flag &quot;version&quot; to false</span>
<a name="l00162"></a>00162   <span class="keywordflow">if</span>(!<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>()[<span class="stringliteral">&quot;version&quot;</span>].getBool()) {
<a name="l00163"></a>00163     cout &lt;&lt; <span class="stringliteral">&quot;This is CVC3 version &quot;</span> &lt;&lt; <a class="code" href="main_8cpp.html#a1c6d5de492ac61ad29aec7aa9a436bbf">VERSION</a>
<a name="l00164"></a>00164       <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>( &lt;&lt; <span class="stringliteral">&quot; (debug build)&quot;</span>)
<a name="l00165"></a>00165    &lt;&lt; <span class="stringliteral">&quot;\n\n&quot;</span>;
<a name="l00166"></a>00166     cout &lt;&lt;
<a name="l00167"></a>00167       <span class="stringliteral">&quot;Copyright (C) 2003-2010 by the Board of Trustees of Leland Stanford Junior\n&quot;</span> 
<a name="l00168"></a>00168       <span class="stringliteral">&quot;University, New York University, and the University of Iowa.\n\n&quot;</span>
<a name="l00169"></a>00169       <span class="stringliteral">&quot;THIS SOFTWARE PROVIDED AS-IS, WITHOUT ANY WARRANTIES. &quot;</span>
<a name="l00170"></a>00170       <span class="stringliteral">&quot;USE IT AT YOUR OWN RISK.\n&quot;</span>
<a name="l00171"></a>00171    &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00172"></a>00172     <span class="keywordflow">return</span> 0;
<a name="l00173"></a>00173   }
<a name="l00174"></a>00174 
<a name="l00175"></a>00175   <span class="keywordflow">try</span> {
<a name="l00176"></a>00176     <span class="comment">// Calling getOutputLang() tests if the output language is</span>
<a name="l00177"></a>00177     <span class="comment">// correctly specified; if not, an exception will be thrown</span>
<a name="l00178"></a>00178     <a class="code" href="namespaceCVC3.html#a3aaaf7bc1fc47a4860ef6e59ddb0db0e" title="Different input languages.">InputLanguage</a> outlang = <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a448e0df25ec6d756861e7d1d217f1063" title="Return the ExprManager.">getEM</a>()-&gt;<a class="code" href="group__EM__Priv.html#gaeef110905b00e6e89f54c082e3c4c1a3" title="Get the output language for printing.">getOutputLang</a>();
<a name="l00179"></a>00179     <span class="keywordflow">if</span>(outlang == <a class="code" href="namespaceCVC3.html#a3aaaf7bc1fc47a4860ef6e59ddb0db0ea7bdae8b250b94f50cea68f05c563cdca" title="for output in SPASS format">SPASS_LANG</a> &amp;&amp;
<a name="l00180"></a>00180        <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>()[<span class="stringliteral">&quot;translate&quot;</span>].getBool() &amp;&amp;
<a name="l00181"></a>00181        !<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>()[<span class="stringliteral">&quot;liftITE&quot;</span>].modified()) {
<a name="l00182"></a>00182       <span class="comment">// SPASS doesn&#39;t support ITE; make sure there are none</span>
<a name="l00183"></a>00183       <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>().<a class="code" href="classCVC3_1_1CLFlags.html#a20dee56b9b946d73421253eb99e434e3">setFlag</a>(<span class="stringliteral">&quot;liftITE&quot;</span>, <span class="keyword">true</span>);
<a name="l00184"></a>00184     }
<a name="l00185"></a>00185     <span class="comment">// Set the timer</span>
<a name="l00186"></a>00186     <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(CVC3::debugger.setCurrentTime(runtime);)
<a name="l00187"></a>00187     <span class="comment">// Read the input file</span>
<a name="l00188"></a>00188     <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a68a96b7331b5a81b67c600cec05bbf8e" title="Read and execute the commands from a file given by name (&quot;&quot; means stdin)">loadFile</a>(fileName, <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a448e0df25ec6d756861e7d1d217f1063" title="Return the ExprManager.">getEM</a>()-&gt;<a class="code" href="group__EM__Priv.html#gae33e1c95930679cde944e2d2d5984db1" title="Get the input language for printing.">getInputLang</a>(),
<a name="l00189"></a>00189                  flags[<span class="stringliteral">&quot;interactive&quot;</span>].getBool());
<a name="l00190"></a>00190   } <span class="keywordflow">catch</span>(<a class="code" href="classCVC3_1_1Exception.html">Exception</a>&amp; e) {
<a name="l00191"></a>00191     cerr &lt;&lt; <span class="stringliteral">&quot;*** Fatal exception: &quot;</span> &lt;&lt; e &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00192"></a>00192     exit(1);
<a name="l00193"></a>00193   }
<a name="l00194"></a>00194 
<a name="l00195"></a>00195   <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(CVC3::debugger.setElapsed(runtime);)
<a name="l00196"></a>00196 
<a name="l00197"></a>00197   <span class="comment">// Print the debugging info</span>
<a name="l00198"></a>00198   <a class="code" href="debug_8h.html#a600cb2d68efe7cc413cccbb5714c7016">IF_DEBUG</a>(debugger.printAll();)
<a name="l00199"></a>00199   <span class="comment">// Print statistics</span>
<a name="l00200"></a>00200   <span class="keywordflow">if</span>(<a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#a9a09f71dc5a3dd47f0240abceab2fad3" title="Return the set of command-line flags.">getFlags</a>()[<span class="stringliteral">&quot;stats&quot;</span>].getBool()) <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>-&gt;<a class="code" href="classCVC3_1_1ValidityChecker.html#adbbcda1a243c746f667bcba597482cd6" title="Print collected statistics to stdout.">printStatistics</a>();
<a name="l00201"></a>00201   <span class="comment">// Destruct the system</span>
<a name="l00202"></a>00202   <a class="code" href="debug_8h.html#ad64155edafde9f067f4868817cd04bdf">TRACE_MSG</a>(<span class="stringliteral">&quot;delete&quot;</span>, <span class="stringliteral">&quot;Deleting ValidityChecker [last trace from main.cpp]&quot;</span>);
<a name="l00203"></a>00203   <span class="keywordflow">try</span> {
<a name="l00204"></a>00204     <span class="comment">// The signal handler deletes the vc.  If deletion segfaults, we don&#39;t</span>
<a name="l00205"></a>00205     <span class="comment">// want to try it again.</span>
<a name="l00206"></a>00206     <a class="code" href="classCVC3_1_1ValidityChecker.html" title="Generic API for a validity checker.">ValidityChecker</a>* toDelete = <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a>;
<a name="l00207"></a>00207     <a class="code" href="main_8cpp.html#a88136d6dfceb0dedcb0b781a65423d54">vc</a> = NULL;
<a name="l00208"></a>00208     <span class="keyword">delete</span> toDelete;
<a name="l00209"></a>00209   } <span class="keywordflow">catch</span>(<a class="code" href="classCVC3_1_1Exception.html">Exception</a>&amp; e) {
<a name="l00210"></a>00210     cerr &lt;&lt; <span class="stringliteral">&quot;*** Fatal exception: &quot;</span> &lt;&lt; e &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00211"></a>00211     exit(1);
<a name="l00212"></a>00212   }
<a name="l00213"></a>00213 
<a name="l00214"></a>00214   <span class="keywordflow">return</span> 0;
<a name="l00215"></a>00215 }
<a name="l00216"></a>00216 
<a name="l00217"></a><a class="code" href="main_8cpp.html#a33de348acfed4f7c53c0834d445a18f6">00217</a> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#a33de348acfed4f7c53c0834d445a18f6">printUsage</a>(<span class="keyword">const</span> <a class="code" href="classCVC3_1_1CLFlags.html">CLFlags</a>&amp; flags, <span class="keywordtype">bool</span> followDisplay) {
<a name="l00218"></a>00218   cout &lt;&lt; <span class="stringliteral">&quot;Usage: &quot;</span> &lt;&lt; <a class="code" href="main_8cpp.html#a3f35d80d721a8d188637199028676715">programName</a> &lt;&lt; <span class="stringliteral">&quot; [options]\n&quot;</span>
<a name="l00219"></a>00219        &lt;&lt; <a class="code" href="main_8cpp.html#a3f35d80d721a8d188637199028676715">programName</a> &lt;&lt; <span class="stringliteral">&quot; will read the input from STDIN and \n&quot;</span>
<a name="l00220"></a>00220        &lt;&lt; <span class="stringliteral">&quot;print the result on STDOUT.\n&quot;</span>
<a name="l00221"></a>00221        &lt;&lt; <span class="stringliteral">&quot;Boolean (b) options are set &#39;on&#39; by +option and &#39;off&#39; by -option\n&quot;</span>
<a name="l00222"></a>00222        &lt;&lt; <span class="stringliteral">&quot;(for instance, +model or -model).\n&quot;</span>
<a name="l00223"></a>00223        &lt;&lt; <span class="stringliteral">&quot;Integer (i), string (s) and vector (v) options \n&quot;</span>
<a name="l00224"></a>00224        &lt;&lt; <span class="stringliteral">&quot;require a parameter, e.g. -width 80\n&quot;</span> 
<a name="l00225"></a>00225        &lt;&lt; <span class="stringliteral">&quot;Also, (v) options can appear multiple times setting &quot;</span>
<a name="l00226"></a>00226        &lt;&lt; <span class="stringliteral">&quot;args on and off,\n&quot;</span>
<a name="l00227"></a>00227        &lt;&lt; <span class="stringliteral">&quot;as in +trace \&quot;enable this\&quot; -trace \&quot;disable that\&quot;.\n&quot;</span>
<a name="l00228"></a>00228        &lt;&lt; <span class="stringliteral">&quot;Option names can be abbreviated to the &quot;</span>
<a name="l00229"></a>00229        &lt;&lt; <span class="stringliteral">&quot;shortest unambiguous prefix.\n\n&quot;</span>
<a name="l00230"></a>00230        &lt;&lt; <span class="stringliteral">&quot;The options are:\n&quot;</span>;
<a name="l00231"></a>00231   vector&lt;string&gt; names;
<a name="l00232"></a>00232   <span class="comment">// Get all the names of options (they all match the empty string)</span>
<a name="l00233"></a>00233   flags.<a class="code" href="classCVC3_1_1CLFlags.html#af2ae348c56b88e203f5eade60946d217">countFlags</a>(<span class="stringliteral">&quot;&quot;</span>, names);
<a name="l00234"></a>00234   <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i=0,iend=names.size(); i!=iend; ++i) {
<a name="l00235"></a>00235     <span class="keyword">const</span> <a class="code" href="classCVC3_1_1CLFlag.html">CLFlag</a>&amp; f(flags[names[i]]);
<a name="l00236"></a>00236     <span class="keywordflow">if</span> (f.<a class="code" href="classCVC3_1_1CLFlag.html#ae86a22aa89529dde24dac8a2bc942798" title="Return true if flag should be displayed in regular help.">display</a>() != followDisplay) <span class="keywordflow">continue</span>;
<a name="l00237"></a>00237     <span class="keywordtype">string</span> tpStr; <span class="comment">// Print type of the option</span>
<a name="l00238"></a>00238     <span class="keywordtype">string</span> pref; <span class="comment">// Print + or - in front of the option</span>
<a name="l00239"></a>00239     <span class="keywordtype">string</span> name(names[i]); <span class="comment">// Print name and optionally the value</span>
<a name="l00240"></a>00240     <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683" title="Different types of command line flags.">CLFlagType</a> tp = f.<a class="code" href="classCVC3_1_1CLFlag.html#a5b69bc92a83154afcb2d05973a0bb6a1" title="Return the type of the flag.">getType</a>();
<a name="l00241"></a>00241     <span class="keywordflow">switch</span>(tp) {
<a name="l00242"></a>00242     <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683a0ba368100918bc8a59c7f5f3951381ce">CLFLAG_NULL</a>: tpStr = <span class="stringliteral">&quot;(null)&quot;</span>; <span class="keywordflow">break</span>;
<a name="l00243"></a>00243     <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683a911f121f0f78d0b13aa7a8facc2a6d02">CLFLAG_BOOL</a>:
<a name="l00244"></a>00244       tpStr = <span class="stringliteral">&quot;(b)&quot;</span>; pref = (f.<a class="code" href="classCVC3_1_1CLFlag.html#a30fda6cd5b164cb30d9849db45d90773">getBool</a>())? <span class="stringliteral">&quot;+&quot;</span> : <span class="stringliteral">&quot;-&quot;</span>;
<a name="l00245"></a>00245       <span class="keywordflow">break</span>;
<a name="l00246"></a>00246     <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683a3a164f9a853c7a4741fcc0bd7f0379ed">CLFLAG_INT</a>:
<a name="l00247"></a>00247       tpStr = <span class="stringliteral">&quot;(i)&quot;</span>; pref = <span class="stringliteral">&quot;-&quot;</span>; name = name+<span class="stringliteral">&quot; &quot;</span>+<a class="code" href="namespaceCVC3.html#af69618103f1f0f2eadada0796a2a940c">int2string</a>(f.<a class="code" href="classCVC3_1_1CLFlag.html#ae78fbec7197ac89368860d4b2c12138e">getInt</a>());
<a name="l00248"></a>00248       <span class="keywordflow">break</span>;
<a name="l00249"></a>00249     <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683aa958b88033c4eabb9902aab89bb81dd7">CLFLAG_STRING</a>:
<a name="l00250"></a>00250       tpStr = <span class="stringliteral">&quot;(s)&quot;</span>; pref = <span class="stringliteral">&quot;-&quot;</span>; name = name+<span class="stringliteral">&quot; &quot;</span>+f.<a class="code" href="classCVC3_1_1CLFlag.html#a7a291448efc533fe859771d2951e30b8">getString</a>();
<a name="l00251"></a>00251       <span class="keywordflow">break</span>;
<a name="l00252"></a>00252     <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683a0ab466a578e52835eafc8531da1eb2ae" title="Vector of pair&lt;string, bool&gt;">CLFLAG_STRVEC</a>:
<a name="l00253"></a>00253       tpStr = <span class="stringliteral">&quot;(v)&quot;</span>; pref = <span class="stringliteral">&quot;-&quot;</span>; name = name;
<a name="l00254"></a>00254       <span class="keywordflow">break</span>;
<a name="l00255"></a>00255     <span class="keywordflow">default</span>:
<a name="l00256"></a>00256       <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(<span class="keyword">false</span>, <span class="stringliteral">&quot;printUsage: unknown flag type&quot;</span>);
<a name="l00257"></a>00257     }
<a name="l00258"></a>00258     cout &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; tpStr &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; pref &lt;&lt; setw(25);
<a name="l00259"></a>00259     cout.setf(<a class="code" href="namespaceMiniSat.html#ad93cb56673487974071ed3b75bf4ea83">ios::left</a>);
<a name="l00260"></a>00260     cout &lt;&lt; name &lt;&lt; <span class="stringliteral">&quot; &quot;</span> &lt;&lt; f.<a class="code" href="classCVC3_1_1CLFlag.html#a7d495ea7fc3c8801595789136a88c795">getHelp</a>() &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;
<a name="l00261"></a>00261   }
<a name="l00262"></a>00262   cout &lt;&lt; <a class="code" href="group__ExprStream__Manip.html#ga05b0ea7353ec24fa8e7e272d7a7875d8" title="Print the end-of-line.">endl</a>;
<a name="l00263"></a>00263 }
<a name="l00264"></a>00264   
<a name="l00265"></a>00265 
<a name="l00266"></a><a class="code" href="main_8cpp.html#a02b40230ee387fc210cfd0c48b891604">00266</a> <span class="keywordtype">void</span> <a class="code" href="main_8cpp.html#a02b40230ee387fc210cfd0c48b891604">parse_args</a>(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> **argv, <a class="code" href="classCVC3_1_1CLFlags.html">CLFlags</a> &amp;flags, <span class="keywordtype">string</span>&amp; fileName) {
<a name="l00267"></a>00267   <span class="comment">/* skip 0&#39;th argument */</span>
<a name="l00268"></a>00268   argv++;
<a name="l00269"></a>00269   argc--;
<a name="l00270"></a>00270   <span class="keywordtype">bool</span> seenFileName(<span class="keyword">false</span>);
<a name="l00271"></a>00271 
<a name="l00272"></a>00272   <span class="keywordflow">for</span>( ; argc &gt; 0; argc--, argv++) {
<a name="l00273"></a>00273     <span class="keywordflow">if</span>((*argv)[0] == <span class="charliteral">&#39;-&#39;</span> || (*argv)[0] == <span class="charliteral">&#39;+&#39;</span>) {
<a name="l00274"></a>00274       <span class="comment">// A command-line option</span>
<a name="l00275"></a>00275       vector&lt;string&gt; names;
<a name="l00276"></a>00276       <span class="keywordtype">bool</span> val = ((*argv)[0] == <span class="charliteral">&#39;+&#39;</span>);
<a name="l00277"></a>00277       <span class="keywordtype">size_t</span> n = flags.<a class="code" href="classCVC3_1_1CLFlags.html#af2ae348c56b88e203f5eade60946d217">countFlags</a>((*argv)+1, names);
<a name="l00278"></a>00278       <span class="keywordflow">if</span>(n == 0)
<a name="l00279"></a>00279   <span class="keywordflow">throw</span> <a class="code" href="classCVC3_1_1CLException.html">CLException</a>(<span class="keywordtype">string</span>(*argv) + <span class="stringliteral">&quot; does not match any known option&quot;</span>);
<a name="l00280"></a>00280       <span class="keywordflow">else</span> <span class="keywordflow">if</span>(n &gt; 1) {
<a name="l00281"></a>00281   ostringstream ss;
<a name="l00282"></a>00282   ss &lt;&lt; *argv &lt;&lt; <span class="stringliteral">&quot; is ambiguous.  Possible matches are:\n&quot;</span>;
<a name="l00283"></a>00283   <span class="keywordflow">for</span>(<span class="keywordtype">size_t</span> i=0,iend=names.size(); i!=iend; ++i) {
<a name="l00284"></a>00284     ss &lt;&lt; <span class="stringliteral">&quot;  &quot;</span> &lt;&lt; names[i] &lt;&lt; <span class="stringliteral">&quot;\n&quot;</span>;
<a name="l00285"></a>00285   }
<a name="l00286"></a>00286   <span class="keywordflow">throw</span> <a class="code" href="classCVC3_1_1CLException.html">CLException</a>(ss.str());
<a name="l00287"></a>00287       } <span class="keywordflow">else</span> {
<a name="l00288"></a>00288   <span class="keywordtype">string</span> name = names[0];
<a name="l00289"></a>00289         <span class="keywordflow">if</span>(name == <span class="stringliteral">&quot;no-save-model&quot;</span>) {
<a name="l00290"></a>00290           flags.<a class="code" href="classCVC3_1_1CLFlags.html#a20dee56b9b946d73421253eb99e434e3">setFlag</a>(<span class="stringliteral">&quot;internal::userSetNoSaveModel&quot;</span>, <span class="keyword">true</span>);
<a name="l00291"></a>00291         }
<a name="l00292"></a>00292   <span class="comment">// Single match; process the option</span>
<a name="l00293"></a>00293   <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683" title="Different types of command line flags.">CLFlagType</a> tp = flags[name].getType();
<a name="l00294"></a>00294   <span class="keywordflow">switch</span>(tp) {
<a name="l00295"></a>00295   <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683a911f121f0f78d0b13aa7a8facc2a6d02">CLFLAG_BOOL</a>: flags.<a class="code" href="classCVC3_1_1CLFlags.html#a20dee56b9b946d73421253eb99e434e3">setFlag</a>(name, val); <span class="keywordflow">break</span>;
<a name="l00296"></a>00296   <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683a3a164f9a853c7a4741fcc0bd7f0379ed">CLFLAG_INT</a>:
<a name="l00297"></a>00297     argc--;
<a name="l00298"></a>00298     <span class="keywordflow">if</span>(argc &lt;= 0)
<a name="l00299"></a>00299       <span class="keywordflow">throw</span> <a class="code" href="classCVC3_1_1CLException.html">CLException</a>(<span class="keywordtype">string</span>(*argv)+<span class="stringliteral">&quot; (-&quot;</span>+name
<a name="l00300"></a>00300             +<span class="stringliteral">&quot;) expects an integer argument.&quot;</span>);
<a name="l00301"></a>00301     argv++;
<a name="l00302"></a>00302     <span class="comment">// FIXME: test for *argv being an integer string</span>
<a name="l00303"></a>00303     flags.<a class="code" href="classCVC3_1_1CLFlags.html#a20dee56b9b946d73421253eb99e434e3">setFlag</a>(name, atoi(*argv));
<a name="l00304"></a>00304     <span class="keywordflow">break</span>;
<a name="l00305"></a>00305   <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683aa958b88033c4eabb9902aab89bb81dd7">CLFLAG_STRING</a>:
<a name="l00306"></a>00306     argc--;
<a name="l00307"></a>00307     <span class="keywordflow">if</span>(argc &lt;= 0)
<a name="l00308"></a>00308       <span class="keywordflow">throw</span> <a class="code" href="classCVC3_1_1CLException.html">CLException</a>(<span class="keywordtype">string</span>(*argv)+<span class="stringliteral">&quot; (-&quot;</span>+name
<a name="l00309"></a>00309             +<span class="stringliteral">&quot;) expects a string argument.&quot;</span>);
<a name="l00310"></a>00310     argv++;
<a name="l00311"></a>00311     flags.<a class="code" href="classCVC3_1_1CLFlags.html#a20dee56b9b946d73421253eb99e434e3">setFlag</a>(name, *argv);
<a name="l00312"></a>00312     <span class="keywordflow">break</span>;
<a name="l00313"></a>00313   <span class="keywordflow">case</span> <a class="code" href="namespaceCVC3.html#ad8e707d3b90ce7dcd048a5b651e0a683a0ab466a578e52835eafc8531da1eb2ae" title="Vector of pair&lt;string, bool&gt;">CLFLAG_STRVEC</a>:
<a name="l00314"></a>00314     argc--;
<a name="l00315"></a>00315     <span class="keywordflow">if</span>(argc &lt;= 0)
<a name="l00316"></a>00316       <span class="keywordflow">throw</span> <a class="code" href="classCVC3_1_1CLException.html">CLException</a>(<span class="keywordtype">string</span>(*argv)+<span class="stringliteral">&quot; (-&quot;</span>+name
<a name="l00317"></a>00317             +<span class="stringliteral">&quot;) expects a string argument.&quot;</span>);
<a name="l00318"></a>00318     argv++;
<a name="l00319"></a>00319     flags.<a class="code" href="classCVC3_1_1CLFlags.html#a20dee56b9b946d73421253eb99e434e3">setFlag</a>(name, pair&lt;string,bool&gt;(*argv,val));
<a name="l00320"></a>00320     <span class="keywordflow">break</span>;
<a name="l00321"></a>00321   <span class="keywordflow">default</span>:
<a name="l00322"></a>00322     <a class="code" href="debug_8h.html#a40dac3bdb2166ffc852ee8b1489d2b56">DebugAssert</a>(<span class="keyword">false</span>, <span class="stringliteral">&quot;parse_args: Bad flag type: &quot;</span>+<a class="code" href="namespaceCVC3.html#af69618103f1f0f2eadada0796a2a940c">int2string</a>(tp));
<a name="l00323"></a>00323   }
<a name="l00324"></a>00324       }
<a name="l00325"></a>00325     } <span class="keywordflow">else</span> <span class="keywordflow">if</span>(seenFileName) {
<a name="l00326"></a>00326       <span class="keywordflow">throw</span> <a class="code" href="classCVC3_1_1CLException.html">CLException</a>(<span class="stringliteral">&quot;More than one file name given: &quot;</span>+fileName
<a name="l00327"></a>00327       +<span class="stringliteral">&quot; and &quot;</span>+<span class="keywordtype">string</span>(*argv));
<a name="l00328"></a>00328     } <span class="keywordflow">else</span> {
<a name="l00329"></a>00329       fileName = string(*argv);
<a name="l00330"></a>00330       seenFileName = <span class="keyword">true</span>;
<a name="l00331"></a>00331     }
<a name="l00332"></a>00332   }
<a name="l00333"></a>00333 }
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Sep 7 2011 for CVC3 by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>