nanotrav/main.c File Reference

Main program for the nanotrav program. More...

#include "cuddInt.h"
#include "ntr.h"
Include dependency graph for main.c:

Defines

#define NTR_VERSION   "Nanotrav Version #0.13, Release date 2015/7/15"
#define BUFLENGTH   8192

Functions

int main (int argc, char **argv)
 Main program for ntr.
static NtrOptionsmainInit ()
 Allocates the option structure and initializes it.
static void ntrReadOptions (int argc, char **argv, NtrOptions *option)
 Reads the command line options.
static void ntrReadOptionsFile (char *name, char ***argv, int *argc)
 Reads the program options from a file.
static char * readLine (FILE *fp)
 Reads a line from the option file.
static FILE * open_file (char *filename, const char *mode)
 Opens a file.
static int reorder (BnetNetwork *net, DdManager *dd, NtrOptions *option)
 Explicitly applies reordering to the DDs.
static void freeOption (NtrOptions *option)
 Frees the option structure and its appendages.
static DdManagerstartCudd (NtrOptions *option, int nvars)
 Starts the CUDD manager with the desired options.
static int ntrReadTree (DdManager *dd, char *treefile, int nvars)
 Reads the variable group tree from a file.

Variables

static char buffer [8192]

Detailed Description

Main program for the nanotrav program.

Author:
Fabio Somenzi

Copyright (c) 1995-2015, Regents of the University of Colorado

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the University of Colorado nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


Function Documentation

static void freeOption ( NtrOptions option  )  [static]

Frees the option structure and its appendages.

Side effects
None
int main ( int  argc,
char **  argv 
)

Main program for ntr.

Performs initialization. Reads command line options and network(s). Builds BDDs with reordering, and optionally does reachability analysis. Prints stats.

Side effects
None
static NtrOptions* mainInit (  )  [static]

Allocates the option structure and initializes it.

Side effects
none
See also:
ntrReadOptions
static void ntrReadOptions ( int  argc,
char **  argv,
NtrOptions option 
) [static]

Reads the command line options.

Scans the command line one argument at a time and performs a switch on each arguement it hits. Some arguemnts also read in the following arg from the list (i.e., -f also gets the filename which should folow.) Gives a usage message and exits if any unrecognized args are found.

Side effects
May initialize the random number generator.
See also:
mainInit ntrReadOptionsFile
static void ntrReadOptionsFile ( char *  name,
char ***  argv,
int *  argc 
) [static]

Reads the program options from a file.

Opens file. Reads the command line from the otpions file using the read_line func. Scans the line looking for spaces, each space is a searator and demarks a new option. When a space is found, it is changed to a to terminate that string; then the next value of slot points to the next non-space character. There is a limit of 1024 options. Should produce an error (presently doesn't) on overrun of options, but this is very unlikely to happen.

Side effects
none
static int ntrReadTree ( DdManager dd,
char *  treefile,
int  nvars 
) [static]

Reads the variable group tree from a file.

Returns:
1 if successful; 0 otherwise.
Side effects
None
static FILE* open_file ( char *  filename,
const char *  mode 
) [static]

Opens a file.

Opens a file, or fails with an error message and exits. Allows '-' as a synonym for standard input.

Side effects
None
static char* readLine ( FILE *  fp  )  [static]

Reads a line from the option file.

Side effects
none
static int reorder ( BnetNetwork net,
DdManager dd,
NtrOptions option 
) [static]

Explicitly applies reordering to the DDs.

Returns:
1 if successful; 0 otherwise.
Side effects
None
static DdManager* startCudd ( NtrOptions option,
int  nvars 
) [static]

Starts the CUDD manager with the desired options.

Starts with 0 variables, because Ntr_buildDDs will create new variables rather than using whatever already exists.

Side effects
None
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 31 Dec 2015 for cudd by  doxygen 1.6.1