diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -4,11 +4,12 @@
         installExecutableFile, copyFileVerbose, createDirectoryIfMissingVerbose)
 import Distribution.Simple.LocalBuildInfo (
         LocalBuildInfo(..), InstallDirs(..), absoluteInstallDirs)
-import Distribution.PackageDescription (PackageDescription(..),
+import Distribution.PackageDescription (PackageDescription(..), GenericPackageDescription(..),
         HookedBuildInfo(..), BuildInfo(..), emptyBuildInfo,
         updatePackageDescription, FlagAssignment(..), FlagName(..))
 import Distribution.Verbosity (verbose, Verbosity(..))
 import Distribution.System (OS(..), Arch(..), Platform (..), buildOS, buildPlatform)
+import Data.Version( Version, showVersion )
 import System.Directory
 import System.FilePath
 import System.Environment( getEnvironment )
@@ -22,8 +23,8 @@
 -- to handle the ABC source tree.  We do this by editing, at runtime, the
 -- cabal package description to include the ABC sources files to `extra-source-files`
 -- (so `cabal sdist` works as expected), and to add the ABC source tree directories
--- to `include-dirs`.  This is done by reading the files `scripts/abc-sources.txt`
--- and `scripts/abc-incl-dirs.txt`, which are set up by `scripts/setup-abc.sh`.
+-- to `include-dirs`.  This is done by reading the files `abc-build/abc-sources.txt`
+-- and `abc-build/abc-incl-dirs.txt`, which are set up by `scripts/setup-abc.sh`.
 --
 -- Finally, we must also include some information about where do find the libabc.a
 -- and libabc.dll files.
@@ -33,22 +34,26 @@
 -- "in flight" inside each of the various hooks.
 
 main = defaultMainWithHooks simpleUserHooks
-    { preConf  = \a f -> let v = fromFlag $ configVerbosity f
-                             fs = configConfigurationsFlags f
-                          in setupAbc v >> buildAbc v fs >> preConf simpleUserHooks a f
+    { postConf = \a f pkg_desc lbi -> do
+                    pkg_desc' <- abcPkgDesc pkg_desc
+                    postConf simpleUserHooks a f pkg_desc' lbi
 
-    , preSDist = \a f -> let v = fromFlag $ sDistVerbosity f
-                          in setupAbc v >> preSDist simpleUserHooks a f
+    ,  confHook = \(gpkg_desc, hbi) f -> do
+                    let v = fromFlag $ configVerbosity f
+                    let fs = configConfigurationsFlags f
+                    setupAbc v (packageDescription gpkg_desc)
+                    buildAbc v fs
+                    confHook simpleUserHooks (gpkg_desc, hbi) f
 
-    , postConf = \a f pkg_desc lbi -> do
+    , sDistHook = \pkg_desc lbi h f -> do
+                    let v = fromFlag $ sDistVerbosity f
+                    setupAbc v pkg_desc
                     pkg_desc' <- abcPkgDesc pkg_desc
-                    postConf simpleUserHooks a f pkg_desc' lbi
+                    sDistHook simpleUserHooks pkg_desc' lbi h f
+
     , buildHook = \pkg_desc lbi h f -> do
                     pkg_desc' <- abcPkgDesc pkg_desc
                     buildHook simpleUserHooks pkg_desc' lbi h f
-    , sDistHook = \pkg_desc lbi h f -> do
-                    pkg_desc' <- abcPkgDesc pkg_desc
-                    sDistHook simpleUserHooks pkg_desc' lbi h f
     , haddockHook = \pkg_desc lbi h f -> do
                     pkg_desc' <- abcPkgDesc pkg_desc
                     haddockHook simpleUserHooks pkg_desc' lbi h f
@@ -83,8 +88,8 @@
 abcPkgDesc :: PackageDescription -> IO PackageDescription
 abcPkgDesc pkg_desc = do
   cwd <- getCurrentDirectory
-  abcSrcFiles <- fmap lines $ readFile "scripts/abc-sources.txt"
-  abcInclDirs <- fmap lines $ readFile "scripts/abc-incl-dirs.txt"
+  abcSrcFiles <- fmap lines $ readFile $ "abc-build" </> "abc-sources.txt"
+  abcInclDirs <- fmap lines $ readFile $ "abc-build" </> "abc-incl-dirs.txt"
   let pg' = updatePackageDescription (libDirAbc cwd abcInclDirs) pkg_desc
   return pg'{ extraSrcFiles = extraSrcFiles pg' ++ abcSrcFiles 
             }
@@ -102,12 +107,14 @@
                   _                  -> return ()
 
 -- If necessary, fetch the ABC sources and prepare for building
-setupAbc :: Verbosity -> IO ()
-setupAbc verbosity = do
+setupAbc :: Verbosity -> PackageDescription -> IO ()
+setupAbc verbosity pkg_desc = do
+    let version = pkgVersion $ package $ pkg_desc
+    let packageVersion = "PACKAGE_VERSION"
     env <- getEnvironment
     rawSystemExitWithEnv verbosity "sh"
-        ("scripts/setup-abc.sh" : (tail . words . show $ buildPlatform))
-        env
+        ( ("scripts" </> "setup-abc.sh") : (tail . words . show $ buildPlatform))
+        ([(packageVersion, showVersion version)] ++ filter ((/=packageVersion) . fst) env)
 
 -- Build the ABC library and put the files in the expected places
 buildAbc :: Verbosity -> FlagAssignment -> IO ()
@@ -115,11 +122,11 @@
     let pthreads = maybe "0" (\x -> if x then "1" else "0") $ lookup (FlagName "enable-pthreads") fs
     env <- getEnvironment
     rawSystemExitWithEnv verbosity "sh"
-        ("scripts/build-abc.sh" : (tail . words . show $ buildPlatform))
+        (("scripts"</>"build-abc.sh") : (tail . words . show $ buildPlatform))
         ([("PTHREADS",pthreads)] ++ filter ((/="PTHREADS") . fst) env)
     createDirectoryIfMissingVerbose verbosity True static_dir
-    copyFileVerbose verbosity "abc-build/libabc.a" (static_dir</>"libabc.a")
-    onWindows $ copyFileVerbose verbosity "abc-build/libabc.dll" (static_dir</>"abc.dll")
+    copyFileVerbose verbosity ("abc-build"</>"libabc.a") (static_dir</>"libabc.a")
+    onWindows $ copyFileVerbose verbosity ("abc-build"</>"libabc.dll") (static_dir</>"abc.dll")
 
 -- Make sure the ABC libraries are installed in the appropriate places
 postInstAbc :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO ()
diff --git a/abc-build/.hg_archival.txt b/abc-build/.hg_archival.txt
--- a/abc-build/.hg_archival.txt
+++ b/abc-build/.hg_archival.txt
@@ -1,5 +1,5 @@
 repo: 27f68cec826fd69da083a19ad1384a074eb56f73
-node: 87fc2c2ca39f02ddd3bd204aba4cad4ea201c9e5
+node: 0fd8533faa9695adbd48b259263c1f9446a60093
 branch: galois-abcBridge
 latesttag: null
-latesttagdistance: 2427
+latesttagdistance: 2470
diff --git a/abc-build/.hgignore b/abc-build/.hgignore
deleted file mode 100644
--- a/abc-build/.hgignore
+++ /dev/null
@@ -1,58 +0,0 @@
-syntax:glob
-
-DebugLib/
-DebugExe/
-DebugExt/
-
-ReleaseLib/
-ReleaseExe/
-ReleaseExt/
-
-_TEST/
-lib/abc*
-lib/m114*
-lib/bip*
-docs/
-
-src/ext/
-src/xxx/
-src/aig/au/
-src/aig/ssm/
-src/aig/ddb/
-
-src/base/abc2/
-src/base/abc2d/
-
-*~
-*.orig
-
-*.[od]
-
-*.ncb
-*.opt
-*.plg
-
-*.zip
-
-abcspaceext.dsw
-abcext.dsp
-
-abcexe.vcproj*
-abclib.vcproj*
-abcspace.sln
-abcspace.suo
-
-*.pyc
-
-src/python/build
-src/python/bdist
-src/python/pyabc.py
-src/python/pyabc_wrap.*
-
-syntax: regexp
-
-^libabc.a$
-^abc$
-
-^arch_flags$
-
diff --git a/abc-build/Makefile b/abc-build/Makefile
--- a/abc-build/Makefile
+++ b/abc-build/Makefile
@@ -14,7 +14,7 @@
 MODULES := \
 	$(wildcard src/ext) src/misc/ext \
 	src/base/abc src/base/abci src/base/cmd src/base/io \
-	src/base/main src/base/ver src/base/test \
+	src/base/main src/base/ver src/base/wlc src/base/test \
 	src/bdd/cudd src/bdd/dsd src/bdd/epd src/bdd/mtr src/bdd/parse \
 	src/bdd/reo src/bdd/cas \
 	src/map/mapper src/map/mio src/map/super src/map/if \
diff --git a/abc-build/abc-incl-dirs.txt b/abc-build/abc-incl-dirs.txt
new file mode 100644
--- /dev/null
+++ b/abc-build/abc-incl-dirs.txt
@@ -0,0 +1,104 @@
+abc-build/src
+abc-build/src/aig
+abc-build/src/aig/aig
+abc-build/src/aig/gia
+abc-build/src/aig/hop
+abc-build/src/aig/ioa
+abc-build/src/aig/ivy
+abc-build/src/aig/miniaig
+abc-build/src/aig/saig
+abc-build/src/base
+abc-build/src/base/abc
+abc-build/src/base/abci
+abc-build/src/base/cmd
+abc-build/src/base/io
+abc-build/src/base/main
+abc-build/src/base/test
+abc-build/src/base/ver
+abc-build/src/base/wlc
+abc-build/src/bdd
+abc-build/src/bdd/cas
+abc-build/src/bdd/cudd
+abc-build/src/bdd/dsd
+abc-build/src/bdd/epd
+abc-build/src/bdd/mtr
+abc-build/src/bdd/parse
+abc-build/src/bdd/reo
+abc-build/src/bool
+abc-build/src/bool/bdc
+abc-build/src/bool/dec
+abc-build/src/bool/deco
+abc-build/src/bool/kit
+abc-build/src/bool/lucky
+abc-build/src/bool/rpo
+abc-build/src/bool/rsb
+abc-build/src/map
+abc-build/src/map/amap
+abc-build/src/map/cov
+abc-build/src/map/fpga
+abc-build/src/map/if
+abc-build/src/map/mapper
+abc-build/src/map/mio
+abc-build/src/map/mpm
+abc-build/src/map/scl
+abc-build/src/map/super
+abc-build/src/misc
+abc-build/src/misc/avl
+abc-build/src/misc/bar
+abc-build/src/misc/bbl
+abc-build/src/misc/bzlib
+abc-build/src/misc/espresso
+abc-build/src/misc/ext
+abc-build/src/misc/extra
+abc-build/src/misc/hash
+abc-build/src/misc/mem
+abc-build/src/misc/mvc
+abc-build/src/misc/nm
+abc-build/src/misc/st
+abc-build/src/misc/tim
+abc-build/src/misc/util
+abc-build/src/misc/vec
+abc-build/src/misc/zlib
+abc-build/src/opt
+abc-build/src/opt/cgt
+abc-build/src/opt/csw
+abc-build/src/opt/cut
+abc-build/src/opt/dar
+abc-build/src/opt/dau
+abc-build/src/opt/fsim
+abc-build/src/opt/fxu
+abc-build/src/opt/lpk
+abc-build/src/opt/mfs
+abc-build/src/opt/nwk
+abc-build/src/opt/res
+abc-build/src/opt/ret
+abc-build/src/opt/rwr
+abc-build/src/opt/rwt
+abc-build/src/opt/sfm
+abc-build/src/opt/sim
+abc-build/src/phys
+abc-build/src/phys/place
+abc-build/src/proof
+abc-build/src/proof/abs
+abc-build/src/proof/bbr
+abc-build/src/proof/cec
+abc-build/src/proof/dch
+abc-build/src/proof/fra
+abc-build/src/proof/fraig
+abc-build/src/proof/int
+abc-build/src/proof/int2
+abc-build/src/proof/live
+abc-build/src/proof/llb
+abc-build/src/proof/pdr
+abc-build/src/proof/ssc
+abc-build/src/proof/ssw
+abc-build/src/python
+abc-build/src/sat
+abc-build/src/sat/bmc
+abc-build/src/sat/bsat
+abc-build/src/sat/cnf
+abc-build/src/sat/csat
+abc-build/src/sat/lsat
+abc-build/src/sat/msat
+abc-build/src/sat/proof
+abc-build/src/sat/psat
diff --git a/abc-build/abc-sources.txt b/abc-build/abc-sources.txt
new file mode 100644
--- /dev/null
+++ b/abc-build/abc-sources.txt
@@ -0,0 +1,1447 @@
+abc-build/.hg_archival.txt
+abc-build/abc-incl-dirs.txt
+abc-build/abc-sources.txt
+abc-build/abc.rc
+abc-build/abcexe.dsp
+abc-build/abclib.dsp
+abc-build/abcspace.dsw
+abc-build/arch_flags.c
+abc-build/copyright.txt
+abc-build/depends.sh
+abc-build/galois-abcBridge.version
+abc-build/i10.aig
+abc-build/lib/pthread.h
+abc-build/lib/sched.h
+abc-build/lib/semaphore.h
+abc-build/Makefile
+abc-build/readme.md
+abc-build/readmeaig
+abc-build/scripts/abc.rc
+abc-build/scripts/abc_common.py
+abc-build/scripts/main.py
+abc-build/scripts/multi_prove.sh
+abc-build/scripts/new_abc_commands.py
+abc-build/scripts/niklas.py
+abc-build/scripts/par.py
+abc-build/scripts/simple.sh
+abc-build/scripts/simple_bip.sh
+abc-build/scripts/simple_liveness.sh
+abc-build/scripts/simple_sat.sh
+abc-build/scripts/super_prove.sh
+abc-build/src/aig/aig/aig.h
+abc-build/src/aig/aig/aig_.c
+abc-build/src/aig/aig/aigCanon.c
+abc-build/src/aig/aig/aigCheck.c
+abc-build/src/aig/aig/aigCuts.c
+abc-build/src/aig/aig/aigDfs.c
+abc-build/src/aig/aig/aigDoms.c
+abc-build/src/aig/aig/aigDup.c
+abc-build/src/aig/aig/aigFact.c
+abc-build/src/aig/aig/aigFanout.c
+abc-build/src/aig/aig/aigFrames.c
+abc-build/src/aig/aig/aigInter.c
+abc-build/src/aig/aig/aigJust.c
+abc-build/src/aig/aig/aigMan.c
+abc-build/src/aig/aig/aigMem.c
+abc-build/src/aig/aig/aigMffc.c
+abc-build/src/aig/aig/aigObj.c
+abc-build/src/aig/aig/aigOper.c
+abc-build/src/aig/aig/aigOrder.c
+abc-build/src/aig/aig/aigPack.c
+abc-build/src/aig/aig/aigPart.c
+abc-build/src/aig/aig/aigPartReg.c
+abc-build/src/aig/aig/aigPartSat.c
+abc-build/src/aig/aig/aigRepar.c
+abc-build/src/aig/aig/aigRepr.c
+abc-build/src/aig/aig/aigRet.c
+abc-build/src/aig/aig/aigRetF.c
+abc-build/src/aig/aig/aigScl.c
+abc-build/src/aig/aig/aigShow.c
+abc-build/src/aig/aig/aigSplit.c
+abc-build/src/aig/aig/aigTable.c
+abc-build/src/aig/aig/aigTest.c
+abc-build/src/aig/aig/aigTiming.c
+abc-build/src/aig/aig/aigTruth.c
+abc-build/src/aig/aig/aigTsim.c
+abc-build/src/aig/aig/aigUtil.c
+abc-build/src/aig/aig/aigWin.c
+abc-build/src/aig/aig/module.make
+abc-build/src/aig/gia/gia.c
+abc-build/src/aig/gia/gia.h
+abc-build/src/aig/gia/giaAgi.c
+abc-build/src/aig/gia/giaAig.c
+abc-build/src/aig/gia/giaAig.h
+abc-build/src/aig/gia/giaAiger.c
+abc-build/src/aig/gia/giaAigerExt.c
+abc-build/src/aig/gia/giaBalAig.c
+abc-build/src/aig/gia/giaBalLut.c
+abc-build/src/aig/gia/giaBalMap.c
+abc-build/src/aig/gia/giaBidec.c
+abc-build/src/aig/gia/giaCCof.c
+abc-build/src/aig/gia/giaCex.c
+abc-build/src/aig/gia/giaClp.c
+abc-build/src/aig/gia/giaCof.c
+abc-build/src/aig/gia/giaCone.c
+abc-build/src/aig/gia/giaConstr.c
+abc-build/src/aig/gia/giaCSat.c
+abc-build/src/aig/gia/giaCSatOld.c
+abc-build/src/aig/gia/giaCTas.c
+abc-build/src/aig/gia/giaCTas2.c
+abc-build/src/aig/gia/giaDfs.c
+abc-build/src/aig/gia/giaDup.c
+abc-build/src/aig/gia/giaEmbed.c
+abc-build/src/aig/gia/giaEnable.c
+abc-build/src/aig/gia/giaEquiv.c
+abc-build/src/aig/gia/giaEra.c
+abc-build/src/aig/gia/giaEra2.c
+abc-build/src/aig/gia/giaFalse.c
+abc-build/src/aig/gia/giaFanout.c
+abc-build/src/aig/gia/giaForce.c
+abc-build/src/aig/gia/giaFrames.c
+abc-build/src/aig/gia/giaFront.c
+abc-build/src/aig/gia/giaFx.c
+abc-build/src/aig/gia/giaGiarf.c
+abc-build/src/aig/gia/giaGig.c
+abc-build/src/aig/gia/giaGlitch.c
+abc-build/src/aig/gia/giaHash.c
+abc-build/src/aig/gia/giaHcd.c
+abc-build/src/aig/gia/giaIf.c
+abc-build/src/aig/gia/giaIff.c
+abc-build/src/aig/gia/giaIso.c
+abc-build/src/aig/gia/giaIso2.c
+abc-build/src/aig/gia/giaIso3.c
+abc-build/src/aig/gia/giaJf.c
+abc-build/src/aig/gia/giaKf.c
+abc-build/src/aig/gia/giaLf.c
+abc-build/src/aig/gia/giaMan.c
+abc-build/src/aig/gia/giaMem.c
+abc-build/src/aig/gia/giaMf.c
+abc-build/src/aig/gia/giaMffc.c
+abc-build/src/aig/gia/giaMfs.c
+abc-build/src/aig/gia/giaMini.c
+abc-build/src/aig/gia/giaMuxes.c
+abc-build/src/aig/gia/giaNf.c
+abc-build/src/aig/gia/giaPat.c
+abc-build/src/aig/gia/giaProp.c
+abc-build/src/aig/gia/giaResub.c
+abc-build/src/aig/gia/giaRetime.c
+abc-build/src/aig/gia/giaSat.c
+abc-build/src/aig/gia/giaScl.c
+abc-build/src/aig/gia/giaScript.c
+abc-build/src/aig/gia/giaShrink.c
+abc-build/src/aig/gia/giaShrink6.c
+abc-build/src/aig/gia/giaShrink7.c
+abc-build/src/aig/gia/giaSim.c
+abc-build/src/aig/gia/giaSim2.c
+abc-build/src/aig/gia/giaSort.c
+abc-build/src/aig/gia/giaSpeedup.c
+abc-build/src/aig/gia/giaStg.c
+abc-build/src/aig/gia/giaStr.c
+abc-build/src/aig/gia/giaSupMin.c
+abc-build/src/aig/gia/giaSweep.c
+abc-build/src/aig/gia/giaSweeper.c
+abc-build/src/aig/gia/giaSwitch.c
+abc-build/src/aig/gia/giaTim.c
+abc-build/src/aig/gia/giaTis.c
+abc-build/src/aig/gia/giaTruth.c
+abc-build/src/aig/gia/giaTsim.c
+abc-build/src/aig/gia/giaUtil.c
+abc-build/src/aig/gia/module.make
+abc-build/src/aig/hop/cudd2.c
+abc-build/src/aig/hop/cudd2.h
+abc-build/src/aig/hop/hop.h
+abc-build/src/aig/hop/hop_.c
+abc-build/src/aig/hop/hopBalance.c
+abc-build/src/aig/hop/hopCheck.c
+abc-build/src/aig/hop/hopDfs.c
+abc-build/src/aig/hop/hopMan.c
+abc-build/src/aig/hop/hopMem.c
+abc-build/src/aig/hop/hopObj.c
+abc-build/src/aig/hop/hopOper.c
+abc-build/src/aig/hop/hopTable.c
+abc-build/src/aig/hop/hopTruth.c
+abc-build/src/aig/hop/hopUtil.c
+abc-build/src/aig/hop/module.make
+abc-build/src/aig/ioa/ioa.h
+abc-build/src/aig/ioa/ioaReadAig.c
+abc-build/src/aig/ioa/ioaUtil.c
+abc-build/src/aig/ioa/ioaWriteAig.c
+abc-build/src/aig/ioa/module.make
+abc-build/src/aig/ivy/attr.h
+abc-build/src/aig/ivy/ivy.h
+abc-build/src/aig/ivy/ivy_.c
+abc-build/src/aig/ivy/ivyBalance.c
+abc-build/src/aig/ivy/ivyCanon.c
+abc-build/src/aig/ivy/ivyCheck.c
+abc-build/src/aig/ivy/ivyCut.c
+abc-build/src/aig/ivy/ivyCutTrav.c
+abc-build/src/aig/ivy/ivyDfs.c
+abc-build/src/aig/ivy/ivyDsd.c
+abc-build/src/aig/ivy/ivyFanout.c
+abc-build/src/aig/ivy/ivyFastMap.c
+abc-build/src/aig/ivy/ivyFraig.c
+abc-build/src/aig/ivy/ivyHaig.c
+abc-build/src/aig/ivy/ivyMan.c
+abc-build/src/aig/ivy/ivyMem.c
+abc-build/src/aig/ivy/ivyMulti.c
+abc-build/src/aig/ivy/ivyMulti8.c
+abc-build/src/aig/ivy/ivyObj.c
+abc-build/src/aig/ivy/ivyOper.c
+abc-build/src/aig/ivy/ivyResyn.c
+abc-build/src/aig/ivy/ivyRwr.c
+abc-build/src/aig/ivy/ivyRwrAlg.c
+abc-build/src/aig/ivy/ivySeq.c
+abc-build/src/aig/ivy/ivyShow.c
+abc-build/src/aig/ivy/ivyTable.c
+abc-build/src/aig/ivy/ivyUtil.c
+abc-build/src/aig/ivy/module.make
+abc-build/src/aig/miniaig/abcapis.h
+abc-build/src/aig/miniaig/miniaig.h
+abc-build/src/aig/miniaig/module.make
+abc-build/src/aig/saig/module.make
+abc-build/src/aig/saig/saig.h
+abc-build/src/aig/saig/saig_.c
+abc-build/src/aig/saig/saigCone.c
+abc-build/src/aig/saig/saigConstr.c
+abc-build/src/aig/saig/saigConstr2.c
+abc-build/src/aig/saig/saigDual.c
+abc-build/src/aig/saig/saigDup.c
+abc-build/src/aig/saig/saigGlaCba.c
+abc-build/src/aig/saig/saigGlaPba.c
+abc-build/src/aig/saig/saigGlaPba2.c
+abc-build/src/aig/saig/saigInd.c
+abc-build/src/aig/saig/saigIoa.c
+abc-build/src/aig/saig/saigIso.c
+abc-build/src/aig/saig/saigIsoFast.c
+abc-build/src/aig/saig/saigIsoSlow.c
+abc-build/src/aig/saig/saigMiter.c
+abc-build/src/aig/saig/saigOutDec.c
+abc-build/src/aig/saig/saigPhase.c
+abc-build/src/aig/saig/saigRefSat.c
+abc-build/src/aig/saig/saigRetFwd.c
+abc-build/src/aig/saig/saigRetMin.c
+abc-build/src/aig/saig/saigRetStep.c
+abc-build/src/aig/saig/saigScl.c
+abc-build/src/aig/saig/saigSimFast.c
+abc-build/src/aig/saig/saigSimMv.c
+abc-build/src/aig/saig/saigSimSeq.c
+abc-build/src/aig/saig/saigStrSim.c
+abc-build/src/aig/saig/saigSwitch.c
+abc-build/src/aig/saig/saigSynch.c
+abc-build/src/aig/saig/saigTempor.c
+abc-build/src/aig/saig/saigTrans.c
+abc-build/src/aig/saig/saigUnfold2.c
+abc-build/src/aig/saig/saigWnd.c
+abc-build/src/base/abc/abc.h
+abc-build/src/base/abc/abc_.c
+abc-build/src/base/abc/abcAig.c
+abc-build/src/base/abc/abcBarBuf.c
+abc-build/src/base/abc/abcBlifMv.c
+abc-build/src/base/abc/abcCheck.c
+abc-build/src/base/abc/abcDfs.c
+abc-build/src/base/abc/abcFanio.c
+abc-build/src/base/abc/abcFanOrder.c
+abc-build/src/base/abc/abcFunc.c
+abc-build/src/base/abc/abcHie.c
+abc-build/src/base/abc/abcHieCec.c
+abc-build/src/base/abc/abcHieNew.c
+abc-build/src/base/abc/abcInt.h
+abc-build/src/base/abc/abcLatch.c
+abc-build/src/base/abc/abcLib.c
+abc-build/src/base/abc/abcMinBase.c
+abc-build/src/base/abc/abcNames.c
+abc-build/src/base/abc/abcNetlist.c
+abc-build/src/base/abc/abcNtk.c
+abc-build/src/base/abc/abcObj.c
+abc-build/src/base/abc/abcRefs.c
+abc-build/src/base/abc/abcShow.c
+abc-build/src/base/abc/abcSop.c
+abc-build/src/base/abc/abcUtil.c
+abc-build/src/base/abc/module.make
+abc-build/src/base/abci/abc.c
+abc-build/src/base/abci/abcAttach.c
+abc-build/src/base/abci/abcAuto.c
+abc-build/src/base/abci/abcBalance.c
+abc-build/src/base/abci/abcBidec.c
+abc-build/src/base/abci/abcBm.c
+abc-build/src/base/abci/abcBmc.c
+abc-build/src/base/abci/abcCas.c
+abc-build/src/base/abci/abcCascade.c
+abc-build/src/base/abci/abcCollapse.c
+abc-build/src/base/abci/abcCut.c
+abc-build/src/base/abci/abcDar.c
+abc-build/src/base/abci/abcDarUnfold2.c
+abc-build/src/base/abci/abcDebug.c
+abc-build/src/base/abci/abcDec.c
+abc-build/src/base/abci/abcDress.c
+abc-build/src/base/abci/abcDress2.c
+abc-build/src/base/abci/abcDsd.c
+abc-build/src/base/abci/abcEspresso.c
+abc-build/src/base/abci/abcExtract.c
+abc-build/src/base/abci/abcFlop.c
+abc-build/src/base/abci/abcFpga.c
+abc-build/src/base/abci/abcFpgaFast.c
+abc-build/src/base/abci/abcFraig.c
+abc-build/src/base/abci/abcFx.c
+abc-build/src/base/abci/abcFxu.c
+abc-build/src/base/abci/abcGen.c
+abc-build/src/base/abci/abcHaig.c
+abc-build/src/base/abci/abcIf.c
+abc-build/src/base/abci/abcIfif.c
+abc-build/src/base/abci/abcIfMux.c
+abc-build/src/base/abci/abciUnfold2.c
+abc-build/src/base/abci/abcIvy.c
+abc-build/src/base/abci/abcLog.c
+abc-build/src/base/abci/abcLut.c
+abc-build/src/base/abci/abcLutmin.c
+abc-build/src/base/abci/abcMap.c
+abc-build/src/base/abci/abcMeasure.c
+abc-build/src/base/abci/abcMerge.c
+abc-build/src/base/abci/abcMffc.c
+abc-build/src/base/abci/abcMfs.c
+abc-build/src/base/abci/abcMini.c
+abc-build/src/base/abci/abcMiter.c
+abc-build/src/base/abci/abcMulti.c
+abc-build/src/base/abci/abcMv.c
+abc-build/src/base/abci/abcNpn.c
+abc-build/src/base/abci/abcNpnSave.c
+abc-build/src/base/abci/abcNtbdd.c
+abc-build/src/base/abci/abcOdc.c
+abc-build/src/base/abci/abcOrder.c
+abc-build/src/base/abci/abcPart.c
+abc-build/src/base/abci/abcPlace.c
+abc-build/src/base/abci/abcPrint.c
+abc-build/src/base/abci/abcProve.c
+abc-build/src/base/abci/abcQbf.c
+abc-build/src/base/abci/abcQuant.c
+abc-build/src/base/abci/abcReach.c
+abc-build/src/base/abci/abcRec3.c
+abc-build/src/base/abci/abcReconv.c
+abc-build/src/base/abci/abcRefactor.c
+abc-build/src/base/abci/abcRenode.c
+abc-build/src/base/abci/abcReorder.c
+abc-build/src/base/abci/abcRestruct.c
+abc-build/src/base/abci/abcResub.c
+abc-build/src/base/abci/abcRewrite.c
+abc-build/src/base/abci/abcRpo.c
+abc-build/src/base/abci/abcRr.c
+abc-build/src/base/abci/abcSat.c
+abc-build/src/base/abci/abcSaucy.c
+abc-build/src/base/abci/abcScorr.c
+abc-build/src/base/abci/abcSense.c
+abc-build/src/base/abci/abcSpeedup.c
+abc-build/src/base/abci/abcStrash.c
+abc-build/src/base/abci/abcSweep.c
+abc-build/src/base/abci/abcSymm.c
+abc-build/src/base/abci/abcTim.c
+abc-build/src/base/abci/abcTiming.c
+abc-build/src/base/abci/abcUnate.c
+abc-build/src/base/abci/abcUnreach.c
+abc-build/src/base/abci/abcVerify.c
+abc-build/src/base/abci/abcXsim.c
+abc-build/src/base/abci/fahout_cut.c
+abc-build/src/base/abci/module.make
+abc-build/src/base/cmd/cmd.c
+abc-build/src/base/cmd/cmd.h
+abc-build/src/base/cmd/cmdAlias.c
+abc-build/src/base/cmd/cmdApi.c
+abc-build/src/base/cmd/cmdFlag.c
+abc-build/src/base/cmd/cmdHist.c
+abc-build/src/base/cmd/cmdInt.h
+abc-build/src/base/cmd/cmdLoad.c
+abc-build/src/base/cmd/cmdPlugin.c
+abc-build/src/base/cmd/cmdStarter.c
+abc-build/src/base/cmd/cmdUtils.c
+abc-build/src/base/cmd/module.make
+abc-build/src/base/io/io.c
+abc-build/src/base/io/ioAbc.h
+abc-build/src/base/io/ioInt.h
+abc-build/src/base/io/ioReadAiger.c
+abc-build/src/base/io/ioReadBaf.c
+abc-build/src/base/io/ioReadBblif.c
+abc-build/src/base/io/ioReadBench.c
+abc-build/src/base/io/ioReadBlif.c
+abc-build/src/base/io/ioReadBlifAig.c
+abc-build/src/base/io/ioReadBlifMv.c
+abc-build/src/base/io/ioReadDsd.c
+abc-build/src/base/io/ioReadEdif.c
+abc-build/src/base/io/ioReadEqn.c
+abc-build/src/base/io/ioReadPla.c
+abc-build/src/base/io/ioReadVerilog.c
+abc-build/src/base/io/ioUtil.c
+abc-build/src/base/io/ioWriteAiger.c
+abc-build/src/base/io/ioWriteBaf.c
+abc-build/src/base/io/ioWriteBblif.c
+abc-build/src/base/io/ioWriteBench.c
+abc-build/src/base/io/ioWriteBlif.c
+abc-build/src/base/io/ioWriteBlifMv.c
+abc-build/src/base/io/ioWriteBook.c
+abc-build/src/base/io/ioWriteCnf.c
+abc-build/src/base/io/ioWriteDot.c
+abc-build/src/base/io/ioWriteEqn.c
+abc-build/src/base/io/ioWriteGml.c
+abc-build/src/base/io/ioWriteList.c
+abc-build/src/base/io/ioWritePla.c
+abc-build/src/base/io/ioWriteSmv.c
+abc-build/src/base/io/ioWriteVerilog.c
+abc-build/src/base/io/module.make
+abc-build/src/base/main/libSupport.c
+abc-build/src/base/main/main.c
+abc-build/src/base/main/main.h
+abc-build/src/base/main/mainFrame.c
+abc-build/src/base/main/mainInit.c
+abc-build/src/base/main/mainInt.h
+abc-build/src/base/main/mainLib.c
+abc-build/src/base/main/mainMC.c
+abc-build/src/base/main/mainUtils.c
+abc-build/src/base/main/module.make
+abc-build/src/base/test/module.make
+abc-build/src/base/test/test.c
+abc-build/src/base/ver/module.make
+abc-build/src/base/ver/ver.h
+abc-build/src/base/ver/ver_.c
+abc-build/src/base/ver/verCore.c
+abc-build/src/base/ver/verFormula.c
+abc-build/src/base/ver/verParse.c
+abc-build/src/base/ver/verStream.c
+abc-build/src/base/ver/verWords.c
+abc-build/src/base/wlc/module.make
+abc-build/src/base/wlc/wlc.c
+abc-build/src/base/wlc/wlc.h
+abc-build/src/base/wlc/wlcBlast.c
+abc-build/src/base/wlc/wlcCom.c
+abc-build/src/base/wlc/wlcNtk.c
+abc-build/src/base/wlc/wlcReadVer.c
+abc-build/src/base/wlc/wlcWriteVer.c
+abc-build/src/bdd/cas/cas.h
+abc-build/src/bdd/cas/casCore.c
+abc-build/src/bdd/cas/casDec.c
+abc-build/src/bdd/cas/module.make
+abc-build/src/bdd/cudd/cuBdd.make
+abc-build/src/bdd/cudd/cudd.h
+abc-build/src/bdd/cudd/cudd.make
+abc-build/src/bdd/cudd/cuddAddAbs.c
+abc-build/src/bdd/cudd/cuddAddApply.c
+abc-build/src/bdd/cudd/cuddAddFind.c
+abc-build/src/bdd/cudd/cuddAddInv.c
+abc-build/src/bdd/cudd/cuddAddIte.c
+abc-build/src/bdd/cudd/cuddAddNeg.c
+abc-build/src/bdd/cudd/cuddAddWalsh.c
+abc-build/src/bdd/cudd/cuddAndAbs.c
+abc-build/src/bdd/cudd/cuddAnneal.c
+abc-build/src/bdd/cudd/cuddApa.c
+abc-build/src/bdd/cudd/cuddAPI.c
+abc-build/src/bdd/cudd/cuddApprox.c
+abc-build/src/bdd/cudd/cuddBddAbs.c
+abc-build/src/bdd/cudd/cuddBddCorr.c
+abc-build/src/bdd/cudd/cuddBddIte.c
+abc-build/src/bdd/cudd/cuddBridge.c
+abc-build/src/bdd/cudd/cuddCache.c
+abc-build/src/bdd/cudd/cuddCheck.c
+abc-build/src/bdd/cudd/cuddClip.c
+abc-build/src/bdd/cudd/cuddCof.c
+abc-build/src/bdd/cudd/cuddCompose.c
+abc-build/src/bdd/cudd/cuddDecomp.c
+abc-build/src/bdd/cudd/cuddEssent.c
+abc-build/src/bdd/cudd/cuddExact.c
+abc-build/src/bdd/cudd/cuddExport.c
+abc-build/src/bdd/cudd/cuddGenCof.c
+abc-build/src/bdd/cudd/cuddGenetic.c
+abc-build/src/bdd/cudd/cuddGroup.c
+abc-build/src/bdd/cudd/cuddHarwell.c
+abc-build/src/bdd/cudd/cuddInit.c
+abc-build/src/bdd/cudd/cuddInt.h
+abc-build/src/bdd/cudd/cuddInteract.c
+abc-build/src/bdd/cudd/cuddLCache.c
+abc-build/src/bdd/cudd/cuddLevelQ.c
+abc-build/src/bdd/cudd/cuddLinear.c
+abc-build/src/bdd/cudd/cuddLiteral.c
+abc-build/src/bdd/cudd/cuddMatMult.c
+abc-build/src/bdd/cudd/cuddPriority.c
+abc-build/src/bdd/cudd/cuddRead.c
+abc-build/src/bdd/cudd/cuddRef.c
+abc-build/src/bdd/cudd/cuddReorder.c
+abc-build/src/bdd/cudd/cuddSat.c
+abc-build/src/bdd/cudd/cuddSign.c
+abc-build/src/bdd/cudd/cuddSolve.c
+abc-build/src/bdd/cudd/cuddSplit.c
+abc-build/src/bdd/cudd/cuddSubsetHB.c
+abc-build/src/bdd/cudd/cuddSubsetSP.c
+abc-build/src/bdd/cudd/cuddSymmetry.c
+abc-build/src/bdd/cudd/cuddTable.c
+abc-build/src/bdd/cudd/cuddUtil.c
+abc-build/src/bdd/cudd/cuddWindow.c
+abc-build/src/bdd/cudd/cuddZddCount.c
+abc-build/src/bdd/cudd/cuddZddFuncs.c
+abc-build/src/bdd/cudd/cuddZddGroup.c
+abc-build/src/bdd/cudd/cuddZddIsop.c
+abc-build/src/bdd/cudd/cuddZddLin.c
+abc-build/src/bdd/cudd/cuddZddMisc.c
+abc-build/src/bdd/cudd/cuddZddPort.c
+abc-build/src/bdd/cudd/cuddZddReord.c
+abc-build/src/bdd/cudd/cuddZddSetop.c
+abc-build/src/bdd/cudd/cuddZddSymm.c
+abc-build/src/bdd/cudd/cuddZddUtil.c
+abc-build/src/bdd/cudd/license
+abc-build/src/bdd/cudd/Makefile
+abc-build/src/bdd/cudd/module.make
+abc-build/src/bdd/cudd/r7x8.1.mat
+abc-build/src/bdd/cudd/r7x8.1.out
+abc-build/src/bdd/cudd/testcudd.c
+abc-build/src/bdd/dsd/dsd.h
+abc-build/src/bdd/dsd/dsdApi.c
+abc-build/src/bdd/dsd/dsdCheck.c
+abc-build/src/bdd/dsd/dsdInt.h
+abc-build/src/bdd/dsd/dsdLocal.c
+abc-build/src/bdd/dsd/dsdMan.c
+abc-build/src/bdd/dsd/dsdProc.c
+abc-build/src/bdd/dsd/dsdTree.c
+abc-build/src/bdd/dsd/module.make
+abc-build/src/bdd/epd/epd.c
+abc-build/src/bdd/epd/epd.h
+abc-build/src/bdd/epd/module.make
+abc-build/src/bdd/mtr/module.make
+abc-build/src/bdd/mtr/mtr.h
+abc-build/src/bdd/mtr/mtrBasic.c
+abc-build/src/bdd/mtr/mtrGroup.c
+abc-build/src/bdd/mtr/mtrInt.h
+abc-build/src/bdd/parse/module.make
+abc-build/src/bdd/parse/parse.h
+abc-build/src/bdd/parse/parseCore.c
+abc-build/src/bdd/parse/parseEqn.c
+abc-build/src/bdd/parse/parseInt.h
+abc-build/src/bdd/parse/parseStack.c
+abc-build/src/bdd/reo/module.make
+abc-build/src/bdd/reo/reo.h
+abc-build/src/bdd/reo/reoApi.c
+abc-build/src/bdd/reo/reoCore.c
+abc-build/src/bdd/reo/reoProfile.c
+abc-build/src/bdd/reo/reoShuffle.c
+abc-build/src/bdd/reo/reoSift.c
+abc-build/src/bdd/reo/reoSwap.c
+abc-build/src/bdd/reo/reoTest.c
+abc-build/src/bdd/reo/reoTransfer.c
+abc-build/src/bdd/reo/reoUnits.c
+abc-build/src/bool/bdc/bdc.h
+abc-build/src/bool/bdc/bdc_.c
+abc-build/src/bool/bdc/bdcCore.c
+abc-build/src/bool/bdc/bdcDec.c
+abc-build/src/bool/bdc/bdcInt.h
+abc-build/src/bool/bdc/bdcSpfd.c
+abc-build/src/bool/bdc/bdcTable.c
+abc-build/src/bool/bdc/module.make
+abc-build/src/bool/dec/dec.h
+abc-build/src/bool/dec/decAbc.c
+abc-build/src/bool/dec/decFactor.c
+abc-build/src/bool/dec/decMan.c
+abc-build/src/bool/dec/decPrint.c
+abc-build/src/bool/dec/decUtil.c
+abc-build/src/bool/dec/module.make
+abc-build/src/bool/deco/deco.h
+abc-build/src/bool/deco/module.make
+abc-build/src/bool/kit/cloud.c
+abc-build/src/bool/kit/cloud.h
+abc-build/src/bool/kit/kit.h
+abc-build/src/bool/kit/kit_.c
+abc-build/src/bool/kit/kitAig.c
+abc-build/src/bool/kit/kitBdd.c
+abc-build/src/bool/kit/kitCloud.c
+abc-build/src/bool/kit/kitDec.c
+abc-build/src/bool/kit/kitDsd.c
+abc-build/src/bool/kit/kitFactor.c
+abc-build/src/bool/kit/kitGraph.c
+abc-build/src/bool/kit/kitHop.c
+abc-build/src/bool/kit/kitIsop.c
+abc-build/src/bool/kit/kitPerm.c
+abc-build/src/bool/kit/kitPla.c
+abc-build/src/bool/kit/kitSop.c
+abc-build/src/bool/kit/kitTruth.c
+abc-build/src/bool/kit/module.make
+abc-build/src/bool/lucky/lucky.c
+abc-build/src/bool/lucky/lucky.h
+abc-build/src/bool/lucky/luckyFast16.c
+abc-build/src/bool/lucky/luckyFast6.c
+abc-build/src/bool/lucky/luckyInt.h
+abc-build/src/bool/lucky/luckyRead.c
+abc-build/src/bool/lucky/luckySimple.c
+abc-build/src/bool/lucky/luckySwap.c
+abc-build/src/bool/lucky/luckySwapIJ.c
+abc-build/src/bool/lucky/module.make
+abc-build/src/bool/rpo/literal.h
+abc-build/src/bool/rpo/module.make
+abc-build/src/bool/rpo/rpo.c
+abc-build/src/bool/rpo/rpo.h
+abc-build/src/bool/rsb/module.make
+abc-build/src/bool/rsb/rsb.h
+abc-build/src/bool/rsb/rsbDec6.c
+abc-build/src/bool/rsb/rsbInt.h
+abc-build/src/bool/rsb/rsbMan.c
+abc-build/src/demo.c
+abc-build/src/generic.c
+abc-build/src/generic.h
+abc-build/src/map/amap/amap.h
+abc-build/src/map/amap/amapCore.c
+abc-build/src/map/amap/amapGraph.c
+abc-build/src/map/amap/amapInt.h
+abc-build/src/map/amap/amapLib.c
+abc-build/src/map/amap/amapLiberty.c
+abc-build/src/map/amap/amapMan.c
+abc-build/src/map/amap/amapMatch.c
+abc-build/src/map/amap/amapMerge.c
+abc-build/src/map/amap/amapOutput.c
+abc-build/src/map/amap/amapParse.c
+abc-build/src/map/amap/amapPerm.c
+abc-build/src/map/amap/amapRead.c
+abc-build/src/map/amap/amapRule.c
+abc-build/src/map/amap/amapUniq.c
+abc-build/src/map/amap/module.make
+abc-build/src/map/cov/cov.h
+abc-build/src/map/cov/covBuild.c
+abc-build/src/map/cov/covCore.c
+abc-build/src/map/cov/covInt.h
+abc-build/src/map/cov/covMan.c
+abc-build/src/map/cov/covMinEsop.c
+abc-build/src/map/cov/covMinMan.c
+abc-build/src/map/cov/covMinSop.c
+abc-build/src/map/cov/covMinUtil.c
+abc-build/src/map/cov/covTest.c
+abc-build/src/map/cov/module.make
+abc-build/src/map/fpga/fpga.c
+abc-build/src/map/fpga/fpga.h
+abc-build/src/map/fpga/fpgaCore.c
+abc-build/src/map/fpga/fpgaCreate.c
+abc-build/src/map/fpga/fpgaCut.c
+abc-build/src/map/fpga/fpgaCutUtils.c
+abc-build/src/map/fpga/fpgaFanout.c
+abc-build/src/map/fpga/fpgaGENERIC.c
+abc-build/src/map/fpga/fpgaInt.h
+abc-build/src/map/fpga/fpgaLib.c
+abc-build/src/map/fpga/fpgaMatch.c
+abc-build/src/map/fpga/fpgaSwitch.c
+abc-build/src/map/fpga/fpgaTime.c
+abc-build/src/map/fpga/fpgaTruth.c
+abc-build/src/map/fpga/fpgaUtils.c
+abc-build/src/map/fpga/fpgaVec.c
+abc-build/src/map/fpga/module.make
+abc-build/src/map/if/if.h
+abc-build/src/map/if/if_.c
+abc-build/src/map/if/ifCache.c
+abc-build/src/map/if/ifCheck.c
+abc-build/src/map/if/ifCom.c
+abc-build/src/map/if/ifCore.c
+abc-build/src/map/if/ifCount.h
+abc-build/src/map/if/ifCut.c
+abc-build/src/map/if/ifData2.c
+abc-build/src/map/if/ifDec07.c
+abc-build/src/map/if/ifDec08.c
+abc-build/src/map/if/ifDec10.c
+abc-build/src/map/if/ifDec16.c
+abc-build/src/map/if/ifDec75.c
+abc-build/src/map/if/ifDelay.c
+abc-build/src/map/if/ifDsd.c
+abc-build/src/map/if/ifLibBox.c
+abc-build/src/map/if/ifLibLut.c
+abc-build/src/map/if/ifMan.c
+abc-build/src/map/if/ifMap.c
+abc-build/src/map/if/ifMatch2.c
+abc-build/src/map/if/ifReduce.c
+abc-build/src/map/if/ifSat.c
+abc-build/src/map/if/ifSelect.c
+abc-build/src/map/if/ifSeq.c
+abc-build/src/map/if/ifTest.c
+abc-build/src/map/if/ifTime.c
+abc-build/src/map/if/ifTruth.c
+abc-build/src/map/if/ifTune.c
+abc-build/src/map/if/ifUtil.c
+abc-build/src/map/if/module.make
+abc-build/src/map/mapper/mapper.c
+abc-build/src/map/mapper/mapper.h
+abc-build/src/map/mapper/mapperCanon.c
+abc-build/src/map/mapper/mapperCore.c
+abc-build/src/map/mapper/mapperCreate.c
+abc-build/src/map/mapper/mapperCut.c
+abc-build/src/map/mapper/mapperCutUtils.c
+abc-build/src/map/mapper/mapperFanout.c
+abc-build/src/map/mapper/mapperInt.h
+abc-build/src/map/mapper/mapperLib.c
+abc-build/src/map/mapper/mapperMatch.c
+abc-build/src/map/mapper/mapperRefs.c
+abc-build/src/map/mapper/mapperSuper.c
+abc-build/src/map/mapper/mapperSwitch.c
+abc-build/src/map/mapper/mapperTable.c
+abc-build/src/map/mapper/mapperTime.c
+abc-build/src/map/mapper/mapperTree.c
+abc-build/src/map/mapper/mapperTruth.c
+abc-build/src/map/mapper/mapperUtils.c
+abc-build/src/map/mapper/mapperVec.c
+abc-build/src/map/mapper/module.make
+abc-build/src/map/mio/exp.h
+abc-build/src/map/mio/mio.c
+abc-build/src/map/mio/mio.h
+abc-build/src/map/mio/mioApi.c
+abc-build/src/map/mio/mioForm.c
+abc-build/src/map/mio/mioFunc.c
+abc-build/src/map/mio/mioInt.h
+abc-build/src/map/mio/mioParse.c
+abc-build/src/map/mio/mioRead.c
+abc-build/src/map/mio/mioSop.c
+abc-build/src/map/mio/mioUtils.c
+abc-build/src/map/mio/module.make
+abc-build/src/map/mpm/module.make
+abc-build/src/map/mpm/mpm.c
+abc-build/src/map/mpm/mpm.h
+abc-build/src/map/mpm/mpmAbc.c
+abc-build/src/map/mpm/mpmCore.c
+abc-build/src/map/mpm/mpmDsd.c
+abc-build/src/map/mpm/mpmGates.c
+abc-build/src/map/mpm/mpmInt.h
+abc-build/src/map/mpm/mpmLib.c
+abc-build/src/map/mpm/mpmMan.c
+abc-build/src/map/mpm/mpmMap.c
+abc-build/src/map/mpm/mpmMig.c
+abc-build/src/map/mpm/mpmMig.h
+abc-build/src/map/mpm/mpmPre.c
+abc-build/src/map/mpm/mpmTruth.c
+abc-build/src/map/mpm/mpmUtil.c
+abc-build/src/map/scl/module.make
+abc-build/src/map/scl/scl.c
+abc-build/src/map/scl/scl.h
+abc-build/src/map/scl/sclBuffer.c
+abc-build/src/map/scl/sclBufSize.c
+abc-build/src/map/scl/sclDnsize.c
+abc-build/src/map/scl/sclLib.h
+abc-build/src/map/scl/sclLiberty.c
+abc-build/src/map/scl/sclLibScl.c
+abc-build/src/map/scl/sclLibUtil.c
+abc-build/src/map/scl/sclLoad.c
+abc-build/src/map/scl/sclSize.c
+abc-build/src/map/scl/sclSize.h
+abc-build/src/map/scl/sclTime.h
+abc-build/src/map/scl/sclUpsize.c
+abc-build/src/map/scl/sclUtil.c
+abc-build/src/map/super/module.make
+abc-build/src/map/super/super.c
+abc-build/src/map/super/super.h
+abc-build/src/map/super/superAnd.c
+abc-build/src/map/super/superGate.c
+abc-build/src/map/super/superGENERIC.c
+abc-build/src/map/super/superInt.h
+abc-build/src/map/super/superWrite.c
+abc-build/src/misc/avl/avl.c
+abc-build/src/misc/avl/avl.doc
+abc-build/src/misc/avl/avl.h
+abc-build/src/misc/bar/bar.c
+abc-build/src/misc/bar/bar.h
+abc-build/src/misc/bar/module.make
+abc-build/src/misc/bbl/bblif.c
+abc-build/src/misc/bbl/bblif.h
+abc-build/src/misc/bbl/module.make
+abc-build/src/misc/bzlib/blocksort.c
+abc-build/src/misc/bzlib/bzip2.txt
+abc-build/src/misc/bzlib/bzlib.c
+abc-build/src/misc/bzlib/bzlib.h
+abc-build/src/misc/bzlib/bzlib_private.h
+abc-build/src/misc/bzlib/CHANGES
+abc-build/src/misc/bzlib/compress.c
+abc-build/src/misc/bzlib/crctable.c
+abc-build/src/misc/bzlib/decompress.c
+abc-build/src/misc/bzlib/huffman.c
+abc-build/src/misc/bzlib/LICENSE
+abc-build/src/misc/bzlib/link.txt
+abc-build/src/misc/bzlib/manual.html
+abc-build/src/misc/bzlib/module.make
+abc-build/src/misc/bzlib/randtable.c
+abc-build/src/misc/espresso/cofactor.c
+abc-build/src/misc/espresso/cols.c
+abc-build/src/misc/espresso/compl.c
+abc-build/src/misc/espresso/contain.c
+abc-build/src/misc/espresso/cubehack.c
+abc-build/src/misc/espresso/cubestr.c
+abc-build/src/misc/espresso/cvrin.c
+abc-build/src/misc/espresso/cvrm.c
+abc-build/src/misc/espresso/cvrmisc.c
+abc-build/src/misc/espresso/cvrout.c
+abc-build/src/misc/espresso/dominate.c
+abc-build/src/misc/espresso/equiv.c
+abc-build/src/misc/espresso/espresso.c
+abc-build/src/misc/espresso/espresso.h
+abc-build/src/misc/espresso/essen.c
+abc-build/src/misc/espresso/exact.c
+abc-build/src/misc/espresso/expand.c
+abc-build/src/misc/espresso/gasp.c
+abc-build/src/misc/espresso/gimpel.c
+abc-build/src/misc/espresso/globals.c
+abc-build/src/misc/espresso/hack.c
+abc-build/src/misc/espresso/indep.c
+abc-build/src/misc/espresso/irred.c
+abc-build/src/misc/espresso/main.c
+abc-build/src/misc/espresso/main.h.bak
+abc-build/src/misc/espresso/map.c
+abc-build/src/misc/espresso/matrix.c
+abc-build/src/misc/espresso/mincov.c
+abc-build/src/misc/espresso/mincov.h
+abc-build/src/misc/espresso/mincov_int.h
+abc-build/src/misc/espresso/module.make
+abc-build/src/misc/espresso/opo.c
+abc-build/src/misc/espresso/pair.c
+abc-build/src/misc/espresso/part.c
+abc-build/src/misc/espresso/primes.c
+abc-build/src/misc/espresso/reduce.c
+abc-build/src/misc/espresso/rows.c
+abc-build/src/misc/espresso/set.c
+abc-build/src/misc/espresso/setc.c
+abc-build/src/misc/espresso/sharp.c
+abc-build/src/misc/espresso/sminterf.c
+abc-build/src/misc/espresso/solution.c
+abc-build/src/misc/espresso/sparse.c
+abc-build/src/misc/espresso/sparse.h
+abc-build/src/misc/espresso/sparse_int.h
+abc-build/src/misc/espresso/unate.c
+abc-build/src/misc/espresso/util_old.h
+abc-build/src/misc/espresso/verify.c
+abc-build/src/misc/ext/ext.h
+abc-build/src/misc/ext/module.make
+abc-build/src/misc/extra/extra.h
+abc-build/src/misc/extra/extraBdd.h
+abc-build/src/misc/extra/extraBddAuto.c
+abc-build/src/misc/extra/extraBddCas.c
+abc-build/src/misc/extra/extraBddImage.c
+abc-build/src/misc/extra/extraBddKmap.c
+abc-build/src/misc/extra/extraBddMisc.c
+abc-build/src/misc/extra/extraBddSymm.c
+abc-build/src/misc/extra/extraBddTime.c
+abc-build/src/misc/extra/extraBddUnate.c
+abc-build/src/misc/extra/extraUtilBitMatrix.c
+abc-build/src/misc/extra/extraUtilCanon.c
+abc-build/src/misc/extra/extraUtilCube.c
+abc-build/src/misc/extra/extraUtilDsd.c
+abc-build/src/misc/extra/extraUtilEnum.c
+abc-build/src/misc/extra/extraUtilFile.c
+abc-build/src/misc/extra/extraUtilMemory.c
+abc-build/src/misc/extra/extraUtilMisc.c
+abc-build/src/misc/extra/extraUtilPerm.c
+abc-build/src/misc/extra/extraUtilProgress.c
+abc-build/src/misc/extra/extraUtilReader.c
+abc-build/src/misc/extra/extraUtilSupp.c
+abc-build/src/misc/extra/extraUtilTruth.c
+abc-build/src/misc/extra/extraUtilUtil.c
+abc-build/src/misc/extra/extraZddTrunc.c
+abc-build/src/misc/extra/module.make
+abc-build/src/misc/hash/hash.h
+abc-build/src/misc/hash/hashFlt.h
+abc-build/src/misc/hash/hashGen.h
+abc-build/src/misc/hash/hashInt.h
+abc-build/src/misc/hash/hashPtr.h
+abc-build/src/misc/hash/module.make
+abc-build/src/misc/mem/mem.c
+abc-build/src/misc/mem/mem.h
+abc-build/src/misc/mem/mem2.h
+abc-build/src/misc/mem/module.make
+abc-build/src/misc/mvc/module.make
+abc-build/src/misc/mvc/mvc.c
+abc-build/src/misc/mvc/mvc.h
+abc-build/src/misc/mvc/mvcApi.c
+abc-build/src/misc/mvc/mvcCompare.c
+abc-build/src/misc/mvc/mvcContain.c
+abc-build/src/misc/mvc/mvcCover.c
+abc-build/src/misc/mvc/mvcCube.c
+abc-build/src/misc/mvc/mvcDivide.c
+abc-build/src/misc/mvc/mvcDivisor.c
+abc-build/src/misc/mvc/mvcList.c
+abc-build/src/misc/mvc/mvcLits.c
+abc-build/src/misc/mvc/mvcMan.c
+abc-build/src/misc/mvc/mvcOpAlg.c
+abc-build/src/misc/mvc/mvcOpBool.c
+abc-build/src/misc/mvc/mvcPrint.c
+abc-build/src/misc/mvc/mvcSort.c
+abc-build/src/misc/mvc/mvcUtils.c
+abc-build/src/misc/nm/module.make
+abc-build/src/misc/nm/nm.h
+abc-build/src/misc/nm/nmApi.c
+abc-build/src/misc/nm/nmInt.h
+abc-build/src/misc/nm/nmTable.c
+abc-build/src/misc/st/module.make
+abc-build/src/misc/st/st.c
+abc-build/src/misc/st/st.h
+abc-build/src/misc/st/stmm.c
+abc-build/src/misc/st/stmm.h
+abc-build/src/misc/tim/module.make
+abc-build/src/misc/tim/tim.c
+abc-build/src/misc/tim/tim.h
+abc-build/src/misc/tim/timBox.c
+abc-build/src/misc/tim/timDump.c
+abc-build/src/misc/tim/timInt.h
+abc-build/src/misc/tim/timMan.c
+abc-build/src/misc/tim/timTime.c
+abc-build/src/misc/tim/timTrav.c
+abc-build/src/misc/util/abc_global.h
+abc-build/src/misc/util/module.make
+abc-build/src/misc/util/util_hack.h
+abc-build/src/misc/util/utilBridge.c
+abc-build/src/misc/util/utilCex.c
+abc-build/src/misc/util/utilCex.h
+abc-build/src/misc/util/utilColor.c
+abc-build/src/misc/util/utilFile.c
+abc-build/src/misc/util/utilMem.c
+abc-build/src/misc/util/utilMem.h
+abc-build/src/misc/util/utilNam.c
+abc-build/src/misc/util/utilNam.h
+abc-build/src/misc/util/utilSignal.c
+abc-build/src/misc/util/utilSignal.h
+abc-build/src/misc/util/utilSort.c
+abc-build/src/misc/util/utilTruth.h
+abc-build/src/misc/vec/module.make
+abc-build/src/misc/vec/vec.h
+abc-build/src/misc/vec/vecAtt.h
+abc-build/src/misc/vec/vecBit.h
+abc-build/src/misc/vec/vecFlt.h
+abc-build/src/misc/vec/vecHash.h
+abc-build/src/misc/vec/vecHsh.h
+abc-build/src/misc/vec/vecInt.h
+abc-build/src/misc/vec/vecMem.h
+abc-build/src/misc/vec/vecPtr.h
+abc-build/src/misc/vec/vecQue.h
+abc-build/src/misc/vec/vecSet.h
+abc-build/src/misc/vec/vecStr.h
+abc-build/src/misc/vec/vecVec.h
+abc-build/src/misc/vec/vecWec.h
+abc-build/src/misc/vec/vecWrd.h
+abc-build/src/misc/zlib/adler32.c
+abc-build/src/misc/zlib/algorithm.txt
+abc-build/src/misc/zlib/compress_.c
+abc-build/src/misc/zlib/crc32.c
+abc-build/src/misc/zlib/crc32.h
+abc-build/src/misc/zlib/deflate.c
+abc-build/src/misc/zlib/deflate.h
+abc-build/src/misc/zlib/gzclose.c
+abc-build/src/misc/zlib/gzguts.h
+abc-build/src/misc/zlib/gzlib.c
+abc-build/src/misc/zlib/gzread.c
+abc-build/src/misc/zlib/gzwrite.c
+abc-build/src/misc/zlib/infback.c
+abc-build/src/misc/zlib/inffast.c
+abc-build/src/misc/zlib/inffast.h
+abc-build/src/misc/zlib/inffixed.h
+abc-build/src/misc/zlib/inflate.c
+abc-build/src/misc/zlib/inflate.h
+abc-build/src/misc/zlib/inftrees.c
+abc-build/src/misc/zlib/inftrees.h
+abc-build/src/misc/zlib/license
+abc-build/src/misc/zlib/link.txt
+abc-build/src/misc/zlib/module.make
+abc-build/src/misc/zlib/README
+abc-build/src/misc/zlib/trees.c
+abc-build/src/misc/zlib/trees.h
+abc-build/src/misc/zlib/uncompr.c
+abc-build/src/misc/zlib/zconf.h
+abc-build/src/misc/zlib/zlib.h
+abc-build/src/misc/zlib/zutil.c
+abc-build/src/misc/zlib/zutil.h
+abc-build/src/opt/cgt/cgt.h
+abc-build/src/opt/cgt/cgtAig.c
+abc-build/src/opt/cgt/cgtCore.c
+abc-build/src/opt/cgt/cgtDecide.c
+abc-build/src/opt/cgt/cgtInt.h
+abc-build/src/opt/cgt/cgtMan.c
+abc-build/src/opt/cgt/cgtSat.c
+abc-build/src/opt/cgt/module.make
+abc-build/src/opt/csw/csw.h
+abc-build/src/opt/csw/csw_.c
+abc-build/src/opt/csw/cswCore.c
+abc-build/src/opt/csw/cswCut.c
+abc-build/src/opt/csw/cswInt.h
+abc-build/src/opt/csw/cswMan.c
+abc-build/src/opt/csw/cswTable.c
+abc-build/src/opt/csw/module.make
+abc-build/src/opt/cut/abcCut.c
+abc-build/src/opt/cut/cut.h
+abc-build/src/opt/cut/cutApi.c
+abc-build/src/opt/cut/cutCut.c
+abc-build/src/opt/cut/cutExpand.c
+abc-build/src/opt/cut/cutInt.h
+abc-build/src/opt/cut/cutList.h
+abc-build/src/opt/cut/cutMan.c
+abc-build/src/opt/cut/cutMerge.c
+abc-build/src/opt/cut/cutNode.c
+abc-build/src/opt/cut/cutOracle.c
+abc-build/src/opt/cut/cutPre22.c
+abc-build/src/opt/cut/cutSeq.c
+abc-build/src/opt/cut/cutTruth.c
+abc-build/src/opt/cut/module.make
+abc-build/src/opt/dar/dar.h
+abc-build/src/opt/dar/dar_.c
+abc-build/src/opt/dar/darBalance.c
+abc-build/src/opt/dar/darCore.c
+abc-build/src/opt/dar/darCut.c
+abc-build/src/opt/dar/darData.c
+abc-build/src/opt/dar/darInt.h
+abc-build/src/opt/dar/darLib.c
+abc-build/src/opt/dar/darMan.c
+abc-build/src/opt/dar/darPrec.c
+abc-build/src/opt/dar/darRefact.c
+abc-build/src/opt/dar/darResub.c
+abc-build/src/opt/dar/darScript.c
+abc-build/src/opt/dar/module.make
+abc-build/src/opt/dau/dau.c
+abc-build/src/opt/dau/dau.h
+abc-build/src/opt/dau/dauArray.c
+abc-build/src/opt/dau/dauCanon.c
+abc-build/src/opt/dau/dauCore.c
+abc-build/src/opt/dau/dauDivs.c
+abc-build/src/opt/dau/dauDsd.c
+abc-build/src/opt/dau/dauDsd2.c
+abc-build/src/opt/dau/dauEnum.c
+abc-build/src/opt/dau/dauGia.c
+abc-build/src/opt/dau/dauInt.h
+abc-build/src/opt/dau/dauMerge.c
+abc-build/src/opt/dau/dauNonDsd.c
+abc-build/src/opt/dau/dauTree.c
+abc-build/src/opt/dau/module.make
+abc-build/src/opt/fsim/fsim.h
+abc-build/src/opt/fsim/fsimCore.c
+abc-build/src/opt/fsim/fsimFront.c
+abc-build/src/opt/fsim/fsimInt.h
+abc-build/src/opt/fsim/fsimMan.c
+abc-build/src/opt/fsim/fsimSim.c
+abc-build/src/opt/fsim/fsimSwitch.c
+abc-build/src/opt/fsim/fsimTsim.c
+abc-build/src/opt/fsim/module.make
+abc-build/src/opt/fxu/fxu.c
+abc-build/src/opt/fxu/fxu.h
+abc-build/src/opt/fxu/fxuCreate.c
+abc-build/src/opt/fxu/fxuHeapD.c
+abc-build/src/opt/fxu/fxuHeapS.c
+abc-build/src/opt/fxu/fxuInt.h
+abc-build/src/opt/fxu/fxuList.c
+abc-build/src/opt/fxu/fxuMatrix.c
+abc-build/src/opt/fxu/fxuPair.c
+abc-build/src/opt/fxu/fxuPrint.c
+abc-build/src/opt/fxu/fxuReduce.c
+abc-build/src/opt/fxu/fxuSelect.c
+abc-build/src/opt/fxu/fxuSingle.c
+abc-build/src/opt/fxu/fxuUpdate.c
+abc-build/src/opt/fxu/module.make
+abc-build/src/opt/lpk/lpk.h
+abc-build/src/opt/lpk/lpk_.c
+abc-build/src/opt/lpk/lpkAbcDec.c
+abc-build/src/opt/lpk/lpkAbcDsd.c
+abc-build/src/opt/lpk/lpkAbcMux.c
+abc-build/src/opt/lpk/lpkAbcUtil.c
+abc-build/src/opt/lpk/lpkCore.c
+abc-build/src/opt/lpk/lpkCut.c
+abc-build/src/opt/lpk/lpkInt.h
+abc-build/src/opt/lpk/lpkMan.c
+abc-build/src/opt/lpk/lpkMap.c
+abc-build/src/opt/lpk/lpkMulti.c
+abc-build/src/opt/lpk/lpkMux.c
+abc-build/src/opt/lpk/lpkSets.c
+abc-build/src/opt/lpk/module.make
+abc-build/src/opt/mfs/mfs.h
+abc-build/src/opt/mfs/mfs_.c
+abc-build/src/opt/mfs/mfsCore.c
+abc-build/src/opt/mfs/mfsCore_.c
+abc-build/src/opt/mfs/mfsDiv.c
+abc-build/src/opt/mfs/mfsGia.c
+abc-build/src/opt/mfs/mfsInt.h
+abc-build/src/opt/mfs/mfsInter.c
+abc-build/src/opt/mfs/mfsMan.c
+abc-build/src/opt/mfs/mfsResub.c
+abc-build/src/opt/mfs/mfsResub_.c
+abc-build/src/opt/mfs/mfsSat.c
+abc-build/src/opt/mfs/mfsStrash.c
+abc-build/src/opt/mfs/mfsWin.c
+abc-build/src/opt/mfs/module.make
+abc-build/src/opt/nwk/module.make
+abc-build/src/opt/nwk/ntlnwk.h
+abc-build/src/opt/nwk/nwk.h
+abc-build/src/opt/nwk/nwk_.c
+abc-build/src/opt/nwk/nwkAig.c
+abc-build/src/opt/nwk/nwkBidec.c
+abc-build/src/opt/nwk/nwkCheck.c
+abc-build/src/opt/nwk/nwkDfs.c
+abc-build/src/opt/nwk/nwkFanio.c
+abc-build/src/opt/nwk/nwkFlow.c
+abc-build/src/opt/nwk/nwkFlow_depth.c
+abc-build/src/opt/nwk/nwkMan.c
+abc-build/src/opt/nwk/nwkMap.c
+abc-build/src/opt/nwk/nwkMerge.c
+abc-build/src/opt/nwk/nwkMerge.h
+abc-build/src/opt/nwk/nwkObj.c
+abc-build/src/opt/nwk/nwkSpeedup.c
+abc-build/src/opt/nwk/nwkStrash.c
+abc-build/src/opt/nwk/nwkTiming.c
+abc-build/src/opt/nwk/nwkUtil.c
+abc-build/src/opt/res/module.make
+abc-build/src/opt/res/res.h
+abc-build/src/opt/res/res_.c
+abc-build/src/opt/res/resCore.c
+abc-build/src/opt/res/resDivs.c
+abc-build/src/opt/res/resFilter.c
+abc-build/src/opt/res/resInt.h
+abc-build/src/opt/res/resSat.c
+abc-build/src/opt/res/resSim.c
+abc-build/src/opt/res/resSim_old.c
+abc-build/src/opt/res/resStrash.c
+abc-build/src/opt/res/resWin.c
+abc-build/src/opt/ret/module.make
+abc-build/src/opt/ret/ret_.c
+abc-build/src/opt/ret/retArea.c
+abc-build/src/opt/ret/retCore.c
+abc-build/src/opt/ret/retDelay.c
+abc-build/src/opt/ret/retFlow.c
+abc-build/src/opt/ret/retIncrem.c
+abc-build/src/opt/ret/retInit.c
+abc-build/src/opt/ret/retInt.h
+abc-build/src/opt/ret/retLvalue.c
+abc-build/src/opt/rwr/module.make
+abc-build/src/opt/rwr/rwr.h
+abc-build/src/opt/rwr/rwrDec.c
+abc-build/src/opt/rwr/rwrEva.c
+abc-build/src/opt/rwr/rwrExp.c
+abc-build/src/opt/rwr/rwrLib.c
+abc-build/src/opt/rwr/rwrMan.c
+abc-build/src/opt/rwr/rwrPrint.c
+abc-build/src/opt/rwr/rwrTemp.c
+abc-build/src/opt/rwr/rwrUtil.c
+abc-build/src/opt/rwt/module.make
+abc-build/src/opt/rwt/rwt.h
+abc-build/src/opt/rwt/rwtDec.c
+abc-build/src/opt/rwt/rwtMan.c
+abc-build/src/opt/rwt/rwtUtil.c
+abc-build/src/opt/sfm/module.make
+abc-build/src/opt/sfm/sfm.h
+abc-build/src/opt/sfm/sfmCnf.c
+abc-build/src/opt/sfm/sfmCore.c
+abc-build/src/opt/sfm/sfmInt.h
+abc-build/src/opt/sfm/sfmNtk.c
+abc-build/src/opt/sfm/sfmSat.c
+abc-build/src/opt/sfm/sfmWin.c
+abc-build/src/opt/sim/module.make
+abc-build/src/opt/sim/sim.h
+abc-build/src/opt/sim/simMan.c
+abc-build/src/opt/sim/simSat.c
+abc-build/src/opt/sim/simSeq.c
+abc-build/src/opt/sim/simSupp.c
+abc-build/src/opt/sim/simSwitch.c
+abc-build/src/opt/sim/simSym.c
+abc-build/src/opt/sim/simSymSat.c
+abc-build/src/opt/sim/simSymSim.c
+abc-build/src/opt/sim/simSymStr.c
+abc-build/src/opt/sim/simUtils.c
+abc-build/src/phys/place/hpwl
+abc-build/src/phys/place/libhmetis.h
+abc-build/src/phys/place/Makefile
+abc-build/src/phys/place/module.make
+abc-build/src/phys/place/place_base.c
+abc-build/src/phys/place/place_base.h
+abc-build/src/phys/place/place_bin.c
+abc-build/src/phys/place/place_genqp.c
+abc-build/src/phys/place/place_gordian.c
+abc-build/src/phys/place/place_gordian.h
+abc-build/src/phys/place/place_inc.c
+abc-build/src/phys/place/place_io.c
+abc-build/src/phys/place/place_legalize.c
+abc-build/src/phys/place/place_pads.c
+abc-build/src/phys/place/place_partition.c
+abc-build/src/phys/place/place_qpsolver.c
+abc-build/src/phys/place/place_qpsolver.h
+abc-build/src/phys/place/place_test.c
+abc-build/src/phys/place/README
+abc-build/src/proof/abs/abs.c
+abc-build/src/proof/abs/abs.h
+abc-build/src/proof/abs/absDup.c
+abc-build/src/proof/abs/absGla.c
+abc-build/src/proof/abs/absGlaOld.c
+abc-build/src/proof/abs/absIter.c
+abc-build/src/proof/abs/absOldCex.c
+abc-build/src/proof/abs/absOldRef.c
+abc-build/src/proof/abs/absOldSat.c
+abc-build/src/proof/abs/absOldSim.c
+abc-build/src/proof/abs/absOut.c
+abc-build/src/proof/abs/absPth.c
+abc-build/src/proof/abs/absRef.c
+abc-build/src/proof/abs/absRef.h
+abc-build/src/proof/abs/absRefJ.c
+abc-build/src/proof/abs/absRefJ.h
+abc-build/src/proof/abs/absRefSelect.c
+abc-build/src/proof/abs/absRpm.c
+abc-build/src/proof/abs/absRpmOld.c
+abc-build/src/proof/abs/absUtil.c
+abc-build/src/proof/abs/absVta.c
+abc-build/src/proof/abs/module.make
+abc-build/src/proof/bbr/bbr.h
+abc-build/src/proof/bbr/bbr_.c
+abc-build/src/proof/bbr/bbrCex.c
+abc-build/src/proof/bbr/bbrImage.c
+abc-build/src/proof/bbr/bbrNtbdd.c
+abc-build/src/proof/bbr/bbrReach.c
+abc-build/src/proof/bbr/module.make
+abc-build/src/proof/cec/cec.c
+abc-build/src/proof/cec/cec.h
+abc-build/src/proof/cec/cecCec.c
+abc-build/src/proof/cec/cecChoice.c
+abc-build/src/proof/cec/cecClass.c
+abc-build/src/proof/cec/cecCore.c
+abc-build/src/proof/cec/cecCorr.c
+abc-build/src/proof/cec/cecInt.h
+abc-build/src/proof/cec/cecIso.c
+abc-build/src/proof/cec/cecMan.c
+abc-build/src/proof/cec/cecPat.c
+abc-build/src/proof/cec/cecSeq.c
+abc-build/src/proof/cec/cecSim.c
+abc-build/src/proof/cec/cecSolve.c
+abc-build/src/proof/cec/cecSplit.c
+abc-build/src/proof/cec/cecSweep.c
+abc-build/src/proof/cec/cecSynth.c
+abc-build/src/proof/cec/module.make
+abc-build/src/proof/dch/dch.h
+abc-build/src/proof/dch/dchAig.c
+abc-build/src/proof/dch/dchChoice.c
+abc-build/src/proof/dch/dchClass.c
+abc-build/src/proof/dch/dchCnf.c
+abc-build/src/proof/dch/dchCore.c
+abc-build/src/proof/dch/dchInt.h
+abc-build/src/proof/dch/dchMan.c
+abc-build/src/proof/dch/dchSat.c
+abc-build/src/proof/dch/dchSim.c
+abc-build/src/proof/dch/dchSimSat.c
+abc-build/src/proof/dch/dchSweep.c
+abc-build/src/proof/dch/module.make
+abc-build/src/proof/fra/fra.h
+abc-build/src/proof/fra/fra_.c
+abc-build/src/proof/fra/fraBmc.c
+abc-build/src/proof/fra/fraCec.c
+abc-build/src/proof/fra/fraClass.c
+abc-build/src/proof/fra/fraClau.c
+abc-build/src/proof/fra/fraClaus.c
+abc-build/src/proof/fra/fraCnf.c
+abc-build/src/proof/fra/fraCore.c
+abc-build/src/proof/fra/fraHot.c
+abc-build/src/proof/fra/fraImp.c
+abc-build/src/proof/fra/fraInd.c
+abc-build/src/proof/fra/fraIndVer.c
+abc-build/src/proof/fra/fraLcr.c
+abc-build/src/proof/fra/fraMan.c
+abc-build/src/proof/fra/fraPart.c
+abc-build/src/proof/fra/fraSat.c
+abc-build/src/proof/fra/fraSec.c
+abc-build/src/proof/fra/fraSim.c
+abc-build/src/proof/fra/module.make
+abc-build/src/proof/fraig/fraig.h
+abc-build/src/proof/fraig/fraigApi.c
+abc-build/src/proof/fraig/fraigCanon.c
+abc-build/src/proof/fraig/fraigChoice.c
+abc-build/src/proof/fraig/fraigFanout.c
+abc-build/src/proof/fraig/fraigFeed.c
+abc-build/src/proof/fraig/fraigInt.h
+abc-build/src/proof/fraig/fraigMan.c
+abc-build/src/proof/fraig/fraigMem.c
+abc-build/src/proof/fraig/fraigNode.c
+abc-build/src/proof/fraig/fraigPrime.c
+abc-build/src/proof/fraig/fraigSat.c
+abc-build/src/proof/fraig/fraigTable.c
+abc-build/src/proof/fraig/fraigUtil.c
+abc-build/src/proof/fraig/fraigVec.c
+abc-build/src/proof/fraig/module.make
+abc-build/src/proof/int/int.h
+abc-build/src/proof/int/intCheck.c
+abc-build/src/proof/int/intContain.c
+abc-build/src/proof/int/intCore.c
+abc-build/src/proof/int/intCtrex.c
+abc-build/src/proof/int/intDup.c
+abc-build/src/proof/int/intFrames.c
+abc-build/src/proof/int/intInt.h
+abc-build/src/proof/int/intInter.c
+abc-build/src/proof/int/intM114.c
+abc-build/src/proof/int/intM114p.c
+abc-build/src/proof/int/intMan.c
+abc-build/src/proof/int/intUtil.c
+abc-build/src/proof/int/module.make
+abc-build/src/proof/int2/int2.h
+abc-build/src/proof/int2/int2Bmc.c
+abc-build/src/proof/int2/int2Core.c
+abc-build/src/proof/int2/int2Int.h
+abc-build/src/proof/int2/int2Refine.c
+abc-build/src/proof/int2/int2Util.c
+abc-build/src/proof/int2/module.make
+abc-build/src/proof/live/arenaViolation.c
+abc-build/src/proof/live/combination.c
+abc-build/src/proof/live/disjunctiveMonotone.c
+abc-build/src/proof/live/kLiveConstraints.c
+abc-build/src/proof/live/kliveness.c
+abc-build/src/proof/live/liveness.c
+abc-build/src/proof/live/liveness_sim.c
+abc-build/src/proof/live/ltl_parser.c
+abc-build/src/proof/live/module.make
+abc-build/src/proof/live/monotone.c
+abc-build/src/proof/llb/llb.c
+abc-build/src/proof/llb/llb.h
+abc-build/src/proof/llb/llb1Cluster.c
+abc-build/src/proof/llb/llb1Constr.c
+abc-build/src/proof/llb/llb1Core.c
+abc-build/src/proof/llb/llb1Group.c
+abc-build/src/proof/llb/llb1Hint.c
+abc-build/src/proof/llb/llb1Man.c
+abc-build/src/proof/llb/llb1Matrix.c
+abc-build/src/proof/llb/llb1Pivot.c
+abc-build/src/proof/llb/llb1Reach.c
+abc-build/src/proof/llb/llb1Sched.c
+abc-build/src/proof/llb/llb2Bad.c
+abc-build/src/proof/llb/llb2Core.c
+abc-build/src/proof/llb/llb2Driver.c
+abc-build/src/proof/llb/llb2Dump.c
+abc-build/src/proof/llb/llb2Flow.c
+abc-build/src/proof/llb/llb2Image.c
+abc-build/src/proof/llb/llb3Image.c
+abc-build/src/proof/llb/llb3Nonlin.c
+abc-build/src/proof/llb/llb4Cex.c
+abc-build/src/proof/llb/llb4Cluster.c
+abc-build/src/proof/llb/llb4Image.c
+abc-build/src/proof/llb/llb4Map.c
+abc-build/src/proof/llb/llb4Nonlin.c
+abc-build/src/proof/llb/llb4Sweep.c
+abc-build/src/proof/llb/llbInt.h
+abc-build/src/proof/llb/module.make
+abc-build/src/proof/pdr/module.make
+abc-build/src/proof/pdr/pdr.c
+abc-build/src/proof/pdr/pdr.h
+abc-build/src/proof/pdr/pdrClass.c
+abc-build/src/proof/pdr/pdrCnf.c
+abc-build/src/proof/pdr/pdrCore.c
+abc-build/src/proof/pdr/pdrInt.h
+abc-build/src/proof/pdr/pdrInv.c
+abc-build/src/proof/pdr/pdrMan.c
+abc-build/src/proof/pdr/pdrSat.c
+abc-build/src/proof/pdr/pdrTsim.c
+abc-build/src/proof/pdr/pdrUtil.c
+abc-build/src/proof/ssc/module.make
+abc-build/src/proof/ssc/ssc.h
+abc-build/src/proof/ssc/sscClass.c
+abc-build/src/proof/ssc/sscCore.c
+abc-build/src/proof/ssc/sscInt.h
+abc-build/src/proof/ssc/sscSat.c
+abc-build/src/proof/ssc/sscSim.c
+abc-build/src/proof/ssc/sscUtil.c
+abc-build/src/proof/ssw/module.make
+abc-build/src/proof/ssw/ssw.h
+abc-build/src/proof/ssw/sswAig.c
+abc-build/src/proof/ssw/sswBmc.c
+abc-build/src/proof/ssw/sswClass.c
+abc-build/src/proof/ssw/sswCnf.c
+abc-build/src/proof/ssw/sswConstr.c
+abc-build/src/proof/ssw/sswCore.c
+abc-build/src/proof/ssw/sswDyn.c
+abc-build/src/proof/ssw/sswFilter.c
+abc-build/src/proof/ssw/sswInt.h
+abc-build/src/proof/ssw/sswIslands.c
+abc-build/src/proof/ssw/sswLcorr.c
+abc-build/src/proof/ssw/sswMan.c
+abc-build/src/proof/ssw/sswPairs.c
+abc-build/src/proof/ssw/sswPart.c
+abc-build/src/proof/ssw/sswRarity.c
+abc-build/src/proof/ssw/sswRarity2.c
+abc-build/src/proof/ssw/sswSat.c
+abc-build/src/proof/ssw/sswSemi.c
+abc-build/src/proof/ssw/sswSim.c
+abc-build/src/proof/ssw/sswSimSat.c
+abc-build/src/proof/ssw/sswSweep.c
+abc-build/src/proof/ssw/sswUnique.c
+abc-build/src/python/abc.sh
+abc-build/src/python/abcpy_test.py
+abc-build/src/python/build.txt
+abc-build/src/python/getch.py
+abc-build/src/python/module.make
+abc-build/src/python/package.py
+abc-build/src/python/pyabc.i
+abc-build/src/python/pyabc_split.py
+abc-build/src/python/reachx_cmd.py
+abc-build/src/python/redirect.py
+abc-build/src/python/setup.py
+abc-build/src/sat/bmc/bmc.c
+abc-build/src/sat/bmc/bmc.h
+abc-build/src/sat/bmc/bmcBCore.c
+abc-build/src/sat/bmc/bmcBmc.c
+abc-build/src/sat/bmc/bmcBmc2.c
+abc-build/src/sat/bmc/bmcBmc3.c
+abc-build/src/sat/bmc/bmcBmcAnd.c
+abc-build/src/sat/bmc/bmcBmci.c
+abc-build/src/sat/bmc/bmcCexCare.c
+abc-build/src/sat/bmc/bmcCexCut.c
+abc-build/src/sat/bmc/bmcCexDepth.c
+abc-build/src/sat/bmc/bmcCexMin1.c
+abc-build/src/sat/bmc/bmcCexMin2.c
+abc-build/src/sat/bmc/bmcCexTools.c
+abc-build/src/sat/bmc/bmcEco.c
+abc-build/src/sat/bmc/bmcFault.c
+abc-build/src/sat/bmc/bmcICheck.c
+abc-build/src/sat/bmc/bmcInse.c
+abc-build/src/sat/bmc/bmcLoad.c
+abc-build/src/sat/bmc/bmcMaxi.c
+abc-build/src/sat/bmc/bmcMulti.c
+abc-build/src/sat/bmc/bmcUnroll.c
+abc-build/src/sat/bmc/module.make
+abc-build/src/sat/bsat/license
+abc-build/src/sat/bsat/module.make
+abc-build/src/sat/bsat/satChecker.c
+abc-build/src/sat/bsat/satClause.h
+abc-build/src/sat/bsat/satInter.c
+abc-build/src/sat/bsat/satInterA.c
+abc-build/src/sat/bsat/satInterB.c
+abc-build/src/sat/bsat/satInterP.c
+abc-build/src/sat/bsat/satMem.c
+abc-build/src/sat/bsat/satMem.h
+abc-build/src/sat/bsat/satProof.c
+abc-build/src/sat/bsat/satProof2.h
+abc-build/src/sat/bsat/satSolver.c
+abc-build/src/sat/bsat/satSolver.h
+abc-build/src/sat/bsat/satSolver2.c
+abc-build/src/sat/bsat/satSolver2.h
+abc-build/src/sat/bsat/satSolver2i.c
+abc-build/src/sat/bsat/satStore.c
+abc-build/src/sat/bsat/satStore.h
+abc-build/src/sat/bsat/satTrace.c
+abc-build/src/sat/bsat/satTruth.c
+abc-build/src/sat/bsat/satTruth.h
+abc-build/src/sat/bsat/satUtil.c
+abc-build/src/sat/bsat/satVec.h
+abc-build/src/sat/cnf/cnf.h
+abc-build/src/sat/cnf/cnf_.c
+abc-build/src/sat/cnf/cnfCore.c
+abc-build/src/sat/cnf/cnfCut.c
+abc-build/src/sat/cnf/cnfData.c
+abc-build/src/sat/cnf/cnfFast.c
+abc-build/src/sat/cnf/cnfMan.c
+abc-build/src/sat/cnf/cnfMap.c
+abc-build/src/sat/cnf/cnfPost.c
+abc-build/src/sat/cnf/cnfUtil.c
+abc-build/src/sat/cnf/cnfWrite.c
+abc-build/src/sat/cnf/module.make
+abc-build/src/sat/csat/csat_apis.c
+abc-build/src/sat/csat/csat_apis.h
+abc-build/src/sat/csat/module.make
+abc-build/src/sat/lsat/solver.h
+abc-build/src/sat/msat/module.make
+abc-build/src/sat/msat/msat.h
+abc-build/src/sat/msat/msatActivity.c
+abc-build/src/sat/msat/msatClause.c
+abc-build/src/sat/msat/msatClauseVec.c
+abc-build/src/sat/msat/msatInt.h
+abc-build/src/sat/msat/msatMem.c
+abc-build/src/sat/msat/msatOrderH.c
+abc-build/src/sat/msat/msatOrderJ.c
+abc-build/src/sat/msat/msatQueue.c
+abc-build/src/sat/msat/msatRead.c
+abc-build/src/sat/msat/msatSolverApi.c
+abc-build/src/sat/msat/msatSolverCore.c
+abc-build/src/sat/msat/msatSolverIo.c
+abc-build/src/sat/msat/msatSolverSearch.c
+abc-build/src/sat/msat/msatSort.c
+abc-build/src/sat/msat/msatVec.c
+abc-build/src/sat/proof/pr.c
+abc-build/src/sat/proof/pr.h
+abc-build/src/sat/proof/stats.txt
+abc-build/src/sat/psat/m114p.h
+abc-build/src/sat/psat/m114p_types.h
+abc-build/src/sat/psat/module.make
+abc-build/src/starter.c
+abc-build/src/template.c
diff --git a/abc-build/abclib.dsp b/abc-build/abclib.dsp
--- a/abc-build/abclib.dsp
+++ b/abc-build/abclib.dsp
@@ -734,7 +734,47 @@
 
 # PROP Default_Filter ""
 # End Group
+# Begin Group "pcm"
+
+# PROP Default_Filter ""
 # End Group
+# Begin Group "ply"
+
+# PROP Default_Filter ""
+# End Group
+# Begin Group "wlc"
+
+# PROP Default_Filter ""
+# Begin Source File
+
+SOURCE=.\src\base\wlc\wlc.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\base\wlc\wlc.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\base\wlc\wlcBlast.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\base\wlc\wlcCom.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\base\wlc\wlcNtk.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\base\wlc\wlcReadVer.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\src\base\wlc\wlcWriteVer.c
+# End Source File
+# End Group
+# End Group
 # Begin Group "bdd"
 
 # PROP Default_Filter ""
@@ -2339,6 +2379,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\src\map\if\ifData2.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\map\if\ifDec07.c
 # End Source File
 # Begin Source File
@@ -2383,6 +2427,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\src\map\if\ifMatch2.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\map\if\ifReduce.c
 # End Source File
 # Begin Source File
@@ -3687,14 +3735,18 @@
 # End Source File
 # Begin Source File
 
-SOURCE=.\src\aig\gia\giaBalance.c
+SOURCE=.\src\aig\gia\giaBalAig.c
 # End Source File
 # Begin Source File
 
-SOURCE=.\src\aig\gia\giaBalance2.c
+SOURCE=.\src\aig\gia\giaBalLut.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\src\aig\gia\giaBalMap.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\aig\gia\giaBidec.c
 # End Source File
 # Begin Source File
@@ -3707,6 +3759,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\src\aig\gia\giaClp.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\aig\gia\giaCof.c
 # End Source File
 # Begin Source File
@@ -3867,6 +3923,10 @@
 # End Source File
 # Begin Source File
 
+SOURCE=.\src\aig\gia\giaScript.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\src\aig\gia\giaShrink.c
 # End Source File
 # Begin Source File
@@ -3884,10 +3944,6 @@
 # Begin Source File
 
 SOURCE=.\src\aig\gia\giaSim2.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\src\aig\gia\giaSopb.c
 # End Source File
 # Begin Source File
 
diff --git a/abc-build/galois-abcBridge.version b/abc-build/galois-abcBridge.version
new file mode 100644
--- /dev/null
+++ b/abc-build/galois-abcBridge.version
@@ -0,0 +1,1 @@
+0.11
diff --git a/abc-build/lib/x64/pthreadVC2.dll b/abc-build/lib/x64/pthreadVC2.dll
deleted file mode 100644
Binary files a/abc-build/lib/x64/pthreadVC2.dll and /dev/null differ
diff --git a/abc-build/lib/x64/pthreadVC2.lib b/abc-build/lib/x64/pthreadVC2.lib
deleted file mode 100644
Binary files a/abc-build/lib/x64/pthreadVC2.lib and /dev/null differ
diff --git a/abc-build/lib/x86/pthreadVC2.dll b/abc-build/lib/x86/pthreadVC2.dll
deleted file mode 100644
Binary files a/abc-build/lib/x86/pthreadVC2.dll and /dev/null differ
diff --git a/abc-build/lib/x86/pthreadVC2.lib b/abc-build/lib/x86/pthreadVC2.lib
deleted file mode 100644
Binary files a/abc-build/lib/x86/pthreadVC2.lib and /dev/null differ
diff --git a/abc-build/src/aig/aig/aigFact.c b/abc-build/src/aig/aig/aigFact.c
--- a/abc-build/src/aig/aig/aigFact.c
+++ b/abc-build/src/aig/aig/aigFact.c
@@ -347,7 +347,7 @@
 ***********************************************************************/
 Aig_Obj_t * Aig_SuppMinReconstruct( Aig_Man_t * p, Vec_Ptr_t * vCofs, Vec_Ptr_t * vNodes, Vec_Ptr_t * vSupp )
 {
-    Aig_Obj_t * pObj;
+    Aig_Obj_t * pObj = NULL;
     int i;
     // set the value of the support variables
     Vec_PtrForEachEntry( Aig_Obj_t *, vSupp, pObj, i )
diff --git a/abc-build/src/aig/gia/gia.h b/abc-build/src/aig/gia/gia.h
--- a/abc-build/src/aig/gia/gia.h
+++ b/abc-build/src/aig/gia/gia.h
@@ -278,6 +278,7 @@
     int            nLutSizeMax;
     int            nCutNumMax;
     int            nProcNumMax;
+    int            nLutSizeMux;
     word           Delay;
     word           Area;
     word           Edge;
@@ -1020,7 +1021,7 @@
 /*=== giaBalance.c ===========================================================*/
 extern Gia_Man_t *         Gia_ManBalance( Gia_Man_t * p, int fSimpleAnd, int fVerbose );
 extern Gia_Man_t *         Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax, int fVerbose, int fVeryVerbose );
-extern Gia_Man_t *         Gia_ManAigSyn2( Gia_Man_t * p, int fOldAlgo, int fCoarsen, int fCutMin, int nRelaxRatio, int fVerbose, int fVeryVerbose );
+extern Gia_Man_t *         Gia_ManAigSyn2( Gia_Man_t * p, int fOldAlgo, int fCoarsen, int fCutMin, int nRelaxRatio, int fDelayMin, int fVerbose, int fVeryVerbose );
 extern Gia_Man_t *         Gia_ManAigSyn3( Gia_Man_t * p, int fVerbose, int fVeryVerbose );
 extern Gia_Man_t *         Gia_ManAigSyn4( Gia_Man_t * p, int fVerbose, int fVeryVerbose );
 /*=== giaBidec.c ===========================================================*/
@@ -1066,6 +1067,7 @@
 extern Gia_Man_t *         Gia_ManDupFlip( Gia_Man_t * p, int * pInitState );
 extern Gia_Man_t *         Gia_ManDupCycled( Gia_Man_t * pAig, Abc_Cex_t * pCex, int nFrames );
 extern Gia_Man_t *         Gia_ManDup( Gia_Man_t * p );  
+extern Gia_Man_t *         Gia_ManDupWithAttributes( Gia_Man_t * p );  
 extern Gia_Man_t *         Gia_ManDupZero( Gia_Man_t * p );
 extern Gia_Man_t *         Gia_ManDupPerm( Gia_Man_t * p, Vec_Int_t * vPiPerm );
 extern Gia_Man_t *         Gia_ManDupPermFlop( Gia_Man_t * p, Vec_Int_t * vFfPerm );
@@ -1179,12 +1181,16 @@
 extern int                 Gia_ManLutSizeMax( Gia_Man_t * p );
 extern int                 Gia_ManLutNum( Gia_Man_t * p );
 extern int                 Gia_ManLutLevel( Gia_Man_t * p );
+extern void                Gia_ManLutParams( Gia_Man_t * p, int * pnCurLuts, int * pnCurEdges, int * pnCurLevels );
 extern void                Gia_ManSetRefsMapped( Gia_Man_t * p );
 extern void                Gia_ManSetIfParsDefault( void * pIfPars );
 extern void                Gia_ManMappingVerify( Gia_Man_t * p );
-extern void                Gia_ManTransferMapping( Gia_Man_t * pGia, Gia_Man_t * p );
-extern Gia_Man_t *         Gia_ManPerformMapping( Gia_Man_t * p, void * pIfPars, int fNormalized );
+extern void                Gia_ManTransferMapping( Gia_Man_t * p, Gia_Man_t * pGia );
+extern void                Gia_ManTransferPacking( Gia_Man_t * p, Gia_Man_t * pGia );
+extern void                Gia_ManTransferTiming( Gia_Man_t * p, Gia_Man_t * pGia );
+extern Gia_Man_t *         Gia_ManPerformMapping( Gia_Man_t * p, void * pIfPars );
 extern Gia_Man_t *         Gia_ManPerformSopBalance( Gia_Man_t * p, int nCutNum, int nRelaxRatio, int fVerbose );
+extern Gia_Man_t *         Gia_ManPerformDsdBalance( Gia_Man_t * p, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose );
 /*=== giaJf.c ===========================================================*/
 extern void                Jf_ManSetDefaultPars( Jf_Par_t * pPars );
 extern Gia_Man_t *         Jf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars );
@@ -1258,7 +1264,9 @@
 extern Gia_Man_t *         Gia_ManMapShrink4( Gia_Man_t * p, int fKeepLevel, int fVerbose );
 extern Gia_Man_t *         Gia_ManMapShrink6( Gia_Man_t * p, int nFanoutMax, int fKeepLevel, int fVerbose );
 /*=== giaSopb.c ============================================================*/
-extern Gia_Man_t *         Gia_ManPerformSopBalanceWin( Gia_Man_t * p, int LevelMax, int nLevelRatio, int nCutNum, int nRelaxRatio, int fVerbose );
+extern Gia_Man_t *         Gia_ManExtractWindow( Gia_Man_t * p, int LevelMax, int nTimeWindow, int fVerbose );
+extern Gia_Man_t *         Gia_ManPerformSopBalanceWin( Gia_Man_t * p, int LevelMax, int nTimeWindow, int nCutNum, int nRelaxRatio, int fVerbose );
+extern Gia_Man_t *         Gia_ManPerformDsdBalanceWin( Gia_Man_t * p, int LevelMax, int nTimeWindow, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose );
 /*=== giaSort.c ============================================================*/
 extern int *               Gia_SortFloats( float * pArray, int * pPerm, int nSize );
 /*=== giaSim.c ============================================================*/
@@ -1307,6 +1315,7 @@
 extern Gia_Man_t *         Gia_ManDupUnnormalize( Gia_Man_t * p );
 extern Gia_Man_t *         Gia_ManDupCollapse( Gia_Man_t * p, Gia_Man_t * pBoxes, Vec_Int_t * vBoxPres );
 extern int                 Gia_ManLevelWithBoxes( Gia_Man_t * p );
+extern int                 Gia_ManLutLevelWithBoxes( Gia_Man_t * p );
 extern int                 Gia_ManVerifyWithBoxes( Gia_Man_t * pGia, void * pParsInit );
 extern void *              Gia_ManUpdateTimMan( Gia_Man_t * p, Vec_Int_t * vBoxPres );
 extern Gia_Man_t *         Gia_ManUpdateExtraAig( void * pTime, Gia_Man_t * pAig, Vec_Int_t * vBoxPres );
diff --git a/abc-build/src/aig/gia/giaAig.c b/abc-build/src/aig/gia/giaAig.c
--- a/abc-build/src/aig/gia/giaAig.c
+++ b/abc-build/src/aig/gia/giaAig.c
@@ -558,10 +558,8 @@
     pNew = Dar_ManCompress2( pTemp = pNew, 1, fUpdateLevel, 1, 0, fVerbose );
     Aig_ManStop( pTemp );
     pGia = Gia_ManFromAig( pNew );
-    Aig_ManStop( pNew );
-    pGia->pManTime   = p->pManTime;   p->pManTime   = NULL;
-    pGia->pAigExtra  = p->pAigExtra;  p->pAigExtra  = NULL;
-    pGia->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
+    Aig_ManStop( pNew );
+    Gia_ManTransferTiming( pGia, p );
     return pGia;
 }
 
@@ -586,10 +584,8 @@
     pNew = Dar_ManChoiceNew( pNew, (Dch_Pars_t *)pPars );
 //    pGia = Gia_ManFromAig( pNew );
     pGia = Gia_ManFromAigChoices( pNew );
-    Aig_ManStop( pNew );
-    pGia->pManTime   = p->pManTime;   p->pManTime   = NULL;
-    pGia->pAigExtra  = p->pAigExtra;  p->pAigExtra  = NULL;
-    pGia->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
+    Aig_ManStop( pNew );
+    Gia_ManTransferTiming( pGia, p );
     return pGia;
 }
 
diff --git a/abc-build/src/aig/gia/giaAiger.c b/abc-build/src/aig/gia/giaAiger.c
--- a/abc-build/src/aig/gia/giaAiger.c
+++ b/abc-build/src/aig/gia/giaAiger.c
@@ -785,7 +785,10 @@
     }
     Vec_IntFreeP( &vInits );
     if ( !fSkipStrash && pNew->vMapping )
-        Abc_Print( 0, "Structural hashing enabled while reading AIGER may have invalidated the mapping.  Consider using \"&r -s\".\n" );
+    {
+        Abc_Print( 0, "Structural hashing enabled while reading AIGER invalidated the mapping.  Consider using \"&r -s\".\n" );
+        Vec_IntFreeP( &pNew->vMapping );
+    }
     return pNew;
 }
 
@@ -1035,11 +1038,11 @@
     {
 //        printf( "Gia_AigerWrite(): Normalizing AIG for writing.\n" );
         p = Gia_ManDupNormalize( pInit );
-        p->pManTime   = pInit->pManTime;   pInit->pManTime   = NULL;
+		Gia_ManTransferMapping( p, pInit );
+	    Gia_ManTransferPacking( p, pInit );
+        Gia_ManTransferTiming( p, pInit );
         p->vNamesIn   = pInit->vNamesIn;   pInit->vNamesIn   = NULL;
         p->vNamesOut  = pInit->vNamesOut;  pInit->vNamesOut  = NULL;
-        p->pAigExtra  = pInit->pAigExtra;  pInit->pAigExtra  = NULL;
-        p->nAnd2Delay = pInit->nAnd2Delay; pInit->nAnd2Delay = 0;
         p->nConstrs   = pInit->nConstrs;   pInit->nConstrs   = 0;
     }
     else
diff --git a/abc-build/src/aig/gia/giaBalAig.c b/abc-build/src/aig/gia/giaBalAig.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/aig/gia/giaBalAig.c
@@ -0,0 +1,989 @@
+/**CFile****************************************************************
+
+  FileName    [giaBalance.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Scalable AIG package.]
+
+  Synopsis    [AIG balancing.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - June 20, 2005.]
+
+  Revision    [$Id: giaBalance.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "gia.h"
+#include "misc/vec/vecHash.h"
+#include "misc/vec/vecQue.h"
+#include "opt/dau/dau.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+// operation manager
+typedef struct Dam_Man_t_ Dam_Man_t;
+struct Dam_Man_t_
+{
+    Gia_Man_t *      pGia;      // user's AIG
+    Vec_Int_t *      vNod2Set;  // node ID into fanin set
+    Vec_Int_t *      vDiv2Nod;  // div ID into root node set
+    Vec_Int_t *      vSetStore; // fanin set storage
+    Vec_Int_t *      vNodStore; // root node set storage
+    Vec_Flt_t *      vCounts;   // occur counts
+    Vec_Int_t *      vNodLevR;  // node reverse level
+    Vec_Int_t *      vDivLevR;  // divisor reverse level
+    Vec_Int_t *      vVisit;    // visited MUXes
+    Vec_Que_t *      vQue;      // pairs by their weight
+    Hash_IntMan_t *  vHash;     // pair hash table
+    abctime          clkStart;  // starting the clock
+    int              nLevelMax; // maximum level
+    int              nDivs;     // extracted divisor count
+    int              nAnds;     // total AND node count
+    int              nGain;     // total gain in AND nodes
+    int              nGainX;    // gain from XOR nodes
+};
+
+static inline int    Dam_ObjHand( Dam_Man_t * p, int i )     { return i < Vec_IntSize(p->vNod2Set) ? Vec_IntEntry(p->vNod2Set, i) : 0;                      }
+static inline int *  Dam_ObjSet( Dam_Man_t * p, int i )      { int h = Dam_ObjHand(p, i); if ( h == 0 ) return NULL; return Vec_IntEntryP(p->vSetStore, h); }
+
+static inline int    Dam_DivHand( Dam_Man_t * p, int d )     { return d < Vec_IntSize(p->vDiv2Nod) ? Vec_IntEntry(p->vDiv2Nod, d) : 0;                      }
+static inline int *  Dam_DivSet( Dam_Man_t * p, int d )      { int h = Dam_DivHand(p, d); if ( h == 0 ) return NULL; return Vec_IntEntryP(p->vNodStore, h); }
+
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    [Simplify multi-input AND/XOR.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManSimplifyXor( Vec_Int_t * vSuper )
+{
+    int i, k = 0, Prev = -1, This, fCompl = 0;
+    Vec_IntForEachEntry( vSuper, This, i )
+    {
+        if ( This == 0 )
+            continue;
+        if ( This == 1 )
+            fCompl ^= 1; 
+        else if ( Prev != This )
+            Vec_IntWriteEntry( vSuper, k++, This ), Prev = This;
+        else
+            Prev = -1, k--;
+    }
+    Vec_IntShrink( vSuper, k );
+    if ( Vec_IntSize( vSuper ) == 0 )
+        Vec_IntPush( vSuper, fCompl );
+    else if ( fCompl )
+        Vec_IntWriteEntry( vSuper, 0, Abc_LitNot(Vec_IntEntry(vSuper, 0)) );
+}
+void Gia_ManSimplifyAnd( Vec_Int_t * vSuper )
+{
+    int i, k = 0, Prev = -1, This;
+    Vec_IntForEachEntry( vSuper, This, i )
+    {
+        if ( This == 0 )
+            { Vec_IntFill(vSuper, 1, 0); return; }
+        if ( This == 1 )
+            continue;
+        if ( Prev == -1 || Abc_Lit2Var(Prev) != Abc_Lit2Var(This) )
+            Vec_IntWriteEntry( vSuper, k++, This ), Prev = This;
+        else if ( Prev != This )
+            { Vec_IntFill(vSuper, 1, 0); return; }
+    }
+    Vec_IntShrink( vSuper, k );
+    if ( Vec_IntSize( vSuper ) == 0 )
+        Vec_IntPush( vSuper, 1 );
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Collect multi-input AND/XOR.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManSuperCollectXor_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+    assert( !Gia_IsComplement(pObj) );
+    if ( !Gia_ObjIsXor(pObj) || 
+//        Gia_ObjRefNum(p, pObj) > 1 || 
+        Gia_ObjRefNum(p, pObj) > 2 || 
+        (Gia_ObjRefNum(p, pObj) == 2 && (Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) == 1 || Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) == 1)) || 
+        Vec_IntSize(p->vSuper) > 100 )
+    {
+        Vec_IntPush( p->vSuper, Gia_ObjToLit(p, pObj) );
+        return;
+    }
+    assert( !Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) );
+    Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin0(pObj) );
+    Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin1(pObj) );
+}
+void Gia_ManSuperCollectAnd_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+    if ( Gia_IsComplement(pObj) || 
+        !Gia_ObjIsAndReal(p, pObj) || 
+//        Gia_ObjRefNum(p, pObj) > 1 || 
+        Gia_ObjRefNum(p, pObj) > 2 || 
+        (Gia_ObjRefNum(p, pObj) == 2 && (Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) == 1 || Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) == 1)) || 
+        Vec_IntSize(p->vSuper) > 100 )
+    {
+        Vec_IntPush( p->vSuper, Gia_ObjToLit(p, pObj) );
+        return;
+    }
+    Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild0(pObj) );
+    Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild1(pObj) );
+}
+void Gia_ManSuperCollect( Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+//    int nSize;
+    if ( p->vSuper == NULL )
+        p->vSuper = Vec_IntAlloc( 1000 );
+    else
+        Vec_IntClear( p->vSuper );
+    if ( Gia_ObjIsXor(pObj) )
+    {
+        assert( !Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) );
+        Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin0(pObj) );
+        Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin1(pObj) );
+//        nSize = Vec_IntSize(vSuper);
+        Vec_IntSort( p->vSuper, 0 );
+        Gia_ManSimplifyXor( p->vSuper );
+//        if ( nSize != Vec_IntSize(vSuper) )
+//            printf( "X %d->%d  ", nSize, Vec_IntSize(vSuper) );
+    }
+    else if ( Gia_ObjIsAndReal(p, pObj) )
+    {
+        Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild0(pObj) );
+        Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild1(pObj) );
+//        nSize = Vec_IntSize(vSuper);
+        Vec_IntSort( p->vSuper, 0 );
+        Gia_ManSimplifyAnd( p->vSuper );
+//        if ( nSize != Vec_IntSize(vSuper) )
+//            printf( "A %d->%d  ", nSize, Vec_IntSize(vSuper) );
+    }
+    else assert( 0 );
+//    if ( nSize > 10 )
+//        printf( "%d ", nSize );
+    assert( Vec_IntSize(p->vSuper) > 0 );
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManCreateGate( Gia_Man_t * pNew, Gia_Obj_t * pObj, Vec_Int_t * vSuper )
+{
+    int iLit0 = Vec_IntPop(vSuper);
+    int iLit1 = Vec_IntPop(vSuper);
+    int iLit, i;
+    if ( !Gia_ObjIsXor(pObj) )
+        iLit = Gia_ManHashAnd( pNew, iLit0, iLit1 );
+    else if ( pNew->pMuxes )
+        iLit = Gia_ManHashXorReal( pNew, iLit0, iLit1 );
+    else 
+        iLit = Gia_ManHashXor( pNew, iLit0, iLit1 );
+    Vec_IntPush( vSuper, iLit );
+    Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(iLit)) );
+    // shift to the corrent location
+    for ( i = Vec_IntSize(vSuper)-1; i > 0; i-- )
+    {
+        int iLit1 = Vec_IntEntry(vSuper, i);
+        int iLit2 = Vec_IntEntry(vSuper, i-1);
+        if ( Gia_ObjLevelId(pNew, Abc_Lit2Var(iLit1)) <= Gia_ObjLevelId(pNew, Abc_Lit2Var(iLit2)) )
+            break;
+        Vec_IntWriteEntry( vSuper, i,   iLit2 );
+        Vec_IntWriteEntry( vSuper, i-1, iLit1 );
+    }
+}
+int Gia_ManBalanceGate( Gia_Man_t * pNew, Gia_Obj_t * pObj, Vec_Int_t * vSuper, int * pLits, int nLits )
+{
+    Vec_IntClear( vSuper );
+    if ( nLits == 1 )
+        Vec_IntPush( vSuper, pLits[0] );
+    else if ( nLits == 2 )
+    {
+        Vec_IntPush( vSuper, pLits[0] );
+        Vec_IntPush( vSuper, pLits[1] );
+        Gia_ManCreateGate( pNew, pObj, vSuper );
+    }
+    else if ( nLits > 2 )
+    {
+        // collect levels
+        int i, * pArray, * pPerm;
+        for ( i = 0; i < nLits; i++ )
+            Vec_IntPush( vSuper, Gia_ObjLevelId(pNew, Abc_Lit2Var(pLits[i])) );
+        // sort by level
+        Vec_IntGrow( vSuper, 4 * nLits );        
+        pArray = Vec_IntArray( vSuper );
+        pPerm = pArray + nLits;
+        Abc_QuickSortCostData( pArray, nLits, 1, (word *)(pArray + 2 * nLits), pPerm );
+        // collect in the increasing order of level
+        for ( i = 0; i < nLits; i++ )
+            Vec_IntWriteEntry( vSuper, i, pLits[pPerm[i]] );
+        Vec_IntShrink( vSuper, nLits );
+//        Vec_IntForEachEntry( vSuper, iLit, i )
+//            printf( "%d ", Gia_ObjLevel(pNew, Gia_ManObj( pNew, Abc_Lit2Var(iLit) )) );
+//        printf( "\n" );
+        // perform incremental extraction
+        while ( Vec_IntSize(vSuper) > 1 )
+            Gia_ManCreateGate( pNew, pObj, vSuper );
+    }
+    // consider trivial case
+    assert( Vec_IntSize(vSuper) == 1 );
+    return Vec_IntEntry(vSuper, 0);
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManBalance_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+    int i, iLit, iBeg, iEnd;
+    if ( ~pObj->Value )
+        return;
+    assert( Gia_ObjIsAnd(pObj) );
+    // handle MUX
+    if ( Gia_ObjIsMux(p, pObj) )
+    {
+        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin0(pObj) );
+        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin1(pObj) );
+        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin2(p, pObj) );
+        pObj->Value = Gia_ManHashMuxReal( pNew, Gia_ObjFanin2Copy(p, pObj), Gia_ObjFanin1Copy(pObj), Gia_ObjFanin0Copy(pObj) );
+        Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(pObj->Value)) );
+        return;
+    }
+    // find supergate
+    Gia_ManSuperCollect( p, pObj );
+    // save entries
+    if ( p->vStore == NULL )
+        p->vStore = Vec_IntAlloc( 1000 );
+    iBeg = Vec_IntSize( p->vStore );
+    Vec_IntAppend( p->vStore, p->vSuper );
+    iEnd = Vec_IntSize( p->vStore );
+    // call recursively
+    Vec_IntForEachEntryStartStop( p->vStore, iLit, i, iBeg, iEnd )
+    {
+        Gia_Obj_t * pTemp = Gia_ManObj( p, Abc_Lit2Var(iLit) );
+        Gia_ManBalance_rec( pNew, p, pTemp );
+        Vec_IntWriteEntry( p->vStore, i, Abc_LitNotCond(pTemp->Value, Abc_LitIsCompl(iLit)) );
+    }
+    assert( Vec_IntSize(p->vStore) == iEnd );
+    // consider general case
+    pObj->Value = Gia_ManBalanceGate( pNew, pObj, p->vSuper, Vec_IntEntryP(p->vStore, iBeg), iEnd-iBeg );
+    Vec_IntShrink( p->vStore, iBeg );
+}
+Gia_Man_t * Gia_ManBalanceInt( Gia_Man_t * p )
+{
+    Gia_Man_t * pNew, * pTemp;
+    Gia_Obj_t * pObj;
+    int i;
+    Gia_ManFillValue( p );
+    Gia_ManCreateRefs( p ); 
+    // start the new manager
+    pNew = Gia_ManStart( Gia_ManObjNum(p) );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+    pNew->pMuxes = ABC_CALLOC( unsigned, pNew->nObjsAlloc );
+    pNew->vLevels = Vec_IntStart( pNew->nObjsAlloc );
+    // create constant and inputs
+    Gia_ManConst0(p)->Value = 0;
+    Gia_ManForEachCi( p, pObj, i )
+        pObj->Value = Gia_ManAppendCi( pNew );
+    // create internal nodes
+    Gia_ManHashStart( pNew );
+    Gia_ManForEachCo( p, pObj, i )
+    {
+        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin0(pObj) );
+        pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+    }
+    assert( Gia_ManObjNum(pNew) <= Gia_ManObjNum(p) );
+    Gia_ManHashStop( pNew );
+    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+    // perform cleanup
+    pNew = Gia_ManCleanup( pTemp = pNew );
+    Gia_ManStop( pTemp );
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManBalance( Gia_Man_t * p, int fSimpleAnd, int fVerbose )
+{
+    Gia_Man_t * pNew, * pNew1, * pNew2;
+    if ( fVerbose )      Gia_ManPrintStats( p, NULL );
+    pNew = fSimpleAnd ? Gia_ManDup( p ) : Gia_ManDupMuxes( p, 2 );
+    if ( fVerbose )      Gia_ManPrintStats( pNew, NULL );
+    pNew1 = Gia_ManBalanceInt( pNew );
+    if ( fVerbose )      Gia_ManPrintStats( pNew1, NULL );
+    Gia_ManStop( pNew );
+    pNew2 = Gia_ManDupNoMuxes( pNew1 );
+    if ( fVerbose )      Gia_ManPrintStats( pNew2, NULL );
+    Gia_ManStop( pNew1 );
+    return pNew2;
+}
+
+
+
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Dam_Man_t * Dam_ManAlloc( Gia_Man_t * pGia )
+{
+    Dam_Man_t * p;
+    p = ABC_CALLOC( Dam_Man_t, 1 );
+    p->clkStart = Abc_Clock();
+    p->vVisit = Vec_IntAlloc( 1000 );
+    p->pGia = pGia;
+    return p;
+}
+void Dam_ManFree( Dam_Man_t * p )
+{   
+    Vec_IntFreeP( &p->vVisit );
+    Vec_IntFreeP( &p->vDivLevR );
+    Vec_IntFreeP( &p->vNodLevR );
+    Vec_IntFreeP( &p->vNod2Set );
+    Vec_IntFreeP( &p->vDiv2Nod );
+    Vec_IntFreeP( &p->vSetStore );
+    Vec_IntFreeP( &p->vNodStore );
+    Vec_FltFreeP( &p->vCounts );
+    Vec_QueFreeP( &p->vQue );
+    Hash_IntManStop( p->vHash );
+    ABC_FREE( p );
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Collect initial multi-input gates.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Dam_ManCollectSets_rec( Dam_Man_t * p, int Id )
+{
+    Gia_Obj_t * pObj;
+    int i, iBeg, iEnd, iLit;
+    if ( Dam_ObjHand(p, Id) || Id == 0 )
+        return;
+    pObj = Gia_ManObj(p->pGia, Id);
+    if ( Gia_ObjIsCi(pObj) )
+        return;
+    if ( Gia_ObjIsMux(p->pGia, pObj) )
+    {
+        if ( pObj->fMark0 )
+            return;
+        pObj->fMark0 = 1;
+        Vec_IntPush( p->vVisit, Id );
+        Dam_ManCollectSets_rec( p, Gia_ObjFaninId0(pObj, Id) );
+        Dam_ManCollectSets_rec( p, Gia_ObjFaninId1(pObj, Id) );
+        Dam_ManCollectSets_rec( p, Gia_ObjFaninId2(p->pGia, Id) );
+        p->nAnds += 3;
+        return;
+    }
+    Gia_ManSuperCollect( p->pGia, pObj );
+    Vec_IntWriteEntry( p->vNod2Set, Id, Vec_IntSize(p->vSetStore) );
+    Vec_IntPush( p->vSetStore, Vec_IntSize(p->pGia->vSuper) );
+    p->nAnds += (1 + 2 * Gia_ObjIsXor(pObj)) * (Vec_IntSize(p->pGia->vSuper) - 1);
+    // save entries
+    iBeg = Vec_IntSize( p->vSetStore );
+    Vec_IntAppend( p->vSetStore, p->pGia->vSuper );
+    iEnd = Vec_IntSize( p->vSetStore );
+    // call recursively
+    Vec_IntForEachEntryStartStop( p->vSetStore, iLit, i, iBeg, iEnd )
+        Dam_ManCollectSets_rec( p, Abc_Lit2Var(iLit) );
+}
+void Dam_ManCollectSets( Dam_Man_t * p )
+{
+    Gia_Obj_t * pObj;
+    int i;
+    Gia_ManCreateRefs( p->pGia );
+    p->vNod2Set  = Vec_IntStart( Gia_ManObjNum(p->pGia) );
+    p->vSetStore = Vec_IntAlloc( Gia_ManObjNum(p->pGia) );
+    Vec_IntPush( p->vSetStore, -1 );
+    Vec_IntClear( p->vVisit );
+    Gia_ManForEachCo( p->pGia, pObj, i )
+        Dam_ManCollectSets_rec( p, Gia_ObjFaninId0p(p->pGia, pObj) );
+    ABC_FREE( p->pGia->pRefs );
+    Gia_ManForEachObjVec( p->vVisit, p->pGia, pObj, i )
+        pObj->fMark0 = 0;
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Create divisors.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Dam_ManDivSlack( Dam_Man_t * p, int iLit0, int iLit1, int LevR )
+{
+    int Lev0 = Gia_ObjLevel(p->pGia, Gia_ManObj(p->pGia, Abc_Lit2Var(iLit0)));
+    int Lev1 = Gia_ObjLevel(p->pGia, Gia_ManObj(p->pGia, Abc_Lit2Var(iLit1)));
+    int Slack = p->nLevelMax - LevR - Abc_MaxInt(Lev0, Lev1) - 1 - (int)(iLit0 > iLit1);
+    return Abc_MinInt( Slack, 100 );
+}
+void Dam_ManCreateMultiRefs( Dam_Man_t * p, Vec_Int_t ** pvRefsAnd, Vec_Int_t ** pvRefsXor )  
+{
+    Vec_Int_t * vRefsAnd, * vRefsXor;
+    Gia_Obj_t * pObj;
+    int i, k, * pSet;
+    vRefsAnd = Vec_IntStart( 2 * Gia_ManObjNum(p->pGia) );
+    vRefsXor = Vec_IntStart( Gia_ManObjNum(p->pGia) );
+    Gia_ManForEachAnd( p->pGia, pObj, i )
+    {
+        if ( !Dam_ObjHand(p, i) )
+            continue;
+        pSet = Dam_ObjSet(p, i);
+        if ( Gia_ObjIsXor(pObj) )
+            for ( k = 1; k <= pSet[0]; k++ )
+            {
+                assert( !Abc_LitIsCompl(pSet[k]) );
+                Vec_IntAddToEntry( vRefsXor, Abc_Lit2Var(pSet[k]), 1 );
+            }
+        else if ( Gia_ObjIsAndReal(p->pGia, pObj) )
+            for ( k = 1; k <= pSet[0]; k++ )
+                Vec_IntAddToEntry( vRefsAnd, pSet[k], 1 );
+        else assert( 0 );
+    }
+    *pvRefsAnd = vRefsAnd;
+    *pvRefsXor = vRefsXor;
+}
+void Dam_ManCreatePairs( Dam_Man_t * p, int fVerbose )
+{
+    Gia_Obj_t * pObj;
+    Hash_IntMan_t * vHash;
+    Vec_Int_t * vRefsAnd, * vRefsXor, * vSuper, * vDivs, * vRemap, * vLevRMax;
+    int i, j, k, Num, FanK, FanJ, nRefs, iNode, iDiv, * pSet;
+    int nPairsAll = 0, nPairsTried = 0, nPairsUsed = 0, nPairsXor = 0;
+    int nDivsAll = 0, nDivsUsed = 0, nDivsXor = 0;
+    Dam_ManCollectSets( p );
+    vSuper = p->pGia->vSuper;
+    vDivs  = Vec_IntAlloc( Gia_ManObjNum(p->pGia) );
+    vHash  = Hash_IntManStart( Gia_ManObjNum(p->pGia)/2 );
+    vLevRMax = Vec_IntStart( 1000 );
+    Dam_ManCreateMultiRefs( p, &vRefsAnd, &vRefsXor );
+    Gia_ManForEachAnd( p->pGia, pObj, i )
+    {
+        if ( !Dam_ObjHand(p, i) )
+            continue;
+        pSet = Dam_ObjSet(p, i);
+        nPairsAll += pSet[0] * (pSet[0] - 1) / 2;
+        Vec_IntClear(vSuper);
+        if ( Gia_ObjIsXor(pObj) )
+        {
+            for ( k = 1; k <= pSet[0]; k++ )
+                if ( Vec_IntEntry(vRefsXor, Abc_Lit2Var(pSet[k])) > 1 )
+                    Vec_IntPush( vSuper, pSet[k] );
+        }
+        else if ( Gia_ObjIsAndReal(p->pGia, pObj) )
+        {
+            for ( k = 1; k <= pSet[0]; k++ )
+                if ( Vec_IntEntry(vRefsAnd, pSet[k]) > 1 )
+                    Vec_IntPush( vSuper, pSet[k] );
+        }
+        else assert( 0 );
+        if ( Vec_IntSize(vSuper) < 2 )
+            continue;
+        // enumerate pairs
+        nPairsTried += Vec_IntSize(vSuper) * (Vec_IntSize(vSuper) - 1) / 2;
+        Vec_IntPush( vDivs, -i ); // remember node
+        Vec_IntForEachEntry( vSuper, FanK, k )
+        Vec_IntForEachEntryStart( vSuper, FanJ, j, k+1 )
+        {
+            if ( (FanK > FanJ) ^ Gia_ObjIsXor(pObj) )
+                Num = Hash_Int2ManInsert( vHash, FanJ, FanK, 0 );
+            else
+                Num = Hash_Int2ManInsert( vHash, FanK, FanJ, 0 );
+            if ( Hash_Int2ObjInc( vHash, Num ) == 1 )
+            {
+                nDivsUsed++;
+                nDivsXor += Gia_ObjIsXor(pObj);
+            }
+            Vec_IntPush( vDivs, Num ); // remember devisor
+            // update reverse level
+            if ( Num >= Vec_IntSize(vLevRMax) )
+                Vec_IntFillExtra( vLevRMax, 3 * Vec_IntSize(vLevRMax) / 2, 0 );
+            Vec_IntUpdateEntry( vLevRMax, Num, Vec_IntEntry(p->vNodLevR, i) );
+        }
+    }
+    Vec_IntFree( vRefsAnd );
+    Vec_IntFree( vRefsXor );
+//    Hash_IntManProfile( vHash );
+    // remove entries that appear only once
+    p->vHash     = Hash_IntManStart( 3 * nDivsUsed /2 );
+    p->vCounts   = Vec_FltAlloc( 2 * nDivsUsed );           Vec_FltPush( p->vCounts, ABC_INFINITY );
+    p->vQue      = Vec_QueAlloc( Vec_FltCap(p->vCounts) );
+    Vec_QueSetPriority( p->vQue, Vec_FltArrayP(p->vCounts) );
+    // mapping div to node
+    p->vDiv2Nod  = Vec_IntAlloc( 2 * nDivsUsed );           Vec_IntPush( p->vDiv2Nod, ABC_INFINITY );
+    p->vNodStore = Vec_IntAlloc( Gia_ManObjNum(p->pGia) );  Vec_IntPush( p->vNodStore, -1 );
+    nDivsAll     = Hash_IntManEntryNum(vHash);
+    vRemap       = Vec_IntStartFull( nDivsAll+1 );
+    for ( i = 1; i <= nDivsAll; i++ )
+    {
+        nRefs = Hash_IntObjData2(vHash, i);
+        if ( nRefs < 2 )
+            continue;
+        nPairsUsed += nRefs;
+        if ( Hash_IntObjData0(vHash, i) > Hash_IntObjData1(vHash, i) )
+            nPairsXor += nRefs; 
+        Num = Hash_Int2ManInsert( p->vHash, Hash_IntObjData0(vHash, i), Hash_IntObjData1(vHash, i), 0 );
+        assert( Num == Hash_IntManEntryNum(p->vHash) );
+        assert( Num == Vec_FltSize(p->vCounts) );
+        Vec_FltPush( p->vCounts, nRefs + 0.005*Dam_ManDivSlack(p, Hash_IntObjData0(vHash, i), Hash_IntObjData1(vHash, i), Vec_IntEntry(vLevRMax, i)) );
+        Vec_QuePush( p->vQue, Num );
+        // remember divisors
+        assert( Num == Vec_IntSize(p->vDiv2Nod) );
+        Vec_IntPush( p->vDiv2Nod, Vec_IntSize(p->vNodStore) );
+        Vec_IntPush( p->vNodStore, 0 );
+        Vec_IntFillExtra( p->vNodStore, Vec_IntSize(p->vNodStore) + nRefs, -1 );
+        // remember entry
+        Vec_IntWriteEntry( vRemap, i, Num );
+    }
+    assert( Vec_FltSize(p->vCounts) == Hash_IntManEntryNum(p->vHash)+1 );
+    assert( Vec_IntSize(p->vDiv2Nod) == nDivsUsed+1 );
+    Hash_IntManStop( vHash );
+    Vec_IntFree( vLevRMax );
+    // fill in the divisors
+    iNode = -1;
+    Vec_IntForEachEntry( vDivs, iDiv, i )
+    {
+        if ( iDiv < 0 )
+        {
+            iNode = -iDiv;
+            continue;
+        }
+        Num = Vec_IntEntry( vRemap, iDiv );
+        if ( Num == -1 )
+            continue;
+        pSet = Dam_DivSet( p, Num );
+        pSet[++pSet[0]] = iNode;
+    }
+    Vec_IntFree( vRemap );
+    Vec_IntFree( vDivs );
+    // create storage for reverse level of divisor during update
+    p->vDivLevR = Vec_IntStart( 2 * nDivsUsed );
+    // make sure divisors are added correctly
+//    for ( i = 1; i <= nDivsUsed; i++ )
+//        assert( Dam_DivSet(p, i)[0] == Vec_FltEntry(p->vCounts, i)+1 );
+    if ( !fVerbose )
+        return;
+    // print stats
+    printf( "Pairs:" );
+    printf( "  Total =%9d (%6.2f %%)", nPairsAll,   100.0 * nPairsAll   / Abc_MaxInt(nPairsAll, 1) );
+    printf( "  Tried =%9d (%6.2f %%)", nPairsTried, 100.0 * nPairsTried / Abc_MaxInt(nPairsAll, 1) );
+    printf( "  Used =%9d (%6.2f %%)",  nPairsUsed,  100.0 * nPairsUsed  / Abc_MaxInt(nPairsAll, 1) );
+    printf( "  Xor =%9d (%6.2f %%)",   nPairsXor,   100.0 * nPairsXor   / Abc_MaxInt(nPairsAll, 1) );
+    printf( "\n" );
+    printf( "Div:  " );
+    printf( "  Total =%9d (%6.2f %%)", nDivsAll,    100.0 * nDivsAll    / Abc_MaxInt(nDivsAll, 1) );
+    printf( "  Tried =%9d (%6.2f %%)", nDivsAll,    100.0 * nDivsAll    / Abc_MaxInt(nDivsAll, 1) );
+    printf( "  Used =%9d (%6.2f %%)",  nDivsUsed,   100.0 * nDivsUsed   / Abc_MaxInt(nDivsAll, 1) );
+    printf( "  Xor =%9d (%6.2f %%)",   nDivsXor,    100.0 * nDivsXor    / Abc_MaxInt(nDivsAll, 1) );
+    printf( "\n" );
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Derives new AIG.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Dam_ManMultiAig_rec( Dam_Man_t * pMan, Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+    int i, * pSet;
+    if ( ~pObj->Value )
+        return;
+    assert( Gia_ObjIsAnd(pObj) );
+    pSet = Dam_ObjSet(pMan, Gia_ObjId(p, pObj));
+    if ( pSet == NULL )
+    {
+        Dam_ManMultiAig_rec( pMan, pNew, p, Gia_ObjFanin0(pObj) );
+        Dam_ManMultiAig_rec( pMan, pNew, p, Gia_ObjFanin1(pObj) );
+        if ( Gia_ObjIsMux(p, pObj) )
+        {
+            Dam_ManMultiAig_rec( pMan, pNew, p, Gia_ObjFanin2(p, pObj) );
+            pObj->Value = Gia_ManHashMuxReal( pNew, Gia_ObjFanin2Copy(p, pObj), Gia_ObjFanin1Copy(pObj), Gia_ObjFanin0Copy(pObj) );
+        }
+        else if ( Gia_ObjIsXor(pObj) )
+            pObj->Value = Gia_ManHashXorReal( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+        else 
+            pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+        Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(pObj->Value)) );
+        return;
+    }
+    assert( Gia_ObjIsXor(pObj) || Gia_ObjIsAndReal(p, pObj) );
+    // call recursively
+    for ( i = 1; i <= pSet[0]; i++ )
+    {
+        Gia_Obj_t * pTemp = Gia_ManObj( p, Abc_Lit2Var(pSet[i]) );
+        Dam_ManMultiAig_rec( pMan, pNew, p, pTemp );
+        pSet[i] = Abc_LitNotCond( pTemp->Value, Abc_LitIsCompl(pSet[i]) );
+    }
+    // create balanced gate
+    pObj->Value = Gia_ManBalanceGate( pNew, pObj, p->vSuper, pSet + 1, pSet[0] );
+}
+Gia_Man_t * Dam_ManMultiAig( Dam_Man_t * pMan )
+{
+    Gia_Man_t * p = pMan->pGia;
+    Gia_Man_t * pNew, * pTemp;
+    Gia_Obj_t * pObj;
+    int i;
+    // start the new manager
+    pNew = Gia_ManStart( 2*Gia_ManObjNum(p) );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+    pNew->pMuxes = ABC_CALLOC( unsigned, pNew->nObjsAlloc );
+    pNew->vLevels = Vec_IntStart( pNew->nObjsAlloc );
+    // create constant and inputs
+    Gia_ManFillValue( p );
+    Gia_ManConst0(p)->Value = 0;
+    Gia_ManForEachCi( p, pObj, i )
+    {
+        pObj->Value = Gia_ManAppendCi( pNew );
+        Vec_IntWriteEntry( pNew->vLevels, Abc_Lit2Var(pObj->Value), Gia_ObjLevel(p, pObj) );
+    }
+    // create internal nodes
+    Gia_ManHashStart( pNew );
+    Gia_ManForEachCo( p, pObj, i )
+    {
+        Dam_ManMultiAig_rec( pMan, pNew, p, Gia_ObjFanin0(pObj) );
+        pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+    }
+    assert( Gia_ManObjNum(pNew) <= Gia_ManObjNum(p) );
+    Gia_ManHashStop( pNew );
+    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+    // perform cleanup
+    pNew = Gia_ManCleanup( pTemp = pNew );
+    Gia_ManStop( pTemp );
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Updates the data-structure after extracting one divisor.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Dam_PrintDiv( Dam_Man_t * p, int iDiv )
+{
+    if ( iDiv == 0 )
+        printf( "Final statistics after extracting %6d divisors:          ", p->nDivs );
+    else
+    {
+        char Buffer[100];
+        int iData0 = Hash_IntObjData0(p->vHash, iDiv);
+        int iData1 = Hash_IntObjData1(p->vHash, iDiv);
+        printf( "Div%5d : ",  p->nDivs+1 );
+        printf( "D%-8d = ",   iDiv );
+        sprintf( Buffer, "%c%d", Abc_LitIsCompl(iData0)? '!':' ', Abc_Lit2Var(iData0) );
+        printf( "%8s ",   Buffer );
+        printf( "%c  ",     (iData0 < iData1) ? '*' : '+' );
+        sprintf( Buffer, "%c%d", Abc_LitIsCompl(iData1)? '!':' ', Abc_Lit2Var(iData1) );
+        printf( "%8s   ", Buffer );
+        printf( "Weight %9.2f  ", Vec_FltEntry(p->vCounts, iDiv) );
+    }
+    printf( "Divs =%8d  ",  Hash_IntManEntryNum(p->vHash) );
+    printf( "Ands =%8d  ",  p->nAnds - p->nGain );
+    Abc_PrintTime( 1, "Time", Abc_Clock() - p->clkStart );
+}
+void Dam_PrintQue( Dam_Man_t * p )
+{
+    int i;
+    printf( "Divisor queue: \n" );
+    for ( i = 1; i <= Hash_IntManEntryNum(p->vHash); i++ )
+    {
+        int iLit0 = Hash_IntObjData0(p->vHash, i);
+        int iLit1 = Hash_IntObjData1(p->vHash, i);
+        printf( "Div %7d : ",     i );
+        printf( "Weight %9.2f  ", Vec_FltEntry(p->vCounts, i) );
+        printf( "F = %c%c ",      Abc_LitIsCompl(iLit0) ? '!': ' ', 'a' + Abc_Lit2Var(iLit0)-1 );
+        printf( "%c ",            (Hash_IntObjData0(p->vHash, i) < Hash_IntObjData1(p->vHash, i)) ? '*':'+' );
+        printf( "%c%c   ",        Abc_LitIsCompl(iLit1) ? '!': ' ', 'a' + Abc_Lit2Var(iLit1)-1 );
+        printf( "\n" );
+    }
+}
+int Dam_ManUpdateNode( Dam_Man_t * p, int iObj, int iLit0, int iLit1, int iLitNew, Vec_Int_t * vDivs )
+{
+    int * pSet = Dam_ObjSet( p, iObj );
+    int i, k, c, Num, iLit, iLit2, fPres;
+    // check if literal can be found
+    for ( i = 1; i <= pSet[0]; i++ )
+        if ( pSet[i] == iLit0 )
+            break;
+    if ( i > pSet[0] )
+        return 0;
+    // check if literal can be found
+    for ( i = 1; i <= pSet[0]; i++ )
+        if ( pSet[i] == iLit1 )
+            break;
+    if ( i > pSet[0] )
+        return 0;
+    // compact literals
+    Vec_IntPush( vDivs, -iObj );
+    for ( k = i = 1; i <= pSet[0]; i++ )
+    {
+        if ( iLit0 == pSet[i] || iLit1 == pSet[i] )
+            continue;
+        pSet[k++] = iLit = pSet[i];
+        // reduce weights of the divisors
+        fPres = 0;
+        for ( c = 0; c < 2; c++ )
+        {
+            iLit2 = c ? iLit1 : iLit0;
+            if ( (iLit > iLit2) ^ (iLit0 > iLit1) )
+                Num = *Hash_Int2ManLookup( p->vHash, iLit2, iLit );
+            else
+                Num = *Hash_Int2ManLookup( p->vHash, iLit, iLit2 );
+            if ( Num > 0 )
+            {
+                Vec_FltAddToEntry( p->vCounts, Num, -1 );
+                if ( Vec_QueIsMember(p->vQue, Num) )
+                {
+                    Vec_QueUpdate( p->vQue, Num );
+                    fPres |= (1 << c);
+                }
+            }
+        }
+        if ( fPres != 3 )
+            continue;
+        if ( (iLit > iLitNew) ^ (iLit0 > iLit1) )
+            Num = Hash_Int2ManInsert( p->vHash, iLitNew, iLit, 0 );
+        else
+            Num = Hash_Int2ManInsert( p->vHash, iLit, iLitNew, 0 );
+        Hash_Int2ObjInc( p->vHash, Num );
+        Vec_IntPush( vDivs, Num );
+        // update reverse level
+        if ( Num >= Vec_IntSize(p->vDivLevR) )
+            Vec_IntFillExtra( p->vDivLevR, 3 * Vec_IntSize(p->vDivLevR) / 2, 0 );
+        Vec_IntUpdateEntry( p->vDivLevR, Num, Vec_IntEntry(p->vNodLevR, iObj) );
+    }
+    pSet[k] = iLitNew;
+    pSet[0] = k;
+    return 1;
+}
+void Dam_ManUpdate( Dam_Man_t * p, int iDiv )
+{
+    Vec_Int_t * vDivs = p->pGia->vSuper;
+    int iLit0 = Hash_IntObjData0(p->vHash, iDiv);
+    int iLit1 = Hash_IntObjData1(p->vHash, iDiv);
+    int i, iLitNew, * pSet, * pNods = Dam_DivSet( p, iDiv );
+    int nPresent = 0, nPairsStart, nPairsStop, pPairsNew, nRefs;
+    int fThisIsXor = (iLit0 > iLit1), iDivTemp, iNode;
+//    Dam_PrintQue( p );
+    if ( fThisIsXor )
+        iLitNew = Gia_ManAppendXorReal( p->pGia, iLit0, iLit1 );
+    else
+        iLitNew = Gia_ManAppendAnd( p->pGia, iLit0, iLit1 );
+    Gia_ObjSetGateLevel( p->pGia, Gia_ManObj(p->pGia, Abc_Lit2Var(iLitNew)) );
+//    printf( "%d ", Gia_ObjLevel(p->pGia, Gia_ManObj(p->pGia, Abc_Lit2Var(iLitNew))) );
+    // replace entries
+    assert( pNods[0] >= 2 );
+    nPairsStart = Hash_IntManEntryNum(p->vHash) + 1;
+    Vec_IntClear( vDivs );
+    for ( i = 1; i <= pNods[0]; i++ )
+        nPresent += Dam_ManUpdateNode( p, pNods[i], iLit0, iLit1, iLitNew, vDivs );
+    nPairsStop = Hash_IntManEntryNum(p->vHash) + 1;
+    // extend arrayvs
+    pPairsNew = 0;
+    Vec_FltFillExtra( p->vCounts, nPairsStop, 0 );
+    Vec_IntFillExtra( p->vDiv2Nod, nPairsStop, -1 );
+    for ( i = nPairsStart; i < nPairsStop; i++ )
+    {
+        nRefs = Hash_IntObjData2(p->vHash, i);
+        if ( nRefs < 2 )
+            continue;
+        Vec_FltWriteEntry( p->vCounts, i, nRefs + 0.001*Dam_ManDivSlack(p, Hash_IntObjData0(p->vHash, i), Hash_IntObjData1(p->vHash, i), Vec_IntEntry(p->vDivLevR, i)) );
+        Vec_QuePush( p->vQue, i );
+        // remember divisors
+        Vec_IntWriteEntry( p->vDiv2Nod, i, Vec_IntSize(p->vNodStore) );
+        Vec_IntPush( p->vNodStore, 0 );
+        Vec_IntFillExtra( p->vNodStore, Vec_IntSize(p->vNodStore) + nRefs, -1 );
+        pPairsNew++;
+    }
+//    printf( "Added %d new pairs\n", pPairsNew );
+    // fill in the divisors
+    iNode = -1;
+    Vec_IntForEachEntry( vDivs, iDivTemp, i )
+    {
+        if ( iDivTemp < 0 )
+        {
+            iNode = -iDivTemp;
+            continue;
+        }
+        if ( Vec_IntEntry(p->vDiv2Nod, iDivTemp) == -1 )
+            continue;
+        pSet = Dam_DivSet( p, iDivTemp );
+        pSet[++pSet[0]] = iNode;
+    }
+    // make sure divisors are added correctly
+    for ( i = nPairsStart; i < nPairsStop; i++ )
+        if ( Vec_IntEntry(p->vDiv2Nod, i) > 0 )
+            assert( Dam_DivSet(p, i)[0] == Hash_IntObjData2(p->vHash, i) );
+    // update costs
+    Vec_FltWriteEntry( p->vCounts, iDiv, 0 );
+    p->nGain += (1 + 2 * fThisIsXor) * (nPresent - 1);
+    p->nGainX += 3 * fThisIsXor * (nPresent - 1);
+    p->nDivs++;
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Perform extraction for multi-input AND/XOR.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Dam_ManAreaBalanceInt( Gia_Man_t * pGia, Vec_Int_t * vCiLevels, int nNewNodesMax, int fVerbose, int fVeryVerbose )
+{
+    Gia_Man_t * pNew;
+    Dam_Man_t * p;
+    int i, iDiv;
+    p = Dam_ManAlloc( pGia );
+    p->nLevelMax = Gia_ManSetLevels( p->pGia, vCiLevels );
+    p->vNodLevR = Gia_ManReverseLevel( p->pGia );
+    Vec_IntFillExtra( p->pGia->vLevels, 3*Gia_ManObjNum(p->pGia)/2, 0 );
+    Dam_ManCreatePairs( p, fVerbose );
+    for ( i = 0; i < nNewNodesMax && Vec_QueTopPriority(p->vQue) >= 2; i++ )
+    {
+        iDiv = Vec_QuePop(p->vQue);
+        if ( fVeryVerbose )
+            Dam_PrintDiv( p, iDiv );
+        Dam_ManUpdate( p, iDiv );
+    }
+    if ( fVeryVerbose )
+        Dam_PrintDiv( p, 0 );
+    pNew = Dam_ManMultiAig( p );
+    if ( fVerbose )
+    {
+        int nDivsAll = Hash_IntManEntryNum(p->vHash);
+        int nDivsUsed = p->nDivs;
+        printf( "Div:  " );
+        printf( "  Total =%9d (%6.2f %%) ",   nDivsAll,   100.0 * nDivsAll    / Abc_MaxInt(nDivsAll, 1) );
+        printf( "  Used =%9d (%6.2f %%)",     nDivsUsed,  100.0 * nDivsUsed   / Abc_MaxInt(nDivsAll, 1) );
+        printf( "  Gain =%6d (%6.2f %%)",     p->nGain,   100.0 * p->nGain / Abc_MaxInt(p->nAnds, 1) );
+        printf( "  GainX = %d  ",             p->nGainX  );
+        Abc_PrintTime( 1, "Time", Abc_Clock() - p->clkStart );
+    }
+    Dam_ManFree( p );
+    return pNew;
+}
+Gia_Man_t * Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax, int fVerbose, int fVeryVerbose )
+{
+    Gia_Man_t * pNew0, * pNew, * pNew1, * pNew2;
+    Vec_Int_t * vCiLevels;
+    // determine CI levels
+    if ( p->pManTime && p->vLevels == NULL )
+        Gia_ManLevelWithBoxes( p );
+    vCiLevels = Gia_ManGetCiLevels( p );
+    // get the starting manager
+    pNew0 = Gia_ManHasMapping(p) ? (Gia_Man_t *)Dsm_ManDeriveGia(p, 0) : p;
+    if ( fVerbose )     Gia_ManPrintStats( pNew0, NULL );
+    // derive internal manager
+    pNew = fSimpleAnd ? Gia_ManDup( pNew0 ) : Gia_ManDupMuxes( pNew0, 2 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    if ( pNew0 != p ) Gia_ManStop( pNew0 );
+    // perform the operation
+    pNew1 = Dam_ManAreaBalanceInt( pNew, vCiLevels, nNewNodesMax, fVerbose, fVeryVerbose );
+    if ( fVerbose )     Gia_ManPrintStats( pNew1, NULL );
+    Gia_ManStop( pNew );
+    Vec_IntFreeP( &vCiLevels );
+    // derive the final result
+    pNew2 = Gia_ManDupNoMuxes( pNew1 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew2, NULL );
+    Gia_ManStop( pNew1 );
+    // normalize if needed
+    if ( !Gia_ManIsNormalized(pNew2) )
+    {
+        pNew2 = Gia_ManDupNormalize( pNew1 = pNew2 );
+        Gia_ManStop( pNew1 );
+    }
+    Gia_ManTransferTiming( pNew2, p );
+    return pNew2;
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/aig/gia/giaBalLut.c b/abc-build/src/aig/gia/giaBalLut.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/aig/gia/giaBalLut.c
@@ -0,0 +1,982 @@
+/**CFile****************************************************************
+
+  FileName    [giaBalance.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Scalable AIG package.]
+
+  Synopsis    [AIG balancing.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - June 20, 2005.]
+
+  Revision    [$Id: giaBalance.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "gia.h"
+#include "misc/vec/vecHash.h"
+#include "misc/vec/vecQue.h"
+#include "opt/dau/dau.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+#define BAL_LEAF_MAX    6
+#define BAL_CUT_MAX     8
+#define BAL_SUPER      50
+#define BAL_NO_LEAF    31
+#define BAL_NO_FUNC    134217727     // (1<<27)-1
+
+typedef struct Bal_Cut_t_ Bal_Cut_t; 
+struct Bal_Cut_t_
+{
+    word             Sign;           // signature
+    int              Delay;          // delay
+    unsigned         iFunc   : 27;   // function (BAL_NO_FUNC)
+    unsigned         nLeaves :  5;   // leaf number (Bal_NO_LEAF)
+    int              pLeaves[BAL_LEAF_MAX]; // leaves
+};
+
+// operation manager
+typedef struct Bal_Man_t_ Bal_Man_t;
+struct Bal_Man_t_
+{
+    Gia_Man_t *      pGia;           // user AIG
+    int              nLutSize;       // LUT size
+    int              nCutNum;        // cut number
+    int              fCutMin;        // cut minimization
+    int              fVerbose;       // verbose
+    Gia_Man_t *      pNew;           // derived AIG
+    Vec_Int_t *      vCosts;         // cost of supergate nodes
+    Vec_Ptr_t *      vCutSets;       // object cutsets
+    abctime          clkStart;       // starting the clock
+};
+
+static inline Bal_Man_t * Bal_GiaMan( Gia_Man_t * p )                   { return (Bal_Man_t *)p->pData;           }
+
+static inline int         Bal_ObjCost( Bal_Man_t * p, int i )           { return Vec_IntEntry(p->vCosts, i);      }
+static inline int         Bal_LitCost( Bal_Man_t * p, int i )           { return Bal_ObjCost(p, Abc_Lit2Var(i));  }
+static inline int         Bal_ObjDelay( Bal_Man_t * p, int i )          { return Bal_ObjCost(p, i) >> 4;          }
+static inline int         Bal_LitDelay( Bal_Man_t * p, int i )          { return Bal_ObjDelay(p, Abc_Lit2Var(i)); }
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Bal_Man_t * Bal_ManAlloc( Gia_Man_t * pGia, Gia_Man_t * pNew, int nLutSize, int nCutNum, int fVerbose )
+{
+    Bal_Man_t * p;
+    p = ABC_CALLOC( Bal_Man_t, 1 );
+    p->clkStart = Abc_Clock();
+    p->pGia     = pGia;
+    p->pNew     = pNew;
+    p->nLutSize = nLutSize;
+    p->nCutNum  = nCutNum;
+    p->fVerbose = fVerbose;
+    p->vCosts   = Vec_IntAlloc( 3 * Gia_ManObjNum(pGia) / 2 );
+    p->vCutSets = Vec_PtrAlloc( 3 * Gia_ManObjNum(pGia) / 2 );
+    Vec_IntFill( p->vCosts, Gia_ManObjNum(pNew), 0 );
+    Vec_PtrFill( p->vCutSets, Gia_ManObjNum(pNew), NULL );
+    pNew->pData = p;
+    return p;
+}
+void Bal_ManFree( Bal_Man_t * p )
+{
+    Vec_PtrFreeFree( p->vCutSets );
+    Vec_IntFree( p->vCosts );
+    ABC_FREE( p );
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Bal_CutCountBits( word i )
+{
+    i = i - ((i >> 1) & 0x5555555555555555);
+    i = (i & 0x3333333333333333) + ((i >> 2) & 0x3333333333333333);
+    i = ((i + (i >> 4)) & 0x0F0F0F0F0F0F0F0F);
+    return (i*(0x0101010101010101))>>56;
+}
+static inline word Bal_CutGetSign( int * pLeaves, int nLeaves )
+{
+    word Sign = 0; int i; 
+    for ( i = 0; i < nLeaves; i++ )
+        Sign |= ((word)1) << (pLeaves[i] & 0x3F);
+    return Sign;
+}
+static inline int Bal_CutCreateUnit( Bal_Cut_t * p, int i, int Delay )
+{
+    p->iFunc = 2;
+    p->Delay = Delay;
+    p->nLeaves = 1;
+    p->pLeaves[0] = i;
+    p->Sign = ((word)1) << (i & 0x3F);
+    return 1;
+}
+static inline int Bal_ManPrepareSet( Bal_Man_t * p, int iObj, int Index, int fUnit, Bal_Cut_t ** ppCutSet )
+{
+    static Bal_Cut_t CutTemp[3]; int i;
+    if ( Vec_PtrEntry(p->vCutSets, iObj) == NULL || fUnit )
+        return Bal_CutCreateUnit( (*ppCutSet = CutTemp + Index), iObj, Bal_ObjDelay(p, iObj)+1 );
+    *ppCutSet = (Bal_Cut_t *)Vec_PtrEntry(p->vCutSets, iObj);
+    for ( i = 0; i < p->nCutNum; i++ ) 
+        if ( (*ppCutSet)[i].nLeaves == BAL_NO_LEAF )
+            return i;
+    return i;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    [Check correctness of cuts.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Bal_CutCheck( Bal_Cut_t * pBase, Bal_Cut_t * pCut ) // check if pCut is contained in pBase
+{
+    int nSizeB = pBase->nLeaves;
+    int nSizeC = pCut->nLeaves;
+    int i, * pB = pBase->pLeaves;
+    int k, * pC = pCut->pLeaves;
+    for ( i = 0; i < nSizeC; i++ )
+    {
+        for ( k = 0; k < nSizeB; k++ )
+            if ( pC[i] == pB[k] )
+                break;
+        if ( k == nSizeB )
+            return 0;
+    }
+    return 1;
+}
+static inline int Bal_SetCheckArray( Bal_Cut_t ** ppCuts, int nCuts )
+{
+    Bal_Cut_t * pCut0, * pCut1; 
+    int i, k, m, n, Value;
+    assert( nCuts > 0 );
+    for ( i = 0; i < nCuts; i++ )
+    {
+        pCut0 = ppCuts[i];
+        assert( pCut0->nLeaves <= BAL_LEAF_MAX );
+        assert( pCut0->Sign == Bal_CutGetSign(pCut0->pLeaves, pCut0->nLeaves) );
+        // check duplicates
+        for ( m = 0; m < (int)pCut0->nLeaves; m++ )
+        for ( n = m + 1; n < (int)pCut0->nLeaves; n++ )
+            assert( pCut0->pLeaves[m] < pCut0->pLeaves[n] );
+        // check pairs
+        for ( k = 0; k < nCuts; k++ )
+        {
+            pCut1 = ppCuts[k];
+            if ( pCut0 == pCut1 )
+                continue;
+            // check containments
+            Value = Bal_CutCheck( pCut0, pCut1 );
+            assert( Value == 0 );
+        }
+    }
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Bal_CutMergeOrder( Bal_Cut_t * pCut0, Bal_Cut_t * pCut1, Bal_Cut_t * pCut, int nLutSize )
+{ 
+    int nSize0   = pCut0->nLeaves;
+    int nSize1   = pCut1->nLeaves;
+    int i, * pC0 = pCut0->pLeaves;
+    int k, * pC1 = pCut1->pLeaves;
+    int c, * pC  = pCut->pLeaves;
+    // the case of the largest cut sizes
+    if ( nSize0 == nLutSize && nSize1 == nLutSize )
+    {
+        for ( i = 0; i < nSize0; i++ )
+        {
+            if ( pC0[i] != pC1[i] )  return 0;
+            pC[i] = pC0[i];
+        }
+        pCut->nLeaves = nLutSize;
+        pCut->iFunc = BAL_NO_FUNC;
+        pCut->Sign = pCut0->Sign | pCut1->Sign;
+        pCut->Delay = Abc_MaxInt( pCut0->Delay, pCut1->Delay );
+        return 1;
+    }
+    // compare two cuts with different numbers
+    i = k = c = 0;
+    while ( 1 )
+    {
+        if ( c == nLutSize ) return 0;
+        if ( pC0[i] < pC1[k] )
+        {
+            pC[c++] = pC0[i++];
+            if ( i >= nSize0 ) goto FlushCut1;
+        }
+        else if ( pC0[i] > pC1[k] )
+        {
+            pC[c++] = pC1[k++];
+            if ( k >= nSize1 ) goto FlushCut0;
+        }
+        else
+        {
+            pC[c++] = pC0[i++]; k++;
+            if ( i >= nSize0 ) goto FlushCut1;
+            if ( k >= nSize1 ) goto FlushCut0;
+        }
+    }
+
+FlushCut0:
+    if ( c + nSize0 > nLutSize + i ) return 0;
+    while ( i < nSize0 )
+        pC[c++] = pC0[i++];
+    pCut->nLeaves = c;
+    pCut->iFunc = BAL_NO_FUNC;
+    pCut->Sign = pCut0->Sign | pCut1->Sign;
+    pCut->Delay = Abc_MaxInt( pCut0->Delay, pCut1->Delay );
+    return 1;
+
+FlushCut1:
+    if ( c + nSize1 > nLutSize + k ) return 0;
+    while ( k < nSize1 )
+        pC[c++] = pC1[k++];
+    pCut->nLeaves = c;
+    pCut->iFunc = BAL_NO_FUNC;
+    pCut->Sign = pCut0->Sign | pCut1->Sign;
+    pCut->Delay = Abc_MaxInt( pCut0->Delay, pCut1->Delay );
+    return 1;
+}
+static inline int Bal_CutMergeOrderMux( Bal_Cut_t * pCut0, Bal_Cut_t * pCut1, Bal_Cut_t * pCut2, Bal_Cut_t * pCut, int nLutSize )
+{ 
+    int x0, i0 = 0, nSize0 = pCut0->nLeaves, * pC0 = pCut0->pLeaves;
+    int x1, i1 = 0, nSize1 = pCut1->nLeaves, * pC1 = pCut1->pLeaves;
+    int x2, i2 = 0, nSize2 = pCut2->nLeaves, * pC2 = pCut2->pLeaves;
+    int xMin, c = 0, * pC  = pCut->pLeaves;
+    while ( 1 )
+    {
+        x0 = (i0 == nSize0) ? ABC_INFINITY : pC0[i0];
+        x1 = (i1 == nSize1) ? ABC_INFINITY : pC1[i1];
+        x2 = (i2 == nSize2) ? ABC_INFINITY : pC2[i2];
+        xMin = Abc_MinInt( Abc_MinInt(x0, x1), x2 );
+        if ( xMin == ABC_INFINITY ) break;
+        if ( c == nLutSize ) return 0;
+        pC[c++] = xMin;
+        if (x0 == xMin) i0++;
+        if (x1 == xMin) i1++;
+        if (x2 == xMin) i2++;
+    }
+    pCut->nLeaves = c;
+    pCut->iFunc = BAL_NO_FUNC;
+    pCut->Sign = pCut0->Sign | pCut1->Sign | pCut2->Sign;
+    pCut->Delay = Abc_MaxInt( pCut0->Delay, Abc_MaxInt(pCut1->Delay, pCut2->Delay) );
+    return 1;
+}
+static inline int Bal_SetCutIsContainedOrder( Bal_Cut_t * pBase, Bal_Cut_t * pCut ) // check if pCut is contained in pBase
+{
+    int i, nSizeB = pBase->nLeaves;
+    int k, nSizeC = pCut->nLeaves;
+    if ( nSizeB == nSizeC )
+    {
+        for ( i = 0; i < nSizeB; i++ )
+            if ( pBase->pLeaves[i] != pCut->pLeaves[i] )
+                return 0;
+        return 1;
+    }
+    assert( nSizeB > nSizeC ); 
+    if ( nSizeC == 0 )
+        return 1;
+    for ( i = k = 0; i < nSizeB; i++ )
+    {
+        if ( pBase->pLeaves[i] > pCut->pLeaves[k] )
+            return 0;
+        if ( pBase->pLeaves[i] == pCut->pLeaves[k] )
+        {
+            if ( ++k == nSizeC )
+                return 1;
+        }
+    }
+    return 0;
+}
+static inline int Bal_SetLastCutIsContained( Bal_Cut_t ** pCuts, int nCuts )
+{
+    int i;
+    for ( i = 0; i < nCuts; i++ )
+        if ( pCuts[i]->nLeaves <= pCuts[nCuts]->nLeaves && (pCuts[i]->Sign & pCuts[nCuts]->Sign) == pCuts[i]->Sign && Bal_SetCutIsContainedOrder(pCuts[nCuts], pCuts[i]) )
+            return 1;
+    return 0;
+}
+static inline int Bal_SetLastCutContains( Bal_Cut_t ** pCuts, int nCuts )
+{
+    int i, k, fChanges = 0;
+    for ( i = 0; i < nCuts; i++ )
+        if ( pCuts[nCuts]->nLeaves < pCuts[i]->nLeaves && (pCuts[nCuts]->Sign & pCuts[i]->Sign) == pCuts[nCuts]->Sign && Bal_SetCutIsContainedOrder(pCuts[i], pCuts[nCuts]) )
+            pCuts[i]->nLeaves = BAL_NO_LEAF, fChanges = 1;
+    if ( !fChanges )
+        return nCuts;
+    for ( i = k = 0; i <= nCuts; i++ )
+    {
+        if ( pCuts[i]->nLeaves == BAL_NO_LEAF )
+            continue;
+        if ( k < i )
+            ABC_SWAP( Bal_Cut_t *, pCuts[k], pCuts[i] );
+        k++;
+    }
+    return k - 1;
+}
+static inline int Bal_CutCompareArea( Bal_Cut_t * pCut0, Bal_Cut_t * pCut1 )
+{
+    if ( pCut0->Delay   < pCut1->Delay   )  return -1;
+    if ( pCut0->Delay   > pCut1->Delay   )  return  1;
+    if ( pCut0->nLeaves < pCut1->nLeaves )  return -1;
+    if ( pCut0->nLeaves > pCut1->nLeaves )  return  1;
+    return 0;
+}
+static inline void Bal_SetSortByDelay( Bal_Cut_t ** pCuts, int nCuts )
+{
+    int i;
+    for ( i = nCuts; i > 0; i-- )
+    {
+        if ( Bal_CutCompareArea(pCuts[i - 1], pCuts[i]) < 0 )//!= 1 )
+            return;
+        ABC_SWAP( Bal_Cut_t *, pCuts[i - 1], pCuts[i] );
+    }
+}
+static inline int Bal_SetAddCut( Bal_Cut_t ** pCuts, int nCuts, int nCutNum )
+{
+    if ( nCuts == 0 )
+        return 1;
+    nCuts = Bal_SetLastCutContains(pCuts, nCuts);
+    Bal_SetSortByDelay( pCuts, nCuts );
+    return Abc_MinInt( nCuts + 1, nCutNum - 1 );
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Bal_ManDeriveCuts( Bal_Man_t * p, int iFan0, int iFan1, int iFan2, int fCompl0, int fCompl1, int fCompl2, int fUnit0, int fUnit1, int fUnit2, int fIsXor, int Target, int fSave )
+{
+    Bal_Cut_t pCutSet[BAL_CUT_MAX], * pCutsR[BAL_CUT_MAX];
+    Bal_Cut_t * pCutSet0, * pCutSet1, * pCutSet2;
+    int nCuts0 = Bal_ManPrepareSet( p, iFan0, 0, fUnit0, &pCutSet0 );
+    int nCuts1 = Bal_ManPrepareSet( p, iFan1, 1, fUnit1, &pCutSet1 );
+    Bal_Cut_t * pCut0, * pCut0Lim = pCutSet0 + nCuts0;
+    Bal_Cut_t * pCut1, * pCut1Lim = pCutSet1 + nCuts1;
+    int i, Cost, nCutsR = 0;
+    memset( pCutSet, 0, sizeof(Bal_Cut_t) * p->nCutNum );
+    for ( i = 0; i < p->nCutNum; i++ )
+        pCutsR[i] = pCutSet + i;
+    // enumerate cuts
+    if ( iFan2 > 0 )
+    {
+        int nCuts2 = Bal_ManPrepareSet( p, iFan2, 2, fUnit2, &pCutSet2 );
+        Bal_Cut_t * pCut2, * pCut2Lim = pCutSet2 + nCuts2;
+        for ( pCut0 = pCutSet0; pCut0 < pCut0Lim; pCut0++ )
+        for ( pCut1 = pCutSet1; pCut1 < pCut1Lim; pCut1++ )
+        for ( pCut2 = pCutSet2; pCut2 < pCut2Lim; pCut2++ )
+        {
+            if ( Bal_CutCountBits(pCut0->Sign | pCut1->Sign | pCut2->Sign) > p->nLutSize )
+                continue;
+            if ( !Bal_CutMergeOrderMux(pCut0, pCut1, pCut2, pCutsR[nCutsR], p->nLutSize) )
+                continue;
+            assert( pCutsR[nCutsR]->Delay == Target );
+            if ( Bal_SetLastCutIsContained(pCutsR, nCutsR) )
+                continue;
+//            if ( p->fCutMin && Bal_CutComputeTruthMux(p, pCut0, pCut1, pCut2, fCompl0, fCompl1, fCompl2, pCutsR[nCutsR]) )
+//                pCutsR[nCutsR]->Sign = Bal_CutGetSign(pCutsR[nCutsR]->pLeaves, pCutsR[nCutsR]->nLeaves);
+            nCutsR = Bal_SetAddCut( pCutsR, nCutsR, p->nCutNum );
+        }
+    }
+    else
+    {
+        for ( pCut0 = pCutSet0; pCut0 < pCut0Lim; pCut0++ )
+        for ( pCut1 = pCutSet1; pCut1 < pCut1Lim; pCut1++ )
+        {
+            if ( Bal_CutCountBits(pCut0->Sign | pCut1->Sign) > p->nLutSize )
+                continue;
+            if ( !Bal_CutMergeOrder(pCut0, pCut1, pCutsR[nCutsR], p->nLutSize) )
+                continue;
+            assert( pCutsR[nCutsR]->Delay == Target );
+            if ( Bal_SetLastCutIsContained(pCutsR, nCutsR) )
+                continue;
+//            if ( p->fCutMin && Bal_CutComputeTruth(p, pCut0, pCut1, fCompl0, fCompl1, pCutsR[nCutsR], fIsXor) )
+//                pCutsR[nCutsR]->Sign = Bal_CutGetSign(pCutsR[nCutsR]->pLeaves, pCutsR[nCutsR]->nLeaves);
+            nCutsR = Bal_SetAddCut( pCutsR, nCutsR, p->nCutNum );
+        }
+    }
+    if ( nCutsR == 0 )
+        return -1;
+//printf( "%d ", nCutsR );
+    Cost = ((pCutsR[0]->Delay << 4) | pCutsR[0]->nLeaves);
+    // verify
+    assert( nCutsR > 0 && nCutsR < p->nCutNum );
+    assert( Bal_SetCheckArray(pCutsR, nCutsR) );
+    // save cuts
+    if ( fSave && Cost >= 0 )
+    {
+        pCutSet0 = ABC_CALLOC( Bal_Cut_t, p->nCutNum );
+        Vec_PtrPush( p->vCutSets, pCutSet0 );
+        assert( Vec_PtrSize(p->vCutSets) == Gia_ManObjNum(p->pNew) );
+        for ( i = 0; i < nCutsR; i++ )
+            pCutSet0[i] = *pCutsR[i];        
+        for ( ; i < p->nCutNum; i++ )
+            pCutSet0[i].nLeaves = BAL_NO_LEAF;
+        Vec_IntPush( p->vCosts, Cost );
+        assert( Vec_IntSize(p->vCosts) == Gia_ManObjNum(p->pNew) );
+    }
+    return Cost;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Bal_ManSetGateLevel( Bal_Man_t * p, Gia_Obj_t * pObjOld, int iLitNew )
+{
+    int iFan0, iFan1, iFan2, Cost;
+    int fCompl0, fCompl1, fCompl2;
+    int fUnit0, fUnit1, fUnit2;
+    int Delay0, Delay1, Delay2, DelayMax;
+    int iObjNew = Abc_Lit2Var(iLitNew);
+    Gia_Obj_t * pObjNew = Gia_ManObj( p->pNew, iObjNew );
+    int fMux = Gia_ObjIsMux(p->pNew, pObjNew);
+    if ( iObjNew < Vec_PtrSize(p->vCutSets) )
+        return -1;
+    iFan0    = Gia_ObjFaninId0( pObjNew, iObjNew );
+    iFan1    = Gia_ObjFaninId1( pObjNew, iObjNew );
+    iFan2    = fMux ? Gia_ObjFaninId2(p->pNew, iObjNew) : 0;
+    fCompl0  = Gia_ObjFaninC0( pObjNew );
+    fCompl1  = Gia_ObjFaninC1( pObjNew );
+    fCompl2  = fMux ? Gia_ObjFaninC2(p->pNew, pObjNew) : 0;
+    Delay0   = Bal_ObjDelay( p, iFan0 );
+    Delay1   = Bal_ObjDelay( p, iFan1 );
+    Delay2   = Bal_ObjDelay( p, iFan2 );
+    DelayMax = Abc_MaxInt( Delay0, Abc_MaxInt(Delay1, Delay2) );
+    fUnit0   = (int)(Delay0 != DelayMax); 
+    fUnit1   = (int)(Delay1 != DelayMax); 
+    fUnit2   = (int)(Delay2 != DelayMax); 
+    if ( DelayMax > 0 )
+    {
+//printf( "A" );
+        Cost = Bal_ManDeriveCuts(p, iFan0, iFan1, iFan2, fCompl0, fCompl1, fCompl2, fUnit0, fUnit1, fUnit2, Gia_ObjIsXor(pObjNew), DelayMax, 1 );
+//printf( "B" );
+        if ( Cost >= 0 )
+            return Cost;
+    }
+    DelayMax++;
+    fUnit0 = fUnit1 = fUnit2 = 1;
+//printf( "A" );
+    Cost = Bal_ManDeriveCuts(p, iFan0, iFan1, iFan2, fCompl0, fCompl1, fCompl2, fUnit0, fUnit1, fUnit2, Gia_ObjIsXor(pObjNew), DelayMax, 1 );
+//printf( "B" );
+    assert( Cost >= 0 );
+    return Cost;
+}
+int Bal_ManEvalTwo( Bal_Man_t * p, int iLitNew0, int iLitNew1, int iLitNew2, int fIsXor )
+{
+    int iFan0    = Abc_Lit2Var( iLitNew0 );
+    int iFan1    = Abc_Lit2Var( iLitNew1 );
+    int iFan2    = Abc_Lit2Var( iLitNew2 );
+    int fCompl0  = Abc_LitIsCompl( iLitNew0 );
+    int fCompl1  = Abc_LitIsCompl( iLitNew1 );
+    int fCompl2  = Abc_LitIsCompl( iLitNew2 );
+    int Delay0   = Bal_ObjDelay( p, iFan0 );
+    int Delay1   = Bal_ObjDelay( p, iFan1 );
+    int Delay2   = Bal_ObjDelay( p, iFan2 );
+    int DelayMax = Abc_MaxInt( Delay0, Abc_MaxInt(Delay1, Delay2) );
+    int fUnit0   = (int)(Delay0 != DelayMax); 
+    int fUnit1   = (int)(Delay1 != DelayMax); 
+    int fUnit2   = (int)(Delay2 != DelayMax); 
+    if ( DelayMax == 0 )
+        return -1;
+    return Bal_ManDeriveCuts(p, iFan0, iFan1, iFan2, fCompl0, fCompl1, fCompl2, fUnit0, fUnit1, fUnit2, fIsXor, DelayMax, 0 );
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Sort literals by their cost.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline void Vec_IntSelectSortCostLit( Vec_Int_t * vSuper, Vec_Int_t * vCosts )
+{
+    int * pArray = Vec_IntArray(vSuper);
+    int nSize = Vec_IntSize(vSuper);
+    int i, j, best_i;
+    for ( i = 0; i < nSize-1; i++ )
+    {
+        best_i = i;
+        for ( j = i+1; j < nSize; j++ )
+            if ( Vec_IntEntry(vCosts, Abc_Lit2Var(pArray[j])) > Vec_IntEntry(vCosts, Abc_Lit2Var(pArray[best_i])) )
+                best_i = j;
+        ABC_SWAP( int, pArray[i], pArray[best_i] );
+    }
+}
+static inline void Vec_IntPushOrderCost( Vec_Int_t * vSuper, Vec_Int_t * vCosts, int iLit )
+{
+    int i, nSize, * pArray;
+    Vec_IntPush( vSuper, iLit );
+    pArray = Vec_IntArray(vSuper);
+    nSize = Vec_IntSize(vSuper);
+    for ( i = nSize-1; i > 0; i-- )
+    {
+        if ( Vec_IntEntry(vCosts, Abc_Lit2Var(pArray[i])) <= Vec_IntEntry(vCosts, Abc_Lit2Var(pArray[i - 1])) )
+            return;
+        ABC_SWAP( int, pArray[i], pArray[i - 1] );
+    }
+}
+static inline int Vec_IntFindFirstSameDelayAsLast( Bal_Man_t * p, Vec_Int_t * vSuper )
+{
+    int i, DelayCur, Delay = Bal_LitDelay( p, Vec_IntEntryLast(vSuper) );
+    assert( Vec_IntSize(vSuper) > 1 );
+    for ( i = Vec_IntSize(vSuper)-1; i > 0; i-- )
+    {
+        DelayCur = Bal_LitDelay( p, Vec_IntEntry(vSuper, i-1) );
+        assert( DelayCur >= Delay );
+        if ( DelayCur > Delay )
+            return i;
+    }
+    return i;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    [Select the best pair to merge.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Bal_ManFindBestPair( Bal_Man_t * p, Vec_Int_t * vSuper, Gia_Obj_t * pObj )
+{
+    int * pSuper = Vec_IntArray(vSuper);
+    int iBeg = Vec_IntFindFirstSameDelayAsLast( p, vSuper );
+    int iEnd = Vec_IntSize(vSuper)-1;
+    int i, k, iBest = -1, kBest = -1, BestCost = ABC_INFINITY, Cost;
+    assert( iBeg <= iEnd );
+    // check if we can add to the higher levels without increasing cost
+    for ( k = iBeg-1; k >= 0; k-- )
+    for ( i = iEnd; i >= iBeg; i-- )
+    {
+        Cost = Bal_ManEvalTwo( p, pSuper[i], pSuper[k], 0, Gia_ObjIsXor(pObj) );
+        if ( Cost == -1 )
+            continue;
+        if ( Cost == Bal_LitCost(p, pSuper[k]) )
+        {
+//            printf( "A" );
+            return (k << 16)|i;
+        }
+        if ( BestCost > Cost )
+            BestCost = Cost, iBest = i, kBest = k;
+    }
+    if ( BestCost != ABC_INFINITY && (BestCost >> 4) == Bal_LitDelay(p, pSuper[kBest]) )
+    {
+//        printf( "B" );
+        return (kBest << 16)|iBest;
+    }
+    // check if some can be added to lowest level without increasing cost
+    BestCost = ABC_INFINITY;
+    for ( i = iBeg; i <= iEnd; i++ )
+    for ( k = i+1;  k <= iEnd; k++ )
+    {
+        Cost = Bal_ManEvalTwo( p, pSuper[i], pSuper[k], 0, Gia_ObjIsXor(pObj) );
+        if ( Cost == -1 )
+            continue;
+        if ( Cost == Abc_MaxInt(Bal_LitCost(p, pSuper[i]), Bal_LitCost(p, pSuper[k])) )
+        {
+//            printf( "C" );
+            return (k << 16)|i;
+        }
+        if ( BestCost > Cost )
+            BestCost = Cost, iBest = i, kBest = k;
+    }
+    if ( BestCost != ABC_INFINITY )
+    {
+//        printf( "D" );
+        return (kBest << 16)|iBest;
+    }
+//    printf( "E" );
+    // group pairs from lowest level based on proximity
+    return (iEnd << 16)|(iEnd-1);
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Simplify multi-input AND/XOR.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline void Gia_ManSimplifyXor( Vec_Int_t * vSuper )
+{
+    int i, k = 0, Prev = -1, This, fCompl = 0;
+    Vec_IntForEachEntry( vSuper, This, i )
+    {
+        if ( This == 0 )
+            continue;
+        if ( This == 1 )
+            fCompl ^= 1; 
+        else if ( Prev != This )
+            Vec_IntWriteEntry( vSuper, k++, This ), Prev = This;
+        else
+            Prev = -1, k--;
+    }
+    Vec_IntShrink( vSuper, k );
+    if ( Vec_IntSize( vSuper ) == 0 )
+        Vec_IntPush( vSuper, fCompl );
+    else if ( fCompl )
+        Vec_IntWriteEntry( vSuper, 0, Abc_LitNot(Vec_IntEntry(vSuper, 0)) );
+}
+static inline void Gia_ManSimplifyAnd( Vec_Int_t * vSuper )
+{
+    int i, k = 0, Prev = -1, This;
+    Vec_IntForEachEntry( vSuper, This, i )
+    {
+        if ( This == 0 )
+            { Vec_IntFill(vSuper, 1, 0); return; }
+        if ( This == 1 )
+            continue;
+        if ( Prev == -1 || Abc_Lit2Var(Prev) != Abc_Lit2Var(This) )
+            Vec_IntWriteEntry( vSuper, k++, This ), Prev = This;
+        else if ( Prev != This )
+            { Vec_IntFill(vSuper, 1, 0); return; }
+    }
+    Vec_IntShrink( vSuper, k );
+    if ( Vec_IntSize( vSuper ) == 0 )
+        Vec_IntPush( vSuper, 1 );
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Collect multi-input AND/XOR.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline void Gia_ManSuperCollectXor_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+    assert( !Gia_IsComplement(pObj) );
+    if ( !Gia_ObjIsXor(pObj) || 
+//        Gia_ObjRefNum(p, pObj) > 1 || 
+        Gia_ObjRefNum(p, pObj) > 3 || 
+//        (Gia_ObjRefNum(p, pObj) == 2 && (Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) == 1 || Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) == 1)) || 
+        Vec_IntSize(p->vSuper) > BAL_SUPER )
+    {
+        Vec_IntPush( p->vSuper, Gia_ObjToLit(p, pObj) );
+        return;
+    }
+    assert( !Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) );
+    Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin0(pObj) );
+    Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin1(pObj) );
+}
+static inline void Gia_ManSuperCollectAnd_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+    if ( Gia_IsComplement(pObj) || 
+        !Gia_ObjIsAndReal(p, pObj) || 
+//        Gia_ObjRefNum(p, pObj) > 1 || 
+        Gia_ObjRefNum(p, pObj) > 3 || 
+//        (Gia_ObjRefNum(p, pObj) == 2 && (Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) == 1 || Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) == 1)) || 
+        Vec_IntSize(p->vSuper) > BAL_SUPER )
+    {
+        Vec_IntPush( p->vSuper, Gia_ObjToLit(p, pObj) );
+        return;
+    }
+    Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild0(pObj) );
+    Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild1(pObj) );
+}
+static inline void Gia_ManSuperCollect( Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+//    int nSize;
+    if ( p->vSuper == NULL )
+        p->vSuper = Vec_IntAlloc( 1000 );
+    else
+        Vec_IntClear( p->vSuper );
+    if ( Gia_ObjIsXor(pObj) )
+    {
+        assert( !Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) );
+        Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin0(pObj) );
+        Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin1(pObj) );
+//        nSize = Vec_IntSize(vSuper);
+        Vec_IntSort( p->vSuper, 0 );
+        Gia_ManSimplifyXor( p->vSuper );
+//        if ( nSize != Vec_IntSize(vSuper) )
+//            printf( "X %d->%d  ", nSize, Vec_IntSize(vSuper) );
+    }
+    else if ( Gia_ObjIsAndReal(p, pObj) )
+    {
+        Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild0(pObj) );
+        Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild1(pObj) );
+//        nSize = Vec_IntSize(vSuper);
+        Vec_IntSort( p->vSuper, 0 );
+        Gia_ManSimplifyAnd( p->vSuper );
+//        if ( nSize != Vec_IntSize(vSuper) )
+//            printf( "A %d->%d  ", nSize, Vec_IntSize(vSuper) );
+    }
+    else assert( 0 );
+//    if ( nSize > 10 )
+//        printf( "%d ", nSize );
+    assert( Vec_IntSize(p->vSuper) > 0 );
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline void Gia_ManCreateGate( Gia_Man_t * pNew, Gia_Obj_t * pObj, Vec_Int_t * vSuper )
+{
+    int iLit0 = Vec_IntPop(vSuper);
+    int iLit1 = Vec_IntPop(vSuper);
+    int iLit, i;
+    if ( !Gia_ObjIsXor(pObj) )
+        iLit = Gia_ManHashAnd( pNew, iLit0, iLit1 );
+    else if ( pNew->pMuxes )
+        iLit = Gia_ManHashXorReal( pNew, iLit0, iLit1 );
+    else 
+        iLit = Gia_ManHashXor( pNew, iLit0, iLit1 );
+    Vec_IntPush( vSuper, iLit );
+    Bal_ManSetGateLevel( Bal_GiaMan(pNew), pObj, iLit );
+//    Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(iLit)) );
+    // shift to the corrent location
+    for ( i = Vec_IntSize(vSuper)-1; i > 0; i-- )
+    {
+        int iLit1 = Vec_IntEntry(vSuper, i);
+        int iLit2 = Vec_IntEntry(vSuper, i-1);
+        if ( Gia_ObjLevelId(pNew, Abc_Lit2Var(iLit1)) <= Gia_ObjLevelId(pNew, Abc_Lit2Var(iLit2)) )
+            break;
+        Vec_IntWriteEntry( vSuper, i,   iLit2 );
+        Vec_IntWriteEntry( vSuper, i-1, iLit1 );
+    }
+}
+static inline int Gia_ManBalanceGate( Gia_Man_t * pNew, Gia_Obj_t * pObj, Vec_Int_t * vSuper, int * pLits, int nLits )
+{
+    Vec_IntClear( vSuper );
+    if ( nLits == 1 )
+        Vec_IntPush( vSuper, pLits[0] );
+    else if ( nLits == 2 )
+    {
+        Vec_IntPush( vSuper, pLits[0] );
+        Vec_IntPush( vSuper, pLits[1] );
+        Gia_ManCreateGate( pNew, pObj, vSuper );
+    }
+    else if ( nLits > 2 )
+    {
+        Bal_Man_t * p = Bal_GiaMan(pNew); int i;
+        for ( i = 0; i < nLits; i++ )
+            Vec_IntPush( vSuper, pLits[i] );
+        // sort by level/cut-size
+        Vec_IntSelectSortCostLit( vSuper, p->vCosts );
+        // iterate till everything is grouped
+        while ( Vec_IntSize(vSuper) > 1 )
+        {
+            int iLit, Res = Bal_ManFindBestPair( p, vSuper, pObj );
+            int iBest = Vec_IntEntry( vSuper, Res >> 16 );
+            int kBest = Vec_IntEntry( vSuper, Res & 0xFFFF );
+            Vec_IntRemove( vSuper, iBest );
+            Vec_IntRemove( vSuper, kBest );
+            if ( Gia_ObjIsXor(pObj) )
+                iLit = Gia_ManHashXorReal( pNew, iBest, kBest );
+            else 
+                iLit = Gia_ManHashAnd( pNew, iBest, kBest );
+            Bal_ManSetGateLevel( p, pObj, iLit );
+            Vec_IntPushOrderCost( vSuper, p->vCosts, iLit );
+        }
+    }
+    // consider trivial case
+    assert( Vec_IntSize(vSuper) == 1 );
+    return Vec_IntEntry(vSuper, 0);
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline void Gia_ManBalance_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+    int i, iLit, iBeg, iEnd;
+    if ( ~pObj->Value )
+        return;
+    assert( Gia_ObjIsAnd(pObj) );
+    // handle MUX
+    if ( Gia_ObjIsMux(p, pObj) )
+    {
+        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin0(pObj) );
+        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin1(pObj) );
+        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin2(p, pObj) );
+        pObj->Value = Gia_ManHashMuxReal( pNew, Gia_ObjFanin2Copy(p, pObj), Gia_ObjFanin1Copy(pObj), Gia_ObjFanin0Copy(pObj) );
+        Bal_ManSetGateLevel( Bal_GiaMan(pNew), pObj, pObj->Value );
+//        Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(pObj->Value)) );
+        return;
+    }
+    // find supergate
+    Gia_ManSuperCollect( p, pObj );
+    // save entries
+    if ( p->vStore == NULL )
+        p->vStore = Vec_IntAlloc( 1000 );
+    iBeg = Vec_IntSize( p->vStore );
+    Vec_IntAppend( p->vStore, p->vSuper );
+    iEnd = Vec_IntSize( p->vStore );
+    // call recursively
+    Vec_IntForEachEntryStartStop( p->vStore, iLit, i, iBeg, iEnd )
+    {
+        Gia_Obj_t * pTemp = Gia_ManObj( p, Abc_Lit2Var(iLit) );
+        Gia_ManBalance_rec( pNew, p, pTemp );
+        Vec_IntWriteEntry( p->vStore, i, Abc_LitNotCond(pTemp->Value, Abc_LitIsCompl(iLit)) );
+    }
+    assert( Vec_IntSize(p->vStore) == iEnd );
+    // consider general case
+    pObj->Value = Gia_ManBalanceGate( pNew, pObj, p->vSuper, Vec_IntEntryP(p->vStore, iBeg), iEnd-iBeg );
+    Vec_IntShrink( p->vStore, iBeg );
+}
+static inline Gia_Man_t * Gia_ManBalanceInt( Gia_Man_t * p, int nLutSize, int nCutNum, int fVerbose )
+{
+    Bal_Man_t * pMan;
+    Gia_Man_t * pNew, * pTemp;
+    Gia_Obj_t * pObj;
+    int i;
+    Gia_ManFillValue( p );
+    Gia_ManCreateRefs( p ); 
+    // start the new manager
+    pNew = Gia_ManStart( 3*Gia_ManObjNum(p)/2 );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+    pNew->pMuxes = ABC_CALLOC( unsigned, pNew->nObjsAlloc );
+    pNew->vLevels = Vec_IntStart( pNew->nObjsAlloc );
+    // create constant and inputs
+    Gia_ManConst0(p)->Value = 0;
+    Gia_ManForEachCi( p, pObj, i )
+        pObj->Value = Gia_ManAppendCi( pNew );
+    // create balancing manager
+    pMan = Bal_ManAlloc( p, pNew, nLutSize, nCutNum, fVerbose );
+    // create internal nodes
+    Gia_ManHashStart( pNew );
+    Gia_ManForEachCo( p, pObj, i )
+        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin0(pObj) );
+    Gia_ManForEachCo( p, pObj, i )
+        pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+//    if ( fVerbose )
+    {
+        int nLevelMax = 0;
+        Gia_ManForEachCo( pNew, pObj, i )
+        {
+            nLevelMax = Abc_MaxInt( nLevelMax, Bal_ObjDelay(pMan, Gia_ObjFaninId0p(pNew, pObj)) );
+//            printf( "%d=%d ", i, Bal_ObjDelay(pMan, Gia_ObjFaninId0p(pNew, pObj)) );
+        }
+        printf( "Best delay = %d\n", nLevelMax );
+    }
+
+//    assert( Gia_ManObjNum(pNew) <= Gia_ManObjNum(p) );
+    Gia_ManHashStop( pNew );
+    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+    // delete manager
+    Bal_ManFree( pMan );
+    // perform cleanup
+    pNew = Gia_ManCleanup( pTemp = pNew );
+    Gia_ManStop( pTemp );
+    return pNew;
+}
+Gia_Man_t * Gia_ManBalanceLut( Gia_Man_t * p, int nLutSize, int nCutNum, int fVerbose )
+{
+    Gia_Man_t * pNew, * pNew1, * pNew2;
+    if ( fVerbose )      Gia_ManPrintStats( p, NULL );
+    pNew = Gia_ManDupMuxes( p, 2 );
+    if ( fVerbose )      Gia_ManPrintStats( pNew, NULL );
+    pNew1 = Gia_ManBalanceInt( pNew, nLutSize, nCutNum, fVerbose );
+    if ( fVerbose )      Gia_ManPrintStats( pNew1, NULL );
+    Gia_ManStop( pNew );
+    pNew2 = Gia_ManDupNoMuxes( pNew1 );
+    if ( fVerbose )      Gia_ManPrintStats( pNew2, NULL );
+    Gia_ManStop( pNew1 );
+    return pNew2;
+}
+
+
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/aig/gia/giaBalMap.c b/abc-build/src/aig/gia/giaBalMap.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/aig/gia/giaBalMap.c
@@ -0,0 +1,326 @@
+/**CFile****************************************************************
+
+  FileName    [giaSopb.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Scalable AIG package.]
+
+  Synopsis    [SOP balancing for a window.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - June 20, 2005.]
+
+  Revision    [$Id: giaSopb.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "gia.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManHighlight_rec( Gia_Man_t * p, int iObj )
+{
+    Gia_Obj_t * pObj;
+    if ( Gia_ObjIsTravIdCurrentId(p, iObj) )
+        return;
+    Gia_ObjSetTravIdCurrentId(p, iObj);
+    pObj = Gia_ManObj( p, iObj );
+    if ( Gia_ObjIsAnd(pObj) )
+        Gia_ManHighlight_rec( p, Gia_ObjFaninId0(pObj, iObj) );
+    if ( Gia_ObjIsAnd(pObj) )
+        Gia_ManHighlight_rec( p, Gia_ObjFaninId1(pObj, iObj) );
+}
+void Gia_ManPrepareWin( Gia_Man_t * p, Vec_Int_t * vOuts, Vec_Int_t ** pvPis, Vec_Int_t ** pvPos, Vec_Int_t ** pvAnds, int fPoOnly )
+{
+    Gia_Obj_t * pObj;
+    int i;
+    // mark the section
+    Gia_ManIncrementTravId( p );
+    Gia_ManForEachCoVec( vOuts, p, pObj, i )
+        Gia_ManHighlight_rec( p, Gia_ObjFaninId0p(p, pObj) );
+    // mark fanins of the outside area
+    Gia_ManCleanMark0( p );
+    if ( fPoOnly )
+    {
+        Gia_ManForEachCoVec( vOuts, p, pObj, i )
+            Gia_ObjFanin0(pObj)->fMark0 = 1;
+    }
+    else
+    {
+        Gia_ManForEachObj1( p, pObj, i )
+        {
+            if ( Gia_ObjIsCi(pObj) )
+                continue;
+            if ( Gia_ObjIsAnd(pObj) && !Gia_ObjIsTravIdCurrentId(p, i) )
+                continue;
+            Gia_ObjFanin0(pObj)->fMark0 = 1;
+            if ( Gia_ObjIsAnd(pObj) )
+                Gia_ObjFanin1(pObj)->fMark0 = 1;
+        }
+    }
+    // collect pointed nodes
+    *pvPis  = Vec_IntAlloc( 1000 );
+    *pvPos  = Vec_IntAlloc( 1000 );
+    *pvAnds = Vec_IntAlloc( 1000 );
+    Gia_ManForEachObj1( p, pObj, i )
+    {
+        if ( !Gia_ObjIsTravIdCurrentId(p, i) )
+            continue;
+        if ( Gia_ObjIsCi(pObj) )
+            Vec_IntPush( *pvPis, i );
+        else if ( pObj->fMark0 )
+            Vec_IntPush( *pvPos, i );
+        if ( Gia_ObjIsAnd(pObj) )
+            Vec_IntPush( *pvAnds, i );
+    }
+    Gia_ManCleanMark0( p );
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManExtractWin( Gia_Man_t * p, Vec_Int_t * vOuts, int fPoOnly )
+{
+    Vec_Int_t * vPis, * vPos, * vAnds;
+    Gia_Man_t * pNew;
+    Gia_Obj_t * pObj;
+    int i;
+    Gia_ManPrepareWin( p, vOuts, &vPis, &vPos, &vAnds, fPoOnly );
+    // create AIG
+    pNew = Gia_ManStart( Vec_IntSize(vPis) + Vec_IntSize(vPos) + Vec_IntSize(vAnds) + 1 );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    Gia_ManConst0(p)->Value = 0;
+    Gia_ManForEachObjVec( vPis, p, pObj, i )
+        pObj->Value = Gia_ManAppendCi( pNew );
+    Gia_ManForEachObjVec( vAnds, p, pObj, i )
+        pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+    Gia_ManForEachObjVec( vPos, p, pObj, i )
+        Gia_ManAppendCo( pNew, pObj->Value );
+    Vec_IntFree( vPis );
+    Vec_IntFree( vPos );
+    Vec_IntFree( vAnds );
+    return pNew;
+}
+Gia_Man_t * Gia_ManInsertWin( Gia_Man_t * p, Vec_Int_t * vOuts, Gia_Man_t * pWin )
+{
+    Vec_Int_t * vPos, * vPis, * vAnds;
+    Gia_Man_t * pNew, * pTemp;
+    Gia_Obj_t * pObj;
+    int i;
+    Gia_ManPrepareWin( p, vOuts, &vPis, &vPos, &vAnds, 0 );
+    // create AIG
+    pNew = Gia_ManStart( Gia_ManObjNum(p) - Vec_IntSize(vAnds) + Gia_ManAndNum(pWin) );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+    // inputs
+    Gia_ManConst0(p)->Value = 0;
+    Gia_ManForEachCi( p, pObj, i )
+        pObj->Value = Gia_ManAppendCi( pNew );
+    Gia_ManConst0(pWin)->Value = 0;
+    Gia_ManForEachCi( pWin, pObj, i )
+        pObj->Value = Gia_ManObj(p, Vec_IntEntry(vPis, i))->Value;
+    // internal nodes
+    Gia_ManHashAlloc( pNew );
+    Gia_ManForEachAnd( pWin, pObj, i )
+        pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+    Gia_ManForEachCo( pWin, pObj, i )
+        Gia_ManObj( p, Vec_IntEntry(vPos, i) )->Value = Gia_ObjFanin0Copy(pObj);
+    Gia_ManForEachAnd( p, pObj, i )
+        if ( !Gia_ObjIsTravIdCurrentId(p, i) )
+            pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+    Gia_ManForEachCo( p, pObj, i )
+        Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+    Gia_ManHashStop( pNew );
+    // cleanup
+    Vec_IntFree( vPis );
+    Vec_IntFree( vPos );
+    Vec_IntFree( vAnds );
+    pNew = Gia_ManCleanup( pTemp = pNew );
+    Gia_ManStop( pTemp );
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Vec_Int_t * Gia_ManFindLatest( Gia_Man_t * p, int LevelMax, int nTimeWindow )
+{
+    Gia_Obj_t * pObj;
+    Vec_Int_t * vOuts;
+    vOuts = Vec_IntAlloc( 1000 );
+    if ( Gia_ManHasMapping(p) )
+    {
+        int i, k, iFan, nLevels = 0;
+        int * pLevels = ABC_CALLOC( int, Gia_ManObjNum(p) );
+        Gia_ManForEachLut( p, i )
+        {
+            Gia_LutForEachFanin( p, i, iFan, k )
+                pLevels[i] = Abc_MaxInt( pLevels[i], pLevels[iFan] );
+            pLevels[i]++;
+            nLevels = Abc_MaxInt( nLevels, pLevels[i] );
+        }
+        if ( nTimeWindow )
+            LevelMax = (int)((1.0 - 0.01 * nTimeWindow) * nLevels);
+        if ( nLevels < LevelMax )
+            printf( "The maximum mapped level (%d) is less than the target level (%d).\n", nLevels, LevelMax );
+        Gia_ManForEachCo( p, pObj, i )
+            if ( pLevels[Gia_ObjFaninId0p(p, pObj)] >= LevelMax )
+                Vec_IntPush( vOuts, i );
+        ABC_FREE( pLevels );
+    }
+    else
+    {
+        int i, nLevels = Gia_ManLevelNum( p );
+        if ( nTimeWindow )
+            LevelMax = (int)((1.0 - 0.01 * nTimeWindow) * nLevels);
+        if ( nLevels < LevelMax )
+            printf( "The maximum AIG level (%d) is less than the target level (%d).\n", nLevels, LevelMax );
+        Gia_ManForEachCo( p, pObj, i )
+            if ( Gia_ObjLevel(p, pObj) >= LevelMax )
+                Vec_IntPush( vOuts, i );
+    }
+    return vOuts;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManExtractWindow( Gia_Man_t * p, int LevelMax, int nTimeWindow, int fVerbose )
+{
+    Vec_Int_t * vOuts;
+    Gia_Man_t * pWin;
+    assert( !LevelMax != !nTimeWindow );
+    vOuts = Gia_ManFindLatest( p, LevelMax, nTimeWindow );
+    if ( fVerbose )
+        printf( "Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
+    if ( Vec_IntSize(vOuts) == 0 )
+    {
+        Vec_IntFree( vOuts );
+        return Gia_ManDup( p );
+    }
+    pWin = Gia_ManExtractWin( p, vOuts, 1 );
+    Vec_IntFree( vOuts );
+    return pWin;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManPerformSopBalanceWin( Gia_Man_t * p, int LevelMax, int nTimeWindow, int nCutNum, int nRelaxRatio, int fVerbose )
+{
+    Vec_Int_t * vOuts;
+    Gia_Man_t * pNew, * pWin, * pWinNew;
+    assert( !LevelMax != !nTimeWindow );
+    vOuts = Gia_ManFindLatest( p, LevelMax, nTimeWindow );
+    if ( fVerbose )
+        printf( "Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
+    if ( Vec_IntSize(vOuts) == 0 )
+    {
+        Vec_IntFree( vOuts );
+        return Gia_ManDup( p );
+    }
+    pWin = Gia_ManExtractWin( p, vOuts, 0 );
+    pWinNew = Gia_ManPerformSopBalance( pWin, nCutNum, nRelaxRatio, fVerbose );
+    Gia_ManStop( pWin );
+    pNew = Gia_ManInsertWin( p, vOuts, pWinNew );
+    Gia_ManStop( pWinNew );
+    Vec_IntFree( vOuts );
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManPerformDsdBalanceWin( Gia_Man_t * p, int LevelMax, int nTimeWindow, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose )
+{
+    Vec_Int_t * vOuts;
+    Gia_Man_t * pNew, * pWin, * pWinNew;
+    assert( !LevelMax != !nTimeWindow );
+    vOuts = Gia_ManFindLatest( p, LevelMax, nTimeWindow );
+    if ( fVerbose )
+        printf( "Collected %d outputs to extract.\n", Vec_IntSize(vOuts) );
+    if ( Vec_IntSize(vOuts) == 0 )
+    {
+        Vec_IntFree( vOuts );
+        return Gia_ManDup( p );
+    }
+    pWin = Gia_ManExtractWin( p, vOuts, 0 );
+    pWinNew = Gia_ManPerformDsdBalance( pWin, nLutSize, nCutNum, nRelaxRatio, fVerbose );
+    Gia_ManStop( pWin );
+    pNew = Gia_ManInsertWin( p, vOuts, pWinNew );
+    Gia_ManStop( pWinNew );
+    Vec_IntFree( vOuts );
+    return pNew;
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/aig/gia/giaBalance.c b/abc-build/src/aig/gia/giaBalance.c
deleted file mode 100644
--- a/abc-build/src/aig/gia/giaBalance.c
+++ /dev/null
@@ -1,1151 +0,0 @@
-/**CFile****************************************************************
-
-  FileName    [giaBalance.c]
-
-  SystemName  [ABC: Logic synthesis and verification system.]
-
-  PackageName [Scalable AIG package.]
-
-  Synopsis    [AIG balancing.]
-
-  Author      [Alan Mishchenko]
-  
-  Affiliation [UC Berkeley]
-
-  Date        [Ver. 1.0. Started - June 20, 2005.]
-
-  Revision    [$Id: giaBalance.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
-
-***********************************************************************/
-
-#include "gia.h"
-#include "misc/vec/vecHash.h"
-#include "misc/vec/vecQue.h"
-#include "opt/dau/dau.h"
-
-ABC_NAMESPACE_IMPL_START
-
-
-////////////////////////////////////////////////////////////////////////
-///                        DECLARATIONS                              ///
-////////////////////////////////////////////////////////////////////////
-
-// operation manager
-typedef struct Dam_Man_t_ Dam_Man_t;
-struct Dam_Man_t_
-{
-    Gia_Man_t *      pGia;      // user's AIG
-    Vec_Int_t *      vNod2Set;  // node ID into fanin set
-    Vec_Int_t *      vDiv2Nod;  // div ID into root node set
-    Vec_Int_t *      vSetStore; // fanin set storage
-    Vec_Int_t *      vNodStore; // root node set storage
-    Vec_Flt_t *      vCounts;   // occur counts
-    Vec_Int_t *      vNodLevR;  // node reverse level
-    Vec_Int_t *      vDivLevR;  // divisor reverse level
-    Vec_Int_t *      vVisit;    // visited MUXes
-    Vec_Que_t *      vQue;      // pairs by their weight
-    Hash_IntMan_t *  vHash;     // pair hash table
-    abctime          clkStart;  // starting the clock
-    int              nLevelMax; // maximum level
-    int              nDivs;     // extracted divisor count
-    int              nAnds;     // total AND node count
-    int              nGain;     // total gain in AND nodes
-    int              nGainX;    // gain from XOR nodes
-};
-
-static inline int    Dam_ObjHand( Dam_Man_t * p, int i )     { return i < Vec_IntSize(p->vNod2Set) ? Vec_IntEntry(p->vNod2Set, i) : 0;                      }
-static inline int *  Dam_ObjSet( Dam_Man_t * p, int i )      { int h = Dam_ObjHand(p, i); if ( h == 0 ) return NULL; return Vec_IntEntryP(p->vSetStore, h); }
-
-static inline int    Dam_DivHand( Dam_Man_t * p, int d )     { return d < Vec_IntSize(p->vDiv2Nod) ? Vec_IntEntry(p->vDiv2Nod, d) : 0;                      }
-static inline int *  Dam_DivSet( Dam_Man_t * p, int d )      { int h = Dam_DivHand(p, d); if ( h == 0 ) return NULL; return Vec_IntEntryP(p->vNodStore, h); }
-
-
-////////////////////////////////////////////////////////////////////////
-///                     FUNCTION DEFINITIONS                         ///
-////////////////////////////////////////////////////////////////////////
-
-/**Function*************************************************************
-
-  Synopsis    [Simplify multi-input AND/XOR.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Gia_ManSimplifyXor( Vec_Int_t * vSuper )
-{
-    int i, k = 0, Prev = -1, This, fCompl = 0;
-    Vec_IntForEachEntry( vSuper, This, i )
-    {
-        if ( This == 0 )
-            continue;
-        if ( This == 1 )
-            fCompl ^= 1; 
-        else if ( Prev != This )
-            Vec_IntWriteEntry( vSuper, k++, This ), Prev = This;
-        else
-            Prev = -1, k--;
-    }
-    Vec_IntShrink( vSuper, k );
-    if ( Vec_IntSize( vSuper ) == 0 )
-        Vec_IntPush( vSuper, fCompl );
-    else if ( fCompl )
-        Vec_IntWriteEntry( vSuper, 0, Abc_LitNot(Vec_IntEntry(vSuper, 0)) );
-}
-void Gia_ManSimplifyAnd( Vec_Int_t * vSuper )
-{
-    int i, k = 0, Prev = -1, This;
-    Vec_IntForEachEntry( vSuper, This, i )
-    {
-        if ( This == 0 )
-            { Vec_IntFill(vSuper, 1, 0); return; }
-        if ( This == 1 )
-            continue;
-        if ( Prev == -1 || Abc_Lit2Var(Prev) != Abc_Lit2Var(This) )
-            Vec_IntWriteEntry( vSuper, k++, This ), Prev = This;
-        else if ( Prev != This )
-            { Vec_IntFill(vSuper, 1, 0); return; }
-    }
-    Vec_IntShrink( vSuper, k );
-    if ( Vec_IntSize( vSuper ) == 0 )
-        Vec_IntPush( vSuper, 1 );
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Collect multi-input AND/XOR.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Gia_ManSuperCollectXor_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-    assert( !Gia_IsComplement(pObj) );
-    if ( !Gia_ObjIsXor(pObj) || 
-//        Gia_ObjRefNum(p, pObj) > 1 || 
-        Gia_ObjRefNum(p, pObj) > 2 || 
-        (Gia_ObjRefNum(p, pObj) == 2 && (Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) == 1 || Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) == 1)) || 
-        Vec_IntSize(p->vSuper) > 100 )
-    {
-        Vec_IntPush( p->vSuper, Gia_ObjToLit(p, pObj) );
-        return;
-    }
-    assert( !Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) );
-    Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin0(pObj) );
-    Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin1(pObj) );
-}
-void Gia_ManSuperCollectAnd_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-    if ( Gia_IsComplement(pObj) || 
-        !Gia_ObjIsAndReal(p, pObj) || 
-//        Gia_ObjRefNum(p, pObj) > 1 || 
-        Gia_ObjRefNum(p, pObj) > 2 || 
-        (Gia_ObjRefNum(p, pObj) == 2 && (Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) == 1 || Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) == 1)) || 
-        Vec_IntSize(p->vSuper) > 100 )
-    {
-        Vec_IntPush( p->vSuper, Gia_ObjToLit(p, pObj) );
-        return;
-    }
-    Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild0(pObj) );
-    Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild1(pObj) );
-}
-void Gia_ManSuperCollect( Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-//    int nSize;
-    if ( p->vSuper == NULL )
-        p->vSuper = Vec_IntAlloc( 1000 );
-    else
-        Vec_IntClear( p->vSuper );
-    if ( Gia_ObjIsXor(pObj) )
-    {
-        assert( !Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) );
-        Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin0(pObj) );
-        Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin1(pObj) );
-//        nSize = Vec_IntSize(vSuper);
-        Vec_IntSort( p->vSuper, 0 );
-        Gia_ManSimplifyXor( p->vSuper );
-//        if ( nSize != Vec_IntSize(vSuper) )
-//            printf( "X %d->%d  ", nSize, Vec_IntSize(vSuper) );
-    }
-    else if ( Gia_ObjIsAndReal(p, pObj) )
-    {
-        Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild0(pObj) );
-        Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild1(pObj) );
-//        nSize = Vec_IntSize(vSuper);
-        Vec_IntSort( p->vSuper, 0 );
-        Gia_ManSimplifyAnd( p->vSuper );
-//        if ( nSize != Vec_IntSize(vSuper) )
-//            printf( "A %d->%d  ", nSize, Vec_IntSize(vSuper) );
-    }
-    else assert( 0 );
-//    if ( nSize > 10 )
-//        printf( "%d ", nSize );
-    assert( Vec_IntSize(p->vSuper) > 0 );
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Gia_ManCreateGate( Gia_Man_t * pNew, Gia_Obj_t * pObj, Vec_Int_t * vSuper )
-{
-    int iLit0 = Vec_IntPop(vSuper);
-    int iLit1 = Vec_IntPop(vSuper);
-    int iLit, i;
-    if ( !Gia_ObjIsXor(pObj) )
-        iLit = Gia_ManHashAnd( pNew, iLit0, iLit1 );
-    else if ( pNew->pMuxes )
-        iLit = Gia_ManHashXorReal( pNew, iLit0, iLit1 );
-    else 
-        iLit = Gia_ManHashXor( pNew, iLit0, iLit1 );
-    Vec_IntPush( vSuper, iLit );
-    Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(iLit)) );
-    // shift to the corrent location
-    for ( i = Vec_IntSize(vSuper)-1; i > 0; i-- )
-    {
-        int iLit1 = Vec_IntEntry(vSuper, i);
-        int iLit2 = Vec_IntEntry(vSuper, i-1);
-        if ( Gia_ObjLevelId(pNew, Abc_Lit2Var(iLit1)) <= Gia_ObjLevelId(pNew, Abc_Lit2Var(iLit2)) )
-            break;
-        Vec_IntWriteEntry( vSuper, i,   iLit2 );
-        Vec_IntWriteEntry( vSuper, i-1, iLit1 );
-    }
-}
-int Gia_ManBalanceGate( Gia_Man_t * pNew, Gia_Obj_t * pObj, Vec_Int_t * vSuper, int * pLits, int nLits )
-{
-    Vec_IntClear( vSuper );
-    if ( nLits == 1 )
-        Vec_IntPush( vSuper, pLits[0] );
-    else if ( nLits == 2 )
-    {
-        Vec_IntPush( vSuper, pLits[0] );
-        Vec_IntPush( vSuper, pLits[1] );
-        Gia_ManCreateGate( pNew, pObj, vSuper );
-    }
-    else if ( nLits > 2 )
-    {
-        // collect levels
-        int i, * pArray, * pPerm;
-        for ( i = 0; i < nLits; i++ )
-            Vec_IntPush( vSuper, Gia_ObjLevelId(pNew, Abc_Lit2Var(pLits[i])) );
-        // sort by level
-        Vec_IntGrow( vSuper, 4 * nLits );        
-        pArray = Vec_IntArray( vSuper );
-        pPerm = pArray + nLits;
-        Abc_QuickSortCostData( pArray, nLits, 1, (word *)(pArray + 2 * nLits), pPerm );
-        // collect in the increasing order of level
-        for ( i = 0; i < nLits; i++ )
-            Vec_IntWriteEntry( vSuper, i, pLits[pPerm[i]] );
-        Vec_IntShrink( vSuper, nLits );
-//        Vec_IntForEachEntry( vSuper, iLit, i )
-//            printf( "%d ", Gia_ObjLevel(pNew, Gia_ManObj( pNew, Abc_Lit2Var(iLit) )) );
-//        printf( "\n" );
-        // perform incremental extraction
-        while ( Vec_IntSize(vSuper) > 1 )
-            Gia_ManCreateGate( pNew, pObj, vSuper );
-    }
-    // consider trivial case
-    assert( Vec_IntSize(vSuper) == 1 );
-    return Vec_IntEntry(vSuper, 0);
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Gia_ManBalance_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-    int i, iLit, iBeg, iEnd;
-    if ( ~pObj->Value )
-        return;
-    assert( Gia_ObjIsAnd(pObj) );
-    // handle MUX
-    if ( Gia_ObjIsMux(p, pObj) )
-    {
-        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin0(pObj) );
-        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin1(pObj) );
-        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin2(p, pObj) );
-        pObj->Value = Gia_ManHashMuxReal( pNew, Gia_ObjFanin2Copy(p, pObj), Gia_ObjFanin1Copy(pObj), Gia_ObjFanin0Copy(pObj) );
-        Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(pObj->Value)) );
-        return;
-    }
-    // find supergate
-    Gia_ManSuperCollect( p, pObj );
-    // save entries
-    if ( p->vStore == NULL )
-        p->vStore = Vec_IntAlloc( 1000 );
-    iBeg = Vec_IntSize( p->vStore );
-    Vec_IntAppend( p->vStore, p->vSuper );
-    iEnd = Vec_IntSize( p->vStore );
-    // call recursively
-    Vec_IntForEachEntryStartStop( p->vStore, iLit, i, iBeg, iEnd )
-    {
-        Gia_Obj_t * pTemp = Gia_ManObj( p, Abc_Lit2Var(iLit) );
-        Gia_ManBalance_rec( pNew, p, pTemp );
-        Vec_IntWriteEntry( p->vStore, i, Abc_LitNotCond(pTemp->Value, Abc_LitIsCompl(iLit)) );
-    }
-    assert( Vec_IntSize(p->vStore) == iEnd );
-    // consider general case
-    pObj->Value = Gia_ManBalanceGate( pNew, pObj, p->vSuper, Vec_IntEntryP(p->vStore, iBeg), iEnd-iBeg );
-    Vec_IntShrink( p->vStore, iBeg );
-}
-Gia_Man_t * Gia_ManBalanceInt( Gia_Man_t * p )
-{
-    Gia_Man_t * pNew, * pTemp;
-    Gia_Obj_t * pObj;
-    int i;
-    Gia_ManFillValue( p );
-    Gia_ManCreateRefs( p ); 
-    // start the new manager
-    pNew = Gia_ManStart( Gia_ManObjNum(p) );
-    pNew->pName = Abc_UtilStrsav( p->pName );
-    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
-    pNew->pMuxes = ABC_CALLOC( unsigned, pNew->nObjsAlloc );
-    pNew->vLevels = Vec_IntStart( pNew->nObjsAlloc );
-    // create constant and inputs
-    Gia_ManConst0(p)->Value = 0;
-    Gia_ManForEachCi( p, pObj, i )
-        pObj->Value = Gia_ManAppendCi( pNew );
-    // create internal nodes
-    Gia_ManHashStart( pNew );
-    Gia_ManForEachCo( p, pObj, i )
-    {
-        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin0(pObj) );
-        pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
-    }
-    assert( Gia_ManObjNum(pNew) <= Gia_ManObjNum(p) );
-    Gia_ManHashStop( pNew );
-    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
-    // perform cleanup
-    pNew = Gia_ManCleanup( pTemp = pNew );
-    Gia_ManStop( pTemp );
-    return pNew;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Gia_Man_t * Gia_ManBalance( Gia_Man_t * p, int fSimpleAnd, int fVerbose )
-{
-    Gia_Man_t * pNew, * pNew1, * pNew2;
-    if ( fVerbose )      Gia_ManPrintStats( p, NULL );
-    pNew = fSimpleAnd ? Gia_ManDup( p ) : Gia_ManDupMuxes( p, 2 );
-    if ( fVerbose )      Gia_ManPrintStats( pNew, NULL );
-    pNew1 = Gia_ManBalanceInt( pNew );
-    if ( fVerbose )      Gia_ManPrintStats( pNew1, NULL );
-    Gia_ManStop( pNew );
-    pNew2 = Gia_ManDupNoMuxes( pNew1 );
-    if ( fVerbose )      Gia_ManPrintStats( pNew2, NULL );
-    Gia_ManStop( pNew1 );
-    return pNew2;
-}
-
-
-
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Dam_Man_t * Dam_ManAlloc( Gia_Man_t * pGia )
-{
-    Dam_Man_t * p;
-    p = ABC_CALLOC( Dam_Man_t, 1 );
-    p->clkStart = Abc_Clock();
-    p->vVisit = Vec_IntAlloc( 1000 );
-    p->pGia = pGia;
-    return p;
-}
-void Dam_ManFree( Dam_Man_t * p )
-{   
-    Vec_IntFreeP( &p->vVisit );
-    Vec_IntFreeP( &p->vDivLevR );
-    Vec_IntFreeP( &p->vNodLevR );
-    Vec_IntFreeP( &p->vNod2Set );
-    Vec_IntFreeP( &p->vDiv2Nod );
-    Vec_IntFreeP( &p->vSetStore );
-    Vec_IntFreeP( &p->vNodStore );
-    Vec_FltFreeP( &p->vCounts );
-    Vec_QueFreeP( &p->vQue );
-    Hash_IntManStop( p->vHash );
-    ABC_FREE( p );
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Collect initial multi-input gates.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Dam_ManCollectSets_rec( Dam_Man_t * p, int Id )
-{
-    Gia_Obj_t * pObj;
-    int i, iBeg, iEnd, iLit;
-    if ( Dam_ObjHand(p, Id) || Id == 0 )
-        return;
-    pObj = Gia_ManObj(p->pGia, Id);
-    if ( Gia_ObjIsCi(pObj) )
-        return;
-    if ( Gia_ObjIsMux(p->pGia, pObj) )
-    {
-        if ( pObj->fMark0 )
-            return;
-        pObj->fMark0 = 1;
-        Vec_IntPush( p->vVisit, Id );
-        Dam_ManCollectSets_rec( p, Gia_ObjFaninId0(pObj, Id) );
-        Dam_ManCollectSets_rec( p, Gia_ObjFaninId1(pObj, Id) );
-        Dam_ManCollectSets_rec( p, Gia_ObjFaninId2(p->pGia, Id) );
-        p->nAnds += 3;
-        return;
-    }
-    Gia_ManSuperCollect( p->pGia, pObj );
-    Vec_IntWriteEntry( p->vNod2Set, Id, Vec_IntSize(p->vSetStore) );
-    Vec_IntPush( p->vSetStore, Vec_IntSize(p->pGia->vSuper) );
-    p->nAnds += (1 + 2 * Gia_ObjIsXor(pObj)) * (Vec_IntSize(p->pGia->vSuper) - 1);
-    // save entries
-    iBeg = Vec_IntSize( p->vSetStore );
-    Vec_IntAppend( p->vSetStore, p->pGia->vSuper );
-    iEnd = Vec_IntSize( p->vSetStore );
-    // call recursively
-    Vec_IntForEachEntryStartStop( p->vSetStore, iLit, i, iBeg, iEnd )
-        Dam_ManCollectSets_rec( p, Abc_Lit2Var(iLit) );
-}
-void Dam_ManCollectSets( Dam_Man_t * p )
-{
-    Gia_Obj_t * pObj;
-    int i;
-    Gia_ManCreateRefs( p->pGia );
-    p->vNod2Set  = Vec_IntStart( Gia_ManObjNum(p->pGia) );
-    p->vSetStore = Vec_IntAlloc( Gia_ManObjNum(p->pGia) );
-    Vec_IntPush( p->vSetStore, -1 );
-    Vec_IntClear( p->vVisit );
-    Gia_ManForEachCo( p->pGia, pObj, i )
-        Dam_ManCollectSets_rec( p, Gia_ObjFaninId0p(p->pGia, pObj) );
-    ABC_FREE( p->pGia->pRefs );
-    Gia_ManForEachObjVec( p->vVisit, p->pGia, pObj, i )
-        pObj->fMark0 = 0;
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Create divisors.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Dam_ManDivSlack( Dam_Man_t * p, int iLit0, int iLit1, int LevR )
-{
-    int Lev0 = Gia_ObjLevel(p->pGia, Gia_ManObj(p->pGia, Abc_Lit2Var(iLit0)));
-    int Lev1 = Gia_ObjLevel(p->pGia, Gia_ManObj(p->pGia, Abc_Lit2Var(iLit1)));
-    int Slack = p->nLevelMax - LevR - Abc_MaxInt(Lev0, Lev1) - 1 - (int)(iLit0 > iLit1);
-    return Abc_MinInt( Slack, 100 );
-}
-void Dam_ManCreateMultiRefs( Dam_Man_t * p, Vec_Int_t ** pvRefsAnd, Vec_Int_t ** pvRefsXor )  
-{
-    Vec_Int_t * vRefsAnd, * vRefsXor;
-    Gia_Obj_t * pObj;
-    int i, k, * pSet;
-    vRefsAnd = Vec_IntStart( 2 * Gia_ManObjNum(p->pGia) );
-    vRefsXor = Vec_IntStart( Gia_ManObjNum(p->pGia) );
-    Gia_ManForEachAnd( p->pGia, pObj, i )
-    {
-        if ( !Dam_ObjHand(p, i) )
-            continue;
-        pSet = Dam_ObjSet(p, i);
-        if ( Gia_ObjIsXor(pObj) )
-            for ( k = 1; k <= pSet[0]; k++ )
-            {
-                assert( !Abc_LitIsCompl(pSet[k]) );
-                Vec_IntAddToEntry( vRefsXor, Abc_Lit2Var(pSet[k]), 1 );
-            }
-        else if ( Gia_ObjIsAndReal(p->pGia, pObj) )
-            for ( k = 1; k <= pSet[0]; k++ )
-                Vec_IntAddToEntry( vRefsAnd, pSet[k], 1 );
-        else assert( 0 );
-    }
-    *pvRefsAnd = vRefsAnd;
-    *pvRefsXor = vRefsXor;
-}
-void Dam_ManCreatePairs( Dam_Man_t * p, int fVerbose )
-{
-    Gia_Obj_t * pObj;
-    Hash_IntMan_t * vHash;
-    Vec_Int_t * vRefsAnd, * vRefsXor, * vSuper, * vDivs, * vRemap, * vLevRMax;
-    int i, j, k, Num, FanK, FanJ, nRefs, iNode, iDiv, * pSet;
-    int nPairsAll = 0, nPairsTried = 0, nPairsUsed = 0, nPairsXor = 0;
-    int nDivsAll = 0, nDivsUsed = 0, nDivsXor = 0;
-    Dam_ManCollectSets( p );
-    vSuper = p->pGia->vSuper;
-    vDivs  = Vec_IntAlloc( Gia_ManObjNum(p->pGia) );
-    vHash  = Hash_IntManStart( Gia_ManObjNum(p->pGia)/2 );
-    vLevRMax = Vec_IntStart( 1000 );
-    Dam_ManCreateMultiRefs( p, &vRefsAnd, &vRefsXor );
-    Gia_ManForEachAnd( p->pGia, pObj, i )
-    {
-        if ( !Dam_ObjHand(p, i) )
-            continue;
-        pSet = Dam_ObjSet(p, i);
-        nPairsAll += pSet[0] * (pSet[0] - 1) / 2;
-        Vec_IntClear(vSuper);
-        if ( Gia_ObjIsXor(pObj) )
-        {
-            for ( k = 1; k <= pSet[0]; k++ )
-                if ( Vec_IntEntry(vRefsXor, Abc_Lit2Var(pSet[k])) > 1 )
-                    Vec_IntPush( vSuper, pSet[k] );
-        }
-        else if ( Gia_ObjIsAndReal(p->pGia, pObj) )
-        {
-            for ( k = 1; k <= pSet[0]; k++ )
-                if ( Vec_IntEntry(vRefsAnd, pSet[k]) > 1 )
-                    Vec_IntPush( vSuper, pSet[k] );
-        }
-        else assert( 0 );
-        if ( Vec_IntSize(vSuper) < 2 )
-            continue;
-        // enumerate pairs
-        nPairsTried += Vec_IntSize(vSuper) * (Vec_IntSize(vSuper) - 1) / 2;
-        Vec_IntPush( vDivs, -i ); // remember node
-        Vec_IntForEachEntry( vSuper, FanK, k )
-        Vec_IntForEachEntryStart( vSuper, FanJ, j, k+1 )
-        {
-            if ( (FanK > FanJ) ^ Gia_ObjIsXor(pObj) )
-                Num = Hash_Int2ManInsert( vHash, FanJ, FanK, 0 );
-            else
-                Num = Hash_Int2ManInsert( vHash, FanK, FanJ, 0 );
-            if ( Hash_Int2ObjInc( vHash, Num ) == 1 )
-            {
-                nDivsUsed++;
-                nDivsXor += Gia_ObjIsXor(pObj);
-            }
-            Vec_IntPush( vDivs, Num ); // remember devisor
-            // update reverse level
-            if ( Num >= Vec_IntSize(vLevRMax) )
-                Vec_IntFillExtra( vLevRMax, 3 * Vec_IntSize(vLevRMax) / 2, 0 );
-            Vec_IntUpdateEntry( vLevRMax, Num, Vec_IntEntry(p->vNodLevR, i) );
-        }
-    }
-    Vec_IntFree( vRefsAnd );
-    Vec_IntFree( vRefsXor );
-//    Hash_IntManProfile( vHash );
-    // remove entries that appear only once
-    p->vHash     = Hash_IntManStart( 3 * nDivsUsed /2 );
-    p->vCounts   = Vec_FltAlloc( 2 * nDivsUsed );           Vec_FltPush( p->vCounts, ABC_INFINITY );
-    p->vQue      = Vec_QueAlloc( Vec_FltCap(p->vCounts) );
-    Vec_QueSetPriority( p->vQue, Vec_FltArrayP(p->vCounts) );
-    // mapping div to node
-    p->vDiv2Nod  = Vec_IntAlloc( 2 * nDivsUsed );           Vec_IntPush( p->vDiv2Nod, ABC_INFINITY );
-    p->vNodStore = Vec_IntAlloc( Gia_ManObjNum(p->pGia) );  Vec_IntPush( p->vNodStore, -1 );
-    nDivsAll     = Hash_IntManEntryNum(vHash);
-    vRemap       = Vec_IntStartFull( nDivsAll+1 );
-    for ( i = 1; i <= nDivsAll; i++ )
-    {
-        nRefs = Hash_IntObjData2(vHash, i);
-        if ( nRefs < 2 )
-            continue;
-        nPairsUsed += nRefs;
-        if ( Hash_IntObjData0(vHash, i) > Hash_IntObjData1(vHash, i) )
-            nPairsXor += nRefs; 
-        Num = Hash_Int2ManInsert( p->vHash, Hash_IntObjData0(vHash, i), Hash_IntObjData1(vHash, i), 0 );
-        assert( Num == Hash_IntManEntryNum(p->vHash) );
-        assert( Num == Vec_FltSize(p->vCounts) );
-        Vec_FltPush( p->vCounts, nRefs + 0.005*Dam_ManDivSlack(p, Hash_IntObjData0(vHash, i), Hash_IntObjData1(vHash, i), Vec_IntEntry(vLevRMax, i)) );
-        Vec_QuePush( p->vQue, Num );
-        // remember divisors
-        assert( Num == Vec_IntSize(p->vDiv2Nod) );
-        Vec_IntPush( p->vDiv2Nod, Vec_IntSize(p->vNodStore) );
-        Vec_IntPush( p->vNodStore, 0 );
-        Vec_IntFillExtra( p->vNodStore, Vec_IntSize(p->vNodStore) + nRefs, -1 );
-        // remember entry
-        Vec_IntWriteEntry( vRemap, i, Num );
-    }
-    assert( Vec_FltSize(p->vCounts) == Hash_IntManEntryNum(p->vHash)+1 );
-    assert( Vec_IntSize(p->vDiv2Nod) == nDivsUsed+1 );
-    Hash_IntManStop( vHash );
-    Vec_IntFree( vLevRMax );
-    // fill in the divisors
-    iNode = -1;
-    Vec_IntForEachEntry( vDivs, iDiv, i )
-    {
-        if ( iDiv < 0 )
-        {
-            iNode = -iDiv;
-            continue;
-        }
-        Num = Vec_IntEntry( vRemap, iDiv );
-        if ( Num == -1 )
-            continue;
-        pSet = Dam_DivSet( p, Num );
-        pSet[++pSet[0]] = iNode;
-    }
-    Vec_IntFree( vRemap );
-    Vec_IntFree( vDivs );
-    // create storage for reverse level of divisor during update
-    p->vDivLevR = Vec_IntStart( 2 * nDivsUsed );
-    // make sure divisors are added correctly
-//    for ( i = 1; i <= nDivsUsed; i++ )
-//        assert( Dam_DivSet(p, i)[0] == Vec_FltEntry(p->vCounts, i)+1 );
-    if ( !fVerbose )
-        return;
-    // print stats
-    printf( "Pairs:" );
-    printf( "  Total =%9d (%6.2f %%)", nPairsAll,   100.0 * nPairsAll   / Abc_MaxInt(nPairsAll, 1) );
-    printf( "  Tried =%9d (%6.2f %%)", nPairsTried, 100.0 * nPairsTried / Abc_MaxInt(nPairsAll, 1) );
-    printf( "  Used =%9d (%6.2f %%)",  nPairsUsed,  100.0 * nPairsUsed  / Abc_MaxInt(nPairsAll, 1) );
-    printf( "  Xor =%9d (%6.2f %%)",   nPairsXor,   100.0 * nPairsXor   / Abc_MaxInt(nPairsAll, 1) );
-    printf( "\n" );
-    printf( "Div:  " );
-    printf( "  Total =%9d (%6.2f %%)", nDivsAll,    100.0 * nDivsAll    / Abc_MaxInt(nDivsAll, 1) );
-    printf( "  Tried =%9d (%6.2f %%)", nDivsAll,    100.0 * nDivsAll    / Abc_MaxInt(nDivsAll, 1) );
-    printf( "  Used =%9d (%6.2f %%)",  nDivsUsed,   100.0 * nDivsUsed   / Abc_MaxInt(nDivsAll, 1) );
-    printf( "  Xor =%9d (%6.2f %%)",   nDivsXor,    100.0 * nDivsXor    / Abc_MaxInt(nDivsAll, 1) );
-    printf( "\n" );
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Derives new AIG.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Dam_ManMultiAig_rec( Dam_Man_t * pMan, Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-    int i, * pSet;
-    if ( ~pObj->Value )
-        return;
-    assert( Gia_ObjIsAnd(pObj) );
-    pSet = Dam_ObjSet(pMan, Gia_ObjId(p, pObj));
-    if ( pSet == NULL )
-    {
-        Dam_ManMultiAig_rec( pMan, pNew, p, Gia_ObjFanin0(pObj) );
-        Dam_ManMultiAig_rec( pMan, pNew, p, Gia_ObjFanin1(pObj) );
-        if ( Gia_ObjIsMux(p, pObj) )
-        {
-            Dam_ManMultiAig_rec( pMan, pNew, p, Gia_ObjFanin2(p, pObj) );
-            pObj->Value = Gia_ManHashMuxReal( pNew, Gia_ObjFanin2Copy(p, pObj), Gia_ObjFanin1Copy(pObj), Gia_ObjFanin0Copy(pObj) );
-        }
-        else if ( Gia_ObjIsXor(pObj) )
-            pObj->Value = Gia_ManHashXorReal( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
-        else 
-            pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
-        Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(pObj->Value)) );
-        return;
-    }
-    assert( Gia_ObjIsXor(pObj) || Gia_ObjIsAndReal(p, pObj) );
-    // call recursively
-    for ( i = 1; i <= pSet[0]; i++ )
-    {
-        Gia_Obj_t * pTemp = Gia_ManObj( p, Abc_Lit2Var(pSet[i]) );
-        Dam_ManMultiAig_rec( pMan, pNew, p, pTemp );
-        pSet[i] = Abc_LitNotCond( pTemp->Value, Abc_LitIsCompl(pSet[i]) );
-    }
-    // create balanced gate
-    pObj->Value = Gia_ManBalanceGate( pNew, pObj, p->vSuper, pSet + 1, pSet[0] );
-}
-Gia_Man_t * Dam_ManMultiAig( Dam_Man_t * pMan )
-{
-    Gia_Man_t * p = pMan->pGia;
-    Gia_Man_t * pNew, * pTemp;
-    Gia_Obj_t * pObj;
-    int i;
-    // start the new manager
-    pNew = Gia_ManStart( Gia_ManObjNum(p) );
-    pNew->pName = Abc_UtilStrsav( p->pName );
-    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
-    pNew->pMuxes = ABC_CALLOC( unsigned, pNew->nObjsAlloc );
-    pNew->vLevels = Vec_IntStart( pNew->nObjsAlloc );
-    // create constant and inputs
-    Gia_ManFillValue( p );
-    Gia_ManConst0(p)->Value = 0;
-    Gia_ManForEachCi( p, pObj, i )
-    {
-        pObj->Value = Gia_ManAppendCi( pNew );
-        Vec_IntWriteEntry( pNew->vLevels, Abc_Lit2Var(pObj->Value), Gia_ObjLevel(p, pObj) );
-    }
-    // create internal nodes
-    Gia_ManHashStart( pNew );
-    Gia_ManForEachCo( p, pObj, i )
-    {
-        Dam_ManMultiAig_rec( pMan, pNew, p, Gia_ObjFanin0(pObj) );
-        pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
-    }
-    assert( Gia_ManObjNum(pNew) <= Gia_ManObjNum(p) );
-    Gia_ManHashStop( pNew );
-    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
-    // perform cleanup
-    pNew = Gia_ManCleanup( pTemp = pNew );
-    Gia_ManStop( pTemp );
-    return pNew;
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Updates the data-structure after extracting one divisor.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Dam_PrintDiv( Dam_Man_t * p, int iDiv )
-{
-    if ( iDiv == 0 )
-        printf( "Final statistics after extracting %6d divisors:          ", p->nDivs );
-    else
-    {
-        char Buffer[100];
-        int iData0 = Hash_IntObjData0(p->vHash, iDiv);
-        int iData1 = Hash_IntObjData1(p->vHash, iDiv);
-        printf( "Div%5d : ",  p->nDivs+1 );
-        printf( "D%-8d = ",   iDiv );
-        sprintf( Buffer, "%c%d", Abc_LitIsCompl(iData0)? '!':' ', Abc_Lit2Var(iData0) );
-        printf( "%8s ",   Buffer );
-        printf( "%c  ",     (iData0 < iData1) ? '*' : '+' );
-        sprintf( Buffer, "%c%d", Abc_LitIsCompl(iData1)? '!':' ', Abc_Lit2Var(iData1) );
-        printf( "%8s   ", Buffer );
-        printf( "Weight %9.2f  ", Vec_FltEntry(p->vCounts, iDiv) );
-    }
-    printf( "Divs =%8d  ",  Hash_IntManEntryNum(p->vHash) );
-    printf( "Ands =%8d  ",  p->nAnds - p->nGain );
-    Abc_PrintTime( 1, "Time", Abc_Clock() - p->clkStart );
-}
-void Dam_PrintQue( Dam_Man_t * p )
-{
-    int i;
-    printf( "Divisor queue: \n" );
-    for ( i = 1; i <= Hash_IntManEntryNum(p->vHash); i++ )
-    {
-        int iLit0 = Hash_IntObjData0(p->vHash, i);
-        int iLit1 = Hash_IntObjData1(p->vHash, i);
-        printf( "Div %7d : ",     i );
-        printf( "Weight %9.2f  ", Vec_FltEntry(p->vCounts, i) );
-        printf( "F = %c%c ",      Abc_LitIsCompl(iLit0) ? '!': ' ', 'a' + Abc_Lit2Var(iLit0)-1 );
-        printf( "%c ",            (Hash_IntObjData0(p->vHash, i) < Hash_IntObjData1(p->vHash, i)) ? '*':'+' );
-        printf( "%c%c   ",        Abc_LitIsCompl(iLit1) ? '!': ' ', 'a' + Abc_Lit2Var(iLit1)-1 );
-        printf( "\n" );
-    }
-}
-int Dam_ManUpdateNode( Dam_Man_t * p, int iObj, int iLit0, int iLit1, int iLitNew, Vec_Int_t * vDivs )
-{
-    int * pSet = Dam_ObjSet( p, iObj );
-    int i, k, c, Num, iLit, iLit2, fPres;
-    // check if literal can be found
-    for ( i = 1; i <= pSet[0]; i++ )
-        if ( pSet[i] == iLit0 )
-            break;
-    if ( i > pSet[0] )
-        return 0;
-    // check if literal can be found
-    for ( i = 1; i <= pSet[0]; i++ )
-        if ( pSet[i] == iLit1 )
-            break;
-    if ( i > pSet[0] )
-        return 0;
-    // compact literals
-    Vec_IntPush( vDivs, -iObj );
-    for ( k = i = 1; i <= pSet[0]; i++ )
-    {
-        if ( iLit0 == pSet[i] || iLit1 == pSet[i] )
-            continue;
-        pSet[k++] = iLit = pSet[i];
-        // reduce weights of the divisors
-        fPres = 0;
-        for ( c = 0; c < 2; c++ )
-        {
-            iLit2 = c ? iLit1 : iLit0;
-            if ( (iLit > iLit2) ^ (iLit0 > iLit1) )
-                Num = *Hash_Int2ManLookup( p->vHash, iLit2, iLit );
-            else
-                Num = *Hash_Int2ManLookup( p->vHash, iLit, iLit2 );
-            if ( Num > 0 )
-            {
-                Vec_FltAddToEntry( p->vCounts, Num, -1 );
-                if ( Vec_QueIsMember(p->vQue, Num) )
-                {
-                    Vec_QueUpdate( p->vQue, Num );
-                    fPres |= (1 << c);
-                }
-            }
-        }
-        if ( fPres != 3 )
-            continue;
-        if ( (iLit > iLitNew) ^ (iLit0 > iLit1) )
-            Num = Hash_Int2ManInsert( p->vHash, iLitNew, iLit, 0 );
-        else
-            Num = Hash_Int2ManInsert( p->vHash, iLit, iLitNew, 0 );
-        Hash_Int2ObjInc( p->vHash, Num );
-        Vec_IntPush( vDivs, Num );
-        // update reverse level
-        if ( Num >= Vec_IntSize(p->vDivLevR) )
-            Vec_IntFillExtra( p->vDivLevR, 3 * Vec_IntSize(p->vDivLevR) / 2, 0 );
-        Vec_IntUpdateEntry( p->vDivLevR, Num, Vec_IntEntry(p->vNodLevR, iObj) );
-    }
-    pSet[k] = iLitNew;
-    pSet[0] = k;
-    return 1;
-}
-void Dam_ManUpdate( Dam_Man_t * p, int iDiv )
-{
-    Vec_Int_t * vDivs = p->pGia->vSuper;
-    int iLit0 = Hash_IntObjData0(p->vHash, iDiv);
-    int iLit1 = Hash_IntObjData1(p->vHash, iDiv);
-    int i, iLitNew, * pSet, * pNods = Dam_DivSet( p, iDiv );
-    int nPresent = 0, nPairsStart, nPairsStop, pPairsNew, nRefs;
-    int fThisIsXor = (iLit0 > iLit1), iDivTemp, iNode;
-//    Dam_PrintQue( p );
-    if ( fThisIsXor )
-        iLitNew = Gia_ManAppendXorReal( p->pGia, iLit0, iLit1 );
-    else
-        iLitNew = Gia_ManAppendAnd( p->pGia, iLit0, iLit1 );
-    Gia_ObjSetGateLevel( p->pGia, Gia_ManObj(p->pGia, Abc_Lit2Var(iLitNew)) );
-//    printf( "%d ", Gia_ObjLevel(p->pGia, Gia_ManObj(p->pGia, Abc_Lit2Var(iLitNew))) );
-    // replace entries
-    assert( pNods[0] >= 2 );
-    nPairsStart = Hash_IntManEntryNum(p->vHash) + 1;
-    Vec_IntClear( vDivs );
-    for ( i = 1; i <= pNods[0]; i++ )
-        nPresent += Dam_ManUpdateNode( p, pNods[i], iLit0, iLit1, iLitNew, vDivs );
-    nPairsStop = Hash_IntManEntryNum(p->vHash) + 1;
-    // extend arrayvs
-    pPairsNew = 0;
-    Vec_FltFillExtra( p->vCounts, nPairsStop, 0 );
-    Vec_IntFillExtra( p->vDiv2Nod, nPairsStop, -1 );
-    for ( i = nPairsStart; i < nPairsStop; i++ )
-    {
-        nRefs = Hash_IntObjData2(p->vHash, i);
-        if ( nRefs < 2 )
-            continue;
-        Vec_FltWriteEntry( p->vCounts, i, nRefs + 0.001*Dam_ManDivSlack(p, Hash_IntObjData0(p->vHash, i), Hash_IntObjData1(p->vHash, i), Vec_IntEntry(p->vDivLevR, i)) );
-        Vec_QuePush( p->vQue, i );
-        // remember divisors
-        Vec_IntWriteEntry( p->vDiv2Nod, i, Vec_IntSize(p->vNodStore) );
-        Vec_IntPush( p->vNodStore, 0 );
-        Vec_IntFillExtra( p->vNodStore, Vec_IntSize(p->vNodStore) + nRefs, -1 );
-        pPairsNew++;
-    }
-//    printf( "Added %d new pairs\n", pPairsNew );
-    // fill in the divisors
-    iNode = -1;
-    Vec_IntForEachEntry( vDivs, iDivTemp, i )
-    {
-        if ( iDivTemp < 0 )
-        {
-            iNode = -iDivTemp;
-            continue;
-        }
-        if ( Vec_IntEntry(p->vDiv2Nod, iDivTemp) == -1 )
-            continue;
-        pSet = Dam_DivSet( p, iDivTemp );
-        pSet[++pSet[0]] = iNode;
-    }
-    // make sure divisors are added correctly
-    for ( i = nPairsStart; i < nPairsStop; i++ )
-        if ( Vec_IntEntry(p->vDiv2Nod, i) > 0 )
-            assert( Dam_DivSet(p, i)[0] == Hash_IntObjData2(p->vHash, i) );
-    // update costs
-    Vec_FltWriteEntry( p->vCounts, iDiv, 0 );
-    p->nGain += (1 + 2 * fThisIsXor) * (nPresent - 1);
-    p->nGainX += 3 * fThisIsXor * (nPresent - 1);
-    p->nDivs++;
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Perform extraction for multi-input AND/XOR.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Gia_Man_t * Dam_ManAreaBalanceInt( Gia_Man_t * pGia, Vec_Int_t * vCiLevels, int nNewNodesMax, int fVerbose, int fVeryVerbose )
-{
-    Gia_Man_t * pNew;
-    Dam_Man_t * p;
-    int i, iDiv;
-    p = Dam_ManAlloc( pGia );
-    p->nLevelMax = Gia_ManSetLevels( p->pGia, vCiLevels );
-    p->vNodLevR = Gia_ManReverseLevel( p->pGia );
-    Vec_IntFillExtra( p->pGia->vLevels, 3*Gia_ManObjNum(p->pGia)/2, 0 );
-    Dam_ManCreatePairs( p, fVerbose );
-    for ( i = 0; i < nNewNodesMax && Vec_QueTopPriority(p->vQue) >= 2; i++ )
-    {
-        iDiv = Vec_QuePop(p->vQue);
-        if ( fVeryVerbose )
-            Dam_PrintDiv( p, iDiv );
-        Dam_ManUpdate( p, iDiv );
-    }
-    if ( fVeryVerbose )
-        Dam_PrintDiv( p, 0 );
-    pNew = Dam_ManMultiAig( p );
-    if ( fVerbose )
-    {
-        int nDivsAll = Hash_IntManEntryNum(p->vHash);
-        int nDivsUsed = p->nDivs;
-        printf( "Div:  " );
-        printf( "  Total =%9d (%6.2f %%) ",   nDivsAll,   100.0 * nDivsAll    / Abc_MaxInt(nDivsAll, 1) );
-        printf( "  Used =%9d (%6.2f %%)",     nDivsUsed,  100.0 * nDivsUsed   / Abc_MaxInt(nDivsAll, 1) );
-        printf( "  Gain =%6d (%6.2f %%)",     p->nGain,   100.0 * p->nGain / Abc_MaxInt(p->nAnds, 1) );
-        printf( "  GainX = %d  ",             p->nGainX  );
-        Abc_PrintTime( 1, "Time", Abc_Clock() - p->clkStart );
-    }
-    Dam_ManFree( p );
-    return pNew;
-}
-Gia_Man_t * Gia_ManAreaBalance( Gia_Man_t * p, int fSimpleAnd, int nNewNodesMax, int fVerbose, int fVeryVerbose )
-{
-    Gia_Man_t * pNew0, * pNew, * pNew1, * pNew2;
-    Vec_Int_t * vCiLevels;
-    // determine CI levels
-    if ( p->pManTime && p->vLevels == NULL )
-        Gia_ManLevelWithBoxes( p );
-    vCiLevels = Gia_ManGetCiLevels( p );
-    // get the starting manager
-    pNew0 = Gia_ManHasMapping(p) ? (Gia_Man_t *)Dsm_ManDeriveGia(p, 0) : p;
-    if ( fVerbose )     Gia_ManPrintStats( pNew0, NULL );
-    // derive internal manager
-    pNew = fSimpleAnd ? Gia_ManDup( pNew0 ) : Gia_ManDupMuxes( pNew0, 2 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    if ( pNew0 != p ) Gia_ManStop( pNew0 );
-    // perform the operation
-    pNew1 = Dam_ManAreaBalanceInt( pNew, vCiLevels, nNewNodesMax, fVerbose, fVeryVerbose );
-    if ( fVerbose )     Gia_ManPrintStats( pNew1, NULL );
-    Gia_ManStop( pNew );
-    Vec_IntFreeP( &vCiLevels );
-    // derive the final result
-    pNew2 = Gia_ManDupNoMuxes( pNew1 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew2, NULL );
-    Gia_ManStop( pNew1 );
-    return pNew2;
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Synthesis script.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Gia_ManAigPrintPiLevels( Gia_Man_t * p )
-{
-    Gia_Obj_t * pObj;
-    int i;
-    Gia_ManForEachPi( p, pObj, i )
-        printf( "%d ", Gia_ObjLevel(p, pObj) );
-    printf( "\n" );
-}
-void Gia_ManAigTransferPiLevels( Gia_Man_t * pNew, Gia_Man_t * p )
-{
-/*
-    Gia_Obj_t * pObj;
-    int i;
-    if ( p->vLevels == NULL )
-        return;
-    Gia_ManCleanLevels( pNew, Gia_ManObjNum(pNew) );
-    Gia_ManForEachCi( pNew, pObj, i )
-        Gia_ObjSetLevel( pNew, pObj, Gia_ObjLevel(p, Gia_ManCi(p, i)) );
-*/
-    if ( p->pManTime ) pNew->pManTime = p->pManTime, p->pManTime = NULL;
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Synthesis script.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Gia_Man_t * Gia_ManAigSyn2( Gia_Man_t * p, int fOldAlgo, int fCoarsen, int fCutMin, int nRelaxRatio, int fVerbose, int fVeryVerbose )
-{
-    Gia_Man_t * pNew, * pTemp;
-    Jf_Par_t Pars, * pPars = &Pars;
-    if ( fOldAlgo )
-    {
-        Jf_ManSetDefaultPars( pPars );
-        pPars->fCutMin     = fCutMin;
-    }
-    else
-    {
-        Lf_ManSetDefaultPars( pPars );
-        pPars->fCoarsen    = fCoarsen;
-        pPars->fCutMin     = fCutMin;
-        pPars->nRelaxRatio = nRelaxRatio;
-        pPars->nAreaTuner  = 1;
-    }
-    if ( fVerbose )     Gia_ManPrintStats( p, NULL );
-    if ( Gia_ManAndNum(p) == 0 )
-        return Gia_ManDup(p);
-    // perform balancing
-    pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, p );
-    // perform mapping
-    if ( fOldAlgo )
-        pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
-    else
-        pNew = Lf_ManPerformMapping( pTemp = pNew, pPars );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    if ( pTemp != pNew )
-    {
-        Gia_ManAigTransferPiLevels( pNew, pTemp );
-        Gia_ManStop( pTemp );
-    }
-    // perform balancing
-    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, pTemp );
-    Gia_ManStop( pTemp );
-    return pNew;
-}
-Gia_Man_t * Gia_ManAigSyn3( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
-{
-    Gia_Man_t * pNew, * pTemp;
-    Jf_Par_t Pars, * pPars = &Pars;
-    Jf_ManSetDefaultPars( pPars );
-    pPars->nRelaxRatio = 40;
-    if ( fVerbose )     Gia_ManPrintStats( p, NULL );
-    if ( Gia_ManAndNum(p) == 0 )
-        return Gia_ManDup(p);
-    // perform balancing
-    pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, p );
-    // perform mapping
-    pPars->nLutSize = 6;
-    pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-//    Gia_ManStop( pTemp );
-    // perform balancing
-    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, pTemp );
-    Gia_ManStop( pTemp );
-    // perform mapping
-    pPars->nLutSize = 4;
-    pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-//    Gia_ManStop( pTemp );
-    // perform balancing
-    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, pTemp );
-    Gia_ManStop( pTemp );
-    return pNew;
-}
-Gia_Man_t * Gia_ManAigSyn4( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
-{
-    Gia_Man_t * pNew, * pTemp;
-    Jf_Par_t Pars, * pPars = &Pars;
-    Jf_ManSetDefaultPars( pPars );
-    pPars->nRelaxRatio = 40;
-    if ( fVerbose )     Gia_ManPrintStats( p, NULL );
-    if ( Gia_ManAndNum(p) == 0 )
-        return Gia_ManDup(p);
-//Gia_ManAigPrintPiLevels( p );
-    // perform balancing
-    pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, p );
-    // perform mapping
-    pPars->nLutSize = 7;
-    pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-//    Gia_ManStop( pTemp );
-    // perform extraction
-    pNew = Gia_ManPerformFx( pTemp = pNew, ABC_INFINITY, 0, 0, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, pTemp );
-    Gia_ManStop( pTemp );
-    // perform balancing
-    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, pTemp );
-    Gia_ManStop( pTemp );
-    // perform mapping
-    pPars->nLutSize = 5;
-    pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-//    Gia_ManStop( pTemp );
-    // perform extraction
-    pNew = Gia_ManPerformFx( pTemp = pNew, ABC_INFINITY, 0, 0, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, pTemp );
-    Gia_ManStop( pTemp );
-    // perform balancing
-    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
-    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
-    Gia_ManAigTransferPiLevels( pNew, pTemp );
-    Gia_ManStop( pTemp );
-//Gia_ManAigPrintPiLevels( pNew );
-    return pNew;
-}
-
-////////////////////////////////////////////////////////////////////////
-///                       END OF FILE                                ///
-////////////////////////////////////////////////////////////////////////
-
-
-ABC_NAMESPACE_IMPL_END
-
diff --git a/abc-build/src/aig/gia/giaBalance2.c b/abc-build/src/aig/gia/giaBalance2.c
deleted file mode 100644
--- a/abc-build/src/aig/gia/giaBalance2.c
+++ /dev/null
@@ -1,981 +0,0 @@
-/**CFile****************************************************************
-
-  FileName    [giaBalance.c]
-
-  SystemName  [ABC: Logic synthesis and verification system.]
-
-  PackageName [Scalable AIG package.]
-
-  Synopsis    [AIG balancing.]
-
-  Author      [Alan Mishchenko]
-  
-  Affiliation [UC Berkeley]
-
-  Date        [Ver. 1.0. Started - June 20, 2005.]
-
-  Revision    [$Id: giaBalance.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
-
-***********************************************************************/
-
-#include "gia.h"
-#include "misc/vec/vecHash.h"
-#include "misc/vec/vecQue.h"
-#include "opt/dau/dau.h"
-
-ABC_NAMESPACE_IMPL_START
-
-
-////////////////////////////////////////////////////////////////////////
-///                        DECLARATIONS                              ///
-////////////////////////////////////////////////////////////////////////
-
-#define BAL_LEAF_MAX    6
-#define BAL_CUT_MAX     8
-#define BAL_SUPER      50
-#define BAL_NO_LEAF    31
-
-typedef struct Bal_Cut_t_ Bal_Cut_t; 
-struct Bal_Cut_t_
-{
-    word             Sign;           // signature
-    int              Delay;          // delay
-    unsigned         iFunc   : 27;   // function
-    unsigned         nLeaves :  5;   // leaf number (Bal_NO_LEAF)
-    int              pLeaves[BAL_LEAF_MAX]; // leaves
-};
-
-// operation manager
-typedef struct Bal_Man_t_ Bal_Man_t;
-struct Bal_Man_t_
-{
-    Gia_Man_t *      pGia;           // user AIG
-    int              nLutSize;       // LUT size
-    int              nCutNum;        // cut number
-    int              fCutMin;        // cut minimization
-    int              fVerbose;       // verbose
-    Gia_Man_t *      pNew;           // derived AIG
-    Vec_Int_t *      vCosts;         // cost of supergate nodes
-    Vec_Ptr_t *      vCutSets;       // object cutsets
-    abctime          clkStart;       // starting the clock
-};
-
-static inline Bal_Man_t * Bal_GiaMan( Gia_Man_t * p )                   { return (Bal_Man_t *)p->pData;           }
-
-static inline int         Bal_ObjCost( Bal_Man_t * p, int i )           { return Vec_IntEntry(p->vCosts, i);      }
-static inline int         Bal_LitCost( Bal_Man_t * p, int i )           { return Bal_ObjCost(p, Abc_Lit2Var(i));  }
-static inline int         Bal_ObjDelay( Bal_Man_t * p, int i )          { return Bal_ObjCost(p, i) >> 4;          }
-static inline int         Bal_LitDelay( Bal_Man_t * p, int i )          { return Bal_ObjDelay(p, Abc_Lit2Var(i)); }
-
-////////////////////////////////////////////////////////////////////////
-///                     FUNCTION DEFINITIONS                         ///
-////////////////////////////////////////////////////////////////////////
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Bal_Man_t * Bal_ManAlloc( Gia_Man_t * pGia, Gia_Man_t * pNew, int nLutSize, int nCutNum, int fVerbose )
-{
-    Bal_Man_t * p;
-    p = ABC_CALLOC( Bal_Man_t, 1 );
-    p->clkStart = Abc_Clock();
-    p->pGia     = pGia;
-    p->pNew     = pNew;
-    p->nLutSize = nLutSize;
-    p->nCutNum  = nCutNum;
-    p->fVerbose = fVerbose;
-    p->vCosts   = Vec_IntAlloc( 3 * Gia_ManObjNum(pGia) / 2 );
-    p->vCutSets = Vec_PtrAlloc( 3 * Gia_ManObjNum(pGia) / 2 );
-    Vec_IntFill( p->vCosts, Gia_ManObjNum(pNew), 0 );
-    Vec_PtrFill( p->vCutSets, Gia_ManObjNum(pNew), NULL );
-    pNew->pData = p;
-    return p;
-}
-void Bal_ManFree( Bal_Man_t * p )
-{
-    Vec_PtrFreeFree( p->vCutSets );
-    Vec_IntFree( p->vCosts );
-    ABC_FREE( p );
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline int Bal_CutCountBits( word i )
-{
-    i = i - ((i >> 1) & 0x5555555555555555);
-    i = (i & 0x3333333333333333) + ((i >> 2) & 0x3333333333333333);
-    i = ((i + (i >> 4)) & 0x0F0F0F0F0F0F0F0F);
-    return (i*(0x0101010101010101))>>56;
-}
-static inline word Bal_CutGetSign( int * pLeaves, int nLeaves )
-{
-    word Sign = 0; int i; 
-    for ( i = 0; i < nLeaves; i++ )
-        Sign |= ((word)1) << (pLeaves[i] & 0x3F);
-    return Sign;
-}
-static inline int Bal_CutCreateUnit( Bal_Cut_t * p, int i, int Delay )
-{
-    p->iFunc = 2;
-    p->Delay = Delay;
-    p->nLeaves = 1;
-    p->pLeaves[0] = i;
-    p->Sign = ((word)1) << (i & 0x3F);
-    return 1;
-}
-static inline int Bal_ManPrepareSet( Bal_Man_t * p, int iObj, int Index, int fUnit, Bal_Cut_t ** ppCutSet )
-{
-    static Bal_Cut_t CutTemp[3]; int i;
-    if ( Vec_PtrEntry(p->vCutSets, iObj) == NULL || fUnit )
-        return Bal_CutCreateUnit( (*ppCutSet = CutTemp + Index), iObj, Bal_ObjDelay(p, iObj)+1 );
-    *ppCutSet = (Bal_Cut_t *)Vec_PtrEntry(p->vCutSets, iObj);
-    for ( i = 0; i < p->nCutNum; i++ ) 
-        if ( (*ppCutSet)[i].nLeaves == BAL_NO_LEAF )
-            return i;
-    return i;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    [Check correctness of cuts.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline int Bal_CutCheck( Bal_Cut_t * pBase, Bal_Cut_t * pCut ) // check if pCut is contained in pBase
-{
-    int nSizeB = pBase->nLeaves;
-    int nSizeC = pCut->nLeaves;
-    int i, * pB = pBase->pLeaves;
-    int k, * pC = pCut->pLeaves;
-    for ( i = 0; i < nSizeC; i++ )
-    {
-        for ( k = 0; k < nSizeB; k++ )
-            if ( pC[i] == pB[k] )
-                break;
-        if ( k == nSizeB )
-            return 0;
-    }
-    return 1;
-}
-static inline int Bal_SetCheckArray( Bal_Cut_t ** ppCuts, int nCuts )
-{
-    Bal_Cut_t * pCut0, * pCut1; 
-    int i, k, m, n, Value;
-    assert( nCuts > 0 );
-    for ( i = 0; i < nCuts; i++ )
-    {
-        pCut0 = ppCuts[i];
-        assert( pCut0->nLeaves <= BAL_LEAF_MAX );
-        assert( pCut0->Sign == Bal_CutGetSign(pCut0->pLeaves, pCut0->nLeaves) );
-        // check duplicates
-        for ( m = 0; m < (int)pCut0->nLeaves; m++ )
-        for ( n = m + 1; n < (int)pCut0->nLeaves; n++ )
-            assert( pCut0->pLeaves[m] < pCut0->pLeaves[n] );
-        // check pairs
-        for ( k = 0; k < nCuts; k++ )
-        {
-            pCut1 = ppCuts[k];
-            if ( pCut0 == pCut1 )
-                continue;
-            // check containments
-            Value = Bal_CutCheck( pCut0, pCut1 );
-            assert( Value == 0 );
-        }
-    }
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline int Bal_CutMergeOrder( Bal_Cut_t * pCut0, Bal_Cut_t * pCut1, Bal_Cut_t * pCut, int nLutSize )
-{ 
-    int nSize0   = pCut0->nLeaves;
-    int nSize1   = pCut1->nLeaves;
-    int i, * pC0 = pCut0->pLeaves;
-    int k, * pC1 = pCut1->pLeaves;
-    int c, * pC  = pCut->pLeaves;
-    // the case of the largest cut sizes
-    if ( nSize0 == nLutSize && nSize1 == nLutSize )
-    {
-        for ( i = 0; i < nSize0; i++ )
-        {
-            if ( pC0[i] != pC1[i] )  return 0;
-            pC[i] = pC0[i];
-        }
-        pCut->nLeaves = nLutSize;
-        pCut->iFunc = -1;
-        pCut->Sign = pCut0->Sign | pCut1->Sign;
-        pCut->Delay = Abc_MaxInt( pCut0->Delay, pCut1->Delay );
-        return 1;
-    }
-    // compare two cuts with different numbers
-    i = k = c = 0;
-    while ( 1 )
-    {
-        if ( c == nLutSize ) return 0;
-        if ( pC0[i] < pC1[k] )
-        {
-            pC[c++] = pC0[i++];
-            if ( i >= nSize0 ) goto FlushCut1;
-        }
-        else if ( pC0[i] > pC1[k] )
-        {
-            pC[c++] = pC1[k++];
-            if ( k >= nSize1 ) goto FlushCut0;
-        }
-        else
-        {
-            pC[c++] = pC0[i++]; k++;
-            if ( i >= nSize0 ) goto FlushCut1;
-            if ( k >= nSize1 ) goto FlushCut0;
-        }
-    }
-
-FlushCut0:
-    if ( c + nSize0 > nLutSize + i ) return 0;
-    while ( i < nSize0 )
-        pC[c++] = pC0[i++];
-    pCut->nLeaves = c;
-    pCut->iFunc = -1;
-    pCut->Sign = pCut0->Sign | pCut1->Sign;
-    pCut->Delay = Abc_MaxInt( pCut0->Delay, pCut1->Delay );
-    return 1;
-
-FlushCut1:
-    if ( c + nSize1 > nLutSize + k ) return 0;
-    while ( k < nSize1 )
-        pC[c++] = pC1[k++];
-    pCut->nLeaves = c;
-    pCut->iFunc = -1;
-    pCut->Sign = pCut0->Sign | pCut1->Sign;
-    pCut->Delay = Abc_MaxInt( pCut0->Delay, pCut1->Delay );
-    return 1;
-}
-static inline int Bal_CutMergeOrderMux( Bal_Cut_t * pCut0, Bal_Cut_t * pCut1, Bal_Cut_t * pCut2, Bal_Cut_t * pCut, int nLutSize )
-{ 
-    int x0, i0 = 0, nSize0 = pCut0->nLeaves, * pC0 = pCut0->pLeaves;
-    int x1, i1 = 0, nSize1 = pCut1->nLeaves, * pC1 = pCut1->pLeaves;
-    int x2, i2 = 0, nSize2 = pCut2->nLeaves, * pC2 = pCut2->pLeaves;
-    int xMin, c = 0, * pC  = pCut->pLeaves;
-    while ( 1 )
-    {
-        x0 = (i0 == nSize0) ? ABC_INFINITY : pC0[i0];
-        x1 = (i1 == nSize1) ? ABC_INFINITY : pC1[i1];
-        x2 = (i2 == nSize2) ? ABC_INFINITY : pC2[i2];
-        xMin = Abc_MinInt( Abc_MinInt(x0, x1), x2 );
-        if ( xMin == ABC_INFINITY ) break;
-        if ( c == nLutSize ) return 0;
-        pC[c++] = xMin;
-        if (x0 == xMin) i0++;
-        if (x1 == xMin) i1++;
-        if (x2 == xMin) i2++;
-    }
-    pCut->nLeaves = c;
-    pCut->iFunc = -1;
-    pCut->Sign = pCut0->Sign | pCut1->Sign | pCut2->Sign;
-    pCut->Delay = Abc_MaxInt( pCut0->Delay, Abc_MaxInt(pCut1->Delay, pCut2->Delay) );
-    return 1;
-}
-static inline int Bal_SetCutIsContainedOrder( Bal_Cut_t * pBase, Bal_Cut_t * pCut ) // check if pCut is contained in pBase
-{
-    int i, nSizeB = pBase->nLeaves;
-    int k, nSizeC = pCut->nLeaves;
-    if ( nSizeB == nSizeC )
-    {
-        for ( i = 0; i < nSizeB; i++ )
-            if ( pBase->pLeaves[i] != pCut->pLeaves[i] )
-                return 0;
-        return 1;
-    }
-    assert( nSizeB > nSizeC ); 
-    if ( nSizeC == 0 )
-        return 1;
-    for ( i = k = 0; i < nSizeB; i++ )
-    {
-        if ( pBase->pLeaves[i] > pCut->pLeaves[k] )
-            return 0;
-        if ( pBase->pLeaves[i] == pCut->pLeaves[k] )
-        {
-            if ( ++k == nSizeC )
-                return 1;
-        }
-    }
-    return 0;
-}
-static inline int Bal_SetLastCutIsContained( Bal_Cut_t ** pCuts, int nCuts )
-{
-    int i;
-    for ( i = 0; i < nCuts; i++ )
-        if ( pCuts[i]->nLeaves <= pCuts[nCuts]->nLeaves && (pCuts[i]->Sign & pCuts[nCuts]->Sign) == pCuts[i]->Sign && Bal_SetCutIsContainedOrder(pCuts[nCuts], pCuts[i]) )
-            return 1;
-    return 0;
-}
-static inline int Bal_SetLastCutContains( Bal_Cut_t ** pCuts, int nCuts )
-{
-    int i, k, fChanges = 0;
-    for ( i = 0; i < nCuts; i++ )
-        if ( pCuts[nCuts]->nLeaves < pCuts[i]->nLeaves && (pCuts[nCuts]->Sign & pCuts[i]->Sign) == pCuts[nCuts]->Sign && Bal_SetCutIsContainedOrder(pCuts[i], pCuts[nCuts]) )
-            pCuts[i]->nLeaves = BAL_NO_LEAF, fChanges = 1;
-    if ( !fChanges )
-        return nCuts;
-    for ( i = k = 0; i <= nCuts; i++ )
-    {
-        if ( pCuts[i]->nLeaves == BAL_NO_LEAF )
-            continue;
-        if ( k < i )
-            ABC_SWAP( Bal_Cut_t *, pCuts[k], pCuts[i] );
-        k++;
-    }
-    return k - 1;
-}
-static inline int Bal_CutCompareArea( Bal_Cut_t * pCut0, Bal_Cut_t * pCut1 )
-{
-    if ( pCut0->Delay   < pCut1->Delay   )  return -1;
-    if ( pCut0->Delay   > pCut1->Delay   )  return  1;
-    if ( pCut0->nLeaves < pCut1->nLeaves )  return -1;
-    if ( pCut0->nLeaves > pCut1->nLeaves )  return  1;
-    return 0;
-}
-static inline void Bal_SetSortByDelay( Bal_Cut_t ** pCuts, int nCuts )
-{
-    int i;
-    for ( i = nCuts; i > 0; i-- )
-    {
-        if ( Bal_CutCompareArea(pCuts[i - 1], pCuts[i]) < 0 )//!= 1 )
-            return;
-        ABC_SWAP( Bal_Cut_t *, pCuts[i - 1], pCuts[i] );
-    }
-}
-static inline int Bal_SetAddCut( Bal_Cut_t ** pCuts, int nCuts, int nCutNum )
-{
-    if ( nCuts == 0 )
-        return 1;
-    nCuts = Bal_SetLastCutContains(pCuts, nCuts);
-    Bal_SetSortByDelay( pCuts, nCuts );
-    return Abc_MinInt( nCuts + 1, nCutNum - 1 );
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Bal_ManDeriveCuts( Bal_Man_t * p, int iFan0, int iFan1, int iFan2, int fCompl0, int fCompl1, int fCompl2, int fUnit0, int fUnit1, int fUnit2, int fIsXor, int Target, int fSave )
-{
-    Bal_Cut_t pCutSet[BAL_CUT_MAX], * pCutsR[BAL_CUT_MAX];
-    Bal_Cut_t * pCutSet0, * pCutSet1, * pCutSet2;
-    int nCuts0 = Bal_ManPrepareSet( p, iFan0, 0, fUnit0, &pCutSet0 );
-    int nCuts1 = Bal_ManPrepareSet( p, iFan1, 1, fUnit1, &pCutSet1 );
-    Bal_Cut_t * pCut0, * pCut0Lim = pCutSet0 + nCuts0;
-    Bal_Cut_t * pCut1, * pCut1Lim = pCutSet1 + nCuts1;
-    int i, Cost, nCutsR = 0;
-    memset( pCutSet, 0, sizeof(Bal_Cut_t) * p->nCutNum );
-    for ( i = 0; i < p->nCutNum; i++ )
-        pCutsR[i] = pCutSet + i;
-    // enumerate cuts
-    if ( iFan2 > 0 )
-    {
-        int nCuts2 = Bal_ManPrepareSet( p, iFan2, 2, fUnit2, &pCutSet2 );
-        Bal_Cut_t * pCut2, * pCut2Lim = pCutSet2 + nCuts2;
-        for ( pCut0 = pCutSet0; pCut0 < pCut0Lim; pCut0++ )
-        for ( pCut1 = pCutSet1; pCut1 < pCut1Lim; pCut1++ )
-        for ( pCut2 = pCutSet2; pCut2 < pCut2Lim; pCut2++ )
-        {
-            if ( Bal_CutCountBits(pCut0->Sign | pCut1->Sign | pCut2->Sign) > p->nLutSize )
-                continue;
-            if ( !Bal_CutMergeOrderMux(pCut0, pCut1, pCut2, pCutsR[nCutsR], p->nLutSize) )
-                continue;
-            assert( pCutsR[nCutsR]->Delay == Target );
-            if ( Bal_SetLastCutIsContained(pCutsR, nCutsR) )
-                continue;
-//            if ( p->fCutMin && Bal_CutComputeTruthMux(p, pCut0, pCut1, pCut2, fCompl0, fCompl1, fCompl2, pCutsR[nCutsR]) )
-//                pCutsR[nCutsR]->Sign = Bal_CutGetSign(pCutsR[nCutsR]->pLeaves, pCutsR[nCutsR]->nLeaves);
-            nCutsR = Bal_SetAddCut( pCutsR, nCutsR, p->nCutNum );
-        }
-    }
-    else
-    {
-        for ( pCut0 = pCutSet0; pCut0 < pCut0Lim; pCut0++ )
-        for ( pCut1 = pCutSet1; pCut1 < pCut1Lim; pCut1++ )
-        {
-            if ( Bal_CutCountBits(pCut0->Sign | pCut1->Sign) > p->nLutSize )
-                continue;
-            if ( !Bal_CutMergeOrder(pCut0, pCut1, pCutsR[nCutsR], p->nLutSize) )
-                continue;
-            assert( pCutsR[nCutsR]->Delay == Target );
-            if ( Bal_SetLastCutIsContained(pCutsR, nCutsR) )
-                continue;
-//            if ( p->fCutMin && Bal_CutComputeTruth(p, pCut0, pCut1, fCompl0, fCompl1, pCutsR[nCutsR], fIsXor) )
-//                pCutsR[nCutsR]->Sign = Bal_CutGetSign(pCutsR[nCutsR]->pLeaves, pCutsR[nCutsR]->nLeaves);
-            nCutsR = Bal_SetAddCut( pCutsR, nCutsR, p->nCutNum );
-        }
-    }
-    if ( nCutsR == 0 )
-        return -1;
-//printf( "%d ", nCutsR );
-    Cost = ((pCutsR[0]->Delay << 4) | pCutsR[0]->nLeaves);
-    // verify
-    assert( nCutsR > 0 && nCutsR < p->nCutNum );
-    assert( Bal_SetCheckArray(pCutsR, nCutsR) );
-    // save cuts
-    if ( fSave && Cost >= 0 )
-    {
-        pCutSet0 = ABC_CALLOC( Bal_Cut_t, p->nCutNum );
-        Vec_PtrPush( p->vCutSets, pCutSet0 );
-        assert( Vec_PtrSize(p->vCutSets) == Gia_ManObjNum(p->pNew) );
-        for ( i = 0; i < nCutsR; i++ )
-            pCutSet0[i] = *pCutsR[i];        
-        for ( ; i < p->nCutNum; i++ )
-            pCutSet0[i].nLeaves = BAL_NO_LEAF;
-        Vec_IntPush( p->vCosts, Cost );
-        assert( Vec_IntSize(p->vCosts) == Gia_ManObjNum(p->pNew) );
-    }
-    return Cost;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Bal_ManSetGateLevel( Bal_Man_t * p, Gia_Obj_t * pObjOld, int iLitNew )
-{
-    int iFan0, iFan1, iFan2, Cost;
-    int fCompl0, fCompl1, fCompl2;
-    int fUnit0, fUnit1, fUnit2;
-    int Delay0, Delay1, Delay2, DelayMax;
-    int iObjNew = Abc_Lit2Var(iLitNew);
-    Gia_Obj_t * pObjNew = Gia_ManObj( p->pNew, iObjNew );
-    int fMux = Gia_ObjIsMux(p->pNew, pObjNew);
-    if ( iObjNew < Vec_PtrSize(p->vCutSets) )
-        return -1;
-    iFan0    = Gia_ObjFaninId0( pObjNew, iObjNew );
-    iFan1    = Gia_ObjFaninId1( pObjNew, iObjNew );
-    iFan2    = fMux ? Gia_ObjFaninId2(p->pNew, iObjNew) : 0;
-    fCompl0  = Gia_ObjFaninC0( pObjNew );
-    fCompl1  = Gia_ObjFaninC1( pObjNew );
-    fCompl2  = fMux ? Gia_ObjFaninC2(p->pNew, pObjNew) : 0;
-    Delay0   = Bal_ObjDelay( p, iFan0 );
-    Delay1   = Bal_ObjDelay( p, iFan1 );
-    Delay2   = Bal_ObjDelay( p, iFan2 );
-    DelayMax = Abc_MaxInt( Delay0, Abc_MaxInt(Delay1, Delay2) );
-    fUnit0   = (int)(Delay0 != DelayMax); 
-    fUnit1   = (int)(Delay1 != DelayMax); 
-    fUnit2   = (int)(Delay2 != DelayMax); 
-    if ( DelayMax > 0 )
-    {
-//printf( "A" );
-        Cost = Bal_ManDeriveCuts(p, iFan0, iFan1, iFan2, fCompl0, fCompl1, fCompl2, fUnit0, fUnit1, fUnit2, Gia_ObjIsXor(pObjNew), DelayMax, 1 );
-//printf( "B" );
-        if ( Cost >= 0 )
-            return Cost;
-    }
-    DelayMax++;
-    fUnit0 = fUnit1 = fUnit2 = 1;
-//printf( "A" );
-    Cost = Bal_ManDeriveCuts(p, iFan0, iFan1, iFan2, fCompl0, fCompl1, fCompl2, fUnit0, fUnit1, fUnit2, Gia_ObjIsXor(pObjNew), DelayMax, 1 );
-//printf( "B" );
-    assert( Cost >= 0 );
-    return Cost;
-}
-int Bal_ManEvalTwo( Bal_Man_t * p, int iLitNew0, int iLitNew1, int iLitNew2, int fIsXor )
-{
-    int iFan0    = Abc_Lit2Var( iLitNew0 );
-    int iFan1    = Abc_Lit2Var( iLitNew1 );
-    int iFan2    = Abc_Lit2Var( iLitNew2 );
-    int fCompl0  = Abc_LitIsCompl( iLitNew0 );
-    int fCompl1  = Abc_LitIsCompl( iLitNew1 );
-    int fCompl2  = Abc_LitIsCompl( iLitNew2 );
-    int Delay0   = Bal_ObjDelay( p, iFan0 );
-    int Delay1   = Bal_ObjDelay( p, iFan1 );
-    int Delay2   = Bal_ObjDelay( p, iFan2 );
-    int DelayMax = Abc_MaxInt( Delay0, Abc_MaxInt(Delay1, Delay2) );
-    int fUnit0   = (int)(Delay0 != DelayMax); 
-    int fUnit1   = (int)(Delay1 != DelayMax); 
-    int fUnit2   = (int)(Delay2 != DelayMax); 
-    if ( DelayMax == 0 )
-        return -1;
-    return Bal_ManDeriveCuts(p, iFan0, iFan1, iFan2, fCompl0, fCompl1, fCompl2, fUnit0, fUnit1, fUnit2, fIsXor, DelayMax, 0 );
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Sort literals by their cost.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline void Vec_IntSelectSortCostLit( Vec_Int_t * vSuper, Vec_Int_t * vCosts )
-{
-    int * pArray = Vec_IntArray(vSuper);
-    int nSize = Vec_IntSize(vSuper);
-    int i, j, best_i;
-    for ( i = 0; i < nSize-1; i++ )
-    {
-        best_i = i;
-        for ( j = i+1; j < nSize; j++ )
-            if ( Vec_IntEntry(vCosts, Abc_Lit2Var(pArray[j])) > Vec_IntEntry(vCosts, Abc_Lit2Var(pArray[best_i])) )
-                best_i = j;
-        ABC_SWAP( int, pArray[i], pArray[best_i] );
-    }
-}
-static inline void Vec_IntPushOrderCost( Vec_Int_t * vSuper, Vec_Int_t * vCosts, int iLit )
-{
-    int i, nSize, * pArray;
-    Vec_IntPush( vSuper, iLit );
-    pArray = Vec_IntArray(vSuper);
-    nSize = Vec_IntSize(vSuper);
-    for ( i = nSize-1; i > 0; i-- )
-    {
-        if ( Vec_IntEntry(vCosts, Abc_Lit2Var(pArray[i])) <= Vec_IntEntry(vCosts, Abc_Lit2Var(pArray[i - 1])) )
-            return;
-        ABC_SWAP( int, pArray[i], pArray[i - 1] );
-    }
-}
-static inline int Vec_IntFindFirstSameDelayAsLast( Bal_Man_t * p, Vec_Int_t * vSuper )
-{
-    int i, DelayCur, Delay = Bal_LitDelay( p, Vec_IntEntryLast(vSuper) );
-    assert( Vec_IntSize(vSuper) > 1 );
-    for ( i = Vec_IntSize(vSuper)-1; i > 0; i-- )
-    {
-        DelayCur = Bal_LitDelay( p, Vec_IntEntry(vSuper, i-1) );
-        assert( DelayCur >= Delay );
-        if ( DelayCur > Delay )
-            return i;
-    }
-    return i;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    [Select the best pair to merge.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline int Bal_ManFindBestPair( Bal_Man_t * p, Vec_Int_t * vSuper, Gia_Obj_t * pObj )
-{
-    int * pSuper = Vec_IntArray(vSuper);
-    int iBeg = Vec_IntFindFirstSameDelayAsLast( p, vSuper );
-    int iEnd = Vec_IntSize(vSuper)-1;
-    int i, k, iBest = -1, kBest = -1, BestCost = ABC_INFINITY, Cost;
-    assert( iBeg <= iEnd );
-    // check if we can add to the higher levels without increasing cost
-    for ( k = iBeg-1; k >= 0; k-- )
-    for ( i = iEnd; i >= iBeg; i-- )
-    {
-        Cost = Bal_ManEvalTwo( p, pSuper[i], pSuper[k], 0, Gia_ObjIsXor(pObj) );
-        if ( Cost == -1 )
-            continue;
-        if ( Cost == Bal_LitCost(p, pSuper[k]) )
-        {
-//            printf( "A" );
-            return (k << 16)|i;
-        }
-        if ( BestCost > Cost )
-            BestCost = Cost, iBest = i, kBest = k;
-    }
-    if ( BestCost != ABC_INFINITY && (BestCost >> 4) == Bal_LitDelay(p, pSuper[kBest]) )
-    {
-//        printf( "B" );
-        return (kBest << 16)|iBest;
-    }
-    // check if some can be added to lowest level without increasing cost
-    BestCost = ABC_INFINITY;
-    for ( i = iBeg; i <= iEnd; i++ )
-    for ( k = i+1;  k <= iEnd; k++ )
-    {
-        Cost = Bal_ManEvalTwo( p, pSuper[i], pSuper[k], 0, Gia_ObjIsXor(pObj) );
-        if ( Cost == -1 )
-            continue;
-        if ( Cost == Abc_MaxInt(Bal_LitCost(p, pSuper[i]), Bal_LitCost(p, pSuper[k])) )
-        {
-//            printf( "C" );
-            return (k << 16)|i;
-        }
-        if ( BestCost > Cost )
-            BestCost = Cost, iBest = i, kBest = k;
-    }
-    if ( BestCost != ABC_INFINITY )
-    {
-//        printf( "D" );
-        return (kBest << 16)|iBest;
-    }
-//    printf( "E" );
-    // group pairs from lowest level based on proximity
-    return (iEnd << 16)|(iEnd-1);
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Simplify multi-input AND/XOR.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline void Gia_ManSimplifyXor( Vec_Int_t * vSuper )
-{
-    int i, k = 0, Prev = -1, This, fCompl = 0;
-    Vec_IntForEachEntry( vSuper, This, i )
-    {
-        if ( This == 0 )
-            continue;
-        if ( This == 1 )
-            fCompl ^= 1; 
-        else if ( Prev != This )
-            Vec_IntWriteEntry( vSuper, k++, This ), Prev = This;
-        else
-            Prev = -1, k--;
-    }
-    Vec_IntShrink( vSuper, k );
-    if ( Vec_IntSize( vSuper ) == 0 )
-        Vec_IntPush( vSuper, fCompl );
-    else if ( fCompl )
-        Vec_IntWriteEntry( vSuper, 0, Abc_LitNot(Vec_IntEntry(vSuper, 0)) );
-}
-static inline void Gia_ManSimplifyAnd( Vec_Int_t * vSuper )
-{
-    int i, k = 0, Prev = -1, This;
-    Vec_IntForEachEntry( vSuper, This, i )
-    {
-        if ( This == 0 )
-            { Vec_IntFill(vSuper, 1, 0); return; }
-        if ( This == 1 )
-            continue;
-        if ( Prev == -1 || Abc_Lit2Var(Prev) != Abc_Lit2Var(This) )
-            Vec_IntWriteEntry( vSuper, k++, This ), Prev = This;
-        else if ( Prev != This )
-            { Vec_IntFill(vSuper, 1, 0); return; }
-    }
-    Vec_IntShrink( vSuper, k );
-    if ( Vec_IntSize( vSuper ) == 0 )
-        Vec_IntPush( vSuper, 1 );
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Collect multi-input AND/XOR.]
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline void Gia_ManSuperCollectXor_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-    assert( !Gia_IsComplement(pObj) );
-    if ( !Gia_ObjIsXor(pObj) || 
-//        Gia_ObjRefNum(p, pObj) > 1 || 
-        Gia_ObjRefNum(p, pObj) > 3 || 
-//        (Gia_ObjRefNum(p, pObj) == 2 && (Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) == 1 || Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) == 1)) || 
-        Vec_IntSize(p->vSuper) > BAL_SUPER )
-    {
-        Vec_IntPush( p->vSuper, Gia_ObjToLit(p, pObj) );
-        return;
-    }
-    assert( !Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) );
-    Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin0(pObj) );
-    Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin1(pObj) );
-}
-static inline void Gia_ManSuperCollectAnd_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-    if ( Gia_IsComplement(pObj) || 
-        !Gia_ObjIsAndReal(p, pObj) || 
-//        Gia_ObjRefNum(p, pObj) > 1 || 
-        Gia_ObjRefNum(p, pObj) > 3 || 
-//        (Gia_ObjRefNum(p, pObj) == 2 && (Gia_ObjRefNum(p, Gia_ObjFanin0(pObj)) == 1 || Gia_ObjRefNum(p, Gia_ObjFanin1(pObj)) == 1)) || 
-        Vec_IntSize(p->vSuper) > BAL_SUPER )
-    {
-        Vec_IntPush( p->vSuper, Gia_ObjToLit(p, pObj) );
-        return;
-    }
-    Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild0(pObj) );
-    Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild1(pObj) );
-}
-static inline void Gia_ManSuperCollect( Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-//    int nSize;
-    if ( p->vSuper == NULL )
-        p->vSuper = Vec_IntAlloc( 1000 );
-    else
-        Vec_IntClear( p->vSuper );
-    if ( Gia_ObjIsXor(pObj) )
-    {
-        assert( !Gia_ObjFaninC0(pObj) && !Gia_ObjFaninC1(pObj) );
-        Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin0(pObj) );
-        Gia_ManSuperCollectXor_rec( p, Gia_ObjFanin1(pObj) );
-//        nSize = Vec_IntSize(vSuper);
-        Vec_IntSort( p->vSuper, 0 );
-        Gia_ManSimplifyXor( p->vSuper );
-//        if ( nSize != Vec_IntSize(vSuper) )
-//            printf( "X %d->%d  ", nSize, Vec_IntSize(vSuper) );
-    }
-    else if ( Gia_ObjIsAndReal(p, pObj) )
-    {
-        Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild0(pObj) );
-        Gia_ManSuperCollectAnd_rec( p, Gia_ObjChild1(pObj) );
-//        nSize = Vec_IntSize(vSuper);
-        Vec_IntSort( p->vSuper, 0 );
-        Gia_ManSimplifyAnd( p->vSuper );
-//        if ( nSize != Vec_IntSize(vSuper) )
-//            printf( "A %d->%d  ", nSize, Vec_IntSize(vSuper) );
-    }
-    else assert( 0 );
-//    if ( nSize > 10 )
-//        printf( "%d ", nSize );
-    assert( Vec_IntSize(p->vSuper) > 0 );
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline void Gia_ManCreateGate( Gia_Man_t * pNew, Gia_Obj_t * pObj, Vec_Int_t * vSuper )
-{
-    int iLit0 = Vec_IntPop(vSuper);
-    int iLit1 = Vec_IntPop(vSuper);
-    int iLit, i;
-    if ( !Gia_ObjIsXor(pObj) )
-        iLit = Gia_ManHashAnd( pNew, iLit0, iLit1 );
-    else if ( pNew->pMuxes )
-        iLit = Gia_ManHashXorReal( pNew, iLit0, iLit1 );
-    else 
-        iLit = Gia_ManHashXor( pNew, iLit0, iLit1 );
-    Vec_IntPush( vSuper, iLit );
-    Bal_ManSetGateLevel( Bal_GiaMan(pNew), pObj, iLit );
-//    Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(iLit)) );
-    // shift to the corrent location
-    for ( i = Vec_IntSize(vSuper)-1; i > 0; i-- )
-    {
-        int iLit1 = Vec_IntEntry(vSuper, i);
-        int iLit2 = Vec_IntEntry(vSuper, i-1);
-        if ( Gia_ObjLevelId(pNew, Abc_Lit2Var(iLit1)) <= Gia_ObjLevelId(pNew, Abc_Lit2Var(iLit2)) )
-            break;
-        Vec_IntWriteEntry( vSuper, i,   iLit2 );
-        Vec_IntWriteEntry( vSuper, i-1, iLit1 );
-    }
-}
-static inline int Gia_ManBalanceGate( Gia_Man_t * pNew, Gia_Obj_t * pObj, Vec_Int_t * vSuper, int * pLits, int nLits )
-{
-    Vec_IntClear( vSuper );
-    if ( nLits == 1 )
-        Vec_IntPush( vSuper, pLits[0] );
-    else if ( nLits == 2 )
-    {
-        Vec_IntPush( vSuper, pLits[0] );
-        Vec_IntPush( vSuper, pLits[1] );
-        Gia_ManCreateGate( pNew, pObj, vSuper );
-    }
-    else if ( nLits > 2 )
-    {
-        Bal_Man_t * p = Bal_GiaMan(pNew); int i;
-        for ( i = 0; i < nLits; i++ )
-            Vec_IntPush( vSuper, pLits[i] );
-        // sort by level/cut-size
-        Vec_IntSelectSortCostLit( vSuper, p->vCosts );
-        // iterate till everything is grouped
-        while ( Vec_IntSize(vSuper) > 1 )
-        {
-            int iLit, Res = Bal_ManFindBestPair( p, vSuper, pObj );
-            int iBest = Vec_IntEntry( vSuper, Res >> 16 );
-            int kBest = Vec_IntEntry( vSuper, Res & 0xFFFF );
-            Vec_IntRemove( vSuper, iBest );
-            Vec_IntRemove( vSuper, kBest );
-            if ( Gia_ObjIsXor(pObj) )
-                iLit = Gia_ManHashXorReal( pNew, iBest, kBest );
-            else 
-                iLit = Gia_ManHashAnd( pNew, iBest, kBest );
-            Bal_ManSetGateLevel( p, pObj, iLit );
-            Vec_IntPushOrderCost( vSuper, p->vCosts, iLit );
-        }
-    }
-    // consider trivial case
-    assert( Vec_IntSize(vSuper) == 1 );
-    return Vec_IntEntry(vSuper, 0);
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-static inline void Gia_ManBalance_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pObj )
-{
-    int i, iLit, iBeg, iEnd;
-    if ( ~pObj->Value )
-        return;
-    assert( Gia_ObjIsAnd(pObj) );
-    // handle MUX
-    if ( Gia_ObjIsMux(p, pObj) )
-    {
-        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin0(pObj) );
-        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin1(pObj) );
-        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin2(p, pObj) );
-        pObj->Value = Gia_ManHashMuxReal( pNew, Gia_ObjFanin2Copy(p, pObj), Gia_ObjFanin1Copy(pObj), Gia_ObjFanin0Copy(pObj) );
-        Bal_ManSetGateLevel( Bal_GiaMan(pNew), pObj, pObj->Value );
-//        Gia_ObjSetGateLevel( pNew, Gia_ManObj(pNew, Abc_Lit2Var(pObj->Value)) );
-        return;
-    }
-    // find supergate
-    Gia_ManSuperCollect( p, pObj );
-    // save entries
-    if ( p->vStore == NULL )
-        p->vStore = Vec_IntAlloc( 1000 );
-    iBeg = Vec_IntSize( p->vStore );
-    Vec_IntAppend( p->vStore, p->vSuper );
-    iEnd = Vec_IntSize( p->vStore );
-    // call recursively
-    Vec_IntForEachEntryStartStop( p->vStore, iLit, i, iBeg, iEnd )
-    {
-        Gia_Obj_t * pTemp = Gia_ManObj( p, Abc_Lit2Var(iLit) );
-        Gia_ManBalance_rec( pNew, p, pTemp );
-        Vec_IntWriteEntry( p->vStore, i, Abc_LitNotCond(pTemp->Value, Abc_LitIsCompl(iLit)) );
-    }
-    assert( Vec_IntSize(p->vStore) == iEnd );
-    // consider general case
-    pObj->Value = Gia_ManBalanceGate( pNew, pObj, p->vSuper, Vec_IntEntryP(p->vStore, iBeg), iEnd-iBeg );
-    Vec_IntShrink( p->vStore, iBeg );
-}
-static inline Gia_Man_t * Gia_ManBalanceInt( Gia_Man_t * p, int nLutSize, int nCutNum, int fVerbose )
-{
-    Bal_Man_t * pMan;
-    Gia_Man_t * pNew, * pTemp;
-    Gia_Obj_t * pObj;
-    int i;
-    Gia_ManFillValue( p );
-    Gia_ManCreateRefs( p ); 
-    // start the new manager
-    pNew = Gia_ManStart( 3*Gia_ManObjNum(p)/2 );
-    pNew->pName = Abc_UtilStrsav( p->pName );
-    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
-    pNew->pMuxes = ABC_CALLOC( unsigned, pNew->nObjsAlloc );
-    pNew->vLevels = Vec_IntStart( pNew->nObjsAlloc );
-    // create constant and inputs
-    Gia_ManConst0(p)->Value = 0;
-    Gia_ManForEachCi( p, pObj, i )
-        pObj->Value = Gia_ManAppendCi( pNew );
-    // create balancing manager
-    pMan = Bal_ManAlloc( p, pNew, nLutSize, nCutNum, fVerbose );
-    // create internal nodes
-    Gia_ManHashStart( pNew );
-    Gia_ManForEachCo( p, pObj, i )
-        Gia_ManBalance_rec( pNew, p, Gia_ObjFanin0(pObj) );
-    Gia_ManForEachCo( p, pObj, i )
-        pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
-//    if ( fVerbose )
-    {
-        int nLevelMax = 0;
-        Gia_ManForEachCo( pNew, pObj, i )
-        {
-            nLevelMax = Abc_MaxInt( nLevelMax, Bal_ObjDelay(pMan, Gia_ObjFaninId0p(pNew, pObj)) );
-//            printf( "%d=%d ", i, Bal_ObjDelay(pMan, Gia_ObjFaninId0p(pNew, pObj)) );
-        }
-        printf( "Best delay = %d\n", nLevelMax );
-    }
-
-//    assert( Gia_ManObjNum(pNew) <= Gia_ManObjNum(p) );
-    Gia_ManHashStop( pNew );
-    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
-    // delete manager
-    Bal_ManFree( pMan );
-    // perform cleanup
-    pNew = Gia_ManCleanup( pTemp = pNew );
-    Gia_ManStop( pTemp );
-    return pNew;
-}
-Gia_Man_t * Gia_ManBalanceLut( Gia_Man_t * p, int nLutSize, int nCutNum, int fVerbose )
-{
-    Gia_Man_t * pNew, * pNew1, * pNew2;
-    if ( fVerbose )      Gia_ManPrintStats( p, NULL );
-    pNew = Gia_ManDupMuxes( p, 2 );
-    if ( fVerbose )      Gia_ManPrintStats( pNew, NULL );
-    pNew1 = Gia_ManBalanceInt( pNew, nLutSize, nCutNum, fVerbose );
-    if ( fVerbose )      Gia_ManPrintStats( pNew1, NULL );
-    Gia_ManStop( pNew );
-    pNew2 = Gia_ManDupNoMuxes( pNew1 );
-    if ( fVerbose )      Gia_ManPrintStats( pNew2, NULL );
-    Gia_ManStop( pNew1 );
-    return pNew2;
-}
-
-
-
-////////////////////////////////////////////////////////////////////////
-///                       END OF FILE                                ///
-////////////////////////////////////////////////////////////////////////
-
-
-ABC_NAMESPACE_IMPL_END
-
diff --git a/abc-build/src/aig/gia/giaClp.c b/abc-build/src/aig/gia/giaClp.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/aig/gia/giaClp.c
@@ -0,0 +1,373 @@
+/**CFile****************************************************************
+
+  FileName    [giaClp.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Scalable AIG package.]
+
+  Synopsis    [Collapsing AIG.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - June 20, 2005.]
+
+  Revision    [$Id: gia.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "gia.h"
+#include "misc/extra/extraBdd.h"
+#include "bdd/dsd/dsd.h"
+
+ABC_NAMESPACE_IMPL_START
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+extern int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover, char * pSop, int nFanins, Vec_Str_t * vCube, int fPhase );
+extern int Abc_CountZddCubes( DdManager * dd, DdNode * zCover );
+extern int Abc_NtkDeriveFlatGiaSop( Gia_Man_t * pGia, int * gFanins, char * pSop );
+extern Vec_Ptr_t * Abc_NodeGetFakeNames( int nNames );
+extern int Gia_ManFactorNode( Gia_Man_t * p, char * pSop, Vec_Int_t * vLeaves );
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Gia_ManRebuildIsop( DdManager * dd, DdNode * bLocal, Gia_Man_t * pNew, Vec_Int_t * vFanins, Vec_Str_t * vSop, Vec_Str_t * vCube )
+{
+    char * pSop;
+    DdNode * bCover, * zCover, * zCover0, * zCover1;
+    int nFanins = Vec_IntSize(vFanins);
+    int fPhase, nCubes, nCubes0, nCubes1;
+
+    // get the ZDD of the negative polarity
+    bCover = Cudd_zddIsop( dd, Cudd_Not(bLocal), Cudd_Not(bLocal), &zCover0 );
+    Cudd_Ref( zCover0 );
+    Cudd_Ref( bCover );
+    Cudd_RecursiveDeref( dd, bCover );
+    nCubes0 = Abc_CountZddCubes( dd, zCover0 );
+
+    // get the ZDD of the positive polarity
+    bCover = Cudd_zddIsop( dd, bLocal, bLocal, &zCover1 );
+    Cudd_Ref( zCover1 );
+    Cudd_Ref( bCover );
+    Cudd_RecursiveDeref( dd, bCover );
+    nCubes1 = Abc_CountZddCubes( dd, zCover1 );
+
+    // compare the number of cubes
+    if ( nCubes1 <= nCubes0 )
+    { // use positive polarity
+        nCubes = nCubes1;
+        zCover = zCover1;
+        Cudd_RecursiveDerefZdd( dd, zCover0 );
+        fPhase = 1;
+    }
+    else
+    { // use negative polarity
+        nCubes = nCubes0;
+        zCover = zCover0;
+        Cudd_RecursiveDerefZdd( dd, zCover1 );
+        fPhase = 0;
+    }
+    if ( nCubes > 1000 )
+    {
+        Cudd_RecursiveDerefZdd( dd, zCover );
+        return -1;
+    }
+
+    // allocate memory for the cover
+    Vec_StrGrow( vSop, (nFanins + 3) * nCubes + 1 );
+    pSop = Vec_StrArray( vSop );
+    pSop[(nFanins + 3) * nCubes] = 0;
+    // create the SOP
+    Vec_StrFill( vCube, nFanins, '-' );
+    Vec_StrPush( vCube, '\0' );
+    Abc_ConvertZddToSop( dd, zCover, pSop, nFanins, vCube, fPhase );
+    Cudd_RecursiveDerefZdd( dd, zCover );
+
+    // perform factoring
+//    return Abc_NtkDeriveFlatGiaSop( pNew, Vec_IntArray(vFanins), pSop );
+    return Gia_ManFactorNode( pNew, pSop, vFanins );
+}
+int Gia_ManRebuildNode( Dsd_Manager_t * pManDsd, Dsd_Node_t * pNodeDsd, Gia_Man_t * pNew, DdManager * ddNew, Vec_Int_t * vFanins, Vec_Str_t * vSop, Vec_Str_t * vCube )
+{
+    DdManager * ddDsd = Dsd_ManagerReadDd( pManDsd );
+    DdNode * bLocal, * bTemp;
+    Dsd_Node_t * pFaninDsd;
+    Dsd_Type_t Type;
+    int i, nDecs, iLit = -1;
+
+    // add the fanins
+    Type  = Dsd_NodeReadType( pNodeDsd );
+    nDecs = Dsd_NodeReadDecsNum( pNodeDsd );
+    assert( nDecs > 1 );
+    Vec_IntClear( vFanins );
+    for ( i = 0; i < nDecs; i++ )
+    {
+        pFaninDsd = Dsd_NodeReadDec( pNodeDsd, i );
+        iLit      = Dsd_NodeReadMark( Dsd_Regular(pFaninDsd) );
+        iLit      = Abc_LitNotCond( iLit, Dsd_IsComplement(pFaninDsd) );
+        assert( Type == DSD_NODE_OR || !Dsd_IsComplement(pFaninDsd) );
+        Vec_IntPush( vFanins, iLit );
+    }
+
+    // create the local function depending on the type of the node
+    switch ( Type )
+    {
+        case DSD_NODE_CONST1:
+        {
+            iLit = 1;
+            break;
+        }
+        case DSD_NODE_OR:
+        {
+            iLit = 0;
+            for ( i = 0; i < nDecs; i++ )
+                iLit = Gia_ManHashOr( pNew, iLit, Vec_IntEntry(vFanins, i) );
+            break;
+        }
+        case DSD_NODE_EXOR:
+        {
+            iLit = 0;
+            for ( i = 0; i < nDecs; i++ )
+                iLit = Gia_ManHashXor( pNew, iLit, Vec_IntEntry(vFanins, i) );
+            break;
+        }
+        case DSD_NODE_PRIME:
+        {
+            bLocal = Dsd_TreeGetPrimeFunction( ddDsd, pNodeDsd );                Cudd_Ref( bLocal );
+            bLocal = Extra_TransferLevelByLevel( ddDsd, ddNew, bTemp = bLocal ); Cudd_Ref( bLocal );
+            Cudd_RecursiveDeref( ddDsd, bTemp );
+            // bLocal is now in the new BDD manager
+            iLit = Gia_ManRebuildIsop( ddNew, bLocal, pNew, vFanins, vSop, vCube );
+            Cudd_RecursiveDeref( ddNew, bLocal );
+            break;
+        }
+        default:
+        {
+            assert( 0 );
+            break;
+        }
+    }
+    Dsd_NodeSetMark( pNodeDsd, iLit );
+    return iLit;
+}
+Gia_Man_t * Gia_ManRebuild( Gia_Man_t * p, Dsd_Manager_t * pManDsd, DdManager * ddNew )
+{
+    Gia_Man_t * pNew;
+    Dsd_Node_t ** ppNodesDsd;
+    Dsd_Node_t * pNodeDsd;
+    int i, nNodesDsd, iLit = -1;
+    Vec_Str_t * vSop, * vCube;
+    Vec_Int_t * vFanins;
+
+    vFanins = Vec_IntAlloc( 1000 );
+    vSop    = Vec_StrAlloc( 10000 );
+    vCube   = Vec_StrAlloc( 1000 );
+
+    pNew = Gia_ManStart( 2*Gia_ManObjNum(p) );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+    Gia_ManHashAlloc( pNew );
+
+    // save the CI nodes in the DSD nodes
+    Dsd_NodeSetMark( Dsd_ManagerReadConst1(pManDsd), 1 );
+    for ( i = 0; i < Gia_ManCiNum(p); i++ )
+    {
+        pNodeDsd = Dsd_ManagerReadInput( pManDsd, i );
+        Dsd_NodeSetMark( pNodeDsd, Gia_ManAppendCi( pNew ) );
+    }
+
+    // collect DSD nodes in DFS order (leaves and const1 are not collected)
+    ppNodesDsd = Dsd_TreeCollectNodesDfs( pManDsd, &nNodesDsd );
+    for ( i = 0; i < nNodesDsd; i++ )
+    {
+        iLit = Gia_ManRebuildNode( pManDsd, ppNodesDsd[i], pNew, ddNew, vFanins, vSop, vCube );
+        if ( iLit == -1 )
+            break;
+    }
+    ABC_FREE( ppNodesDsd );
+    Vec_IntFree( vFanins );
+    Vec_StrFree( vSop );
+    Vec_StrFree( vCube );
+    if ( iLit == -1 )
+    {
+        Gia_ManStop( pNew );
+        return Gia_ManDup(p);
+    }
+
+    // set the pointers to the CO drivers
+    for ( i = 0; i < Gia_ManCoNum(p); i++ )
+    {
+        pNodeDsd = Dsd_ManagerReadRoot( pManDsd, i );
+        iLit = Dsd_NodeReadMark( Dsd_Regular(pNodeDsd) );
+        iLit = Abc_LitNotCond( iLit, Dsd_IsComplement(pNodeDsd) );
+        Gia_ManAppendCo( pNew, iLit );
+    }
+    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManCollapseDeref( DdManager * dd, Vec_Ptr_t * vFuncs )
+{
+    DdNode * bFunc; int i;
+    Vec_PtrForEachEntry( DdNode *, vFuncs, bFunc, i )
+        if ( bFunc )
+            Cudd_RecursiveDeref( dd, bFunc );
+    Vec_PtrFree( vFuncs );
+}
+void Gia_ObjCollapseDeref( Gia_Man_t * p, DdManager * dd, Vec_Ptr_t * vFuncs, int Id )
+{
+    if ( Gia_ObjRefDecId(p, Id) )
+        return;
+    Cudd_RecursiveDeref( dd, (DdNode *)Vec_PtrEntry(vFuncs, Id) );
+    Vec_PtrWriteEntry( vFuncs, Id, NULL );
+}
+Vec_Ptr_t * Gia_ManCollapse( Gia_Man_t * p, DdManager * dd, int nBddLimit, int fVerbose )
+{
+    Vec_Ptr_t * vFuncs;
+    DdNode * bFunc0, * bFunc1, * bFunc;
+    Gia_Obj_t * pObj;
+    int i, Id;
+    Gia_ManCreateRefs( p );
+    // assign constant node
+    vFuncs = Vec_PtrStart( Gia_ManObjNum(p) );
+    if ( Gia_ObjRefNumId(p, 0) > 0 )
+        Vec_PtrWriteEntry( vFuncs, 0, Cudd_ReadLogicZero(dd) ), Cudd_Ref(Cudd_ReadLogicZero(dd));
+    // assign elementary variables
+    Gia_ManForEachCiId( p, Id, i )
+        if ( Gia_ObjRefNumId(p, Id) > 0 )
+            Vec_PtrWriteEntry( vFuncs, Id, Cudd_bddIthVar(dd,i) ), Cudd_Ref(Cudd_bddIthVar(dd,i));
+    // create BDD for AND nodes
+    Gia_ManForEachAnd( p, pObj, i )
+    {
+        bFunc0 = Cudd_NotCond( (DdNode *)Vec_PtrEntry(vFuncs, Gia_ObjFaninId0(pObj, i)), Gia_ObjFaninC0(pObj) );
+        bFunc1 = Cudd_NotCond( (DdNode *)Vec_PtrEntry(vFuncs, Gia_ObjFaninId1(pObj, i)), Gia_ObjFaninC1(pObj) );
+        bFunc  = Cudd_bddAndLimit( dd, bFunc0, bFunc1, nBddLimit );  
+        if ( bFunc == NULL )
+        {
+            Gia_ManCollapseDeref( dd, vFuncs );
+            return NULL;
+        }        
+        Cudd_Ref( bFunc );
+        Vec_PtrWriteEntry( vFuncs, i, bFunc );
+        Gia_ObjCollapseDeref( p, dd, vFuncs, Gia_ObjFaninId0(pObj, i) );
+        Gia_ObjCollapseDeref( p, dd, vFuncs, Gia_ObjFaninId1(pObj, i) );
+    }
+    // create BDD for outputs
+    Gia_ManForEachCoId( p, Id, i )
+    {
+        pObj = Gia_ManCo( p, i );
+        bFunc0 = Cudd_NotCond( (DdNode *)Vec_PtrEntry(vFuncs, Gia_ObjFaninId0(pObj, Id)), Gia_ObjFaninC0(pObj) );
+        Vec_PtrWriteEntry( vFuncs, Id, bFunc0 ); Cudd_Ref( bFunc0 );
+        Gia_ObjCollapseDeref( p, dd, vFuncs, Gia_ObjFaninId0(pObj, Id) );
+    }
+    assert( Vec_PtrSize(vFuncs) == Vec_PtrCountZero(vFuncs) + Gia_ManCoNum(p) );
+    // compact
+    Gia_ManForEachCoId( p, Id, i )
+        Vec_PtrWriteEntry( vFuncs, i, Vec_PtrEntry(vFuncs, Id) );
+    Vec_PtrShrink( vFuncs, Gia_ManCoNum(p) );
+    return vFuncs;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManCollapseTest( Gia_Man_t * p, int fVerbose )
+{
+    Gia_Man_t * pNew;
+    DdManager * dd, * ddNew;
+    Dsd_Manager_t * pManDsd;
+    Vec_Ptr_t * vFuncs;
+    // derive global BDDs
+    dd = Cudd_Init( Gia_ManCiNum(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
+    Cudd_AutodynEnable( dd,  CUDD_REORDER_SYMM_SIFT );
+    vFuncs = Gia_ManCollapse( p, dd, 10000, 0 );
+    Cudd_AutodynDisable( dd );
+    if ( vFuncs == NULL ) 
+    {
+        Extra_StopManager( dd );
+        return Gia_ManDup(p);
+    }
+    // start ISOP manager
+    ddNew = Cudd_Init( Gia_ManCiNum(p), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );
+    Cudd_zddVarsFromBddVars( ddNew, 2 );
+//    Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 );
+    if ( fVerbose )
+    printf( "Ins = %d. Outs = %d.  Shared BDD nodes = %d.  Peak live nodes = %d. Peak nodes = %d.\n", 
+        Gia_ManCiNum(p), Gia_ManCoNum(p), 
+        Cudd_SharingSize( (DdNode **)Vec_PtrArray(vFuncs), Vec_PtrSize(vFuncs) ),
+        Cudd_ReadPeakLiveNodeCount(dd), (int)Cudd_ReadNodeCount(dd) );
+    // perform decomposition
+    pManDsd = Dsd_ManagerStart( dd, Gia_ManCiNum(p), 0 );
+    Dsd_Decompose( pManDsd, (DdNode **)Vec_PtrArray(vFuncs), Vec_PtrSize(vFuncs) );
+    if ( fVerbose )
+    {
+        Vec_Ptr_t * vNamesCi = Abc_NodeGetFakeNames( Gia_ManCiNum(p) );
+        Vec_Ptr_t * vNamesCo = Abc_NodeGetFakeNames( Gia_ManCoNum(p) );
+        char ** ppNamesCi = (char **)Vec_PtrArray( vNamesCi );
+        char ** ppNamesCo = (char **)Vec_PtrArray( vNamesCo );
+        Dsd_TreePrint( stdout, pManDsd, ppNamesCi, ppNamesCo, 0, -1 );
+        Vec_PtrFreeFree( vNamesCi );
+        Vec_PtrFreeFree( vNamesCo );
+    }
+
+    pNew = Gia_ManRebuild( p, pManDsd, ddNew );
+    Dsd_ManagerStop( pManDsd );
+    // return manager
+    Gia_ManCollapseDeref( dd, vFuncs );
+    Extra_StopManager( dd );
+    Extra_StopManager( ddNew );
+    return pNew;
+}
+void Gia_ManCollapseTestTest( Gia_Man_t * p )
+{
+    Gia_Man_t * pNew;
+    pNew = Gia_ManCollapseTest( p, 0 );
+    Gia_ManPrintStats( p, NULL );
+    Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( pNew );
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/aig/gia/giaDup.c b/abc-build/src/aig/gia/giaDup.c
--- a/abc-build/src/aig/gia/giaDup.c
+++ b/abc-build/src/aig/gia/giaDup.c
@@ -546,6 +546,19 @@
         pNew->pCexSeq = Abc_CexDup( p->pCexSeq, Gia_ManRegNum(p) );
     return pNew;
 }
+Gia_Man_t * Gia_ManDupWithAttributes( Gia_Man_t * p )
+{
+    Gia_Man_t * pNew = Gia_ManDup(p);
+    Gia_ManTransferMapping( pNew, p );
+    Gia_ManTransferPacking( pNew, p );
+    if ( p->pManTime )
+        pNew->pManTime = Tim_ManDup( (Tim_Man_t *)p->pManTime, 0 );
+    if ( p->pAigExtra )
+        pNew->pAigExtra = Gia_ManDup( p->pAigExtra );
+    if ( p->nAnd2Delay )
+        pNew->nAnd2Delay = p->nAnd2Delay;
+    return pNew;
+}
 
 /**Function*************************************************************
 
@@ -3003,6 +3016,41 @@
     Gia_ManStop( pTemp );
     Vec_IntFree( vSuper );
     Vec_PtrFree( vSuperPtr );
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Decomposes the miter outputs.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManDupOuts( Gia_Man_t * p )
+{
+    Gia_Man_t * pNew;
+    Gia_Obj_t * pObj;
+    int i;
+    pNew = Gia_ManStart( Gia_ManObjNum(p) );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+    Gia_ManConst0(p)->Value = 0;
+    Gia_ManForEachCi( p, pObj, i )
+        pObj->Value = Gia_ManAppendCi(pNew);
+    Gia_ManForEachAnd( p, pObj, i )
+        pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
+    Gia_ManForEachPo( p, pObj, i )
+        Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+    Gia_ManForEachAnd( p, pObj, i )
+        Gia_ManAppendCo( pNew, pObj->Value );
+    Gia_ManForEachRi( p, pObj, i )
+        Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+    assert( Gia_ManIsNormalized(pNew) );
     return pNew;
 }
 
diff --git a/abc-build/src/aig/gia/giaFx.c b/abc-build/src/aig/gia/giaFx.c
--- a/abc-build/src/aig/gia/giaFx.c
+++ b/abc-build/src/aig/gia/giaFx.c
@@ -464,6 +464,7 @@
 //    Abc_PrintTime( 1, "Fx runtime", Abc_Clock() - clk );
     // insert information
     pNew = Gia_ManFxInsert( p, vCubes, vCompl );
+    Gia_ManTransferTiming( pNew, p );
     // cleanup
     Vec_WecFree( vCubes );
     Vec_StrFree( vCompl );
diff --git a/abc-build/src/aig/gia/giaIf.c b/abc-build/src/aig/gia/giaIf.c
--- a/abc-build/src/aig/gia/giaIf.c
+++ b/abc-build/src/aig/gia/giaIf.c
@@ -183,6 +183,56 @@
 
 /**Function*************************************************************
 
+  Synopsis    [Prints mapping statistics.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManLutParams( Gia_Man_t * p, int * pnCurLuts, int * pnCurEdges, int * pnCurLevels )
+{
+    if ( p->pManTime && Tim_ManBoxNum((Tim_Man_t *)p->pManTime) )
+    {
+        int i;
+        *pnCurLuts = 0;
+        *pnCurEdges = 0;
+        Gia_ManForEachLut( p, i )
+        {
+            (*pnCurLuts)++;
+            (*pnCurEdges) += Gia_ObjLutSize(p, i);
+        }
+        *pnCurLevels = Gia_ManLutLevelWithBoxes( p );
+    }
+    else
+    {
+        Gia_Obj_t * pObj;
+        int i, k, iFan;
+        int * pLevels = ABC_CALLOC( int, Gia_ManObjNum(p) );
+        *pnCurLuts = 0;
+        *pnCurEdges = 0;
+        Gia_ManForEachLut( p, i )
+        {
+            int Level = 0;
+            (*pnCurLuts)++;
+            (*pnCurEdges) += Gia_ObjLutSize(p, i);
+            Gia_LutForEachFanin( p, i, iFan, k )
+                if ( Level < pLevels[iFan] )
+                    Level = pLevels[iFan];
+            pLevels[i] = Level + 1;
+        }
+        *pnCurLevels = 0;
+        Gia_ManForEachCo( p, pObj, k )
+            if ( *pnCurLevels < pLevels[Gia_ObjFaninId0p(p, pObj)] )
+                *pnCurLevels = pLevels[Gia_ObjFaninId0p(p, pObj)];
+        ABC_FREE( pLevels );
+    }
+}
+
+/**Function*************************************************************
+
   Synopsis    [Assigns levels.]
 
   Description []
@@ -394,8 +444,10 @@
     SetConsoleTextAttribute( hConsole, 12 ); // red
     Abc_Print( 1, "lev =%5d ",   LevelMax );
     Abc_Print( 1, "(%.2f)  ",    (float)Ave / Gia_ManCoNum(p) );
+//    Abc_Print( 1, "over =%5.1f %%  ", 100.0 * Gia_ManComputeOverlap(p) / Gia_ManAndNum(p) );
+    if ( p->pManTime && Tim_ManBoxNum((Tim_Man_t *)p->pManTime) )
+        Abc_Print( 1, "levB =%5d  ", Gia_ManLutLevelWithBoxes(p) );
     SetConsoleTextAttribute( hConsole, 7 );  // normal
-    Abc_Print( 1, "over =%5.1f %%  ", 100.0 * Gia_ManComputeOverlap(p) / Gia_ManAndNum(p) );
     Abc_Print( 1, "mem =%5.2f MB", 4.0*(Gia_ManObjNum(p) + 2*nLuts + nFanins)/(1<<20) );
     Abc_Print( 1, "\n" );
     }
@@ -405,7 +457,9 @@
     Abc_Print( 1, "%sedge =%8d%s  ", "\033[1;32m", nFanins,  "\033[0m" );  // green
     Abc_Print( 1, "%slev =%5d%s ",   "\033[1;31m", LevelMax, "\033[0m" );  // red
     Abc_Print( 1, "%s(%.2f)%s  ",    "\033[1;31m", (float)Ave / Gia_ManCoNum(p), "\033[0m" );
-    Abc_Print( 1, "over =%5.1f %%  ", 100.0 * Gia_ManComputeOverlap(p) / Gia_ManAndNum(p) );
+//    Abc_Print( 1, "over =%5.1f %%  ", 100.0 * Gia_ManComputeOverlap(p) / Gia_ManAndNum(p) );
+    if ( p->pManTime && Tim_ManBoxNum((Tim_Man_t *)p->pManTime) )
+        Abc_Print( 1, "%slevB =%5d%s  ", "\033[1;31m", Gia_ManLutLevelWithBoxes(p), "\033[0m" );
     Abc_Print( 1, "mem =%5.2f MB", 4.0*(Gia_ManObjNum(p) + 2*nLuts + nFanins)/(1<<20) );
     Abc_Print( 1, "\n" );
 #endif
@@ -1561,7 +1615,7 @@
   SeeAlso     []
 
 ***********************************************************************/
-void Gia_ManTransferMapping( Gia_Man_t * pGia, Gia_Man_t * p )
+void Gia_ManTransferMapping( Gia_Man_t * p, Gia_Man_t * pGia )
 {
     Gia_Obj_t * pObj;
     int i, k, iFan;
@@ -1583,19 +1637,7 @@
     }
     Gia_ManMappingVerify( p );
 }
-
-/**Function*************************************************************
-
-  Synopsis    [Transfers packing from hie GIA to normalized GIA.]
-
-  Description [Hie GIA (pGia) points to normalized GIA (p).]
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Gia_ManTransferPacking( Gia_Man_t * pGia, Gia_Man_t * p )
+void Gia_ManTransferPacking( Gia_Man_t * p, Gia_Man_t * pGia )
 {
     Vec_Int_t * vPackingNew;
     Gia_Obj_t * pObj, * pObjNew;
@@ -1629,7 +1671,14 @@
     assert( p->vPacking == NULL );
     p->vPacking = vPackingNew;
 }
-
+void Gia_ManTransferTiming( Gia_Man_t * p, Gia_Man_t * pGia )
+{
+    if ( pGia->pManTime == NULL || p == pGia )
+        return;
+    p->pManTime   = pGia->pManTime;   pGia->pManTime   = NULL;
+    p->pAigExtra  = pGia->pAigExtra;  pGia->pAigExtra  = NULL;
+    p->nAnd2Delay = pGia->nAnd2Delay; pGia->nAnd2Delay = 0;
+}
 
 /**Function*************************************************************
 
@@ -1642,44 +1691,20 @@
   SeeAlso     [] 
 
 ***********************************************************************/
-Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized )
+Gia_Man_t * Gia_ManPerformMappingInt( Gia_Man_t * p, If_Par_t * pPars )
 {
     extern void Gia_ManIffTest( Gia_Man_t * pGia, If_LibLut_t * pLib, int fVerbose );
     Gia_Man_t * pNew;
     If_Man_t * pIfMan;
-    If_Par_t * pPars = (If_Par_t *)pp;
+    assert( pPars->pTimesArr == NULL );
+    assert( pPars->pTimesReq == NULL );
     // disable cut minimization when GIA strucure is needed
     if ( !pPars->fDelayOpt && !pPars->fDelayOptLut && !pPars->fDsdBalance && !pPars->fUserRecLib && !pPars->fDeriveLuts && !pPars->fUseDsd && !pPars->fUseTtPerm )
         pPars->fCutMin = 0;
-
-    // reconstruct GIA according to the hierarchy manager
-    assert( pPars->pTimesArr == NULL );
-    assert( pPars->pTimesReq == NULL );
-    if ( p->pManTime )
-    {
-        if ( fNormalized )
-        {
-            pNew = Gia_ManDupUnnormalize( p );
-            if ( pNew == NULL )
-                return NULL;
-            pNew->pManTime   = p->pManTime;   p->pManTime  = NULL;
-            pNew->pAigExtra  = p->pAigExtra;  p->pAigExtra = NULL;
-            pNew->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
-            p = pNew;
-            // set arrival and required times
-            pPars->pTimesArr = Tim_ManGetArrTimes( (Tim_Man_t *)p->pManTime );
-            pPars->pTimesReq = Tim_ManGetReqTimes( (Tim_Man_t *)p->pManTime );
-        }
-    }
-    else 
-        p = Gia_ManDup( p );
     // translate into the mapper
     pIfMan = Gia_ManToIf( p, pPars );    
     if ( pIfMan == NULL )
-    {
-        Gia_ManStop( p );
         return NULL;
-    }
     // create DSD manager
     if ( pPars->fUseDsd )
     {
@@ -1699,11 +1724,11 @@
             Abc_Print( 0, "Switching activity computation for designs with boxes is disabled.\n" );
     }
     if ( p->pManTime )
-        pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, 0 );
+        pIfMan->pManTim = Tim_ManDup( (Tim_Man_t *)p->pManTime, pPars->fDelayOpt || pPars->fDelayOptLut || pPars->fDsdBalance || pPars->fUserRecLib );
+//	Tim_ManPrint( pIfMan->pManTim );
     if ( !If_ManPerformMapping( pIfMan ) )
     {
         If_ManStop( pIfMan );
-        Gia_ManStop( p );
         return NULL;
     }
     // transform the result of mapping into the new network
@@ -1717,21 +1742,53 @@
     pNew->pName = Abc_UtilStrsav( p->pName );
     pNew->pSpec = Abc_UtilStrsav( p->pSpec );
     Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
-    // return the original (unmodified by the mapper) timing manager
-    pNew->pManTime   = p->pManTime;   p->pManTime   = NULL;
-    pNew->pAigExtra  = p->pAigExtra;  p->pAigExtra  = NULL;
-    pNew->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
-    Gia_ManStop( p );
-    // normalize and transfer mapping
-    pNew = Gia_ManDupNormalize( p = pNew );
-    Gia_ManTransferMapping( p, pNew );
-    Gia_ManTransferPacking( p, pNew );
-    pNew->pManTime   = p->pManTime;   p->pManTime   = NULL;
-    pNew->pAigExtra  = p->pAigExtra;  p->pAigExtra  = NULL;
-    pNew->nAnd2Delay = p->nAnd2Delay; p->nAnd2Delay = 0;
-    Gia_ManStop( p );
     return pNew;
 }
+Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp )
+{
+    Gia_Man_t * pNew;
+    if ( p->pManTime && Tim_ManBoxNum(p->pManTime) && Gia_ManIsNormalized(p) )
+    {
+        pNew = Gia_ManDupUnnormalize( p );
+        if ( pNew == NULL )
+            return NULL;
+        Gia_ManTransferTiming( pNew, p );
+        p = pNew;
+        // mapping
+        pNew = Gia_ManPerformMappingInt( p, (If_Par_t *)pp );
+        if ( pNew != p )
+        {
+            Gia_ManTransferTiming( pNew, p );
+            Gia_ManStop( p );
+        }
+        // normalize
+        pNew = Gia_ManDupNormalize( p = pNew );
+        Gia_ManTransferMapping( pNew, p );
+        Gia_ManTransferPacking( pNew, p );
+        Gia_ManTransferTiming( pNew, p );
+        Gia_ManStop( p );
+        assert( Gia_ManIsNormalized(pNew) );
+    }
+    else 
+    {
+        // mapping
+        pNew = Gia_ManPerformMappingInt( p, (If_Par_t *)pp );
+        Gia_ManTransferTiming( pNew, p );
+    }
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Interface of other mapping-based procedures.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     [] 
+
+***********************************************************************/
 Gia_Man_t * Gia_ManPerformSopBalance( Gia_Man_t * p, int nCutNum, int nRelaxRatio, int fVerbose )
 {
     Gia_Man_t * pNew;
@@ -1751,6 +1808,40 @@
     If_ManPerformMapping( pIfMan );
     pNew = Gia_ManFromIfAig( pIfMan );
     If_ManStop( pIfMan );
+    Gia_ManTransferTiming( pNew, p );
+    // transfer name
+    assert( pNew->pName == NULL );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+    Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
+    return pNew;
+}
+Gia_Man_t * Gia_ManPerformDsdBalance( Gia_Man_t * p, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose )
+{
+    Gia_Man_t * pNew;
+    If_Man_t * pIfMan;
+    If_Par_t Pars, * pPars = &Pars;
+    If_ManSetDefaultPars( pPars );
+    pPars->nCutsMax    = nCutNum;
+    pPars->nRelaxRatio = nRelaxRatio;
+    pPars->fVerbose    = fVerbose;
+    pPars->nLutSize    = nLutSize;
+    pPars->fDsdBalance = 1;
+    pPars->fUseDsd     = 1;
+    pPars->fCutMin     = 1;
+    pPars->fTruth      = 1;
+    pPars->fExpRed     = 0;
+    if ( Abc_FrameReadManDsd2() == NULL )
+        Abc_FrameSetManDsd2( If_DsdManAlloc(pPars->nLutSize, 0) );
+    // perform mapping
+    pIfMan = Gia_ManToIf( p, pPars );
+    pIfMan->pIfDsdMan = (If_DsdMan_t *)Abc_FrameReadManDsd2();
+    if ( pPars->fDsdBalance )
+        If_DsdManAllocIsops( pIfMan->pIfDsdMan, pPars->nLutSize );
+    If_ManPerformMapping( pIfMan );
+    pNew = Gia_ManFromIfAig( pIfMan );
+    If_ManStop( pIfMan );
+    Gia_ManTransferTiming( pNew, p );
     // transfer name
     assert( pNew->pName == NULL );
     pNew->pName = Abc_UtilStrsav( p->pName );
diff --git a/abc-build/src/aig/gia/giaMan.c b/abc-build/src/aig/gia/giaMan.c
--- a/abc-build/src/aig/gia/giaMan.c
+++ b/abc-build/src/aig/gia/giaMan.c
@@ -427,6 +427,8 @@
     Abc_Print( 1, "  mem =%5.2f MB", Gia_ManMemory(p)/(1<<20) );
     if ( Gia_ManHasChoices(p) )
         Abc_Print( 1, "  ch =%5d", Gia_ManChoiceNum(p) );
+	if ( p->pManTime )
+		Abc_Print( 1, "  box = %d", Tim_ManBoxNum((Tim_Man_t *)p->pManTime) );
     if ( pPars && pPars->fMuxXor )
         printf( "\nXOR/MUX " ), Gia_ManPrintMuxStats( p );
     if ( pPars && pPars->fSwitch )
@@ -456,8 +458,8 @@
         Gia_ManPrintLutStats( p );
     if ( p->pPlacement )
         Gia_ManPrintPlacement( p );
-    if ( p->pManTime )
-        Tim_ManPrintStats( (Tim_Man_t *)p->pManTime, p->nAnd2Delay );
+//    if ( p->pManTime )
+//        Tim_ManPrintStats( (Tim_Man_t *)p->pManTime, p->nAnd2Delay );
     // print register classes
     Gia_ManPrintFlopClasses( p );
     Gia_ManPrintGateClasses( p );
diff --git a/abc-build/src/aig/gia/giaMf.c b/abc-build/src/aig/gia/giaMf.c
--- a/abc-build/src/aig/gia/giaMf.c
+++ b/abc-build/src/aig/gia/giaMf.c
@@ -35,6 +35,7 @@
 #define MF_LOG_PAGE   12
 #define MF_NO_LEAF    31
 #define MF_TT_WORDS  ((MF_LEAF_MAX > 6) ? 1 << (MF_LEAF_MAX-6) : 1)
+#define MF_NO_FUNC    134217727     // (1<<27)-1
 
 typedef struct Mf_Cut_t_ Mf_Cut_t; 
 struct Mf_Cut_t_
@@ -42,7 +43,7 @@
     word            Sign;           // signature
     int             Delay;          // delay
     float           Flow;           // flow
-    unsigned        iFunc   : 27;   // function
+    unsigned        iFunc   : 27;   // function (MF_NO_FUNC)
     unsigned        nLeaves :  5;   // leaf number (MF_NO_LEAF)
     int             pLeaves[MF_LEAF_MAX+1]; // leaves
 };
@@ -785,7 +786,7 @@
             pC[i] = pC0[i];
         }
         pCut->nLeaves = nLutSize;
-        pCut->iFunc = -1;
+        pCut->iFunc = MF_NO_FUNC;
         pCut->Sign = pCut0->Sign | pCut1->Sign;
         return 1;
     }
@@ -819,7 +820,7 @@
     while ( i < nSize0 )
         pC[c++] = pC0[i++];
     pCut->nLeaves = c;
-    pCut->iFunc = -1;
+    pCut->iFunc = MF_NO_FUNC;
     pCut->Sign = pCut0->Sign | pCut1->Sign;
     return 1;
 
@@ -828,7 +829,7 @@
     while ( k < nSize1 )
         pC[c++] = pC1[k++];
     pCut->nLeaves = c;
-    pCut->iFunc = -1;
+    pCut->iFunc = MF_NO_FUNC;
     pCut->Sign = pCut0->Sign | pCut1->Sign;
     return 1;
 }
@@ -852,7 +853,7 @@
         if (x2 == xMin) i2++;
     }
     pCut->nLeaves = c;
-    pCut->iFunc = -1;
+    pCut->iFunc = MF_NO_FUNC;
     pCut->Sign = pCut0->Sign | pCut1->Sign | pCut2->Sign;
     return 1;
 }
diff --git a/abc-build/src/aig/gia/giaMffc.c b/abc-build/src/aig/gia/giaMffc.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/aig/gia/giaMffc.c
@@ -0,0 +1,313 @@
+/**CFile****************************************************************
+
+  FileName    [gia.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Scalable AIG package.]
+
+  Synopsis    []
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - June 20, 2005.]
+
+  Revision    [$Id: gia.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "gia.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+static inline int   Gia_ObjDom( Gia_Man_t * p, Gia_Obj_t * pObj )            { return Vec_IntEntry(p->vDoms, Gia_ObjId(p, pObj));   }
+static inline void  Gia_ObjSetDom( Gia_Man_t * p, Gia_Obj_t * pObj, int d )  { Vec_IntWriteEntry(p->vDoms, Gia_ObjId(p, pObj), d);  }
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    [Computes one-node dominators.]
+
+  Description [For each node, computes the closest one-node dominator,
+  which can be the node itself if the node has no other dominators.]
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline void Gia_ManAddDom( Gia_Man_t * p, Gia_Obj_t * pObj, int iDom0 )
+{
+    int iDom1, iDomNext;
+    if ( Gia_ObjDom(p, pObj) == -1 )
+    {
+        Gia_ObjSetDom( p, pObj, iDom0 );
+        return;
+    }
+    iDom1 = Gia_ObjDom( p, pObj );
+    while ( 1 )
+    {
+        if ( iDom0 > iDom1 )
+        {
+            iDomNext = Gia_ObjDom( p, Gia_ManObj(p, iDom1) );
+            if ( iDomNext == iDom1 )
+                break;
+            iDom1 = iDomNext;
+            continue;
+        }
+        if ( iDom1 > iDom0 )
+        {
+            iDomNext = Gia_ObjDom( p, Gia_ManObj(p, iDom0) );
+            if ( iDomNext == iDom0 )
+                break;
+            iDom0 = iDomNext;
+            continue;
+        }
+        assert( iDom0 == iDom1 );
+        Gia_ObjSetDom( p, pObj, iDom0 );
+        return;
+    }
+    Gia_ObjSetDom( p, pObj, Gia_ObjId(p, pObj) );
+}
+static inline void Gia_ManComputeDoms( Gia_Man_t * p )
+{
+    Gia_Obj_t * pObj;
+    int i;
+    if ( p->vDoms == NULL )
+        p->vDoms = Vec_IntAlloc( 0 );
+    Vec_IntFill( p->vDoms, Gia_ManObjNum(p), -1 );
+    Gia_ManForEachObjReverse( p, pObj, i )
+    {
+        if ( i == 0 || Gia_ObjIsCi(pObj) )
+            continue;
+        if ( Gia_ObjIsCo(pObj) )
+        {
+            Gia_ObjSetDom( p, pObj, i );
+            Gia_ManAddDom( p, Gia_ObjFanin0(pObj), i );
+            continue;
+        }
+        assert( Gia_ObjIsAnd(pObj) );
+        Gia_ManAddDom( p, Gia_ObjFanin0(pObj), i );
+        Gia_ManAddDom( p, Gia_ObjFanin1(pObj), i );
+    }
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    [Returns the number of internal nodes in the MFFC.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Gia_NodeDeref_rec( Gia_Man_t * p, Gia_Obj_t * pNode )
+{
+    Gia_Obj_t * pFanin;
+    int Counter = 0;
+    if ( Gia_ObjIsCi(pNode) )
+        return 0;
+    assert( Gia_ObjIsAnd(pNode) );
+    pFanin = Gia_ObjFanin0(pNode);
+    assert( Gia_ObjRefNum(p, pFanin) > 0 );
+    if ( Gia_ObjRefDec(p, pFanin) == 0 )
+        Counter += Gia_NodeDeref_rec( p, pFanin );
+    pFanin = Gia_ObjFanin1(pNode);
+    assert( Gia_ObjRefNum(p, pFanin) > 0 );
+    if ( Gia_ObjRefDec(p, pFanin) == 0 )
+        Counter += Gia_NodeDeref_rec( p, pFanin );
+    return Counter + 1;
+}
+static inline int Gia_NodeRef_rec( Gia_Man_t * p, Gia_Obj_t * pNode )
+{
+    Gia_Obj_t * pFanin;
+    int Counter = 0;
+    if ( Gia_ObjIsCi(pNode) )
+        return 0;
+    assert( Gia_ObjIsAnd(pNode) );
+    pFanin = Gia_ObjFanin0(pNode);
+    if ( Gia_ObjRefInc(p, pFanin) == 0 )
+        Counter += Gia_NodeRef_rec( p, pFanin );
+    pFanin = Gia_ObjFanin1(pNode);
+    if ( Gia_ObjRefInc(p, pFanin) == 0 )
+        Counter += Gia_NodeRef_rec( p, pFanin );
+    return Counter + 1;
+}
+static inline void Gia_NodeCollect_rec( Gia_Man_t * p, Gia_Obj_t * pNode, Vec_Int_t * vSupp, Vec_Int_t * vSuppRefs  )
+{
+    if ( Gia_ObjIsTravIdCurrent(p, pNode) )
+        return;
+    Gia_ObjSetTravIdCurrent(p, pNode);
+    if ( Gia_ObjRefNum(p, pNode) || Gia_ObjIsCi(pNode) )
+    {
+        Vec_IntPush( vSupp, Gia_ObjId(p, pNode) );
+        Vec_IntPush( vSuppRefs, Gia_ObjRefNum(p, pNode) );
+        return;
+    }
+    assert( Gia_ObjIsAnd(pNode) );
+    Gia_NodeCollect_rec( p, Gia_ObjFanin0(pNode), vSupp, vSuppRefs );
+    Gia_NodeCollect_rec( p, Gia_ObjFanin1(pNode), vSupp, vSuppRefs );
+}
+static inline int Gia_NodeMffcSizeSupp( Gia_Man_t * p, Gia_Obj_t * pNode, Vec_Int_t * vSupp, Vec_Int_t * vSuppRefs )
+{
+    int ConeSize1, ConeSize2, i, iObj;
+    assert( !Gia_IsComplement(pNode) );
+    assert( Gia_ObjIsAnd(pNode) );
+    Vec_IntClear( vSupp );
+    Vec_IntClear( vSuppRefs );
+    Gia_ManIncrementTravId( p );
+    ConeSize1 = Gia_NodeDeref_rec( p, pNode );
+    Gia_NodeCollect_rec( p, Gia_ObjFanin0(pNode), vSupp, vSuppRefs );
+    Gia_NodeCollect_rec( p, Gia_ObjFanin1(pNode), vSupp, vSuppRefs );
+    ConeSize2 = Gia_NodeRef_rec( p, pNode );
+    assert( ConeSize1 == ConeSize2 );
+    assert( ConeSize1 >= 0 );
+    // record supp refs    
+    Vec_IntForEachEntry( vSupp, iObj, i )
+        Vec_IntAddToEntry( vSuppRefs, i, -Gia_ObjRefNumId(p, iObj) );
+    return ConeSize1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Gia_ManDomDerive_rec( Gia_Man_t * pNew, Gia_Man_t * p, Gia_Obj_t * pNode )
+{
+    if ( Gia_ObjIsTravIdCurrent(p, pNode) )
+        return pNode->Value;
+    Gia_ObjSetTravIdCurrent(p, pNode);
+    assert( Gia_ObjIsAnd(pNode) );
+    Gia_ManDomDerive_rec( pNew, p, Gia_ObjFanin0(pNode) );
+    Gia_ManDomDerive_rec( pNew, p, Gia_ObjFanin1(pNode) );
+    return pNode->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pNode), Gia_ObjFanin1Copy(pNode) );
+}
+Gia_Man_t * Gia_ManDomDerive( Gia_Man_t * p, Gia_Obj_t * pRoot, Vec_Int_t * vSupp, int nVars )
+{
+    Gia_Man_t * pNew, * pTemp;
+    int nMints = 1 << nVars;
+    int i, m, iResLit;
+    assert( nVars >= 0 && nVars <= 5 );
+    pNew = Gia_ManStart( Gia_ManObjNum(p) );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
+    Gia_ManConst0(p)->Value = 0;
+    Gia_ManHashAlloc( pNew );
+    for ( i = 0; i < Vec_IntSize(vSupp); i++ )
+        Gia_ManAppendCi(pNew);
+    for ( m = 0; m < nMints; m++ )
+    {
+        Gia_Obj_t * pObj;
+        Gia_ManIncrementTravId( p );
+        Gia_ManForEachObjVec( vSupp, p, pObj, i )
+        {
+            if ( i < nVars )
+                pObj->Value = (m >> i) & 1;
+            else
+                pObj->Value = Gia_ObjToLit(pNew, Gia_ManCi(pNew, i));
+            Gia_ObjSetTravIdCurrent( p, pObj );
+        }
+        iResLit = Gia_ManDomDerive_rec( pNew, p, pRoot );
+        Gia_ManAppendCo( pNew, iResLit );
+    }
+    Gia_ManHashStop( pNew );
+    pNew = Gia_ManCleanup( pTemp = pNew );
+    Gia_ManStop( pTemp );
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManComputeDomsTry( Gia_Man_t * p )
+{
+    extern void Gia_ManCollapseTestTest( Gia_Man_t * p );
+
+    Vec_Int_t * vSupp, * vSuppRefs;
+    Gia_Man_t * pNew;
+    Gia_Obj_t * pObj;
+    int i, nSize, Entry, k;
+    abctime clk = Abc_Clock();
+    ABC_FREE( p->pRefs );
+    Gia_ManLevelNum( p );
+    Gia_ManCreateRefs( p );
+    Gia_ManComputeDoms( p );
+    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
+    vSupp = Vec_IntAlloc( 1000 );
+    vSuppRefs = Vec_IntAlloc( 1000 );
+    Gia_ManForEachObj( p, pObj, i )
+    {
+        if ( !Gia_ObjIsAnd(pObj) && !Gia_ObjIsCo(pObj) )
+            continue;
+        if ( Gia_ObjDom(p, pObj) != i )
+            continue;
+        if ( Gia_ObjIsCo(pObj) )
+            pObj = Gia_ObjFanin0(pObj);
+        if ( !Gia_ObjIsAnd(pObj) )
+            continue;
+        nSize = Gia_NodeMffcSizeSupp( p, pObj, vSupp, vSuppRefs );
+        if ( nSize < 10 )//|| nSize > 100 )
+            continue;
+        // sort by cost
+        Vec_IntSelectSortCost2( Vec_IntArray(vSupp), Vec_IntSize(vSupp), Vec_IntArray(vSuppRefs) );
+
+        printf( "Obj %6d : ", i );
+        printf( "Cone = %4d  ", nSize );
+        printf( "Supp = %4d  ", Vec_IntSize(vSupp) );
+//        Vec_IntForEachEntry( vSuppRefs, Entry, k )
+//            printf( "%d(%d) ", -Entry, Gia_ObjLevelId(p, Vec_IntEntry(vSupp, k)) );
+        printf( "\n" );
+
+        // selected k
+        for ( k = 0; k < Vec_IntSize(vSupp); k++ )
+            if ( Vec_IntEntry(vSuppRefs, k) == 1 )
+                break;
+        k = Abc_MinInt( k, 3 );
+        k = 0;
+
+        // dump
+        pNew = Gia_ManDomDerive( p, pObj, vSupp, k );
+        Gia_DumpAiger( pNew, "mffc", i, 6 );
+        Gia_ManCollapseTestTest( pNew );
+
+        Gia_ManStop( pNew );
+    }
+    Vec_IntFree( vSuppRefs );
+    Vec_IntFree( vSupp );
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/aig/gia/giaScript.c b/abc-build/src/aig/gia/giaScript.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/aig/gia/giaScript.c
@@ -0,0 +1,369 @@
+/**CFile****************************************************************
+
+  FileName    [giaScript.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Scalable AIG package.]
+
+  Synopsis    [Various hardcoded scripts.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - June 20, 2005.]
+
+  Revision    [$Id: giaScript.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "gia.h"
+#include "base/main/main.h"
+#include "base/cmd/cmd.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    [Synthesis script.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManAigPrintPiLevels( Gia_Man_t * p )
+{
+    Gia_Obj_t * pObj;
+    int i;
+    Gia_ManForEachPi( p, pObj, i )
+        printf( "%d ", Gia_ObjLevel(p, pObj) );
+    printf( "\n" );
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Synthesis script.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManAigSyn2( Gia_Man_t * pInit, int fOldAlgo, int fCoarsen, int fCutMin, int nRelaxRatio, int fDelayMin, int fVerbose, int fVeryVerbose )
+{
+    Gia_Man_t * p, * pNew, * pTemp;
+    Jf_Par_t Pars, * pPars = &Pars;
+    if ( fOldAlgo )
+    {
+        Jf_ManSetDefaultPars( pPars );
+        pPars->fCutMin     = fCutMin;
+    }
+    else
+    {
+        Lf_ManSetDefaultPars( pPars );
+        pPars->fCutMin     = fCutMin;
+        pPars->fCoarsen    = fCoarsen;
+        pPars->nRelaxRatio = nRelaxRatio;
+        pPars->nAreaTuner  = 1;
+        pPars->nCutNum     = 4;
+    }
+    if ( fVerbose )  Gia_ManPrintStats( pInit, NULL );
+    p = Gia_ManDup( pInit );
+    Gia_ManTransferTiming( p, pInit );
+    if ( Gia_ManAndNum(p) == 0 )
+        return p;
+    // delay optimization
+    if ( fDelayMin && p->pManTime == NULL )
+    {
+        int Area0, Area1, Delay0, Delay1;
+        int fCutMin = pPars->fCutMin;
+        int fCoarsen = pPars->fCoarsen;
+        int nRelaxRatio = pPars->nRelaxRatio;
+        pPars->fCutMin = 0;
+        pPars->fCoarsen = 0;
+        pPars->nRelaxRatio = 0;
+        // perform mapping
+        if ( fOldAlgo )
+            Jf_ManPerformMapping( p, pPars );
+        else
+            Lf_ManPerformMapping( p, pPars );
+        Area0  = (int)pPars->Area;
+        Delay0 = (int)pPars->Delay;
+        // perform balancing
+        pNew = Gia_ManPerformDsdBalance( p, 6, 4, 0, 0 );
+        // perform mapping again
+        if ( fOldAlgo )
+            Jf_ManPerformMapping( pNew, pPars );
+        else
+            Lf_ManPerformMapping( pNew, pPars );
+        Area1  = (int)pPars->Area;
+        Delay1 = (int)pPars->Delay;
+        // choose the best result
+        if ( Delay1 < Delay0 - 1 || (Delay1 == Delay0 + 1 && 100.0 * (Area1 - Area0) / Area1 < 3.0) )
+        {
+            Gia_ManStop( p );
+            p = pNew;
+        }
+        else
+        {
+            Gia_ManStop( pNew );
+            Vec_IntFreeP( &p->vMapping );
+        }
+        // reset params
+        pPars->fCutMin = fCutMin;
+        pPars->fCoarsen = fCoarsen;
+        pPars->nRelaxRatio = nRelaxRatio;
+    }
+    // perform balancing
+    pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( p );
+    // perform mapping
+    if ( fOldAlgo )
+        pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
+    else
+        pNew = Lf_ManPerformMapping( pTemp = pNew, pPars );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    if ( pTemp != pNew )
+        Gia_ManStop( pTemp );
+    // perform balancing
+    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( pTemp );
+    return pNew;
+}
+Gia_Man_t * Gia_ManAigSyn3( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
+{
+    Gia_Man_t * pNew, * pTemp;
+    Jf_Par_t Pars, * pPars = &Pars;
+    Jf_ManSetDefaultPars( pPars );
+    pPars->nRelaxRatio = 40;
+    if ( fVerbose )     Gia_ManPrintStats( p, NULL );
+    if ( Gia_ManAndNum(p) == 0 )
+        return Gia_ManDup(p);
+    // perform balancing
+    pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    // perform mapping
+    pPars->nLutSize = 6;
+    pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+//    Gia_ManStop( pTemp );
+    // perform balancing
+    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( pTemp );
+    // perform mapping
+    pPars->nLutSize = 4;
+    pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+//    Gia_ManStop( pTemp );
+    // perform balancing
+    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( pTemp );
+    return pNew;
+}
+Gia_Man_t * Gia_ManAigSyn4( Gia_Man_t * p, int fVerbose, int fVeryVerbose )
+{
+    Gia_Man_t * pNew, * pTemp;
+    Jf_Par_t Pars, * pPars = &Pars;
+    Jf_ManSetDefaultPars( pPars );
+    pPars->nRelaxRatio = 40;
+    if ( fVerbose )     Gia_ManPrintStats( p, NULL );
+    if ( Gia_ManAndNum(p) == 0 )
+        return Gia_ManDup(p);
+//Gia_ManAigPrintPiLevels( p );
+    // perform balancing
+    pNew = Gia_ManAreaBalance( p, 0, ABC_INFINITY, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    // perform mapping
+    pPars->nLutSize = 7;
+    pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+//    Gia_ManStop( pTemp );
+    // perform extraction
+    pNew = Gia_ManPerformFx( pTemp = pNew, ABC_INFINITY, 0, 0, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( pTemp );
+    // perform balancing
+    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( pTemp );
+    // perform mapping
+    pPars->nLutSize = 5;
+    pNew = Jf_ManPerformMapping( pTemp = pNew, pPars );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+//    Gia_ManStop( pTemp );
+    // perform extraction
+    pNew = Gia_ManPerformFx( pTemp = pNew, ABC_INFINITY, 0, 0, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( pTemp );
+    // perform balancing
+    pNew = Gia_ManAreaBalance( pTemp = pNew, 0, ABC_INFINITY, fVeryVerbose, 0 );
+    if ( fVerbose )     Gia_ManPrintStats( pNew, NULL );
+    Gia_ManStop( pTemp );
+//Gia_ManAigPrintPiLevels( pNew );
+    return pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Gia_ManPerformMap( int nAnds, int nLutSize, int nCutNum, int fVerbose )
+{
+    char Command[200];
+    sprintf( Command, "&unmap; &lf -K %d -C %d -k; &save", nLutSize, nCutNum );
+    Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command );
+	if ( fVerbose )
+	{
+		printf( "MAPPING:\n" );
+		printf( "Mapping with &lf -k:\n" );
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" );
+	}
+    sprintf( Command, "&unmap; &lf -K %d -C %d; &save", nLutSize, nCutNum );
+    Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command );
+	if ( fVerbose )
+	{
+		printf( "Mapping with &lf:\n" );
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" );
+	}
+	if ( (nLutSize == 4 && nAnds < 100000) || (nLutSize == 6 && nAnds < 2000) )
+	{
+		sprintf( Command, "&unmap; &if -sz -S %d%d -K %d -C %d", nLutSize, nLutSize, 2*nLutSize-1, 2*nCutNum );
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command );
+		Vec_IntFreeP( &Abc_FrameReadGia(Abc_FrameGetGlobalFrame())->vPacking );
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&save" );
+		if ( fVerbose )
+		{
+			printf( "Mapping with &if -sz -S %d%d -K %d -C %d:\n", nLutSize, nLutSize, 2*nLutSize-1, 2*nCutNum );
+			Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" );
+		}
+	}
+	Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&load" );
+	if ( fVerbose )
+	{
+		printf( "Mapping final:\n" );
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" );
+	}
+}
+void Gia_ManPerformRound( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose )
+{
+    char Command[200];
+
+	// perform AIG-based synthesis
+	if ( nAnds < 50000 )
+	{
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "" );
+		sprintf( Command, "&dsdb; &dch -f; &if -K %d -C %d; &save", nLutSize, nCutNum );
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command );
+		if ( fVerbose )
+		{
+			printf( "Mapping with &dch -f; &if -K %d -C %d:\n", nLutSize, nCutNum );
+			Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" );
+		}
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" );
+	}
+
+	// perform AIG-based synthesis
+	if ( nAnds < 20000 )
+	{
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "" );
+		sprintf( Command, "&dsdb; &dch -f; &if -K %d -C %d; &save", nLutSize, nCutNum );
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command );
+		if ( fVerbose )
+		{
+			printf( "Mapping with &dch -f; &if -K %d -C %d:\n", nLutSize, nCutNum );
+			Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&ps" );
+		}
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" );
+	}
+
+	// perform first round of mapping
+	Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fVerbose );
+	Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" );
+
+	// perform synthesis
+	Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&dsdb" );
+
+	// perform second round of mapping
+	Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fVerbose );
+	Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" );
+
+	// perform synthesis
+	Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&syn2 -m -R 10; &dsdb" );
+
+	// prepare for final mapping
+    sprintf( Command, "&blut -a -K %d", nLutSize );
+    Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), Command );
+
+	// perform third round of mapping
+	Gia_ManPerformMap( nAnds, nLutSize, nCutNum, fVerbose );
+}
+void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose )
+{
+	// remove comb equivs
+	if ( fIsMapped )
+	    Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st" );
+	if ( Abc_FrameReadGia(Abc_FrameGetGlobalFrame())->pManTime )
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&sweep" );
+	else
+		Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&fraig -c" );
+
+	// perform first round
+	Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, nRelaxRatio, fVerbose );
+
+	// perform synthesis
+	Cmd_CommandExecute( Abc_FrameGetGlobalFrame(), "&st; &sopb" );
+
+	// perform first round
+	Gia_ManPerformRound( fIsMapped, nAnds, nLevels, nLutSize, nCutNum, nRelaxRatio, fVerbose );
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Gia_ManAigSynch2( Gia_Man_t * p, int fVerbose )
+{
+    return NULL;
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/aig/gia/giaSopb.c b/abc-build/src/aig/gia/giaSopb.c
deleted file mode 100644
--- a/abc-build/src/aig/gia/giaSopb.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/**CFile****************************************************************
-
-  FileName    [giaSopb.c]
-
-  SystemName  [ABC: Logic synthesis and verification system.]
-
-  PackageName [Scalable AIG package.]
-
-  Synopsis    [SOP balancing for a window.]
-
-  Author      [Alan Mishchenko]
-  
-  Affiliation [UC Berkeley]
-
-  Date        [Ver. 1.0. Started - June 20, 2005.]
-
-  Revision    [$Id: giaSopb.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]
-
-***********************************************************************/
-
-#include "gia.h"
-
-ABC_NAMESPACE_IMPL_START
-
-
-////////////////////////////////////////////////////////////////////////
-///                        DECLARATIONS                              ///
-////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////
-///                     FUNCTION DEFINITIONS                         ///
-////////////////////////////////////////////////////////////////////////
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Gia_ManHighlight_rec( Gia_Man_t * p, int iObj )
-{
-    Gia_Obj_t * pObj;
-    if ( Gia_ObjIsTravIdCurrentId(p, iObj) )
-        return;
-    Gia_ObjSetTravIdCurrentId(p, iObj);
-    pObj = Gia_ManObj( p, iObj );
-    if ( Gia_ObjIsAnd(pObj) )
-        Gia_ManHighlight_rec( p, Gia_ObjFaninId0(pObj, iObj) );
-    if ( Gia_ObjIsAnd(pObj) )
-        Gia_ManHighlight_rec( p, Gia_ObjFaninId1(pObj, iObj) );
-}
-void Gia_ManPrepareWin( Gia_Man_t * p, Vec_Int_t * vOuts, Vec_Int_t ** pvPis, Vec_Int_t ** pvPos, Vec_Int_t ** pvAnds )
-{
-    Gia_Obj_t * pObj;
-    int i;
-    // mark the section
-    Gia_ManIncrementTravId( p );
-    Gia_ManForEachCoVec( vOuts, p, pObj, i )
-        Gia_ManHighlight_rec( p, Gia_ObjFaninId0p(p, pObj) );
-    // mark fanins of the outside area
-    Gia_ManCleanMark0( p );
-    Gia_ManForEachObj1( p, pObj, i )
-    {
-        if ( Gia_ObjIsCi(pObj) )
-            continue;
-        if ( Gia_ObjIsAnd(pObj) && !Gia_ObjIsTravIdCurrentId(p, i) )
-            continue;
-        Gia_ObjFanin0(pObj)->fMark0 = 1;
-        if ( Gia_ObjIsAnd(pObj) )
-            Gia_ObjFanin1(pObj)->fMark0 = 1;
-    }
-    // collect pointed nodes
-    *pvPis  = Vec_IntAlloc( 1000 );
-    *pvPos  = Vec_IntAlloc( 1000 );
-    *pvAnds = Vec_IntAlloc( 1000 );
-    Gia_ManForEachObj1( p, pObj, i )
-    {
-        if ( !Gia_ObjIsTravIdCurrentId(p, i) )
-            continue;
-        if ( Gia_ObjIsCi(pObj) )
-            Vec_IntPush( *pvPis, i );
-        else if ( pObj->fMark0 )
-            Vec_IntPush( *pvPos, i );
-        if ( Gia_ObjIsAnd(pObj) )
-            Vec_IntPush( *pvAnds, i );
-    }
-    Gia_ManCleanMark0( p );
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Gia_Man_t * Gia_ManExtractWin( Gia_Man_t * p, Vec_Int_t * vOuts )
-{
-    Vec_Int_t * vPis, * vPos, * vAnds;
-    Gia_Man_t * pNew;
-    Gia_Obj_t * pObj;
-    int i;
-    Gia_ManPrepareWin( p, vOuts, &vPis, &vPos, &vAnds );
-    // create AIG
-    pNew = Gia_ManStart( Vec_IntSize(vPis) + Vec_IntSize(vPos) + Vec_IntSize(vAnds) + 1 );
-    pNew->pName = Abc_UtilStrsav( p->pName );
-    Gia_ManConst0(p)->Value = 0;
-    Gia_ManForEachObjVec( vPis, p, pObj, i )
-        pObj->Value = Gia_ManAppendCi( pNew );
-    Gia_ManForEachObjVec( vAnds, p, pObj, i )
-        pObj->Value = Gia_ManAppendAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
-    Gia_ManForEachObjVec( vPos, p, pObj, i )
-        Gia_ManAppendCo( pNew, pObj->Value );
-    Vec_IntFree( vPis );
-    Vec_IntFree( vPos );
-    Vec_IntFree( vAnds );
-    return pNew;
-}
-Gia_Man_t * Gia_ManInsertWin( Gia_Man_t * p, Vec_Int_t * vOuts, Gia_Man_t * pWin )
-{
-    Vec_Int_t * vPos, * vPis, * vAnds;
-    Gia_Man_t * pNew, * pTemp;
-    Gia_Obj_t * pObj;
-    int i;
-    Gia_ManPrepareWin( p, vOuts, &vPis, &vPos, &vAnds );
-    // create AIG
-    pNew = Gia_ManStart( Gia_ManObjNum(p) - Vec_IntSize(vAnds) + Gia_ManAndNum(pWin) );
-    pNew->pName = Abc_UtilStrsav( p->pName );
-    pNew->pSpec = Abc_UtilStrsav( p->pSpec );
-    // inputs
-    Gia_ManConst0(p)->Value = 0;
-    Gia_ManForEachCi( p, pObj, i )
-        pObj->Value = Gia_ManAppendCi( pNew );
-    Gia_ManConst0(pWin)->Value = 0;
-    Gia_ManForEachCi( pWin, pObj, i )
-        pObj->Value = Gia_ManObj(p, Vec_IntEntry(vPis, i))->Value;
-    // internal nodes
-    Gia_ManHashAlloc( pNew );
-    Gia_ManForEachAnd( pWin, pObj, i )
-        pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
-    Gia_ManForEachCo( pWin, pObj, i )
-        Gia_ManObj( p, Vec_IntEntry(vPos, i) )->Value = Gia_ObjFanin0Copy(pObj);
-    Gia_ManForEachAnd( p, pObj, i )
-        if ( !Gia_ObjIsTravIdCurrentId(p, i) )
-            pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
-    Gia_ManForEachCo( p, pObj, i )
-        Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
-    Gia_ManHashStop( pNew );
-    // cleanup
-    Vec_IntFree( vPis );
-    Vec_IntFree( vPos );
-    Vec_IntFree( vAnds );
-    pNew = Gia_ManCleanup( pTemp = pNew );
-    Gia_ManStop( pTemp );
-    return pNew;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Vec_Int_t * Gia_ManFindLatest( Gia_Man_t * p, int LevelMax )
-{
-    Vec_Int_t * vOuts;
-    Gia_Obj_t * pObj;
-    int i;
-    vOuts = Vec_IntAlloc( 1000 );
-    Gia_ManForEachCo( p, pObj, i )
-        if ( Gia_ObjLevel(p, pObj) > LevelMax )
-            Vec_IntPush( vOuts, i );
-    return vOuts;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Gia_Man_t * Gia_ManPerformSopBalanceWin( Gia_Man_t * p, int LevelMax, int nLevelRatio, int nCutNum, int nRelaxRatio, int fVerbose )
-{
-    Vec_Int_t * vOuts;
-    Gia_Man_t * pNew, * pWin, * pWinNew;
-    int nLevels = Gia_ManLevelNum( p );
-    if ( nLevelRatio )
-        LevelMax = (int)((1.0 - 0.01 * nLevelRatio) * nLevels);
-//printf( "Using LevelMax = %d.\n", LevelMax );
-    vOuts = Gia_ManFindLatest( p, LevelMax );
-    if ( Vec_IntSize(vOuts) == 0 )
-    {
-        Vec_IntFree( vOuts );
-        return Gia_ManDup( p );
-    }
-    pWin = Gia_ManExtractWin( p, vOuts );
-    pWinNew = Gia_ManPerformSopBalance( pWin, nCutNum, nRelaxRatio, fVerbose );
-    Gia_ManStop( pWin );
-    pNew = Gia_ManInsertWin( p, vOuts, pWinNew );
-    Gia_ManStop( pWinNew );
-    Vec_IntFree( vOuts );
-    return pNew;
-}
-
-////////////////////////////////////////////////////////////////////////
-///                       END OF FILE                                ///
-////////////////////////////////////////////////////////////////////////
-
-
-ABC_NAMESPACE_IMPL_END
-
diff --git a/abc-build/src/aig/gia/giaSweep.c b/abc-build/src/aig/gia/giaSweep.c
--- a/abc-build/src/aig/gia/giaSweep.c
+++ b/abc-build/src/aig/gia/giaSweep.c
@@ -328,9 +328,7 @@
     Gia_ManStop( pTemp );
     // normalize the result
     pNew = Gia_ManDupNormalize( pTemp = pNew );
-    pNew->pManTime   = pTemp->pManTime;   pTemp->pManTime   = NULL;
-    pNew->pAigExtra  = pTemp->pAigExtra;  pTemp->pAigExtra  = NULL;
-    pNew->nAnd2Delay = pTemp->nAnd2Delay; pTemp->nAnd2Delay = 0;
+    Gia_ManTransferTiming( pNew, pTemp );
     Gia_ManStop( pTemp );
     // return the result
     assert( pNew->pManTime  != NULL );
diff --git a/abc-build/src/aig/gia/giaTim.c b/abc-build/src/aig/gia/giaTim.c
--- a/abc-build/src/aig/gia/giaTim.c
+++ b/abc-build/src/aig/gia/giaTim.c
@@ -486,6 +486,110 @@
 
 /**Function*************************************************************
 
+  Synopsis    [Computes level with boxes.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Gia_ManLutLevelWithBoxes_rec( Gia_Man_t * p, Gia_Obj_t * pObj )
+{
+    int iObj, k, iFan, Level = 0;
+    if ( Gia_ObjIsTravIdCurrent(p, pObj) )
+        return 0;
+    Gia_ObjSetTravIdCurrent(p, pObj);
+    if ( Gia_ObjIsCi(pObj) )
+        return 1;
+    assert( Gia_ObjIsAnd(pObj) );
+    iObj = Gia_ObjId( p, pObj );
+    Gia_LutForEachFanin( p, iObj, iFan, k )
+    {
+        if ( Gia_ManLutLevelWithBoxes_rec( p, Gia_ManObj(p, iFan) ) )
+            return 1;
+        Level = Abc_MaxInt( Level, Gia_ObjLevelId(p, iFan) );
+    }
+    Gia_ObjSetLevelId( p, iObj, Level + 1 );
+    return 0;
+}
+int Gia_ManLutLevelWithBoxes( Gia_Man_t * p )
+{
+//    int nAnd2Delay = p->nAnd2Delay ? p->nAnd2Delay : 1;
+    Tim_Man_t * pManTime = (Tim_Man_t *)p->pManTime;
+    Gia_Obj_t * pObj, * pObjIn;
+    int i, k, j, curCi, curCo, LevelMax;
+    assert( Gia_ManRegNum(p) == 0 );
+    // copy const and real PIs
+    Gia_ManCleanLevels( p, Gia_ManObjNum(p) );
+    Gia_ObjSetLevel( p, Gia_ManConst0(p), 0 );
+    Gia_ManIncrementTravId( p );
+    Gia_ObjSetTravIdCurrent( p, Gia_ManConst0(p) );
+    for ( i = 0; i < Tim_ManPiNum(pManTime); i++ )
+    {
+        pObj = Gia_ManPi( p, i );
+//        Gia_ObjSetLevel( p, pObj, Tim_ManGetCiArrival(pManTime, i) / nAnd2Delay );
+        Gia_ObjSetLevel( p, pObj, 0 );
+        Gia_ObjSetTravIdCurrent( p, pObj );
+    }
+    // create logic for each box
+    curCi = Tim_ManPiNum(pManTime);
+    curCo = 0;
+    for ( i = 0; i < Tim_ManBoxNum(pManTime); i++ )
+    {
+        int nBoxInputs  = Tim_ManBoxInputNum( pManTime, i );
+        int nBoxOutputs = Tim_ManBoxOutputNum( pManTime, i );
+        float * pDelayTable = Tim_ManBoxDelayTable( pManTime, i );
+        // compute level for TFI of box inputs
+        for ( k = 0; k < nBoxInputs; k++ )
+        {
+            pObj = Gia_ManPo( p, curCo + k );
+            if ( Gia_ManLutLevelWithBoxes_rec( p, Gia_ObjFanin0(pObj) ) )
+            {
+                printf( "Boxes are not in a topological order. Switching to level computation without boxes.\n" );
+                return Gia_ManLevelNum( p );
+            }
+            // set box input level
+            Gia_ObjSetCoLevel( p, pObj );
+        }
+        // compute level for box outputs
+        for ( k = 0; k < nBoxOutputs; k++ )
+        {
+            pObj = Gia_ManPi( p, curCi + k );
+            Gia_ObjSetTravIdCurrent( p, pObj );
+            // evaluate delay of this output
+            LevelMax = 0;
+            assert( nBoxInputs == (int)pDelayTable[1] );
+            for ( j = 0; j < nBoxInputs && (pObjIn = Gia_ManPo(p, curCo + j)); j++ )
+                if ( (int)pDelayTable[3+k*nBoxInputs+j] != -ABC_INFINITY )
+//                    LevelMax = Abc_MaxInt( LevelMax, Gia_ObjLevel(p, pObjIn) + ((int)pDelayTable[3+k*nBoxInputs+j] / nAnd2Delay) );
+                    LevelMax = Abc_MaxInt( LevelMax, Gia_ObjLevel(p, pObjIn) + 1 );
+            // set box output level
+            Gia_ObjSetLevel( p, pObj, LevelMax );
+        }
+        curCo += nBoxInputs;
+        curCi += nBoxOutputs;
+    }
+    // add remaining nodes
+    p->nLevels = 0;
+    for ( i = Tim_ManCoNum(pManTime) - Tim_ManPoNum(pManTime); i < Tim_ManCoNum(pManTime); i++ )
+    {
+        pObj = Gia_ManPo( p, i );
+        Gia_ManLutLevelWithBoxes_rec( p, Gia_ObjFanin0(pObj) );
+        Gia_ObjSetCoLevel( p, pObj );
+        p->nLevels = Abc_MaxInt( p->nLevels, Gia_ObjLevel(p, pObj) );
+    }
+    curCo += Tim_ManPoNum(pManTime);
+    // verify counts
+    assert( curCi == Gia_ManPiNum(p) );
+    assert( curCo == Gia_ManPoNum(p) );
+//    printf( "Max level is %d.\n", p->nLevels );
+    return p->nLevels;
+}
+
+/**Function*************************************************************
+
   Synopsis    [Verify XAIG against its spec.]
 
   Description []
diff --git a/abc-build/src/aig/gia/giaUtil.c b/abc-build/src/aig/gia/giaUtil.c
--- a/abc-build/src/aig/gia/giaUtil.c
+++ b/abc-build/src/aig/gia/giaUtil.c
@@ -1360,6 +1360,8 @@
     {
         Gia_ManPrintCo_rec( p, Gia_ObjFanin0(pObj) );
         Gia_ManPrintCo_rec( p, Gia_ObjFanin1(pObj) );
+        if ( Gia_ObjIsMux(p, pObj) )
+            Gia_ManPrintCo_rec( p, Gia_ObjFanin2(p, pObj) );
     }
     Gia_ObjPrint( p, pObj );
 }
@@ -1378,6 +1380,8 @@
     assert( Gia_ObjIsAnd(pObj) );
     Gia_ManPrintCollect_rec( p, Gia_ObjFanin0(pObj), vNodes );
     Gia_ManPrintCollect_rec( p, Gia_ObjFanin1(pObj), vNodes );
+    if ( Gia_ObjIsMux(p, pObj) )
+        Gia_ManPrintCollect_rec( p, Gia_ObjFanin2(p, pObj), vNodes );
     Vec_IntPush( vNodes, Gia_ObjId(p, pObj) );
 }
 void Gia_ManPrintCone( Gia_Man_t * p, Gia_Obj_t * pObj, int * pLeaves, int nLeaves, Vec_Int_t * vNodes )
@@ -1400,6 +1404,8 @@
         Gia_ManPrintCollect2_rec( p, Gia_ObjFanin0(pObj), vNodes );
     if ( Gia_ObjIsAnd(pObj) )
         Gia_ManPrintCollect2_rec( p, Gia_ObjFanin1(pObj), vNodes );
+    if ( Gia_ObjIsMux(p, pObj) )
+        Gia_ManPrintCollect2_rec( p, Gia_ObjFanin2(p, pObj), vNodes );
     Vec_IntPush( vNodes, Gia_ObjId(p, pObj) );
 }
 void Gia_ManPrintCone2( Gia_Man_t * p, Gia_Obj_t * pObj )
diff --git a/abc-build/src/aig/gia/module.make b/abc-build/src/aig/gia/module.make
--- a/abc-build/src/aig/gia/module.make
+++ b/abc-build/src/aig/gia/module.make
@@ -2,11 +2,13 @@
 	src/aig/gia/giaAgi.c \
 	src/aig/gia/giaAiger.c \
 	src/aig/gia/giaAigerExt.c \
-	src/aig/gia/giaBalance.c \
-	src/aig/gia/giaBalance2.c \
+	src/aig/gia/giaBalAig.c \
+	src/aig/gia/giaBalLut.c \
+	src/aig/gia/giaBalMap.c \
 	src/aig/gia/giaBidec.c \
 	src/aig/gia/giaCCof.c \
 	src/aig/gia/giaCex.c \
+	src/aig/gia/giaClp.c \
 	src/aig/gia/giaCof.c \
 	src/aig/gia/giaCone.c \
 	src/aig/gia/giaCSatOld.c \
@@ -47,12 +49,12 @@
 	src/aig/gia/giaResub.c \
 	src/aig/gia/giaRetime.c \
 	src/aig/gia/giaScl.c \
+	src/aig/gia/giaScript.c \
 	src/aig/gia/giaShrink.c \
 	src/aig/gia/giaShrink6.c \
 	src/aig/gia/giaShrink7.c \
 	src/aig/gia/giaSim.c \
 	src/aig/gia/giaSim2.c \
-	src/aig/gia/giaSopb.c \
 	src/aig/gia/giaSort.c \
 	src/aig/gia/giaSpeedup.c \
 	src/aig/gia/giaStg.c \
diff --git a/abc-build/src/base/abc/abcFunc.c b/abc-build/src/base/abc/abcFunc.c
--- a/abc-build/src/base/abc/abcFunc.c
+++ b/abc-build/src/base/abc/abcFunc.c
@@ -32,7 +32,7 @@
 
 #define ABC_MUX_CUBES   100000
 
-static int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover, char * pSop, int nFanins, Vec_Str_t * vCube, int fPhase );
+int Abc_ConvertZddToSop( DdManager * dd, DdNode * zCover, char * pSop, int nFanins, Vec_Str_t * vCube, int fPhase );
 static DdNode * Abc_ConvertAigToBdd( DdManager * dd, Hop_Obj_t * pRoot);
 static Hop_Obj_t * Abc_ConvertSopToAig( Hop_Man_t * pMan, char * pSop );
 
diff --git a/abc-build/src/base/abc/abcNames.c b/abc-build/src/base/abc/abcNames.c
--- a/abc-build/src/base/abc/abcNames.c
+++ b/abc-build/src/base/abc/abcNames.c
@@ -496,6 +496,33 @@
     Abc_NtkAddDummyBoxNames( pNtk );
 }
 
+/**Function*************************************************************
+
+  Synopsis    [Moves names from the other network.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_NtkMoveNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pOld )
+{
+    Abc_Obj_t * pObj; int i;
+    Nm_ManFree( pNtk->pManName );
+    pNtk->pManName = Nm_ManCreate( Abc_NtkCiNum(pNtk) + Abc_NtkCoNum(pNtk) + Abc_NtkBoxNum(pNtk) );
+    Abc_NtkForEachPi( pNtk, pObj, i )
+        Abc_ObjAssignName( pObj, Abc_ObjName(Abc_NtkPi(pOld, i)), NULL );
+    Abc_NtkForEachPo( pNtk, pObj, i )
+        Abc_ObjAssignName( pObj, Abc_ObjName(Abc_NtkPo(pOld, i)), NULL );
+    Abc_NtkForEachLatch( pNtk, pObj, i )
+    {
+        Abc_ObjAssignName( Abc_ObjFanin0(pObj),  Abc_ObjName(Abc_ObjFanin0(Abc_NtkBox(pOld, i))),  NULL );
+        Abc_ObjAssignName( Abc_ObjFanout0(pObj), Abc_ObjName(Abc_ObjFanout0(Abc_NtkBox(pOld, i))), NULL );
+    }
+}
+
 
 /**Function*************************************************************
 
diff --git a/abc-build/src/base/abc/abcShow.c b/abc-build/src/base/abc/abcShow.c
--- a/abc-build/src/base/abc/abcShow.c
+++ b/abc-build/src/base/abc/abcShow.c
@@ -307,12 +307,14 @@
 #ifdef WIN32
     _unlink( FileNameDot );
     if ( _spawnl( _P_NOWAIT, pGsNameWin, pGsNameWin, FileNamePs, NULL ) == -1 )
-        if ( _spawnl( _P_NOWAIT, "C:\\Program Files\\Ghostgum\\gsview\\gsview32.exe", 
-            "C:\\Program Files\\Ghostgum\\gsview\\gsview32.exe", FileNamePs, NULL ) == -1 )
-        {
-            fprintf( stdout, "Cannot find \"%s\".\n", pGsNameWin );
-            return;
-        }
+        if ( _spawnl( _P_NOWAIT, "C:\\Program Files\\Ghostgum\\gsview\\gsview32.exe", 
+            "C:\\Program Files\\Ghostgum\\gsview\\gsview32.exe", FileNamePs, NULL ) == -1 )
+			if ( _spawnl( _P_NOWAIT, "C:\\Program Files\\Ghostgum\\gsview\\gsview64.exe", 
+				"C:\\Program Files\\Ghostgum\\gsview\\gsview64.exe", FileNamePs, NULL ) == -1 )
+			{
+				fprintf( stdout, "Cannot find \"%s\".\n", pGsNameWin );
+				return;
+			}
 #else
     {
         char CommandPs[1000];
diff --git a/abc-build/src/base/abci/abc.c b/abc-build/src/base/abci/abc.c
--- a/abc-build/src/base/abci/abc.c
+++ b/abc-build/src/base/abci/abc.c
@@ -103,33891 +103,34699 @@
 static int Abc_CommandFastExtract            ( Abc_Frame_t * pAbc, int argc, char ** argv );
 static int Abc_CommandEliminate              ( Abc_Frame_t * pAbc, int argc, char ** argv );
 static int Abc_CommandDisjoint               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandLutpack                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandLutmin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandImfs                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandMfs                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandMfs2                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTrace                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSpeedup                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandPowerdown              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAddBuffs               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandMerge                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTestDec                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTestNpn                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTestRPO                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandRewrite                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRefactor               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRestructure            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandResubstitute           ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRr                     ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCascade                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandExtract                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandVarMin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandLogic                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandComb                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandMiter                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDemiter                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandOrPos                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAndPos                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandZeroPo                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSwapPos                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRemovePo               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDropSat                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAddPi                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAppend                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandPutOnTop               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFrames                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDFrames                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSop                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBdd                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAig                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandReorder                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBidec                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandOrder                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandMuxes                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCubes                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSplitSop               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandExtSeqDcs              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandReach                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCone                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandNode                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTopmost                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTopAnd                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTrim                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandShortNames             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandExdcFree               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandExdcGet                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandExdcSet                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCareSet                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCut                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandEspresso               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandGen                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandGenFsm                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCover                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDouble                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandInter                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBb2Wb                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandOutdec                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandNodeDup                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTestColor              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTest                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandQuaVar                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandQuaRel                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandQuaReach               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSenseInput             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandNpnLoad                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandNpnSave                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandSendAig                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSendStatus             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandIStrash                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandICut                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIRewrite               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDRewrite               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDRefactor              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDc2                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDChoice                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDch                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDrwsat                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIRewriteSeq            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIResyn                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandISat                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIFraig                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDFraig                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCSweep                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDProve                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbSec                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSimSec                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandMatch                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandHaig                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandQbf                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandFraig                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFraigTrust             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFraigStore             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFraigRestore           ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFraigClean             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFraigSweep             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFraigDress             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandRecStart3              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRecStop3               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRecPs3                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRecAdd3                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRecDump3               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRecMerge3              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandMap                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAmap                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandUnmap                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAttach                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSuperChoice            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSuperChoiceLut         ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-//static int Abc_CommandFpga                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandFpgaFast               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIf                     ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIfif                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandDsdSave                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDsdLoad                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDsdFree                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDsdPs                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDsdTune                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDsdMerge               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDsdClean               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandScut                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandInit                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandZero                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandUndc                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandOneHot                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandPipe                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSeq                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandUnseq                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandRetime                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDRetime                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFlowRetime             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCRetime                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSeqFpga                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSeqMap                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSeqSweep               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSeqSweep2              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTestSeqSweep           ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTestScorr              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandLcorr                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSeqCleanup             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCycle                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandXsim                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSim                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSim3                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDarPhase               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSynch                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandClockGate              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandExtWin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandInsWin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandPermute                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandUnpermute              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCubeEnum               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandCec                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDCec                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDSec                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSat                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDSat                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandPSat                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandProve                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIProve                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDebug                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBmc                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBmc2                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBmc3                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBmcInter               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIndcut                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandEnlarge                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTempor                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandInduction              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandConstr                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandUnfold                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFold                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandUnfold2                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandFold2                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBm                     ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBm2                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandSaucy                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTestCex                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandPdr                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandReconcile              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCexSave                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCexLoad                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCexCut                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandCexMerge               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandCexMin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandDualRail               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandBlockPo                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandIso                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandTraceStart             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandTraceCheck             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandAbc9Get                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Put                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Read               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9ReadBlif           ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9ReadCBlif          ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9ReadStg            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Write              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Ps                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9PFan               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9PSig               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Status             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9MuxProfile         ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Show               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Strash             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Topand             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Add1Hot            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Cof                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Trim               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Dfs                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Sim                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Sim3               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Resim              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9SpecI              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Equiv              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Equiv2             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Equiv3             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Semi               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Times              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Frames             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Retime             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Enable             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Dc2                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Bidec              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Shrink             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Fx                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Balance            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9BalanceLut         ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Syn2               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Syn3               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Syn4               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9False              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Miter              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Miter2             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Append             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Scl                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Lcorr              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Scorr              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Choice             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Sat                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Fraig              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9CFraig             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Srm                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Srm2               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Filter             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Reduce             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9EquivMark          ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9EquivFilter        ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Cec                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Verify             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Sweep              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Force              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Embed              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Sopb               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9If                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Iff                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9If2                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Jf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Kf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Lf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Mf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Nf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Struct             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Trace              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Speedup            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Era                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Dch                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Rpm                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9BackReach          ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Posplit            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9ReachM             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9ReachP             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9ReachN             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9ReachY             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Undo               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Iso                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9CexInfo            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Cycle              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Cone               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Slice              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9PoPart             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9GroupProve         ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9MultiProve         ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9SplitProve         ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Bmc                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9BCore              ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9ICheck             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9SatTest            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9FFTest             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Inse               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Maxi               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Bmci               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9PoXsim             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Demiter            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandAbc9PoPart2            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandAbc9CexCut             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandAbc9CexMerge           ( Abc_Frame_t * pAbc, int argc, char ** argv );
-//static int Abc_CommandAbc9CexMin             ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandAbc9AbsDerive          ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9AbsRefine          ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9GlaDerive          ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9GlaRefine          ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9GlaShrink          ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Gla                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Vta                ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Vta2Gla            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Gla2Vta            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Fla2Gla            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-static int Abc_CommandAbc9Gla2Fla            ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-static int Abc_CommandAbc9Test               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-extern int Abc_CommandAbcLivenessToSafety    ( Abc_Frame_t * pAbc, int argc, char ** argv );
-extern int Abc_CommandAbcLivenessToSafetySim ( Abc_Frame_t * pAbc, int argc, char ** argv );
-extern int Abc_CommandAbcLivenessToSafetyWithLTL( Abc_Frame_t * pAbc, int argc, char ** argv );
-extern int Abc_CommandCS_kLiveness           ( Abc_Frame_t * pAbc, int argc, char ** argv );
-extern int Abc_CommandNChooseK               ( Abc_Frame_t * pAbc, int argc, char ** argv );
-
-extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
-extern Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan );
-
-////////////////////////////////////////////////////////////////////////
-///                     FUNCTION DEFINITIONS                         ///
-////////////////////////////////////////////////////////////////////////
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Abc_FrameReplaceCex( Abc_Frame_t * pAbc, Abc_Cex_t ** ppCex )
-{
-    // update CEX
-    ABC_FREE( pAbc->pCex );
-    pAbc->pCex = *ppCex;
-    *ppCex = NULL;
-    // remove CEX vector
-    if ( pAbc->vCexVec )
-    {
-        Vec_PtrFreeFree( pAbc->vCexVec );
-        pAbc->vCexVec = NULL;
-    }
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Abc_FrameReplaceCexVec( Abc_Frame_t * pAbc, Vec_Ptr_t ** pvCexVec )
-{
-    // update CEX vector
-    if ( pAbc->vCexVec )
-        Vec_PtrFreeFree( pAbc->vCexVec );
-    pAbc->vCexVec = *pvCexVec;
-    *pvCexVec = NULL;
-    // remove CEX
-    ABC_FREE( pAbc->pCex );
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Abc_FrameReplacePoEquivs( Abc_Frame_t * pAbc, Vec_Ptr_t ** pvPoEquivs )
-{
-    if ( pAbc->vPoEquivs )
-        Vec_VecFree( (Vec_Vec_t *)pAbc->vPoEquivs );
-    pAbc->vPoEquivs = *pvPoEquivs;
-    *pvPoEquivs = NULL;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Abc_FrameReplacePoStatuses( Abc_Frame_t * pAbc, Vec_Int_t ** pvStatuses )
-{
-    if ( pAbc->vStatuses )
-        Vec_IntFree( pAbc->vStatuses );
-    pAbc->vStatuses = *pvStatuses;
-    *pvStatuses = NULL;
-}
-
-/**Function*************************************************************
-
-  Synopsis    [Derives array of statuses from the array of CEXes.]
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Vec_Int_t * Abc_FrameDeriveStatusArray( Vec_Ptr_t * vCexes )
-{
-    Vec_Int_t * vStatuses;
-    Abc_Cex_t * pCex;
-    int i;
-    if ( vCexes == NULL )
-        return NULL;
-    vStatuses = Vec_IntAlloc( Vec_PtrSize(vCexes) );
-    Vec_IntFill( vStatuses, Vec_PtrSize(vCexes), -1 ); // assume UNDEC
-    Vec_PtrForEachEntry( Abc_Cex_t *, vCexes, pCex, i )
-        if ( pCex != NULL )
-            Vec_IntWriteEntry( vStatuses, i, 0 ); // set this output as SAT
-    return vStatuses;    
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Abc_FrameClearDesign()
-{
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Abc_FrameUpdateGia( Abc_Frame_t * pAbc, Gia_Man_t * pNew )
-{
-    if ( pNew == NULL )
-    {
-        Abc_Print( -1, "Abc_FrameUpdateGia(): Tranformation has failed.\n" );
-        return;
-    }
-    if ( Gia_ManPoNum(pNew) == 0 )
-        Abc_Print( 0, "The current GIA has no primary outputs. Some commands may not work correctly.\n" );
-    if ( pNew == pAbc->pGia )
-        return;
-    // transfer names
-    if (!pNew->vNamesIn && pAbc->pGia && pAbc->pGia->vNamesIn && Gia_ManCiNum(pNew) == Vec_PtrSize(pAbc->pGia->vNamesIn))
-    {
-        pNew->vNamesIn = pAbc->pGia->vNamesIn;
-        pAbc->pGia->vNamesIn = NULL;
-    }
-    if (!pNew->vNamesOut && pAbc->pGia && pAbc->pGia->vNamesOut && Gia_ManCoNum(pNew) == Vec_PtrSize(pAbc->pGia->vNamesOut))
-    {
-        pNew->vNamesOut = pAbc->pGia->vNamesOut;
-        pAbc->pGia->vNamesOut = NULL;
-    }
-    // update
-    if ( pAbc->pGia2 )
-        Gia_ManStop( pAbc->pGia2 );
-    pAbc->pGia2 = pAbc->pGia;
-    pAbc->pGia  = pNew;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-Gia_Man_t * Abc_FrameGetGia( Abc_Frame_t * pAbc )
-{
-    Gia_Man_t * pGia;
-    if ( pAbc->pGia2 )
-        Gia_ManStop( pAbc->pGia2 );
-    pAbc->pGia2 = NULL;
-    pGia = pAbc->pGia;
-    pAbc->pGia = NULL;
-    return pGia;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Abc_Init( Abc_Frame_t * pAbc )
-{
-    Cmd_CommandAdd( pAbc, "Printing",     "print_stats",   Abc_CommandPrintStats,       0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_exdc",    Abc_CommandPrintExdc,        0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_io",      Abc_CommandPrintIo,          0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_latch",   Abc_CommandPrintLatch,       0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_fanio",   Abc_CommandPrintFanio,       0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_mffc",    Abc_CommandPrintMffc,        0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_factor",  Abc_CommandPrintFactor,      0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_level",   Abc_CommandPrintLevel,       0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_supp",    Abc_CommandPrintSupport,     0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_symm",    Abc_CommandPrintSymms,       0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_unate",   Abc_CommandPrintUnate,       0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_auto",    Abc_CommandPrintAuto,        0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_kmap",    Abc_CommandPrintKMap,        0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_gates",   Abc_CommandPrintGates,       0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_sharing", Abc_CommandPrintSharing,     0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_xcut",    Abc_CommandPrintXCut,        0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_dsd",     Abc_CommandPrintDsd,         0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_cone",    Abc_CommandPrintCone,        0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_miter",   Abc_CommandPrintMiter,       0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_status",  Abc_CommandPrintStatus,      0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "print_delay",   Abc_CommandPrintDelay,       0 );
-
-    Cmd_CommandAdd( pAbc, "Printing",     "show",          Abc_CommandShow,             0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "show_bdd",      Abc_CommandShowBdd,          0 );
-    Cmd_CommandAdd( pAbc, "Printing",     "show_cut",      Abc_CommandShowCut,          0 );
-
-    Cmd_CommandAdd( pAbc, "Synthesis",    "collapse",      Abc_CommandCollapse,         1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "strash",        Abc_CommandStrash,           1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "balance",       Abc_CommandBalance,          1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "mux_struct",    Abc_CommandMuxStruct,        1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "multi",         Abc_CommandMulti,            1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "renode",        Abc_CommandRenode,           1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "cleanup",       Abc_CommandCleanup,          1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "sweep",         Abc_CommandSweep,            1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "fx",            Abc_CommandFastExtract,      1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "eliminate",     Abc_CommandEliminate,        1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "dsd",           Abc_CommandDisjoint,         1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "lutpack",       Abc_CommandLutpack,          1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "lutmin",        Abc_CommandLutmin,           1 );
-//    Cmd_CommandAdd( pAbc, "Synthesis",    "imfs",          Abc_CommandImfs,             1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "mfs",           Abc_CommandMfs,              1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "mfs2",          Abc_CommandMfs2,             1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "trace",         Abc_CommandTrace,            0 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "speedup",       Abc_CommandSpeedup,          1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "powerdown",     Abc_CommandPowerdown,        1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "addbuffs",      Abc_CommandAddBuffs,         1 );
-//    Cmd_CommandAdd( pAbc, "Synthesis",    "merge",         Abc_CommandMerge,            1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "testdec",       Abc_CommandTestDec,          0 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "testnpn",       Abc_CommandTestNpn,          0 );
-    Cmd_CommandAdd( pAbc, "LogiCS",       "testrpo",       Abc_CommandTestRPO,          0 );
-
-    Cmd_CommandAdd( pAbc, "Synthesis",    "rewrite",       Abc_CommandRewrite,          1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "refactor",      Abc_CommandRefactor,         1 );
-//    Cmd_CommandAdd( pAbc, "Synthesis",    "restructure",   Abc_CommandRestructure,      1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "resub",         Abc_CommandResubstitute,     1 );
-//    Cmd_CommandAdd( pAbc, "Synthesis",    "rr",            Abc_CommandRr,               1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "cascade",       Abc_CommandCascade,          1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "extract",       Abc_CommandExtract,          1 );
-    Cmd_CommandAdd( pAbc, "Synthesis",    "varmin",        Abc_CommandVarMin,           0 );
-
-    Cmd_CommandAdd( pAbc, "Various",      "logic",         Abc_CommandLogic,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "comb",          Abc_CommandComb,             1 );
-    Cmd_CommandAdd( pAbc, "Various",      "miter",         Abc_CommandMiter,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "demiter",       Abc_CommandDemiter,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "orpos",         Abc_CommandOrPos,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "andpos",        Abc_CommandAndPos,           1 );
-    Cmd_CommandAdd( pAbc, "Various",      "zeropo",        Abc_CommandZeroPo,           1 );
-    Cmd_CommandAdd( pAbc, "Various",      "swappos",       Abc_CommandSwapPos,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "removepo",      Abc_CommandRemovePo,         1 );
-    Cmd_CommandAdd( pAbc, "Various",      "dropsat",       Abc_CommandDropSat,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "addpi",         Abc_CommandAddPi,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "append",        Abc_CommandAppend,           1 );
-    Cmd_CommandAdd( pAbc, "Various",      "putontop",      Abc_CommandPutOnTop,         1 );
-    Cmd_CommandAdd( pAbc, "Various",      "frames",        Abc_CommandFrames,           1 );
-    Cmd_CommandAdd( pAbc, "Various",      "dframes",       Abc_CommandDFrames,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "sop",           Abc_CommandSop,              0 );
-    Cmd_CommandAdd( pAbc, "Various",      "bdd",           Abc_CommandBdd,              0 );
-    Cmd_CommandAdd( pAbc, "Various",      "aig",           Abc_CommandAig,              0 );
-    Cmd_CommandAdd( pAbc, "Various",      "reorder",       Abc_CommandReorder,          0 );
-    Cmd_CommandAdd( pAbc, "Various",      "bidec",         Abc_CommandBidec,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "order",         Abc_CommandOrder,            0 );
-    Cmd_CommandAdd( pAbc, "Various",      "muxes",         Abc_CommandMuxes,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "cubes",         Abc_CommandCubes,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "splitsop",      Abc_CommandSplitSop,         1 );
-    Cmd_CommandAdd( pAbc, "Various",      "ext_seq_dcs",   Abc_CommandExtSeqDcs,        0 );
-    Cmd_CommandAdd( pAbc, "Various",      "reach",         Abc_CommandReach,            0 );
-    Cmd_CommandAdd( pAbc, "Various",      "cone",          Abc_CommandCone,             1 );
-    Cmd_CommandAdd( pAbc, "Various",      "node",          Abc_CommandNode,             1 );
-    Cmd_CommandAdd( pAbc, "Various",      "topmost",       Abc_CommandTopmost,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "topand",        Abc_CommandTopAnd,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "trim",          Abc_CommandTrim,             1 );
-    Cmd_CommandAdd( pAbc, "Various",      "short_names",   Abc_CommandShortNames,       0 );
-    Cmd_CommandAdd( pAbc, "Various",      "exdc_free",     Abc_CommandExdcFree,         1 );
-    Cmd_CommandAdd( pAbc, "Various",      "exdc_get",      Abc_CommandExdcGet,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "exdc_set",      Abc_CommandExdcSet,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "care_set",      Abc_CommandCareSet,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "cut",           Abc_CommandCut,              0 );
-    Cmd_CommandAdd( pAbc, "Various",      "espresso",      Abc_CommandEspresso,         1 );
-    Cmd_CommandAdd( pAbc, "Various",      "gen",           Abc_CommandGen,              0 );
-    Cmd_CommandAdd( pAbc, "Various",      "genfsm",        Abc_CommandGenFsm,           0 );
-    Cmd_CommandAdd( pAbc, "Various",      "cover",         Abc_CommandCover,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "double",        Abc_CommandDouble,           1 );
-    Cmd_CommandAdd( pAbc, "Various",      "inter",         Abc_CommandInter,            1 );
-    Cmd_CommandAdd( pAbc, "Various",      "bb2wb",         Abc_CommandBb2Wb,            0 );
-    Cmd_CommandAdd( pAbc, "Various",      "outdec",        Abc_CommandOutdec,           1 );
-    Cmd_CommandAdd( pAbc, "Various",      "nodedup",       Abc_CommandNodeDup,          1 );
-    Cmd_CommandAdd( pAbc, "Various",      "testcolor",     Abc_CommandTestColor,        0 );
-    Cmd_CommandAdd( pAbc, "Various",      "test",          Abc_CommandTest,             0 );
-//    Cmd_CommandAdd( pAbc, "Various",      "qbf_solve",     Abc_CommandTest,               0 );
-
-    Cmd_CommandAdd( pAbc, "Various",      "qvar",          Abc_CommandQuaVar,           1 );
-    Cmd_CommandAdd( pAbc, "Various",      "qrel",          Abc_CommandQuaRel,           1 );
-    Cmd_CommandAdd( pAbc, "Various",      "qreach",        Abc_CommandQuaReach,         1 );
-    Cmd_CommandAdd( pAbc, "Various",      "senseinput",    Abc_CommandSenseInput,       1 );
-    Cmd_CommandAdd( pAbc, "Various",      "npnload",       Abc_CommandNpnLoad,          0 );
-    Cmd_CommandAdd( pAbc, "Various",      "npnsave",       Abc_CommandNpnSave,          0 );
-
-    Cmd_CommandAdd( pAbc, "Various",      "send_aig",      Abc_CommandSendAig,          0 );
-    Cmd_CommandAdd( pAbc, "Various",      "send_status",   Abc_CommandSendStatus,       0 );
-
-    Cmd_CommandAdd( pAbc, "New AIG",      "istrash",       Abc_CommandIStrash,          1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "icut",          Abc_CommandICut,             0 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "irw",           Abc_CommandIRewrite,         1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "drw",           Abc_CommandDRewrite,         1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "drf",           Abc_CommandDRefactor,        1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "dc2",           Abc_CommandDc2,              1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "dchoice",       Abc_CommandDChoice,          1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "dch",           Abc_CommandDch,              1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "drwsat",        Abc_CommandDrwsat,           1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "irws",          Abc_CommandIRewriteSeq,      1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "iresyn",        Abc_CommandIResyn,           1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "isat",          Abc_CommandISat,             1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "ifraig",        Abc_CommandIFraig,           1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "dfraig",        Abc_CommandDFraig,           1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "csweep",        Abc_CommandCSweep,           1 );
-//    Cmd_CommandAdd( pAbc, "New AIG",      "haig",          Abc_CommandHaig,             1 );
-    Cmd_CommandAdd( pAbc, "New AIG",      "qbf",           Abc_CommandQbf,              0 );
-
-    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig",         Abc_CommandFraig,            1 );
-    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_trust",   Abc_CommandFraigTrust,       1 );
-    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_store",   Abc_CommandFraigStore,       0 );
-    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_restore", Abc_CommandFraigRestore,     1 );
-    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_clean",   Abc_CommandFraigClean,       0 );
-    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_sweep",   Abc_CommandFraigSweep,       1 );
-    Cmd_CommandAdd( pAbc, "Fraiging",     "dress",         Abc_CommandFraigDress,       1 );
-
-    Cmd_CommandAdd( pAbc, "Choicing",     "rec_start3",    Abc_CommandRecStart3,        0 );
-    Cmd_CommandAdd( pAbc, "Choicing",     "rec_stop3",     Abc_CommandRecStop3,         0 );
-    Cmd_CommandAdd( pAbc, "Choicing",     "rec_ps3",       Abc_CommandRecPs3,           0 );
-    Cmd_CommandAdd( pAbc, "Choicing",     "rec_add3",      Abc_CommandRecAdd3,          0 );
-    Cmd_CommandAdd( pAbc, "Choicing",     "rec_dump3",     Abc_CommandRecDump3,         0 );
-    Cmd_CommandAdd( pAbc, "Choicing",     "rec_merge3",    Abc_CommandRecMerge3,        0 );
-
-    Cmd_CommandAdd( pAbc, "SC mapping",   "map",           Abc_CommandMap,              1 );
-    Cmd_CommandAdd( pAbc, "SC mapping",   "amap",          Abc_CommandAmap,             1 );
-    Cmd_CommandAdd( pAbc, "SC mapping",   "unmap",         Abc_CommandUnmap,            1 );
-    Cmd_CommandAdd( pAbc, "SC mapping",   "attach",        Abc_CommandAttach,           1 );
-    Cmd_CommandAdd( pAbc, "SC mapping",   "superc",        Abc_CommandSuperChoice,      1 );
-    Cmd_CommandAdd( pAbc, "SC mapping",   "supercl",       Abc_CommandSuperChoiceLut,   1 );
-
-//    Cmd_CommandAdd( pAbc, "FPGA mapping", "fpga",          Abc_CommandFpga,             1 );
-//    Cmd_CommandAdd( pAbc, "FPGA mapping", "ffpga",         Abc_CommandFpgaFast,         1 );
-    Cmd_CommandAdd( pAbc, "FPGA mapping", "if",            Abc_CommandIf,               1 );
-    Cmd_CommandAdd( pAbc, "FPGA mapping", "ifif",          Abc_CommandIfif,             1 );
-
-    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_save",      Abc_CommandDsdSave,          0 );
-    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_load",      Abc_CommandDsdLoad,          0 );
-    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_free",      Abc_CommandDsdFree,          0 );
-    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_ps",        Abc_CommandDsdPs,            0 );
-    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_tune",      Abc_CommandDsdTune,          0 );
-    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_merge",     Abc_CommandDsdMerge,         0 );
-    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_clean",     Abc_CommandDsdClean,         0 );
-
-//    Cmd_CommandAdd( pAbc, "Sequential",   "scut",          Abc_CommandScut,             0 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "init",          Abc_CommandInit,             1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "zero",          Abc_CommandZero,             1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "undc",          Abc_CommandUndc,             1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "onehot",        Abc_CommandOneHot,           1 );
-//    Cmd_CommandAdd( pAbc, "Sequential",   "pipe",          Abc_CommandPipe,             1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "retime",        Abc_CommandRetime,           1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "dretime",       Abc_CommandDRetime,          1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "fretime",       Abc_CommandFlowRetime,       1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "cretime",       Abc_CommandCRetime,          1 );
-//    Cmd_CommandAdd( pAbc, "Sequential",   "sfpga",         Abc_CommandSeqFpga,          1 );
-//    Cmd_CommandAdd( pAbc, "Sequential",   "smap",          Abc_CommandSeqMap,           1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "ssweep",        Abc_CommandSeqSweep,         1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "scorr",         Abc_CommandSeqSweep2,        1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "testssw",       Abc_CommandTestSeqSweep,     0 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "testscorr",     Abc_CommandTestScorr,        0 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "lcorr",         Abc_CommandLcorr,            1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "scleanup",      Abc_CommandSeqCleanup,       1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "cycle",         Abc_CommandCycle,            1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "xsim",          Abc_CommandXsim,             0 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "sim",           Abc_CommandSim,              0 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "sim3",          Abc_CommandSim3,             0 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "phase",         Abc_CommandDarPhase,         1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "synch",         Abc_CommandSynch,            1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "clockgate",     Abc_CommandClockGate,        1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "extwin",        Abc_CommandExtWin,           1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "inswin",        Abc_CommandInsWin,           1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "permute",       Abc_CommandPermute,          1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "unpermute",     Abc_CommandUnpermute,        1 );
-    Cmd_CommandAdd( pAbc, "Sequential",   "cubeenum",      Abc_CommandCubeEnum,         0 );
-
-    Cmd_CommandAdd( pAbc, "Verification", "cec",           Abc_CommandCec,              0 );
-    Cmd_CommandAdd( pAbc, "Verification", "dcec",          Abc_CommandDCec,             0 );
-    Cmd_CommandAdd( pAbc, "Verification", "dsec",          Abc_CommandDSec,             0 );
-    Cmd_CommandAdd( pAbc, "Verification", "dprove",        Abc_CommandDProve,           0 );
-    Cmd_CommandAdd( pAbc, "Verification", "absec",         Abc_CommandAbSec,            0 );
-    Cmd_CommandAdd( pAbc, "Verification", "simsec",        Abc_CommandSimSec,           0 );
-    Cmd_CommandAdd( pAbc, "Verification", "match",         Abc_CommandMatch,            0 );
-    Cmd_CommandAdd( pAbc, "Verification", "sat",           Abc_CommandSat,              0 );
-    Cmd_CommandAdd( pAbc, "Verification", "dsat",          Abc_CommandDSat,             0 );
-    Cmd_CommandAdd( pAbc, "Verification", "psat",          Abc_CommandPSat,             0 );
-    Cmd_CommandAdd( pAbc, "Verification", "prove",         Abc_CommandProve,            1 );
-    Cmd_CommandAdd( pAbc, "Verification", "iprove",        Abc_CommandIProve,           1 );
-    Cmd_CommandAdd( pAbc, "Verification", "debug",         Abc_CommandDebug,            0 );
-    Cmd_CommandAdd( pAbc, "Verification", "bmc",           Abc_CommandBmc,              0 );
-    Cmd_CommandAdd( pAbc, "Verification", "bmc2",          Abc_CommandBmc2,             0 );
-    Cmd_CommandAdd( pAbc, "Verification", "bmc3",          Abc_CommandBmc3,             1 );
-    Cmd_CommandAdd( pAbc, "Verification", "int",           Abc_CommandBmcInter,         1 );
-    Cmd_CommandAdd( pAbc, "Verification", "indcut",        Abc_CommandIndcut,           0 );
-    Cmd_CommandAdd( pAbc, "Verification", "enlarge",       Abc_CommandEnlarge,          1 );
-    Cmd_CommandAdd( pAbc, "Verification", "tempor",        Abc_CommandTempor,           1 );
-    Cmd_CommandAdd( pAbc, "Verification", "ind",           Abc_CommandInduction,        0 );
-    Cmd_CommandAdd( pAbc, "Verification", "constr",        Abc_CommandConstr,           0 );
-    Cmd_CommandAdd( pAbc, "Verification", "unfold",        Abc_CommandUnfold,           1 );
-    Cmd_CommandAdd( pAbc, "Verification", "fold",          Abc_CommandFold,             1 );
-    Cmd_CommandAdd( pAbc, "Verification", "unfold2",       Abc_CommandUnfold2,          1 );    // jlong 
-    Cmd_CommandAdd( pAbc, "Verification", "fold2",         Abc_CommandFold2,            1 );    // jlong 
-    Cmd_CommandAdd( pAbc, "Verification", "bm",            Abc_CommandBm,               1 );
-    Cmd_CommandAdd( pAbc, "Verification", "bm2",           Abc_CommandBm2,              1 );
-    Cmd_CommandAdd( pAbc, "Verification", "saucy3",        Abc_CommandSaucy,            1 );
-    Cmd_CommandAdd( pAbc, "Verification", "testcex",       Abc_CommandTestCex,          0 );
-    Cmd_CommandAdd( pAbc, "Verification", "pdr",           Abc_CommandPdr,              0 );
-    Cmd_CommandAdd( pAbc, "Verification", "reconcile",     Abc_CommandReconcile,        1 );
-    Cmd_CommandAdd( pAbc, "Verification", "cexsave",       Abc_CommandCexSave,          0 );
-    Cmd_CommandAdd( pAbc, "Verification", "cexload",       Abc_CommandCexLoad,          0 );
-    Cmd_CommandAdd( pAbc, "Verification", "cexcut",        Abc_CommandCexCut,           0 );
-    Cmd_CommandAdd( pAbc, "Verification", "cexmerge",      Abc_CommandCexMerge,         0 );
-//    Cmd_CommandAdd( pAbc, "Verification", "cexmin",        Abc_CommandCexMin,           0 );
-    Cmd_CommandAdd( pAbc, "Verification", "dualrail",      Abc_CommandDualRail,         1 );
-    Cmd_CommandAdd( pAbc, "Verification", "blockpo",       Abc_CommandBlockPo,          1 );
-    Cmd_CommandAdd( pAbc, "Verification", "iso",           Abc_CommandIso,              1 );
-
-    Cmd_CommandAdd( pAbc, "ABC9",         "&get",          Abc_CommandAbc9Get,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&put",          Abc_CommandAbc9Put,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&r",            Abc_CommandAbc9Read,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&read_blif",    Abc_CommandAbc9ReadBlif,     0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&read_cblif",   Abc_CommandAbc9ReadCBlif,    0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&read_stg",     Abc_CommandAbc9ReadStg,      0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&w",            Abc_CommandAbc9Write,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&ps",           Abc_CommandAbc9Ps,           0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&pfan",         Abc_CommandAbc9PFan,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&psig",         Abc_CommandAbc9PSig,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&status",       Abc_CommandAbc9Status,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&mux_profile",  Abc_CommandAbc9MuxProfile,   0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&show",         Abc_CommandAbc9Show,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&st",           Abc_CommandAbc9Strash,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&topand",       Abc_CommandAbc9Topand,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&add1hot",      Abc_CommandAbc9Add1Hot,      0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&cof",          Abc_CommandAbc9Cof,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&trim",         Abc_CommandAbc9Trim,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&dfs",          Abc_CommandAbc9Dfs,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&sim",          Abc_CommandAbc9Sim,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&sim3",         Abc_CommandAbc9Sim3,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&resim",        Abc_CommandAbc9Resim,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&speci",        Abc_CommandAbc9SpecI,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv",        Abc_CommandAbc9Equiv,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv2",       Abc_CommandAbc9Equiv2,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv3",       Abc_CommandAbc9Equiv3,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&semi",         Abc_CommandAbc9Semi,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&times",        Abc_CommandAbc9Times,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&frames",       Abc_CommandAbc9Frames,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&retime",       Abc_CommandAbc9Retime,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&enable",       Abc_CommandAbc9Enable,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&dc2",          Abc_CommandAbc9Dc2,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&bidec",        Abc_CommandAbc9Bidec,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&shrink",       Abc_CommandAbc9Shrink,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&fx",           Abc_CommandAbc9Fx,           0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&b",            Abc_CommandAbc9Balance,      0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&blut",         Abc_CommandAbc9BalanceLut,   0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&syn2",         Abc_CommandAbc9Syn2,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&syn3",         Abc_CommandAbc9Syn3,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&syn4",         Abc_CommandAbc9Syn4,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&false",        Abc_CommandAbc9False,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&miter",        Abc_CommandAbc9Miter,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&miter2",       Abc_CommandAbc9Miter2,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&append",       Abc_CommandAbc9Append,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&scl",          Abc_CommandAbc9Scl,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&lcorr",        Abc_CommandAbc9Lcorr,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&scorr",        Abc_CommandAbc9Scorr,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&choice",       Abc_CommandAbc9Choice,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&sat",          Abc_CommandAbc9Sat,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&fraig",        Abc_CommandAbc9Fraig,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&cfraig",       Abc_CommandAbc9CFraig,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&srm",          Abc_CommandAbc9Srm,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&srm2",         Abc_CommandAbc9Srm2,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&filter",       Abc_CommandAbc9Filter,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&reduce",       Abc_CommandAbc9Reduce,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv_mark",   Abc_CommandAbc9EquivMark,    0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv_filter", Abc_CommandAbc9EquivFilter,  0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&cec",          Abc_CommandAbc9Cec,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&verify",       Abc_CommandAbc9Verify,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&sweep",        Abc_CommandAbc9Sweep,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&force",        Abc_CommandAbc9Force,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&embed",        Abc_CommandAbc9Embed,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&sopb",         Abc_CommandAbc9Sopb,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&if",           Abc_CommandAbc9If,           0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&iff",          Abc_CommandAbc9Iff,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&if2",          Abc_CommandAbc9If2,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&jf",           Abc_CommandAbc9Jf,           0 );
-#ifdef ABC_USE_PTHREADS
-    Cmd_CommandAdd( pAbc, "ABC9",         "&kf",           Abc_CommandAbc9Kf,           0 );
-#endif
-    Cmd_CommandAdd( pAbc, "ABC9",         "&lf",           Abc_CommandAbc9Lf,           0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&mf",           Abc_CommandAbc9Mf,           0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&nf",           Abc_CommandAbc9Nf,           0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&struct",       Abc_CommandAbc9Struct,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&trace",        Abc_CommandAbc9Trace,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&speedup",      Abc_CommandAbc9Speedup,      0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&era",          Abc_CommandAbc9Era,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&dch",          Abc_CommandAbc9Dch,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&rpm",          Abc_CommandAbc9Rpm,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&back_reach",   Abc_CommandAbc9BackReach,    0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&posplit",      Abc_CommandAbc9Posplit,      0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&reachm",       Abc_CommandAbc9ReachM,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&reachp",       Abc_CommandAbc9ReachP,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&reachn",       Abc_CommandAbc9ReachN,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&reachy",       Abc_CommandAbc9ReachY,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&undo",         Abc_CommandAbc9Undo,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&iso",          Abc_CommandAbc9Iso,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&cexinfo",      Abc_CommandAbc9CexInfo,      0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&cycle",        Abc_CommandAbc9Cycle,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&cone",         Abc_CommandAbc9Cone,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&slice",        Abc_CommandAbc9Slice,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&popart",       Abc_CommandAbc9PoPart,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&gprove",       Abc_CommandAbc9GroupProve,   0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&mprove",       Abc_CommandAbc9MultiProve,   0 );
-#ifdef ABC_USE_PTHREADS
-    Cmd_CommandAdd( pAbc, "ABC9",         "&splitprove",   Abc_CommandAbc9SplitProve,   0 );
-#endif
-    Cmd_CommandAdd( pAbc, "ABC9",         "&bmc",          Abc_CommandAbc9Bmc,          0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&bcore",        Abc_CommandAbc9BCore,        0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&icheck",       Abc_CommandAbc9ICheck,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&sattest",      Abc_CommandAbc9SatTest,      0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&fftest",       Abc_CommandAbc9FFTest,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&inse",         Abc_CommandAbc9Inse,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&maxi",         Abc_CommandAbc9Maxi,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&bmci",         Abc_CommandAbc9Bmci,         0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&poxsim",       Abc_CommandAbc9PoXsim,       0 );
-    Cmd_CommandAdd( pAbc, "ABC9",         "&demiter",      Abc_CommandAbc9Demiter,      0 );
-//    Cmd_CommandAdd( pAbc, "ABC9",         "&popart2",      Abc_CommandAbc9PoPart2,      0 );
-//    Cmd_CommandAdd( pAbc, "ABC9",         "&cexcut",       Abc_CommandAbc9CexCut,       0 );
-//    Cmd_CommandAdd( pAbc, "ABC9",         "&cexmerge",     Abc_CommandAbc9CexMerge,     0 );
-//    Cmd_CommandAdd( pAbc, "ABC9",         "&cexmin",       Abc_CommandAbc9CexMin,       0 );
-
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&abs_derive",   Abc_CommandAbc9AbsDerive,    0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&abs_refine",   Abc_CommandAbc9AbsRefine,    0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_derive",   Abc_CommandAbc9GlaDerive,    0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_refine",   Abc_CommandAbc9GlaRefine,    0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_shrink",   Abc_CommandAbc9GlaShrink,    0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla",          Abc_CommandAbc9Gla,          0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&vta",          Abc_CommandAbc9Vta,          0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&vta_gla",      Abc_CommandAbc9Vta2Gla,      0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_vta",      Abc_CommandAbc9Gla2Vta,      0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&fla_gla",      Abc_CommandAbc9Fla2Gla,      0 );
-    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_fla",      Abc_CommandAbc9Gla2Fla,      0 );
-
-    Cmd_CommandAdd( pAbc, "Liveness",     "l2s",           Abc_CommandAbcLivenessToSafety,        0 );
-    Cmd_CommandAdd( pAbc, "Liveness",     "l2ssim",        Abc_CommandAbcLivenessToSafetySim,     0 );
-    Cmd_CommandAdd( pAbc, "Liveness",     "l3s",           Abc_CommandAbcLivenessToSafetyWithLTL, 0 );
-    Cmd_CommandAdd( pAbc, "Liveness",     "kcs",           Abc_CommandCS_kLiveness,               0 );
-    Cmd_CommandAdd( pAbc, "Liveness",     "nck",           Abc_CommandNChooseK,                   0 );
-
-    Cmd_CommandAdd( pAbc, "ABC9",         "&test",         Abc_CommandAbc9Test,         0 );
-    {
-//        extern Mf_ManTruthCount();
-//        Mf_ManTruthCount();
-    }
-
-    {
-        extern void Dar_LibStart();
-        Dar_LibStart();
-    }
-    {
-//        extern void Dau_DsdTest();
-//        Dau_DsdTest();
-//        extern void If_ManSatTest();
-//        If_ManSatTest();
-    }
-
-    if ( Sdm_ManCanRead() )
-        Sdm_ManRead();
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-void Abc_End( Abc_Frame_t * pAbc )
-{
-    extern Abc_Frame_t * Abc_FrameGetGlobalFrame();
-    Abc_FrameClearDesign();
-    Cnf_ManFree();
-    {
-        extern int Abc_NtkCompareAndSaveBest( Abc_Ntk_t * pNtk );
-        Abc_NtkCompareAndSaveBest( NULL );
-    }
-    {
-        extern void Dar_LibStop();
-        Dar_LibStop();
-    }
-    {
-        extern void Aig_RManQuit();
-        Aig_RManQuit();
-    }
-    {
-        extern void Npn_ManClean();
-        Npn_ManClean();
-    }
-    {
-        extern void Sdm_ManQuit();
-        Sdm_ManQuit();
-    }
-    Abc_NtkFraigStoreClean();
-    if ( Abc_FrameGetGlobalFrame()->pGia )
-        Gia_ManStop( Abc_FrameGetGlobalFrame()->pGia );
-    if ( Abc_FrameGetGlobalFrame()->pGia2 )
-        Gia_ManStop( Abc_FrameGetGlobalFrame()->pGia2 );
-    if ( Abc_NtkRecIsRunning3() )
-        Abc_NtkRecStop3();
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int fFactor;
-    int fSaveBest;
-    int fDumpResult;
-    int fUseLutLib;
-    int fPrintTime;
-    int fPrintMuxes;
-    int fPower;
-    int fGlitch;
-    int fSkipBuf;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set the defaults
-    fFactor   = 0;
-    fSaveBest = 0;
-    fDumpResult = 0;
-    fUseLutLib = 0;
-    fPrintTime = 0;
-    fPrintMuxes = 0;
-    fPower = 0;
-    fGlitch = 0;
-    fSkipBuf = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "fbdltmpgsh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'f':
-            fFactor ^= 1;
-            break;
-        case 'b':
-            fSaveBest ^= 1;
-            break;
-        case 'd':
-            fDumpResult ^= 1;
-            break;
-        case 'l':
-            fUseLutLib ^= 1;
-            break;
-        case 't':
-            fPrintTime ^= 1;
-            break;
-        case 'm':
-            fPrintMuxes ^= 1;
-            break;
-        case 'p':
-            fPower ^= 1;
-            break;
-        case 'g':
-            fGlitch ^= 1;
-            break;
-        case 's':
-            fSkipBuf ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) && fUseLutLib )
-    {
-        Abc_Print( -1, "Cannot print LUT delay for a non-logic network.\n" );
-        return 1;
-    }
-    Abc_NtkPrintStats( pNtk, fFactor, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch, fSkipBuf );
-    if ( fPrintTime )
-    {
-        pAbc->TimeTotal += pAbc->TimeCommand;
-        Abc_Print( 1, "elapse: %3.2f seconds, total: %3.2f seconds\n", pAbc->TimeCommand, pAbc->TimeTotal );
-        pAbc->TimeCommand = 0.0;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_stats [-fbdltmpgsh]\n" );
-    Abc_Print( -2, "\t        prints the network statistics\n" );
-    Abc_Print( -2, "\t-f    : toggles printing the literal count in the factored forms [default = %s]\n", fFactor? "yes": "no" );
-    Abc_Print( -2, "\t-b    : toggles saving the best logic network in \"best.blif\" [default = %s]\n", fSaveBest? "yes": "no" );
-    Abc_Print( -2, "\t-d    : toggles dumping network into file \"<input_file_name>_dump.blif\" [default = %s]\n", fDumpResult? "yes": "no" );
-    Abc_Print( -2, "\t-l    : toggles printing delay of LUT mapping using LUT library [default = %s]\n", fSaveBest? "yes": "no" );
-    Abc_Print( -2, "\t-t    : toggles printing runtime statistics [default = %s]\n", fPrintTime? "yes": "no" );
-    Abc_Print( -2, "\t-m    : toggles printing MUX statistics [default = %s]\n", fPrintMuxes? "yes": "no" );
-    Abc_Print( -2, "\t-p    : toggles printing power dissipation due to switching [default = %s]\n", fPower? "yes": "no" );
-    Abc_Print( -2, "\t-g    : toggles printing percentage of increased power due to glitching [default = %s]\n", fGlitch? "yes": "no" );
-    Abc_Print( -2, "\t-s    : toggles not counting single-output nodes as nodes [default = %s]\n", fSkipBuf? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintExdc( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkTemp;
-    double Percentage;
-    int fShort;
-    int c;
-    int fPrintDc;
-    extern double Abc_NtkSpacePercentage( Abc_Obj_t * pNode );
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set the defaults
-    fShort  = 1;
-    fPrintDc = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "sdh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fShort ^= 1;
-            break;
-        case 'd':
-            fPrintDc ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( pNtk->pExdc == NULL )
-    {
-        Abc_Print( -1, "Network has no EXDC.\n" );
-        return 1;
-    }
-
-    if ( fPrintDc )
-    {
-        if ( !Abc_NtkIsStrash(pNtk->pExdc) )
-        {
-            pNtkTemp = Abc_NtkStrash(pNtk->pExdc, 0, 0, 0);
-            Percentage = Abc_NtkSpacePercentage( Abc_ObjChild0( Abc_NtkPo(pNtkTemp, 0) ) );
-            Abc_NtkDelete( pNtkTemp );
-        }
-        else
-            Percentage = Abc_NtkSpacePercentage( Abc_ObjChild0( Abc_NtkPo(pNtk->pExdc, 0) ) );
-
-        Abc_Print( 1, "EXDC network statistics: " );
-        Abc_Print( 1, "(" );
-        if ( Percentage > 0.05 && Percentage < 99.95 )
-            Abc_Print( 1, "%.2f", Percentage );
-        else if ( Percentage > 0.000005 && Percentage < 99.999995 )
-            Abc_Print( 1, "%.6f", Percentage );
-        else
-            Abc_Print( 1, "%f", Percentage );
-        Abc_Print( 1, " %% don't-cares)\n" );
-    }
-    else
-        Abc_Print( 1, "EXDC network statistics: \n" );
-    Abc_NtkPrintStats( pNtk->pExdc, 0, 0, 0, 0, 0, 0, 0, 0 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_exdc [-dh]\n" );
-    Abc_Print( -2, "\t        prints the EXDC network statistics\n" );
-    Abc_Print( -2, "\t-d    : toggles printing don't-care percentage [default = %s]\n", fPrintDc? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintIo( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Obj_t * pNode;
-    int c, fPrintFlops = 1;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "fh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'f':
-            fPrintFlops ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( argc > globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-
-    if ( argc == globalUtilOptind + 1 )
-    {
-        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
-        if ( pNode == NULL )
-        {
-            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
-            return 1;
-        }
-        Abc_NodePrintFanio( stdout, pNode );
-        return 0;
-    }
-    // print the nodes
-    Abc_NtkPrintIo( stdout, pNtk, fPrintFlops );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_io [-fh] <node>\n" );
-    Abc_Print( -2, "\t        prints the PIs/POs/flops or fanins/fanouts of a node\n" );
-    Abc_Print( -2, "\t-f    : toggles printing flops [default = %s]\n", fPrintFlops? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    Abc_Print( -2, "\tnode  : the node to print fanins/fanouts\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintLatch( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fPrintSccs;
-    extern void Abc_NtkPrintSccs( Abc_Ntk_t * pNtk, int fVerbose );
-
-    // set defaults
-    fPrintSccs = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fPrintSccs ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    // print the nodes
-    Abc_NtkPrintLatch( stdout, pNtk );
-    if ( fPrintSccs )
-        Abc_NtkPrintSccs( pNtk, 0 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_latch [-sh]\n" );
-    Abc_Print( -2, "\t        prints information about latches\n" );
-    Abc_Print( -2, "\t-s    : toggles printing SCCs of registers [default = %s]\n", fPrintSccs? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintFanio( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUsePis   = 0;
-    int fMffc     = 0;
-    int fVerbose  = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "imvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'i':
-            fUsePis ^= 1;
-            break;
-        case 'm':
-            fMffc ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    // print the nodes
-    if ( fVerbose )
-        Abc_NtkPrintFanio( stdout, pNtk, fUsePis );
-    else
-        Abc_NtkPrintFanioNew( stdout, pNtk, fMffc );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_fanio [-imvh]\n" );
-    Abc_Print( -2, "\t        prints the statistics about fanins/fanouts of all nodes\n" );
-    Abc_Print( -2, "\t-i    : toggles considering fanouts of primary inputs only [default = %s]\n", fUsePis? "yes": "no" );
-    Abc_Print( -2, "\t-m    : toggles printing MFFC sizes instead of fanouts [default = %s]\n", fMffc? "yes": "no" );
-    Abc_Print( -2, "\t-v    : toggles verbose way of printing the stats [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintMffc( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    extern void Abc_NtkPrintMffc( FILE * pFile, Abc_Ntk_t * pNtk );
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // print the nodes
-    Abc_NtkPrintMffc( stdout, pNtk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_mffc [-h]\n" );
-    Abc_Print( -2, "\t        prints the MFFC of each node in the network\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintFactor( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Obj_t * pNode;
-    int c;
-    int fUseRealNames;
-
-    // set defaults
-    fUseRealNames = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "nh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'n':
-            fUseRealNames ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsSopLogic(pNtk) )
-    {
-        Abc_Print( -1, "Printing factored forms can be done for SOP networks.\n" );
-        return 1;
-    }
-
-    if ( argc > globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-
-    if ( argc == globalUtilOptind + 1 )
-    {
-        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
-        if ( pNode == NULL )
-        {
-            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
-            return 1;
-        }
-        Abc_NodePrintFactor( stdout, pNode, fUseRealNames );
-        return 0;
-    }
-    // print the nodes
-    Abc_NtkPrintFactor( stdout, pNtk, fUseRealNames );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_factor [-nh] <node>\n" );
-    Abc_Print( -2, "\t        prints the factored forms of nodes\n" );
-    Abc_Print( -2, "\t-n    : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    Abc_Print( -2, "\tnode  : (optional) one node to consider\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintLevel( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Obj_t * pNode;
-    int c;
-    int fListNodes;
-    int fProfile;
-    int fVerbose;
-
-    // set defaults
-    fListNodes = 0;
-    fProfile   = 1;
-    fVerbose   = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "npvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'n':
-            fListNodes ^= 1;
-            break;
-        case 'p':
-            fProfile ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !fProfile && !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-
-    if ( argc > globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-
-    if ( argc == globalUtilOptind + 1 )
-    {
-        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
-        if ( pNode == NULL )
-        {
-            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
-            return 1;
-        }
-        Abc_NodePrintLevel( stdout, pNode );
-        return 0;
-    }
-    // process all COs
-    Abc_NtkPrintLevel( stdout, pNtk, fProfile, fListNodes, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_level [-npvh] <node>\n" );
-    Abc_Print( -2, "\t        prints information about node level and cone size\n" );
-    Abc_Print( -2, "\t-n    : toggles printing nodes by levels [default = %s]\n", fListNodes? "yes": "no" );
-    Abc_Print( -2, "\t-p    : toggles printing level profile [default = %s]\n", fProfile? "yes": "no" );
-    Abc_Print( -2, "\t-v    : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    Abc_Print( -2, "\tnode  : (optional) one node to consider\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintSupport( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Vec_Ptr_t * vSuppFun;
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fStruct;
-    int fVerbose;
-    int fVeryVerbose;
-    extern Vec_Ptr_t * Sim_ComputeFunSupp( Abc_Ntk_t * pNtk, int fVerbose );
-    extern void Abc_NtkPrintStrSupports( Abc_Ntk_t * pNtk, int fMatrix );
-
-    // set defaults
-    fStruct = 1;
-    fVerbose = 0;
-    fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "svwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fStruct ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // print support information
-    if ( fStruct )
-    {
-        Abc_NtkPrintStrSupports( pNtk, fVeryVerbose );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for combinational networks (run \"comb\").\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-    vSuppFun = Sim_ComputeFunSupp( pNtk, fVerbose );
-    ABC_FREE( vSuppFun->pArray[0] );
-    Vec_PtrFree( vSuppFun );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_supp [-svwh]\n" );
-    Abc_Print( -2, "\t        prints the supports of the CO nodes\n" );
-    Abc_Print( -2, "\t-s    : toggle printing structural support only [default = %s].\n", fStruct? "yes": "no" );
-    Abc_Print( -2, "\t-v    : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w    : enable printing CI/CO dependency matrix [default = %s].\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintSymms( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseBdds;
-    int fNaive;
-    int fReorder;
-    int fVerbose;
-    extern void Abc_NtkSymmetries( Abc_Ntk_t * pNtk, int fUseBdds, int fNaive, int fReorder, int fVerbose );
-
-    // set defaults
-    fUseBdds = 0;
-    fNaive   = 0;
-    fReorder = 1;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "bnrvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'b':
-            fUseBdds ^= 1;
-            break;
-        case 'n':
-            fNaive ^= 1;
-            break;
-        case 'r':
-            fReorder ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for combinational networks (run \"comb\").\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsStrash(pNtk) )
-        Abc_NtkSymmetries( pNtk, fUseBdds, fNaive, fReorder, fVerbose );
-    else
-    {
-        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        Abc_NtkSymmetries( pNtk, fUseBdds, fNaive, fReorder, fVerbose );
-        Abc_NtkDelete( pNtk );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_symm [-bnrvh]\n" );
-    Abc_Print( -2, "\t         computes symmetries of the PO functions\n" );
-    Abc_Print( -2, "\t-b     : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
-    Abc_Print( -2, "\t-n     : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
-    Abc_Print( -2, "\t-r     : enable dynamic BDD variable reordering [default = %s].\n", fReorder? "yes": "no" );
-    Abc_Print( -2, "\t-v     : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintUnate( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseBdds;
-    int fUseNaive;
-    int fVerbose;
-    extern void Abc_NtkPrintUnate( Abc_Ntk_t * pNtk, int fUseBdds, int fUseNaive, int fVerbose );
-
-    // set defaults
-    fUseBdds  = 1;
-    fUseNaive = 0;
-    fVerbose  = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "bnvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'b':
-            fUseBdds ^= 1;
-            break;
-        case 'n':
-            fUseNaive ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-    Abc_NtkPrintUnate( pNtk, fUseBdds, fUseNaive, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_unate [-bnvh]\n" );
-    Abc_Print( -2, "\t         computes unate variables of the PO functions\n" );
-    Abc_Print( -2, "\t-b     : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
-    Abc_Print( -2, "\t-n     : toggle naive BDD-based computation [default = %s].\n", fUseNaive? "yes": "no" );
-    Abc_Print( -2, "\t-v     : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintAuto( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int Output;
-    int fNaive;
-    int fVerbose;
-    extern void Abc_NtkAutoPrint( Abc_Ntk_t * pNtk, int Output, int fNaive, int fVerbose );
-
-    // set defaults
-    Output   = -1;
-    fNaive   = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Onvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'O':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Output = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Output < 0 )
-                goto usage;
-            break;
-        case 'n':
-            fNaive ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-
-
-    Abc_NtkAutoPrint( pNtk, Output, fNaive, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_auto [-O <num>] [-nvh]\n" );
-    Abc_Print( -2, "\t           computes autosymmetries of the PO functions\n" );
-    Abc_Print( -2, "\t-O <num> : (optional) the 0-based number of the output [default = all]\n");
-    Abc_Print( -2, "\t-n       : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
-    Abc_Print( -2, "\t-v       : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Obj_t * pNode;
-    int c;
-    int fUseRealNames;
-
-    extern void Abc_NodePrintKMap( Abc_Obj_t * pNode, int fUseRealNames );
-
-    // set defaults
-    fUseRealNames = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "nh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'n':
-            fUseRealNames ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( argc == globalUtilOptind + 2 )
-    {
-        Abc_NtkShow6VarFunc( argv[globalUtilOptind], argv[globalUtilOptind+1] );
-        return 0;
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Visualization of Karnaugh maps works for logic networks.\n" );
-        return 1;
-    }
-    if ( argc > globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-    if ( argc == globalUtilOptind )
-    {
-        pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
-        if ( !Abc_ObjIsNode(pNode) )
-        {
-            Abc_Print( -1, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
-            return 1;
-        }
-    }
-    else
-    {
-        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
-        if ( pNode == NULL )
-        {
-            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
-            return 1;
-        }
-    }
-    Abc_NtkToBdd(pNtk);
-    Abc_NodePrintKMap( pNode, fUseRealNames );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_kmap [-nh] <node>\n" );
-    Abc_Print( -2, "\t        shows the truth table of the node\n" );
-    Abc_Print( -2, "\t-n    : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    Abc_Print( -2, "\t<node>: the node to consider (default = the driver of the first PO)\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintGates( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseLibrary;
-
-    extern void Abc_NtkPrintGates( Abc_Ntk_t * pNtk, int fUseLibrary );
-
-    // set defaults
-    fUseLibrary = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUseLibrary ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkHasAig(pNtk) )
-    {
-        Abc_Print( -1, "Printing gates does not work for AIGs and sequential AIGs.\n" );
-        return 1;
-    }
-
-    Abc_NtkPrintGates( pNtk, fUseLibrary );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_gates [-lh]\n" );
-    Abc_Print( -2, "\t        prints statistics about gates used in the network\n" );
-    Abc_Print( -2, "\t-l    : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintSharing( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseLibrary;
-
-    extern void Abc_NtkPrintSharing( Abc_Ntk_t * pNtk );
-
-    // set defaults
-    fUseLibrary = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUseLibrary ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    Abc_NtkPrintSharing( pNtk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_sharing [-h]\n" );
-    Abc_Print( -2, "\t        prints the number of shared nodes in the TFI cones of the COs\n" );
-//    Abc_Print( -2, "\t-l    : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintXCut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseLibrary;
-
-    extern int Abc_NtkCrossCut( Abc_Ntk_t * pNtk );
-
-    // set defaults
-    fUseLibrary = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUseLibrary ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    Abc_NtkCrossCut( pNtk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_xcut [-h]\n" );
-    Abc_Print( -2, "\t        prints the size of the cross cut of the current network\n" );
-//    Abc_Print( -2, "\t-l    : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fCofactor;
-    int nCofLevel;
-    int fProfile;
-    int fPrintDec;
-
-    extern void Kit_DsdTest( unsigned * pTruth, int nVars );
-    extern void Kit_DsdPrintCofactors( unsigned * pTruth, int nVars, int nCofLevel, int fVerbose );
-    extern void Dau_DecTrySets( word * p, int nVars, int fVerbose );
-
-    // set defaults
-    nCofLevel = 1;
-    fCofactor = 0;
-    fProfile  = 0;
-    fPrintDec = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Npcdh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCofLevel = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCofLevel < 0 )
-                goto usage;
-            break;
-        case 'p':
-            fProfile ^= 1;
-            break;
-        case 'c':
-            fCofactor ^= 1;
-            break;
-        case 'd':
-            fPrintDec ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    // get the truth table of the first output
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Currently works only for logic networks.\n" );
-        return 1;
-    }
-    Abc_NtkToAig( pNtk );
-    // convert it to truth table
-    {
-        Abc_Obj_t * pObj = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
-        Vec_Int_t * vMemory;
-        unsigned * pTruth;
-        if ( !Abc_ObjIsNode(pObj) )
-        {
-            Abc_Print( -1, "The fanin of the first PO node does not have a logic function.\n" );
-            return 1;
-        }
-        if ( Abc_ObjFaninNum(pObj) > 16 )
-        {
-            Abc_Print( -1, "Currently works only for up to 16 inputs.\n" );
-            return 1;
-        }
-        vMemory = Vec_IntAlloc(0);
-        pTruth = Hop_ManConvertAigToTruth( (Hop_Man_t *)pNtk->pManFunc, Hop_Regular((Hop_Obj_t *)pObj->pData), Abc_ObjFaninNum(pObj), vMemory, 0 );
-        if ( Hop_IsComplement((Hop_Obj_t *)pObj->pData) )
-            Extra_TruthNot( pTruth, pTruth, Abc_ObjFaninNum(pObj) );
-//        Extra_PrintBinary( stdout, pTruth, 1 << Abc_ObjFaninNum(pObj) );
-//        Abc_Print( -1, "\n" );
-        if ( fPrintDec )//&&Abc_ObjFaninNum(pObj) <= 6 )
-        {
-            word * pTruthW = (word *)pTruth;
-            if ( Abc_ObjFaninNum(pObj) < 6 )
-                pTruthW[0] = Abc_Tt6Stretch( pTruthW[0], Abc_ObjFaninNum(pObj) );
-            Dau_DecTrySets( (word *)pTruth, Abc_ObjFaninNum(pObj), 1 );
-        }
-        if ( fProfile )
-            Kit_TruthPrintProfile( pTruth, Abc_ObjFaninNum(pObj) );
-        else if ( fCofactor )
-            Kit_DsdPrintCofactors( pTruth, Abc_ObjFaninNum(pObj), nCofLevel, 1 );
-        else
-            Kit_DsdTest( pTruth, Abc_ObjFaninNum(pObj) );
-        Vec_IntFree( vMemory );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_dsd [-pcdh] [-N <num>]\n" );
-    Abc_Print( -2, "\t           print DSD formula for a single-output function with less than 16 variables\n" );
-    Abc_Print( -2, "\t-p       : toggle printing profile [default = %s]\n", fProfile? "yes": "no" );
-    Abc_Print( -2, "\t-c       : toggle recursive cofactoring [default = %s]\n", fCofactor? "yes": "no" );
-    Abc_Print( -2, "\t-d       : toggle printing decompositions [default = %s]\n", fPrintDec? "yes": "no" );
-    Abc_Print( -2, "\t-N <num> : the number of levels to cofactor [default = %d]\n", nCofLevel );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintCone( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseLibrary;
-
-    // set defaults
-    fUseLibrary = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUseLibrary ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 1;
-    }
-    Abc_NtkDarPrintCone( pNtk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_cone [-h]\n" );
-    Abc_Print( -2, "\t        prints cones of influence info for each primary output\n" );
-//    Abc_Print( -2, "\t-l    : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseLibrary;
-
-    extern void Abc_NtkPrintMiter( Abc_Ntk_t * pNtk );
-
-    // set defaults
-    fUseLibrary = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUseLibrary ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "The network is should be structurally hashed.\n" );
-        return 1;
-    }
-    Abc_NtkPrintMiter( pNtk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_miter [-h]\n" );
-    Abc_Print( -2, "\t        prints the status of the miter\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintStatus( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c, fShort = 1;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fShort ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    Abc_Print( 1,"Status = %d  Frames = %d   ", pAbc->Status, pAbc->nFrames );
-    if ( pAbc->pCex == NULL && pAbc->vCexVec == NULL )
-        Abc_Print( 1,"Cex is not defined.\n" );
-    else
-    {
-        if ( pAbc->pCex )
-            Abc_CexPrintStats( pAbc->pCex );
-        if ( pAbc->vCexVec )
-        {
-            Abc_Cex_t * pTemp;
-            int nCexes = 0;
-            int Counter = 0;
-            printf( "\n" );
-            Vec_PtrForEachEntry( Abc_Cex_t *, pAbc->vCexVec, pTemp, c )
-            {
-                if ( pTemp == (void *)(ABC_PTRINT_T)1 )
-                {
-                    Counter++;
-                    continue;
-                }
-                if ( pTemp )
-                {
-                    printf( "%4d : ", ++nCexes );
-                    Abc_CexPrintStats( pTemp );
-                }
-            }
-            if ( Counter )
-                printf( "In total, %d (out of %d) outputs are \"sat\" but CEXes are not recorded.\n", Counter, Vec_PtrSize(pAbc->vCexVec) );
-        }
-    }
-    if ( pAbc->vStatuses )
-    {
-        if ( fShort )
-        {
-            printf( "Status array contains %d SAT, %d UNSAT, and %d UNDEC entries (out of %d).", 
-                Vec_IntCountEntry(pAbc->vStatuses, 0), Vec_IntCountEntry(pAbc->vStatuses, 1), 
-                Vec_IntCountEntry(pAbc->vStatuses, -1), Vec_IntSize(pAbc->vStatuses) );
-        }
-        else
-        {
-            int i, Entry;
-            Vec_IntForEachEntry( pAbc->vStatuses, Entry, i )
-                printf( "%d=%d  ", i, Entry );
-        }
-        printf( "\n" );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_status [-sh]\n" );
-    Abc_Print( -2, "\t        prints verification status\n" );
-    Abc_Print( -2, "\t-s    : toggle using short print-out [default = %s]\n", fShort? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPrintDelay( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Obj_t * pObjIn = NULL, * pObjOut = NULL;
-    int c;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsMappedLogic(pNtk) )
-    {
-        Abc_Print( -1, "Delay trace works only for network mapped into standard cells.\n" );
-        return 1;
-    }
-    if ( argc > globalUtilOptind + 2 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-    // collect the first name (PO name)
-    if ( argc >= globalUtilOptind + 1 )
-    {
-        int Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind], ABC_OBJ_PO );
-        if ( Num < 0 )
-            Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind], ABC_OBJ_BI );
-        if ( Num >= 0 )
-            pObjOut = Abc_NtkObj( pNtk, Num );
-        if ( pObjOut == NULL )
-        {
-            Abc_Print( 1, "Cannot find combinational output \"%s\".\n", argv[globalUtilOptind] );
-            return 1;
-        }
-    }
-    // collect the second name (PI name)
-    if ( argc == globalUtilOptind + 2 )
-    {
-        int Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind+1], ABC_OBJ_PI );
-        if ( Num < 0 )
-            Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind+1], ABC_OBJ_BO );
-        if ( Num >= 0 )
-            pObjIn = Abc_NtkObj( pNtk, Num );
-        if ( pObjIn == NULL )
-        {
-            Abc_Print( 1, "Cannot find combinational input \"%s\".\n", argv[globalUtilOptind+1] );
-            return 1;
-        }
-    }
-    Abc_NtkDelayTrace( pNtk, pObjOut, pObjIn, 1 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: print_delay [-h] <CO_name> <CI_name>\n" );
-    Abc_Print( -2, "\t            prints one critical path of the mapped network\n" );
-    Abc_Print( -2, "\t-h        : print the command usage\n");
-    Abc_Print( -2, "\t<CO_name> : (optional) the sink of the critical path (primary output or flop input)\n");
-    Abc_Print( -2, "\t<CI_name> : (optional) the source of the critical path (primary input or flop output)\n");
-    Abc_Print( -2, "\t            (if CO and/or CI are not given, uses the most critical ones)\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandShow( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fSeq;
-    int fGateNames;
-    int fUseReverse;
-    int fFlopDep;
-    extern void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse );
-    extern void Abc_NtkShowFlopDependency( Abc_Ntk_t * pNtk );
-
-    // set defaults
-    fSeq        = 0;
-    fGateNames  = 0;
-    fUseReverse = 1;
-    fFlopDep    = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "rsgfh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'r':
-            fUseReverse ^= 1;
-            break;
-        case 's':
-            fSeq ^= 1;
-            break;
-        case 'g':
-            fGateNames ^= 1;
-            break;
-        case 'f':
-            fFlopDep ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( fFlopDep )
-        Abc_NtkShowFlopDependency( pNtk );
-    else
-        Abc_NtkShow( pNtk, fGateNames, fSeq, fUseReverse );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: show [-srgfh]\n" );
-    Abc_Print( -2, "       visualizes the network structure using DOT and GSVIEW\n" );
-#ifdef WIN32
-    Abc_Print( -2, "       \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
-    Abc_Print( -2, "       (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
-#endif
-    Abc_Print( -2, "\t-s    : toggles visualization of sequential networks [default = %s].\n", fSeq? "yes": "no" );
-    Abc_Print( -2, "\t-r    : toggles ordering nodes in reverse order [default = %s].\n", fUseReverse? "yes": "no" );
-    Abc_Print( -2, "\t-g    : toggles printing gate names for mapped network [default = %s].\n", fGateNames? "yes": "no" );
-    Abc_Print( -2, "\t-f    : toggles visualizing flop dependency graph [default = %s].\n", fFlopDep? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Obj_t * pNode;
-    int c;
-    extern void Abc_NodeShowBdd( Abc_Obj_t * pNode );
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsBddLogic(pNtk) )
-    {
-        Abc_Print( -1, "Visualizing BDDs can only be done for logic BDD networks (run \"bdd\").\n" );
-        return 1;
-    }
-
-    if ( argc > globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-    if ( argc == globalUtilOptind )
-    {
-        pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
-        if ( !Abc_ObjIsNode(pNode) )
-        {
-            Abc_Print( -1, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
-            return 1;
-        }
-    }
-    else
-    {
-        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
-        if ( pNode == NULL )
-        {
-            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
-            return 1;
-        }
-    }
-    Abc_NodeShowBdd( pNode );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: show_bdd [-h] <node>\n" );
-    Abc_Print( -2, "       visualizes the BDD of a node using DOT and GSVIEW\n" );
-#ifdef WIN32
-    Abc_Print( -2, "       \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
-    Abc_Print( -2, "       (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
-#endif
-    Abc_Print( -2, "\t<node>: the node to consider [default = the driver of the first PO]\n");
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandShowCut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Obj_t * pNode;
-    int c;
-    int nNodeSizeMax;
-    int nConeSizeMax;
-    extern void Abc_NodeShowCut( Abc_Obj_t * pNode, int nNodeSizeMax, int nConeSizeMax );
-
-    // set defaults
-    nNodeSizeMax = 10;
-    nConeSizeMax = ABC_INFINITY;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NCh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nNodeSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nNodeSizeMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConeSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConeSizeMax < 0 )
-                goto usage;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Visualizing cuts only works for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-    if ( argc != globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-
-    pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
-    if ( pNode == NULL )
-    {
-        Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
-        return 1;
-    }
-    Abc_NodeShowCut( pNode, nNodeSizeMax, nConeSizeMax );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: show_cut [-N <num>] [-C <num>] [-h] <node>\n" );
-    Abc_Print( -2, "             visualizes the cut of a node using DOT and GSVIEW\n" );
-#ifdef WIN32
-    Abc_Print( -2, "             \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
-    Abc_Print( -2, "             (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
-#endif
-    Abc_Print( -2, "\t-N <num> : the max size of the cut to be computed [default = %d]\n", nNodeSizeMax );
-    Abc_Print( -2, "\t-C <num> : the max support of the containing cone [default = %d]\n", nConeSizeMax );
-    Abc_Print( -2, "\t<node>   : the node to consider\n");
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int fVerbose;
-    int fBddSizeMax;
-    int fDualRail;
-    int fReorder;
-    int c;
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    fVerbose = 0;
-    fReorder = 1;
-    fDualRail = 0;
-    fBddSizeMax = ABC_INFINITY;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Brdvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            fBddSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( fBddSizeMax < 0 )
-                goto usage;
-            break;
-        case 'd':
-            fDualRail ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'r':
-            fReorder ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( Abc_NtkIsStrash(pNtk) )
-        pNtkRes = Abc_NtkCollapse( pNtk, fBddSizeMax, fDualRail, fReorder, fVerbose );
-    else
-    {
-        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        pNtkRes = Abc_NtkCollapse( pNtk, fBddSizeMax, fDualRail, fReorder, fVerbose );
-        Abc_NtkDelete( pNtk );
-    }
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Collapsing has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: collapse [-B <num>] [-rdvh]\n" );
-    Abc_Print( -2, "\t          collapses the network by constructing global BDDs\n" );
-    Abc_Print( -2, "\t-B <num>: limit on live BDD nodes during collapsing [default = %d]\n", fBddSizeMax );
-    Abc_Print( -2, "\t-r      : toggles dynamic variable reordering [default = %s]\n", fReorder? "yes": "no" );
-    Abc_Print( -2, "\t-d      : toggles dual-rail collapsing mode [default = %s]\n", fDualRail? "yes": "no" );
-    Abc_Print( -2, "\t-v      : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h      : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    Abc_Obj_t * pObj;
-    int c;
-    int fAllNodes;
-    int fRecord;
-    int fCleanup;
-    int fComplOuts;
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fAllNodes = 0;
-    fCleanup  = 1;
-    fRecord   = 0;
-    fComplOuts= 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "acrih" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'a':
-            fAllNodes ^= 1;
-            break;
-        case 'c':
-            fCleanup ^= 1;
-            break;
-        case 'r':
-            fRecord ^= 1;
-            break;
-        case 'i':
-            fComplOuts ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkStrash( pNtk, fAllNodes, fCleanup, fRecord );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Strashing has failed.\n" );
-        return 1;
-    }
-    if ( fComplOuts )
-    Abc_NtkForEachPo( pNtkRes, pObj, c )
-        Abc_ObjXorFaninC( pObj, 0 );
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: strash [-acrih]\n" );
-    Abc_Print( -2, "\t        transforms combinational logic into an AIG\n" );
-    Abc_Print( -2, "\t-a    : toggles between using all nodes and DFS nodes [default = %s]\n", fAllNodes? "all": "DFS" );
-    Abc_Print( -2, "\t-c    : toggles cleanup to remove the dagling AIG nodes [default = %s]\n", fCleanup? "all": "DFS" );
-    Abc_Print( -2, "\t-r    : toggles using the record of AIG subgraphs [default = %s]\n", fRecord? "yes": "no" );
-    Abc_Print( -2, "\t-i    : toggles complementing the POs of the AIG [default = %s]\n", fComplOuts? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBalance( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes, * pNtkTemp;
-    int c;
-    int fDuplicate;
-    int fSelective;
-    int fUpdateLevel;
-    int fExor;
-    int fVerbose;
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    fDuplicate   = 0;
-    fSelective   = 0;
-    fUpdateLevel = 1;
-    fExor        = 0;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ldsxvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'd':
-            fDuplicate ^= 1;
-            break;
-        case 's':
-            fSelective ^= 1;
-            break;
-        case 'x':
-            fExor ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    // get the new network
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        if ( fExor )
-            pNtkRes = Abc_NtkBalanceExor( pNtk, fUpdateLevel, fVerbose );
-        else
-            pNtkRes = Abc_NtkBalance( pNtk, fDuplicate, fSelective, fUpdateLevel );
-    }
-    else
-    {
-        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        if ( pNtkTemp == NULL )
-        {
-            Abc_Print( -1, "Strashing before balancing has failed.\n" );
-            return 1;
-        }
-        if ( fExor )
-            pNtkRes = Abc_NtkBalanceExor( pNtkTemp, fUpdateLevel, fVerbose );
-        else
-            pNtkRes = Abc_NtkBalance( pNtkTemp, fDuplicate, fSelective, fUpdateLevel );
-        Abc_NtkDelete( pNtkTemp );
-    }
-
-    // check if balancing worked
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Balancing has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: balance [-ldsxvh]\n" );
-    Abc_Print( -2, "\t        transforms the current network into a well-balanced AIG\n" );
-    Abc_Print( -2, "\t-l    : toggle minimizing the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
-    Abc_Print( -2, "\t-s    : toggle duplication on the critical paths [default = %s]\n", fSelective? "yes": "no" );
-    Abc_Print( -2, "\t-x    : toggle balancing multi-input EXORs [default = %s]\n", fExor? "yes": "no" );
-    Abc_Print( -2, "\t-v    : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMuxStruct( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkMuxRestructure( Abc_Ntk_t * pNtk, int fVerbose );
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    // get the new network
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Does not work for a logic network.\n" );
-        return 1;
-    }
-    // check if balancing worked
-//    pNtkRes = Abc_NtkMuxRestructure( pNtk, fVerbose );
-    pNtkRes = NULL;
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "MUX restructuring has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: mux_struct [-vh]\n" );
-    Abc_Print( -2, "\t        performs MUX restructuring of the current network\n" );
-    Abc_Print( -2, "\t-v    : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int nThresh, nFaninMax, c;
-    int fCnf;
-    int fMulti;
-    int fSimple;
-    int fFactor;
-    extern Abc_Ntk_t * Abc_NtkMulti( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    nThresh   =  1;
-    nFaninMax = 20;
-    fCnf      =  0;
-    fMulti    =  1;
-    fSimple   =  0;
-    fFactor   =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "TFmcsfh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nThresh = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nThresh < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFaninMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFaninMax < 0 )
-                goto usage;
-            break;
-        case 'c':
-            fCnf ^= 1;
-            break;
-        case 'm':
-            fMulti ^= 1;
-            break;
-        case 's':
-            fSimple ^= 1;
-            break;
-        case 'f':
-            fFactor ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkMulti( pNtk, nThresh, nFaninMax, fCnf, fMulti, fSimple, fFactor );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Renoding has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: multi [-TF <num>] [-msfch]\n" );
-    Abc_Print( -2, "\t          transforms an AIG into a logic network by creating larger nodes\n" );
-    Abc_Print( -2, "\t-F <num>: the maximum fanin size after renoding [default = %d]\n", nFaninMax );
-    Abc_Print( -2, "\t-T <num>: the threshold for AIG node duplication [default = %d]\n", nThresh );
-    Abc_Print( -2, "\t          (an AIG node is the root of a new node after renoding\n" );
-    Abc_Print( -2, "\t          if this leads to duplication of no more than %d AIG nodes,\n", nThresh );
-    Abc_Print( -2, "\t          that is, if [(numFanouts(Node)-1) * size(MFFC(Node))] <= %d)\n", nThresh );
-    Abc_Print( -2, "\t-m      : creates multi-input AND graph [default = %s]\n", fMulti? "yes": "no" );
-    Abc_Print( -2, "\t-s      : creates a simple AIG (no renoding) [default = %s]\n", fSimple? "yes": "no" );
-    Abc_Print( -2, "\t-f      : creates a factor-cut network [default = %s]\n", fFactor? "yes": "no" );
-    Abc_Print( -2, "\t-c      : performs renoding to derive the CNF [default = %s]\n", fCnf? "yes": "no" );
-    Abc_Print( -2, "\t-h      : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int nLutSize, nCutsMax, c;
-    int nFlowIters, nAreaIters;
-    int fArea;
-    int fUseBdds;
-    int fUseSops;
-    int fUseCnfs;
-    int fUseMv;
-    int fVerbose;
-    extern Abc_Ntk_t * Abc_NtkRenode( Abc_Ntk_t * pNtk, int nLutSize, int nCutsMax, int nFlowIters, int nAreaIters, int fArea, int fUseBdds, int fUseSops, int fUseCnfs, int fUseMv, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    nLutSize   =  8;
-    nCutsMax   =  4;
-    nFlowIters =  1;
-    nAreaIters =  1;
-    fArea      =  0;
-    fUseBdds   =  0;
-    fUseSops   =  0;
-    fUseCnfs   =  0;
-    fUseMv     =  0;
-    fVerbose   =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAabscivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nFlowIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFlowIters < 0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nAreaIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nAreaIters < 0 )
-                goto usage;
-            break;
-        case 'a':
-            fArea ^= 1;
-            break;
-        case 'b':
-            fUseBdds ^= 1;
-            break;
-        case 's':
-            fUseSops ^= 1;
-            break;
-        case 'c':
-            fUseCnfs ^= 1;
-            break;
-        case 'i':
-            fUseMv ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( fUseBdds + fUseSops + fUseCnfs + fUseMv > 1 )
-    {
-        Abc_Print( -1, "Cannot optimize two parameters at the same time.\n" );
-        return 1;
-    }
-
-    if ( nLutSize < 2 || nLutSize > IF_MAX_FUNC_LUTSIZE )
-    {
-        Abc_Print( -1, "Incorrect LUT size (%d).\n", nLutSize );
-        return 1;
-    }
-
-    if ( nCutsMax < 1 || nCutsMax >= (1<<12) )
-    {
-        Abc_Print( -1, "Incorrect number of cuts.\n" );
-        return 1;
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkRenode( pNtk, nLutSize, nCutsMax, nFlowIters, nAreaIters, fArea, fUseBdds, fUseSops, fUseCnfs, fUseMv, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Renoding has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: renode [-KCFA <num>] [-sbciav]\n" );
-    Abc_Print( -2, "\t          transforms the AIG into a logic network with larger nodes\n" );
-    Abc_Print( -2, "\t          while minimizing the number of FF literals of the node SOPs\n" );
-    Abc_Print( -2, "\t-K <num>: the max cut size for renoding (2 < num < %d) [default = %d]\n", IF_MAX_FUNC_LUTSIZE+1, nLutSize );
-    Abc_Print( -2, "\t-C <num>: the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCutsMax );
-    Abc_Print( -2, "\t-F <num>: the number of area flow recovery iterations (num >= 0) [default = %d]\n", nFlowIters );
-    Abc_Print( -2, "\t-A <num>: the number of exact area recovery iterations (num >= 0) [default = %d]\n", nAreaIters );
-    Abc_Print( -2, "\t-s      : toggles minimizing SOP cubes instead of FF lits [default = %s]\n", fUseSops? "yes": "no" );
-    Abc_Print( -2, "\t-b      : toggles minimizing BDD nodes instead of FF lits [default = %s]\n", fUseBdds? "yes": "no" );
-    Abc_Print( -2, "\t-c      : toggles minimizing CNF clauses instead of FF lits [default = %s]\n", fUseCnfs? "yes": "no" );
-    Abc_Print( -2, "\t-i      : toggles minimizing MV-SOP instead of FF lits [default = %s]\n", fUseMv? "yes": "no" );
-    Abc_Print( -2, "\t-a      : toggles area-oriented mapping [default = %s]\n", fArea? "yes": "no" );
-    Abc_Print( -2, "\t-v      : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h      : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fCleanupPis;
-    int fCleanupPos;
-    int fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkDarCleanupAig( Abc_Ntk_t * pNtk, int fCleanupPis, int fCleanupPos, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    fCleanupPis = 1;
-    fCleanupPos = 1;
-    fVerbose    = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "iovh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'i':
-            fCleanupPis ^= 1;
-            break;
-        case 'o':
-            fCleanupPos ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        if ( !fCleanupPos && !fCleanupPos )
-        {
-            Abc_Print( -1, "Cleanup for PIs and POs is not enabled.\n" );
-            pNtkRes = Abc_NtkDup( pNtk );
-        }
-        else
-            pNtkRes = Abc_NtkDarCleanupAig( pNtk, fCleanupPis, fCleanupPos, fVerbose );
-    }
-    else
-    {
-        Abc_NtkCleanup( pNtk, fVerbose );
-        pNtkRes = Abc_NtkDup( pNtk );
-    }
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Cleanup has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cleanup [-iovh]\n" );
-    Abc_Print( -2, "\t        for logic networks, removes dangling combinatinal logic\n" );
-    Abc_Print( -2, "\t        for AIGs, removes PIs w/o fanout and POs driven by const-0\n" );
-    Abc_Print( -2, "\t-i    : toggles removing PIs without fanout [default = %s]\n", fCleanupPis? "yes": "no" );
-    Abc_Print( -2, "\t-o    : toggles removing POs with const-0 drivers [default = %s]\n", fCleanupPos? "yes": "no" );
-    Abc_Print( -2, "\t-v    : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fSingle = 0;
-    int fVerbose = 0;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fSingle ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "The classical (SIS-like) sweep can only be performed on a logic network.\n" );
-        return 1;
-    }
-    // modify the current network
-    if ( fSingle )
-        Abc_NtkSweepBufsInvs( pNtk, fVerbose );
-    else
-        Abc_NtkSweep( pNtk, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: sweep [-svh]\n" );
-    Abc_Print( -2, "\t        removes dangling nodes; propagates constant, buffers, inverters\n" );
-    Abc_Print( -2, "\t-s    : toggle sweeping buffers/inverters only [default = %s]\n", fSingle? "yes": "no" );
-    Abc_Print( -2, "\t-v    : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int nLitCountMax, int fVerbose, int fVeryVerbose );
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Fxu_Data_t Params, * p = &Params;
-    int c, fNewAlgo = 1;
-    // set the defaults
-    Abc_NtkSetDefaultFxParams( p );
-    Extra_UtilGetoptReset();
-    while ( (c = Extra_UtilGetopt(argc, argv, "SDNWMsdzcnvwh")) != EOF )
-    {
-        switch (c)
-        {
-            case 'S':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                    goto usage;
-                }
-                p->nSingleMax = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( p->nSingleMax < 0 )
-                    goto usage;
-                break;
-            case 'D':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                    goto usage;
-                }
-                p->nPairsMax = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( p->nPairsMax < 0 )
-                    goto usage;
-                break;
-            case 'N':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                    goto usage;
-                }
-                p->nNodesExt = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( p->nNodesExt < 0 )
-                    goto usage;
-                break;
-            case 'W':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                    goto usage;
-                }
-                p->WeightMin = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( p->WeightMin < 0 )
-                    goto usage;
-                break;
-            case 'M':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                    goto usage;
-                }
-                p->LitCountMax = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( p->LitCountMax < 0 )
-                    goto usage;
-                break;
-            case 's':
-                p->fOnlyS ^= 1;
-                break;
-            case 'd':
-                p->fOnlyD ^= 1;
-                break;
-            case 'z':
-                p->fUse0 ^= 1;
-                break;
-            case 'c':
-                p->fUseCompl ^= 1;
-                break;
-            case 'n':
-                fNewAlgo ^= 1;
-                break;
-            case 'v':
-                p->fVerbose ^= 1;
-                break;
-            case 'w':
-                p->fVeryVerbose ^= 1;
-                break;
-            case 'h':
-                goto usage;
-                break;
-            default:
-                goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkNodeNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "The network does not have internal nodes.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Fast extract can only be applied to a logic network (run \"renode\" or \"if\").\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsSopLogic(pNtk) )
-    {
-        Abc_Print( -1, "Fast extract can only be applied to a logic network with SOP local functions (run \"bdd; sop\").\n" );
-        return 1;
-    }
-
-    // the nodes to be merged are linked into the special linked list
-    if ( fNewAlgo )
-        Abc_NtkFxPerform( pNtk, p->nNodesExt, p->LitCountMax, p->fVerbose, p->fVeryVerbose );
-    else
-        Abc_NtkFastExtract( pNtk, p );
-    Abc_NtkFxuFreeInfo( p );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: fx [-SDNWM <num>] [-sdzcnvwh]\n");
-    Abc_Print( -2, "\t           performs unate fast extract on the current network\n");
-    Abc_Print( -2, "\t-S <num> : max number of single-cube divisors to consider [default = %d]\n", p->nSingleMax );
-    Abc_Print( -2, "\t-D <num> : max number of double-cube divisors to consider [default = %d]\n", p->nPairsMax );
-    Abc_Print( -2, "\t-N <num> : max number of divisors to extract during this run [default = %d]\n", p->nNodesExt );
-    Abc_Print( -2, "\t-W <num> : lower bound on the weight of divisors to extract [default = %d]\n", p->WeightMin );
-    Abc_Print( -2, "\t-M <num> : upper bound on literal count of divisors to extract [default = %d]\n", p->LitCountMax );
-    Abc_Print( -2, "\t-s       : use only single-cube divisors [default = %s]\n", p->fOnlyS? "yes": "no" );
-    Abc_Print( -2, "\t-d       : use only double-cube divisors [default = %s]\n", p->fOnlyD? "yes": "no" );
-    Abc_Print( -2, "\t-z       : use zero-weight divisors [default = %s]\n", p->fUse0? "yes": "no" );
-    Abc_Print( -2, "\t-c       : use complement in the binary case [default = %s]\n", p->fUseCompl? "yes": "no" );
-    Abc_Print( -2, "\t-n       : use new implementation of fast extract [default = %s]\n", fNewAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-v       : print verbose information [default = %s]\n", p->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : print additional information [default = %s]\n", p->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int ElimValue;
-    int nMaxSize;
-    int nIterMax;
-    int fGreedy;
-    int fReverse;
-    int fVerbose;
-    int c;
-    extern int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose );
-    extern int Abc_NtkEliminate1( Abc_Ntk_t * pNtk, int ElimValue, int nMaxSize, int nIterMax, int fReverse, int fVerbose );
-
-    // set the defaults
-    ElimValue = -1;
-    nMaxSize  = 12;
-    nIterMax  =  1;
-    fGreedy   =  0;
-    fReverse  =  0;
-    fVerbose  =  0;
-    Extra_UtilGetoptReset();
-    while ( (c = Extra_UtilGetopt(argc, argv, "VNIgrvh")) != EOF )
-    {
-        switch (c)
-        {
-            case 'V':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer that is -1 or larger.\n" );
-                    goto usage;
-                }
-                ElimValue = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( ElimValue < -1 )
-                    goto usage;
-                break;
-            case 'N':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
-                    goto usage;
-                }
-                nMaxSize = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( nMaxSize <= 0 )
-                    goto usage;
-                break;
-            case 'I':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
-                    goto usage;
-                }
-                nIterMax = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( nIterMax <= 0 )
-                    goto usage;
-                break;
-            case 'g':
-                fGreedy ^= 1;
-                break;
-            case 'r':
-                fReverse ^= 1;
-                break;
-            case 'v':
-                fVerbose ^= 1;
-                break;
-            case 'h':
-                goto usage;
-                break;
-            default:
-                goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkNodeNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "The network does not have internal nodes.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network (run \"renode\" or \"if\").\n" );
-        return 1;
-    }
-
-    if ( fGreedy )
-        Abc_NtkEliminate( pNtk, nMaxSize, fReverse, fVerbose );
-    else
-        Abc_NtkEliminate1( pNtk, ElimValue, nMaxSize, nIterMax, fReverse, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: eliminate [-VNI <num>] [-grvh]\n");
-    Abc_Print( -2, "\t           traditional \"eliminate -1\", which collapses the node into its fanout\n");
-    Abc_Print( -2, "\t           if the node's variable appears in the fanout's factored form only once\n");
-    Abc_Print( -2, "\t-V <num> : the \"value\" parameter used by \"eliminate\" in SIS [default = %d]\n", ElimValue );
-    Abc_Print( -2, "\t-N <num> : the maximum node support after collapsing [default = %d]\n", nMaxSize );
-    Abc_Print( -2, "\t-I <num> : the maximum number of iterations [default = %d]\n", nIterMax );
-    Abc_Print( -2, "\t-g       : toggle using greedy eliminate (without \"value\") [default = %s]\n", fGreedy? "yes": "no" );
-    Abc_Print( -2, "\t-r       : use the reverse topological order [default = %s]\n", fReverse? "yes": "no" );
-    Abc_Print( -2, "\t-v       : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDisjoint( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes, * pNtkNew;
-    int fGlobal, fRecursive, fVerbose, fPrint, fShort, c;
-
-    extern Abc_Ntk_t * Abc_NtkDsdGlobal( Abc_Ntk_t * pNtk, int fVerbose, int fPrint, int fShort );
-    extern int         Abc_NtkDsdLocal( Abc_Ntk_t * pNtk, int fVerbose, int fRecursive );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fGlobal    = 1;
-    fRecursive = 0;
-    fVerbose   = 0;
-    fPrint     = 0;
-    fShort     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "grvpsh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-            case 'g':
-                fGlobal ^= 1;
-                break;
-            case 'r':
-                fRecursive ^= 1;
-                break;
-            case 'v':
-                fVerbose ^= 1;
-                break;
-            case 'p':
-                fPrint ^= 1;
-                break;
-            case 's':
-                fShort ^= 1;
-                break;
-            case 'h':
-                goto usage;
-                break;
-            default:
-                goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( fGlobal )
-    {
-//        Abc_Print( 0, "Performing DSD of global functions of the network.\n" );
-        // get the new network
-        if ( !Abc_NtkIsStrash(pNtk) )
-        {
-            pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
-            pNtkRes = Abc_NtkDsdGlobal( pNtkNew, fVerbose, fPrint, fShort );
-            Abc_NtkDelete( pNtkNew );
-        }
-        else
-        {
-            pNtkRes = Abc_NtkDsdGlobal( pNtk, fVerbose, fPrint, fShort );
-        }
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "Global DSD has failed.\n" );
-            return 1;
-        }
-        // replace the current network
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    }
-    else if ( fRecursive )
-    {
-        if ( !Abc_NtkIsBddLogic( pNtk ) )
-        {
-            Abc_Print( -1, "This command is only applicable to logic BDD networks.\n" );
-            return 1;
-        }
-        if ( fVerbose )
-            Abc_Print( 1, "Performing recursive DSD and MUX decomposition of local functions.\n" );
-        if ( !Abc_NtkDsdLocal( pNtk, fVerbose, fRecursive ) )
-            Abc_Print( -1, "Recursive DSD has failed.\n" );
-    }
-    else
-    {
-        if ( !Abc_NtkIsBddLogic( pNtk ) )
-        {
-            Abc_Print( -1, "This command is only applicable to logic BDD networks (run \"bdd\").\n" );
-            return 1;
-        }
-        if ( fVerbose )
-            Abc_Print( 1, "Performing simple non-recursive DSD of local functions.\n" );
-        if ( !Abc_NtkDsdLocal( pNtk, fVerbose, fRecursive ) )
-            Abc_Print( -1, "Simple DSD of local functions has failed.\n" );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsd [-grvpsh]\n" );
-    Abc_Print( -2, "\t     decomposes the network using disjoint-support decomposition\n" );
-    Abc_Print( -2, "\t-g     : toggle DSD of global and local functions [default = %s]\n", fGlobal? "global": "local" );
-    Abc_Print( -2, "\t-r     : toggle recursive DSD/MUX and simple DSD [default = %s]\n", fRecursive? "recursive DSD/MUX": "simple DSD" );
-    Abc_Print( -2, "\t-v     : prints DSD statistics and runtime [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-p     : prints DSD structure to the standard output [default = %s]\n", fPrint? "yes": "no" );
-    Abc_Print( -2, "\t-s     : use short PI names when printing DSD structure [default = %s]\n", fShort? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Lpk_Par_t Pars, * pPars = &Pars;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    memset( pPars, 0, sizeof(Lpk_Par_t) );
-    pPars->nLutsMax     =  4; // (N) the maximum number of LUTs in the structure
-    pPars->nLutsOver    =  3; // (Q) the maximum number of LUTs not in the MFFC
-    pPars->nVarsShared  =  0; // (S) the maximum number of shared variables (crossbars)
-    pPars->nGrowthLevel =  0; // (L) the maximum number of increased levels
-    pPars->fSatur       =  1;
-    pPars->fZeroCost    =  0;
-    pPars->fFirst       =  0;
-    pPars->fOldAlgo     =  0;
-    pPars->fVerbose     =  0;
-    pPars->fVeryVerbose =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NQSLszfovwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nLutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutsMax < 2 || pPars->nLutsMax > 8 )
-                goto usage;
-            break;
-        case 'Q':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nLutsOver = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutsOver < 0 || pPars->nLutsOver > 8 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nVarsShared = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nVarsShared < 0 || pPars->nVarsShared > 4 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
-                goto usage;
-            break;
-        case 's':
-            pPars->fSatur ^= 1;
-            break;
-        case 'z':
-            pPars->fZeroCost ^= 1;
-            break;
-        case 'f':
-            pPars->fFirst ^= 1;
-            break;
-        case 'o':
-            pPars->fOldAlgo ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
-        return 1;
-    }
-    if ( pPars->nVarsShared < 0 || pPars->nVarsShared > 3 )
-    {
-        Abc_Print( -1, "The number of shared variables (%d) is not in the range 0 <= S <= 3.\n", pPars->nVarsShared );
-        return 1;
-    }
-
-    // modify the current network
-    if ( !Lpk_Resynthesize( pNtk, pPars ) )
-    {
-        Abc_Print( -1, "Resynthesis has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: lutpack [-NQSL <num>] [-szfovwh]\n" );
-    Abc_Print( -2, "\t           performs \"rewriting\" for LUT network;\n" );
-    Abc_Print( -2, "\t           determines LUT size as the max fanin count of a node;\n" );
-    Abc_Print( -2, "\t           if the network is not LUT-mapped, packs it into 6-LUTs\n" );
-    Abc_Print( -2, "\t           (there is another command for resynthesis after LUT mapping, \"imfs\")\n" );
-    Abc_Print( -2, "\t-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]\n", pPars->nLutsMax );
-    Abc_Print( -2, "\t-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]\n", pPars->nLutsOver );
-    Abc_Print( -2, "\t-S <num> : the max number of LUT inputs shared (0 <= num <= 3) [default = %d]\n", pPars->nVarsShared );
-    Abc_Print( -2, "\t-L <num> : max level increase after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
-    Abc_Print( -2, "\t-s       : toggle iteration till saturation [default = %s]\n", pPars->fSatur? "yes": "no" );
-    Abc_Print( -2, "\t-z       : toggle zero-cost replacements [default = %s]\n", pPars->fZeroCost? "yes": "no" );
-    Abc_Print( -2, "\t-f       : toggle using only first node and first cut [default = %s]\n", pPars->fFirst? "yes": "no" );
-    Abc_Print( -2, "\t-o       : toggle using old implementation [default = %s]\n", pPars->fOldAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle detailed printout of decomposed functions [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandLutmin( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int nLutSize;
-    int fVerbose;
-    extern Abc_Ntk_t * Abc_NtkLutmin( Abc_Ntk_t * pNtk, int nLutSize, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nLutSize = 4;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Kvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    // modify the current network
-    pNtkRes = Abc_NtkLutmin( pNtk, nLutSize, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "The command has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: lutmin [-K <num>] [-vh]\n" );
-    Abc_Print( -2, "\t           perform FPGA mapping while minimizing the LUT count\n" );
-    Abc_Print( -2, "\t           as described in the paper T. Sasao and A. Mishchenko:\n" );
-    Abc_Print( -2, "\t           \"On the number of LUTs to implement logic functions\".\n" );
-    Abc_Print( -2, "\t-K <num> : the LUT size to use for the mapping (2 <= num) [default = %d]\n", nLutSize );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-#if 0
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Res_Par_t Pars, * pPars = &Pars;
-    int c;
-
-    // set defaults
-    pPars->nWindow      = 62;
-    pPars->nCands       =  5;
-    pPars->nSimWords    =  4;
-    pPars->nGrowthLevel =  0;
-    pPars->fArea        =  0;
-    pPars->fVerbose     =  0;
-    pPars->fVeryVerbose =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WSCLavwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWindow = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWindow < 1 || pPars->nWindow > 99 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nSimWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nSimWords < 1 || pPars->nSimWords > 256 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nCands = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCands < 0 || pPars->nCands > ABC_INFINITY )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fArea ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    if ( !Abc_NtkResynthesize( pNtk, pPars ) )
-    {
-        Abc_Print( -1, "Resynthesis has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: imfs [-W <NM>] [-LCS <num>] [-avwh]\n" );
-    Abc_Print( -2, "\t           performs resubstitution-based resynthesis with interpolation\n" );
-    Abc_Print( -2, "\t           (there is another command for resynthesis after LUT mapping, \"lutpack\")\n" );
-    Abc_Print( -2, "\t-W <NM>  : fanin/fanout levels (NxM) of the window (00 <= NM <= 99) [default = %d%d]\n", pPars->nWindow/10, pPars->nWindow%10 );
-    Abc_Print( -2, "\t-C <num> : the max number of resub candidates (1 <= n) [default = %d]\n", pPars->nCands );
-    Abc_Print( -2, "\t-S <num> : the number of simulation words (1 <= n <= 256) [default = %d]\n", pPars->nSimWords );
-    Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
-    Abc_Print( -2, "\t-a       : toggle optimization for area only [default = %s]\n", pPars->fArea? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printout subgraph statistics [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-#endif
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Mfs_Par_t Pars, * pPars = &Pars;
-    int c;
-    // set defaults
-    Abc_NtkMfsParsDefault( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCdraestpgvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWinTfoLevs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWinTfoLevs < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFanoutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFanoutsMax < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nDepthMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nDepthMax < 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWinMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWinMax < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'd':
-            pPars->fRrOnly ^= 1;
-            break;
-        case 'r':
-            pPars->fResub ^= 1;
-            break;
-        case 'a':
-            pPars->fArea ^= 1;
-            break;
-        case 'e':
-            pPars->fMoreEffort ^= 1;
-            break;
-        case 's':
-            pPars->fSwapEdge ^= 1;
-            break;
-        case 't':
-            pPars->fOneHotness ^= 1;
-            break;
-        case 'p':
-            pPars->fPower ^= 1;
-            break;
-        case 'g':
-            pPars->fGiaSat ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    if ( !Abc_NtkMfs( pNtk, pPars ) )
-    {
-        Abc_Print( -1, "Resynthesis has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: mfs [-WFDMLC <num>] [-draestpgvh]\n" );
-    Abc_Print( -2, "\t           performs don't-care-based optimization of logic networks\n" );
-    Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs );
-    Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax );
-    Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
-    Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinMax );
-    Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
-    Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-d       : toggle performing redundancy removal [default = %s]\n", pPars->fRrOnly? "yes": "no" );
-    Abc_Print( -2, "\t-r       : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" );
-    Abc_Print( -2, "\t-a       : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
-    Abc_Print( -2, "\t-e       : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
-    Abc_Print( -2, "\t-s       : toggle evaluation of edge swapping [default = %s]\n", pPars->fSwapEdge? "yes": "no" );
-    Abc_Print( -2, "\t-t       : toggle using artificial one-hotness conditions [default = %s]\n", pPars->fOneHotness? "yes": "no" );
-    Abc_Print( -2, "\t-p       : toggle power-aware optimization [default = %s]\n", pPars->fPower? "yes": "no" );
-    Abc_Print( -2, "\t-g       : toggle using new SAT solver [default = %s]\n", pPars->fGiaSat? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMfs2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Abc_NtkPerformMfs( Abc_Ntk_t * pNtk, Sfm_Par_t * pPars );
-    extern int Abc_NtkMfsAfterICheck( Abc_Ntk_t * p, int nFrames, int nFramesAdd, Vec_Int_t * vFlops, Sfm_Par_t * pPars );
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Sfm_Par_t Pars, * pPars = &Pars;
-    int c, fIndDCs = 0, fUseAllFfs = 0, nFramesAdd = 0;
-    // set defaults
-    Sfm_ParSetDefault( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCZNIdaeijvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nTfoLevMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nTfoLevMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFanoutMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFanoutMax < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nDepthMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nDepthMax < 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWinSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWinSizeMax < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nGrowthLevel < -ABC_INFINITY || pPars->nGrowthLevel > ABC_INFINITY )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'Z':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Z\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFirstFixed = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFirstFixed < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nNodesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nNodesMax < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFramesAdd = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFramesAdd < 0 )
-                goto usage;
-            break;
-        case 'd':
-            pPars->fRrOnly ^= 1;
-            break;
-        case 'a':
-            pPars->fArea ^= 1;
-            break;
-        case 'e':
-            pPars->fMoreEffort ^= 1;
-            break;
-        case 'i':
-            fIndDCs ^= 1;
-            break;
-        case 'j':
-            fUseAllFfs ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
-        return 1;
-    }
-    if ( fIndDCs )
-    {
-        if ( fUseAllFfs )
-        {
-            pAbc->nIndFrames = 1;
-            Vec_IntFreeP( &pAbc->vIndFlops );
-            pAbc->vIndFlops = Vec_IntAlloc( Abc_NtkLatchNum(pNtk) );
-            Vec_IntFill( pAbc->vIndFlops, Abc_NtkLatchNum(pNtk), 1 );
-        }
-        if ( pAbc->nIndFrames <= 0 )
-        {
-            Abc_Print( -1, "The number of k-inductive frames is not specified.\n" );
-            return 0;
-        }
-        if ( pAbc->vIndFlops == NULL )
-        {
-            Abc_Print( -1, "The set of k-inductive flops is not specified.\n" );
-            return 0;
-        }
-        if ( Vec_IntSize(pAbc->vIndFlops) != Abc_NtkLatchNum(pNtk) )
-        {
-            Abc_Print( -1, "The saved flop count (%d) does not match that of the current network (%d).\n", 
-                Vec_IntSize(pAbc->vIndFlops), Abc_NtkLatchNum(pNtk) );
-            return 0;
-        }
-        // modify the current network
-        if ( !Abc_NtkMfsAfterICheck( pNtk, pAbc->nIndFrames, nFramesAdd, pAbc->vIndFlops, pPars ) )
-        {
-            Abc_Print( -1, "Resynthesis has failed.\n" );
-            return 1;
-        }
-        if ( fUseAllFfs )
-        {
-            pAbc->nIndFrames = 0;
-            Vec_IntFreeP( &pAbc->vIndFlops );
-        }
-    }
-    else
-    {
-        // modify the current network
-        if ( !Abc_NtkPerformMfs( pNtk, pPars ) )
-        {
-            Abc_Print( -1, "Resynthesis has failed.\n" );
-            return 1;
-        }
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: mfs2 [-WFDMLCZNI <num>] [-daeijvwh]\n" );
-    Abc_Print( -2, "\t           performs don't-care-based optimization of logic networks\n" );
-    Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n",             pPars->nTfoLevMax );
-    Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n",                pPars->nFanoutMax );
-    Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n",                   pPars->nDepthMax );
-    Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n",    pPars->nWinSizeMax );
-    Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
-    Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n",   pPars->nBTLimit );
-    Abc_Print( -2, "\t-Z <num> : treat the first <num> logic nodes as fixed (0 = none) [default = %d]\n",       pPars->nFirstFixed );
-    Abc_Print( -2, "\t-N <num> : the max number of nodes to try (0 = all) [default = %d]\n",                    pPars->nNodesMax );
-    Abc_Print( -2, "\t-d       : toggle performing redundancy removal [default = %s]\n",                        pPars->fRrOnly? "yes": "no" );
-    Abc_Print( -2, "\t-a       : toggle minimizing area or area+edges [default = %s]\n",                        pPars->fArea? "area": "area+edges" );
-    Abc_Print( -2, "\t-e       : toggle high-effort resubstitution [default = %s]\n",                           pPars->fMoreEffort? "yes": "no" );
-    Abc_Print( -2, "\t-i       : toggle using inductive don't-cares [default = %s]\n",                          fIndDCs? "yes": "no" );
-    Abc_Print( -2, "\t-j       : toggle using all flops when \"-i\" is enabled [default = %s]\n",               fUseAllFfs? "yes": "no" );
-    Abc_Print( -2, "\t-I       : the number of additional frames inserted [default = %d]\n",                    nFramesAdd );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n",                        pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n",                pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTrace( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseLutLib;
-    int fVerbose;
-    extern void Abc_NtkDelayTracePrint( Abc_Ntk_t * pNtk, int fUseLutLib, int fVerbose );
-
-    // set defaults
-    fUseLutLib = 0;
-    fVerbose   = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUseLutLib ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    Abc_NtkDelayTracePrint( pNtk, fUseLutLib, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: trace [-lvh]\n" );
-    Abc_Print( -2, "\t           performs delay trace of LUT-mapped network\n" );
-    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fUseLutLib;
-    int Percentage;
-    int Degree;
-    int fVerbose;
-    int fVeryVerbose;
-    extern Abc_Ntk_t * Abc_NtkSpeedup( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    fUseLutLib = 0;
-    Percentage = 5;
-    Degree     = 2;
-    fVerbose   = 0;
-    fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Percentage = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Percentage < 1 || Percentage > 100 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Degree = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Degree < 1 || Degree > 5 )
-                goto usage;
-            break;
-        case 'l':
-            fUseLutLib ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    pNtkRes = Abc_NtkSpeedup( pNtk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "The command has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: speedup [-PN <num>] [-lvwh]\n" );
-    Abc_Print( -2, "\t           transforms LUT-mapped network into an AIG with choices;\n" );
-    Abc_Print( -2, "\t           the choices are added to speedup the next round of mapping\n" );
-    Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
-    Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
-    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fUseLutLib;
-    int Percentage;
-    int Degree;
-    int fVerbose;
-    int fVeryVerbose;
-    extern Abc_Ntk_t * Abc_NtkPowerdown( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fUseLutLib = 0;
-    Percentage =10;
-    Degree     = 2;
-    fVerbose   = 0;
-    fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Percentage = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Percentage < 1 || Percentage > 100 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Degree = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Degree < 1 || Degree > 5 )
-                goto usage;
-            break;
-        case 'l':
-            fUseLutLib ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    pNtkRes = Abc_NtkPowerdown( pNtk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "The command has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: powerdown [-PN <num>] [-vwh]\n" );
-    Abc_Print( -2, "\t           transforms LUT-mapped network into an AIG with choices;\n" );
-    Abc_Print( -2, "\t           the choices are added to power down the next round of mapping\n" );
-    Abc_Print( -2, "\t-P <num> : switching propability delta defining power critical edges [default = %d%%]\n", Percentage );
-    Abc_Print( -2, "\t           (e.g. 5% means hot wires switch with probability: 0.45 <= p <= 0.50 (max)\n" );
-    Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
-//    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAddBuffs( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkAddBuffs( Abc_Ntk_t * pNtk, int fDirect, int fReverse, int nImprove, int fVerbose );
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Ntk_t * pNtkRes;
-    int fDirect;
-    int fReverse;
-    int nImprove;
-    int c, fVerbose;
-
-    fDirect  = 0;
-    fReverse = 0;
-    nImprove = 1000;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Idrvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nImprove = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nImprove < 0 )
-                goto usage;
-            break;
-        case 'd':
-            fDirect ^= 1;
-            break;
-        case 'r':
-            fReverse ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    pNtkRes = Abc_NtkAddBuffs( pNtk, fDirect, fReverse, nImprove, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "The command has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: addbuffs [-I num] [-drvh]\n" );
-    Abc_Print( -2, "\t           adds buffers to create balanced CI/CO paths\n" );
-    Abc_Print( -2, "\t-I <num> : the number of refinement iterations [default = %d]\n", nImprove );
-    Abc_Print( -2, "\t-d       : toggle using only CI-to-CO levelized order [default = %s]\n", fDirect? "yes": "no" );
-    Abc_Print( -2, "\t-r       : toggle using only CO-to-C1 levelized order [default = %s]\n", fReverse? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-#if 0
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Nwk_LMPars_t Pars, * pPars = &Pars;
-    Vec_Int_t * vResult;
-    int c;
-    extern Vec_Int_t * Abc_NtkLutMerge( Abc_Ntk_t * pNtk, Nwk_LMPars_t * pPars );
-    // set defaults
-    memset( pPars, 0, sizeof(Nwk_LMPars_t) );
-    pPars->nMaxLutSize    = 5;   // the max LUT size for merging (N=5)
-    pPars->nMaxSuppSize   = 5;   // the max total support size after merging (S=5)
-    pPars->nMaxDistance   = 3;   // the max number of nodes separating LUTs
-    pPars->nMaxLevelDiff  = 2;   // the max difference in levels
-    pPars->nMaxFanout     = 100; // the max number of fanouts to traverse
-    pPars->fUseDiffSupp   = 0;   // enables the use of nodes with different support
-    pPars->fUseTfiTfo     = 0;   // enables the use of TFO/TFO nodes as candidates
-    pPars->fVeryVerbose   = 0;   // enables additional verbose output
-    pPars->fVerbose       = 1;   // enables verbose output
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NSDLFscvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxLutSize < 2 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxSuppSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxSuppSize < 2 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxDistance = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxDistance < 2 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxLevelDiff = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxLevelDiff < 2 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxFanout = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxFanout < 2 )
-                goto usage;
-            break;
-        case 's':
-            pPars->fUseDiffSupp ^= 1;
-            break;
-        case 'c':
-            pPars->fUseTfiTfo ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL || !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Abc_CommandMerge(): There is no mapped network to merge LUTs.\n" );
-        return 1;
-    }
-
-    vResult = Abc_NtkLutMerge( pNtk, pPars );
-    Vec_IntFree( vResult );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: merge [-NSDLF <num>] [-scwvh]\n" );
-    Abc_Print( -2, "\t           creates pairs of topologically-related LUTs\n" );
-    Abc_Print( -2, "\t-N <num> : the max LUT size for merging (1 < num) [default = %d]\n", pPars->nMaxLutSize );
-    Abc_Print( -2, "\t-S <num> : the max total support size after merging (1 < num) [default = %d]\n", pPars->nMaxSuppSize );
-    Abc_Print( -2, "\t-D <num> : the max distance in terms of LUTs (0 < num) [default = %d]\n", pPars->nMaxDistance );
-    Abc_Print( -2, "\t-L <num> : the max difference in levels (0 <= num) [default = %d]\n", pPars->nMaxLevelDiff );
-    Abc_Print( -2, "\t-F <num> : the max number of fanouts to stop traversal (0 < num) [default = %d]\n", pPars->nMaxFanout );
-    Abc_Print( -2, "\t-s       : toggle the use of nodes without support overlap [default = %s]\n", pPars->fUseDiffSupp? "yes" : "no" );
-    Abc_Print( -2, "\t-c       : toggle the use of TFI/TFO nodes as candidates [default = %s]\n", pPars->fUseTfiTfo? "yes" : "no" );
-    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-#endif
-
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTestDec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Abc_DecTest( char * pFileName, int DecType, int nVarNum, int fVerbose );
-    char * pFileName;
-    int c;
-    int fVerbose = 0;
-    int DecType = 0;
-    int nVarNum = -1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ANvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            DecType = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( DecType < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nVarNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nVarNum < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( argc != globalUtilOptind + 1 )
-    {
-        Abc_Print( 1,"Input file is not given.\n" );
-        return 0;
-    }
-    if ( nVarNum >= 0 && nVarNum < 6 )
-    {
-        Abc_Print( 1,"The number of variables cannot be less than 6.\n" );
-        return 0;
-    }
-    // get the output file name
-    pFileName = argv[globalUtilOptind];
-    // call the testbench
-    Abc_DecTest( pFileName, DecType, nVarNum, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: testdec [-AN <num>] [-vh] <file>\n" );
-    Abc_Print( -2, "\t           testbench for Boolean decomposition algorithms\n" );
-    Abc_Print( -2, "\t-A <num> : decomposition algorithm [default = %d]\n", DecType );
-    Abc_Print( -2, "\t               0: none (reading and writing the file)\n" );
-    Abc_Print( -2, "\t               1: algebraic factoring applied to ISOP\n" );
-    Abc_Print( -2, "\t               2: bi-decomposition with cofactoring\n" );
-    Abc_Print( -2, "\t               3: disjoint-support decomposition with cofactoring\n" );
-    Abc_Print( -2, "\t               4: updated disjoint-support decomposition with cofactoring\n" );
-    Abc_Print( -2, "\t               5: enumerating decomposable variable sets\n" );
-    Abc_Print( -2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    Abc_Print( -2, "\t<file>   : a text file with truth tables in hexadecimal, listed one per line,\n");
-    Abc_Print( -2, "\t           or a binary file with an array of truth tables (in this case,\n");
-    Abc_Print( -2, "\t           -N <num> is required to determine how many functions are stored)\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTestNpn( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Abc_NpnTest( char * pFileName, int NpnType, int nVarNum, int fDumpRes, int fBinary, int fVerbose );
-    char * pFileName;
-    int c;
-    int fVerbose = 0;
-    int NpnType = 0;
-    int nVarNum = -1;
-    int fDumpRes = 0;
-    int fBinary = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ANdbvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            NpnType = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( NpnType < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nVarNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nVarNum < 0 )
-                goto usage;
-            break;
-        case 'd':
-            fDumpRes ^= 1;
-            break;
-        case 'b':
-            fBinary ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( argc != globalUtilOptind + 1 )
-    {
-        Abc_Print( 1,"Input file is not given.\n" );
-        return 0;
-    }
-    if ( nVarNum >= 0 && nVarNum < 6 )
-    {
-        Abc_Print( 1,"The number of variables cannot be less than 6.\n" );
-        return 0;
-    }
-    // get the output file name
-    pFileName = argv[globalUtilOptind];
-    // call the testbench
-    Abc_NpnTest( pFileName, NpnType, nVarNum, fDumpRes, fBinary, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: testnpn [-AN <num>] [-dbvh] <file>\n" );
-    Abc_Print( -2, "\t           testbench for computing (semi-)canonical forms\n" );
-    Abc_Print( -2, "\t           of completely-specified Boolean functions up to 16 varibles\n" );
-    Abc_Print( -2, "\t-A <num> : semi-caninical form computation algorithm [default = %d]\n", NpnType );
-    Abc_Print( -2, "\t               0: uniqifying truth tables\n" );
-    Abc_Print( -2, "\t               1: exact NPN canonical form by brute-force enumeration\n" );
-    Abc_Print( -2, "\t               2: semi-canonical form by counting 1s in cofactors\n" );
-    Abc_Print( -2, "\t               3: Jake's hybrid semi-canonical form (fast)\n" );
-    Abc_Print( -2, "\t               4: Jake's hybrid semi-canonical form (high-effort)\n" );
-    Abc_Print( -2, "\t               5: new fast hybrid semi-canonical form\n" );
-    Abc_Print( -2, "\t               6: new phase canonical form\n" );
-    Abc_Print( -2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n" );
-    Abc_Print( -2, "\t-d       : toggle dumping resulting functions into a file [default = %s]\n", fDumpRes? "yes": "no" );
-    Abc_Print( -2, "\t-b       : toggle dumping in binary format [default = %s]\n", fBinary? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    Abc_Print( -2, "\t<file>   : a text file with truth tables in hexadecimal, listed one per line,\n");
-    Abc_Print( -2, "\t           or a binary file with an array of truth tables (in this case,\n");
-    Abc_Print( -2, "\t           -N <num> is required to determine how many functions are stored)\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTestRPO(Abc_Frame_t * pAbc, int argc, char ** argv) {
-    extern int Abc_RpoTest(char * pFileName, int nVarNum, int nThreshold, int fVerbose);
-    char * pFileName;
-    int c;
-    int nVarNum = -1;
-    int fVerbose = 0;
-    int nThreshold = -1;
-    Extra_UtilGetoptReset();
-    while ((c = Extra_UtilGetopt(argc, argv, "TNvh")) != EOF) {
-        switch (c) {
-            case 'N':
-                if (globalUtilOptind >= argc) {
-                    Abc_Print(-1, "Command line switch \"-N\" should be followed by an integer.\n");
-                    goto usage;
-                }
-                nVarNum = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if (nVarNum < 0)
-                    goto usage;
-                break;
-            case 'T':
-                if (globalUtilOptind >= argc) {
-                    Abc_Print(-1, "Command line switch \"-T\" should be followed by an integer.\n");
-                    goto usage;
-                }
-                nThreshold = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if (nThreshold < 0)
-                    goto usage;
-                break;
-            case 'v':
-                fVerbose ^= 1;
-                break;
-            case 'h':
-                goto usage;
-            default:
-                goto usage;
-        }
-    }
-    if (argc != globalUtilOptind + 1) 
-    {
-        Abc_Print(1, "Input file is not given.\n");
-        goto usage;
-    }
-    // get the output file name
-    pFileName = argv[globalUtilOptind];
-    // call the testbench
-    Abc_RpoTest( pFileName, nVarNum, nThreshold, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print(-2, "usage: testrpo [-NT <num>] [-vh] <file>\n");
-    Abc_Print(-2, "\t           RPO algorithm developed and implemented by Mayler G. A. Martins,\n");
-    Abc_Print(-2, "\t           Vinicius Callegaro, Renato P. Ribas and Andre' I. Reis\n");
-    Abc_Print(-2, "\t           at Federal University of Rio Grande do Sul, Porto Alegre, Brazil\n");
-    Abc_Print(-2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n");
-    Abc_Print(-2, "\t-T <num> : the number of recursions accepted before abort [default = INFINITE]\n");
-    Abc_Print(-2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose ? "yes" : "no");
-    Abc_Print(-2, "\t-h       : print the command usage\n");
-    Abc_Print(-2, "\t<file>   : a text file with truth tables in hexadecimal, listed one per line,\n");
-    Abc_Print(-2, "\t           or a binary file with an array of truth tables (in this case,\n");
-    Abc_Print(-2, "\t           -N <num> is required to determine how many functions are stored)\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUpdateLevel;
-    int fPrecompute;
-    int fUseZeros;
-    int fVerbose;
-    int fVeryVerbose;
-    int fPlaceEnable;
-    // external functions
-    extern void Rwr_Precompute();
-
-    // set defaults
-    fUpdateLevel = 1;
-    fPrecompute  = 0;
-    fUseZeros    = 0;
-    fVerbose     = 0;
-    fVeryVerbose = 0;
-    fPlaceEnable = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lxzvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'x':
-            fPrecompute ^= 1;
-            break;
-        case 'z':
-            fUseZeros ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'p':
-            fPlaceEnable ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( fPrecompute )
-    {
-        Rwr_Precompute();
-        return 0;
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum(pNtk) )
-    {
-        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    if ( !Abc_NtkRewrite( pNtk, fUpdateLevel, fUseZeros, fVerbose, fVeryVerbose, fPlaceEnable ) )
-    {
-        Abc_Print( -1, "Rewriting has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: rewrite [-lzvwh]\n" );
-    Abc_Print( -2, "\t         performs technology-independent rewriting of the AIG\n" );
-    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printout subgraph statistics [default = %s]\n", fVeryVerbose? "yes": "no" );
-//    Abc_Print( -2, "\t-p     : toggle placement-aware rewriting [default = %s]\n", fPlaceEnable? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nNodeSizeMax;
-    int nConeSizeMax;
-    int fUpdateLevel;
-    int fUseZeros;
-    int fUseDcs;
-    int fVerbose;
-    extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose );
-
-    // set defaults
-    nNodeSizeMax = 10;
-    nConeSizeMax = 16;
-    fUpdateLevel =  1;
-    fUseZeros    =  0;
-    fUseDcs      =  0;
-    fVerbose     =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NClzdvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nNodeSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nNodeSizeMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConeSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConeSizeMax < 0 )
-                goto usage;
-            break;
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'z':
-            fUseZeros ^= 1;
-            break;
-        case 'd':
-            fUseDcs ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum(pNtk) )
-    {
-        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
-        return 1;
-    }
-
-    if ( fUseDcs && nNodeSizeMax >= nConeSizeMax )
-    {
-        Abc_Print( -1, "For don't-care to work, containing cone should be larger than collapsed node.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    if ( !Abc_NtkRefactor( pNtk, nNodeSizeMax, nConeSizeMax, fUpdateLevel, fUseZeros, fUseDcs, fVerbose ) )
-    {
-        Abc_Print( -1, "Refactoring has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: refactor [-NC <num>] [-lzdvh]\n" );
-    Abc_Print( -2, "\t           performs technology-independent refactoring of the AIG\n" );
-    Abc_Print( -2, "\t-N <num> : the max support of the collapsed node [default = %d]\n", nNodeSizeMax );
-    Abc_Print( -2, "\t-C <num> : the max support of the containing cone [default = %d]\n", nConeSizeMax );
-    Abc_Print( -2, "\t-l       : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-z       : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
-    Abc_Print( -2, "\t-d       : toggle using don't-cares [default = %s]\n", fUseDcs? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRestructure( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nCutsMax;
-    int fUpdateLevel;
-    int fUseZeros;
-    int fVerbose;
-    extern int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutsMax, int fUpdateLevel, int fUseZeros, int fVerbose );
-
-    // set defaults
-    nCutsMax      =  5;
-    fUpdateLevel =  0;
-    fUseZeros    =  0;
-    fVerbose     =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Klzvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'z':
-            fUseZeros ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( nCutsMax < 4 || nCutsMax > CUT_SIZE_MAX )
-    {
-        Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", 4, CUT_SIZE_MAX );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum(pNtk) )
-    {
-        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    if ( !Abc_NtkRestructure( pNtk, nCutsMax, fUpdateLevel, fUseZeros, fVerbose ) )
-    {
-        Abc_Print( -1, "Refactoring has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: restructure [-K <num>] [-lzvh]\n" );
-    Abc_Print( -2, "\t           performs technology-independent restructuring of the AIG\n" );
-    Abc_Print( -2, "\t-K <num> : the max cut size (%d <= num <= %d) [default = %d]\n",   CUT_SIZE_MIN, CUT_SIZE_MAX, nCutsMax );
-    Abc_Print( -2, "\t-l       : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-z       : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandResubstitute( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int RS_CUT_MIN =  4;
-    int RS_CUT_MAX = 16;
-    int c;
-    int nCutsMax;
-    int nNodesMax;
-    int nLevelsOdc;
-    int fUpdateLevel;
-    int fUseZeros;
-    int fVerbose;
-    int fVeryVerbose;
-    extern int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutsMax, int nNodesMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose );
-
-    // set defaults
-    nCutsMax     =  8;
-    nNodesMax    =  1;
-    nLevelsOdc   =  0;
-    fUpdateLevel =  1;
-    fUseZeros    =  0;
-    fVerbose     =  0;
-    fVeryVerbose =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KNFlzvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nNodesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nNodesMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLevelsOdc = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLevelsOdc < 0 )
-                goto usage;
-            break;
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'z':
-            fUseZeros ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( nCutsMax < RS_CUT_MIN || nCutsMax > RS_CUT_MAX )
-    {
-        Abc_Print( -1, "Can only compute cuts for %d <= K <= %d.\n", RS_CUT_MIN, RS_CUT_MAX );
-        return 1;
-    }
-    if ( nNodesMax < 0 || nNodesMax > 3 )
-    {
-        Abc_Print( -1, "Can only resubstitute at most 3 nodes.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum(pNtk) )
-    {
-        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    if ( !Abc_NtkResubstitute( pNtk, nCutsMax, nNodesMax, nLevelsOdc, fUpdateLevel, fVerbose, fVeryVerbose ) )
-    {
-        Abc_Print( -1, "Refactoring has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: resub [-KN <num>] [-lzvwh]\n" );
-    Abc_Print( -2, "\t           performs technology-independent restructuring of the AIG\n" );
-    Abc_Print( -2, "\t-K <num> : the max cut size (%d <= num <= %d) [default = %d]\n", RS_CUT_MIN, RS_CUT_MAX, nCutsMax );
-    Abc_Print( -2, "\t-N <num> : the max number of nodes to add (0 <= num <= 3) [default = %d]\n", nNodesMax );
-    Abc_Print( -2, "\t-F <num> : the number of fanout levels for ODC computation [default = %d]\n", nLevelsOdc );
-    Abc_Print( -2, "\t-l       : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-z       : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle verbose printout of ODC computation [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRr( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c, Window;
-    int nFaninLevels;
-    int nFanoutLevels;
-    int fUseFanouts;
-    int fVerbose;
-    extern int Abc_NtkRR( Abc_Ntk_t * pNtk, int nFaninLevels, int nFanoutLevels, int fUseFanouts, int fVerbose );
-
-    // set defaults
-    nFaninLevels  = 3;
-    nFanoutLevels = 3;
-    fUseFanouts   = 0;
-    fVerbose      = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Wfvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Window = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Window < 0 )
-                goto usage;
-            nFaninLevels  = Window / 10;
-            nFanoutLevels = Window % 10;
-            break;
-        case 'f':
-            fUseFanouts ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum(pNtk) )
-    {
-        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
-        return 1;
-    }
-
-    // modify the current network
-    if ( !Abc_NtkRR( pNtk, nFaninLevels, nFanoutLevels, fUseFanouts, fVerbose ) )
-    {
-        Abc_Print( -1, "Redundancy removal has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: rr [-W NM] [-fvh]\n" );
-    Abc_Print( -2, "\t         removes combinational redundancies in the current network\n" );
-    Abc_Print( -2, "\t-W NM  : window size: TFI (N) and TFO (M) logic levels [default = %d%d]\n", nFaninLevels, nFanoutLevels );
-    Abc_Print( -2, "\t-f     : toggle RR w.r.t. fanouts [default = %s]\n", fUseFanouts? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCascade( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, nLutSize;
-    int fCheck;
-    int fVerbose;
-    extern Abc_Ntk_t * Abc_NtkCascade( Abc_Ntk_t * pNtk, int nLutSize, int fCheck, int fVerbose );
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    nLutSize = 12;
-    fCheck   = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Kcvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 0 )
-                goto usage;
-            break;
-        case 'c':
-            fCheck ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( Abc_NtkIsStrash(pNtk) )
-        pNtkRes = Abc_NtkCascade( pNtk, nLutSize, fCheck, fVerbose );
-    else
-    {
-        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        pNtkRes = Abc_NtkCascade( pNtk, nLutSize, fCheck, fVerbose );
-        Abc_NtkDelete( pNtk );
-    }
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Cascade synthesis has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cascade [-K <num>] [-cvh]\n" );
-    Abc_Print( -2, "\t           performs LUT cascade synthesis for the current network\n" );
-    Abc_Print( -2, "\t-K <num> : the number of LUT inputs [default = %d]\n", nLutSize );
-    Abc_Print( -2, "\t-c       : check equivalence after synthesis [default = %s]\n", fCheck? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    Abc_Print( -2, "\t           \n");
-    Abc_Print( -2, "  A lookup-table cascade is a programmable architecture developed by\n");
-    Abc_Print( -2, "  Professor Tsutomu Sasao (sasao@cse.kyutech.ac.jp) at Kyushu Institute\n");
-    Abc_Print( -2, "  of Technology. This work received Takeda Techno-Entrepreneurship Award:\n");
-    Abc_Print( -2, "  http://www.lsi-cad.com/sasao/photo/takeda.html\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkShareXor( Abc_Ntk_t * pNtk, int nMultiSize, int fAnd, int fVerbose );
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, nMultiSize, fAnd, fVerbose;
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    nMultiSize = 3;
-    fAnd       = 0;
-    fVerbose   = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Kavh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nMultiSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nMultiSize < 0 )
-                goto usage;
-            break;
-        case 'a':
-            fAnd ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
-        return 1;
-    }
-    // get the new network
-    pNtkRes = Abc_NtkShareXor( pNtk, nMultiSize, fAnd, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Cascade synthesis has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: extract [-K <num>] [-avh]\n" );
-    Abc_Print( -2, "\t           extracts shared logic from multi-input gates\n" );
-    Abc_Print( -2, "\t-K <num> : the minimum gate size to consider for extraction [default = %d]\n", nMultiSize );
-    Abc_Print( -2, "\t-a       : toggle multi-input XOR vs multi-input AND [default = %s]\n", fAnd? "AND": "XOR" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandVarMin( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_SuppTest( int nOnes, int nVars, int fUseSimple, int fCheck, int fVerbose );
-    extern void Abc_SuppReadMinTest( char * pFileName );
-    int nOnes      =  4;
-    int nVars      = 20;
-    int fUseSimple =  0;
-    int fCheck     =  0;
-    int fVerbose   =  0;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "MNocvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nOnes = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nOnes < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nVars = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nVars < 0 )
-                goto usage;
-            break;
-        case 'o':
-            fUseSimple ^= 1;
-            break;
-        case 'c':
-            fCheck ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    // get the file name
-    if ( argc == globalUtilOptind + 1 )
-    {
-        Abc_SuppReadMinTest( argv[globalUtilOptind] );
-        return 0;
-    }
-    Abc_SuppTest( nOnes, nVars, fUseSimple, fCheck, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: varmin [-MN <num>] [-ocvh]\n" );
-    Abc_Print( -2, "\t           performs support minimization\n" );
-    Abc_Print( -2, "\t-M <num> : the number of ones in the combination [default = %d]\n", nOnes );
-    Abc_Print( -2, "\t-N <num> : the number of variables in the problem [default = %d]\n", nVars );
-    Abc_Print( -2, "\t-o       : toggle computing reduced difference matrix [default = %s]\n", fUseSimple? "yes": "no" );
-    Abc_Print( -2, "\t-c       : toggle verifying the final result [default = %s]\n", fCheck? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash( pNtk ) )
-    {
-        Abc_Print( -1, "This command is only applicable to strashed networks.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkToLogic( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Converting to a logic network has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: logic [-h]\n" );
-    Abc_Print( -2, "\t        transforms an AIG into a logic network with SOPs\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandComb( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fRemoveLatches;
-    int nLatchesToAdd;
-    extern void Abc_NtkMakeSeq( Abc_Ntk_t * pNtk, int nLatchesToAdd );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fRemoveLatches = 0;
-    nLatchesToAdd = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Llh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLatchesToAdd = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLatchesToAdd < 0 )
-                goto usage;
-            break;
-        case 'l':
-            fRemoveLatches ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsComb(pNtk) && nLatchesToAdd == 0 )
-    {
-        Abc_Print( -1, "The network is already combinational.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkIsComb(pNtk) && nLatchesToAdd != 0 )
-    {
-        Abc_Print( -1, "The network is already combinational.\n" );
-        return 0;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkDup( pNtk );
-    if ( nLatchesToAdd )
-        Abc_NtkMakeSeq( pNtkRes, nLatchesToAdd );
-    else
-        Abc_NtkMakeComb( pNtkRes, fRemoveLatches );
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: comb [-L <num>] [-lh]\n" );
-    Abc_Print( -2, "\t           converts comb network into seq, and vice versa\n" );
-    Abc_Print( -2, "\t-L <num> : number of latches to add to comb network (0 = do not add) [default = %d]\n", nLatchesToAdd );
-    Abc_Print( -2, "\t-l       : toggle converting latches to PIs/POs or removing them [default = %s]\n", fRemoveLatches? "remove": "convert" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[32];
-    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes;
-    int fDelete1, fDelete2;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c;
-    int fCheck;
-    int fComb;
-    int fImplic;
-    int fMulti;
-    int nPartSize;
-    int fTrans;
-    int fIgnoreNames;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    fComb  = 0;
-    fCheck = 1;
-    fImplic = 0;
-    fMulti = 0;
-    nPartSize = 0;
-    fTrans = 0;
-    fIgnoreNames = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Pcmitnh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nPartSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nPartSize < 0 )
-                goto usage;
-            break;
-        case 'c':
-            fComb ^= 1;
-            break;
-        case 'm':
-            fMulti ^= 1;
-            break;
-        case 'i':
-            fImplic ^= 1;
-            break;
-        case 't':
-            fTrans ^= 1;
-            break;
-        case 'n':
-            fIgnoreNames ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( fTrans )
-    {
-        if ( (Abc_NtkPoNum(pNtk) & 1) == 1 )
-        {
-            Abc_Print( -1, "Abc_CommandMiter(): The number of outputs should be even.\n" );
-            return 0;
-        }
-        // replace the current network
-        pNtkRes = Abc_NtkDupTransformMiter( pNtk );
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-        Abc_Print( 1, "The miter (current network) is transformed by XORing POs pair-wise.\n" );
-        return 0;
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-        return 1;
-
-    if ( fIgnoreNames )
-    {
-        if ( !fDelete1 )
-        {
-            pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
-            fDelete1 = 1;
-        }
-        if ( !fDelete2 )
-        {
-            pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
-            fDelete2 = 1;
-        }
-        Abc_NtkShortNames( pNtk1 );
-        Abc_NtkShortNames( pNtk2 );
-    }
-    // compute the miter
-    pNtkRes = Abc_NtkMiter( pNtk1, pNtk2, fComb, nPartSize, fImplic, fMulti );
-    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-
-    // get the new network
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Miter computation has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    if ( nPartSize == 0 )
-        strcpy( Buffer, "unused" );
-    else
-        sprintf(Buffer, "%d", nPartSize );
-    Abc_Print( -2, "usage: miter [-P <num>] [-cimtnh] <file1> <file2>\n" );
-    Abc_Print( -2, "\t           computes the miter of the two circuits\n" );
-    Abc_Print( -2, "\t-P <num> : output partition size [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-c       : toggles deriving combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
-    Abc_Print( -2, "\t-i       : toggles deriving implication miter (file1 => file2) [default = %s]\n", fImplic? "yes": "no" );
-    Abc_Print( -2, "\t-m       : toggles creating multi-output miter [default = %s]\n", fMulti? "yes": "no" );
-    Abc_Print( -2, "\t-t       : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
-    Abc_Print( -2, "\t-n       : toggle ignoring names when matching CIs/COs [default = %s]\n", fIgnoreNames? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    Abc_Print( -2, "\tfile1    : (optional) the file with the first network\n");
-    Abc_Print( -2, "\tfile2    : (optional) the file with the second network\n");
-    Abc_Print( -2, "\t           if no files are given, uses the current network and its spec\n");
-    Abc_Print( -2, "\t           if one file is given, uses the current network and the file\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c, fDual, fVerbose;
-    extern int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk );
-    extern int Abc_NtkDarDemiterDual( Abc_Ntk_t * pNtk, int fVerbose );
-    // set defaults
-    fDual = 0;
-    fVerbose = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'd':
-            fDual ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "The network is not strashed.\n" );
-        return 1;
-    }
-
-    if ( fDual )
-    {
-        if ( (Abc_NtkPoNum(pNtk) & 1) )
-        {
-            Abc_Print( -1, "The number of POs should be even.\n" );
-            return 0;
-        }
-        if ( !Abc_NtkDarDemiterDual( pNtk, fVerbose ) )
-        {
-            Abc_Print( -1, "Demitering has failed.\n" );
-            return 1;
-        }
-        return 0;
-    }
-/*
-    if ( Abc_NtkPoNum(pNtk) != 1 )
-    {
-        Abc_Print( -1, "The network is not a single-output miter.\n" );
-        return 1;
-    }
-    if ( !Abc_NodeIsExorType(Abc_ObjFanin0(Abc_NtkPo(pNtk,0))) )
-    {
-        Abc_Print( -1, "The miter's PO is not an EXOR.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkDemiter( pNtk ) )
-    {
-        Abc_Print( -1, "Demitering has failed.\n" );
-        return 1;
-    }
-*/
-    // get the new network
-    if ( !Abc_NtkDarDemiter( pNtk ) )
-    {
-        Abc_Print( -1, "Demitering has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: demiter [-dvh]\n" );
-    Abc_Print( -2, "\t        splits sequential miter into two circuits\n" );
-    Abc_Print( -2, "\t-d    : expects a dual-output miter (without XORs) [default = %s]\n", fDual? "yes": "no" );
-    Abc_Print( -2, "\t-v    : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandOrPos( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
-    int fReverse = 0;
-    int fComb = 0;
-    int fXor = 0;
-    int c;
-    extern int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd, int fXor );
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "rxh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'r':
-            fReverse ^= 1;
-            break;
-        case 'x':
-            fXor ^= 1;
-            break;
-        case 'c':
-            fComb ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "The network is not strashed.\n" );
-        return 1;
-    }
-    // get the new network
-    if ( fReverse )
-    {
-        extern Aig_Man_t * Abc_NtkToDarBmc( Abc_Ntk_t * pNtk, Vec_Int_t ** pvMap );
-        Aig_Man_t * pMan = Abc_NtkToDarBmc( pNtk, NULL );
-        Abc_Ntk_t * pNtkRes = Abc_NtkFromAigPhase( pMan );
-        Aig_ManStop( pMan );
-        // perform expansion
-        if ( Abc_NtkPoNum(pNtk) != Abc_NtkPoNum(pNtkRes) )
-            Abc_Print( 1,"Expanded %d outputs into %d outputs using OR decomposition.\n", Abc_NtkPoNum(pNtk), Abc_NtkPoNum(pNtkRes) );
-        else
-            Abc_Print( 1,"The output(s) cannot be structurally decomposed.\n" );
-        // clear counter-example
-        if ( pAbc->pCex )
-            ABC_FREE( pAbc->pCex );
-        // replace the current network
-        ABC_FREE( pNtkRes->pName );
-        pNtkRes->pName = Extra_UtilStrsav(pNtk->pName);
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    }
-    else
-    {
-        if ( !Abc_NtkCombinePos( pNtk, 0, fXor ) )
-        {
-            Abc_Print( -1, "ORing the POs has failed.\n" );
-            return 1;
-        }
-        // update counter-example
-        if ( pAbc->pCex )
-            pAbc->pCex->iPo = 0;
-        // replace the current network
-    //    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: orpos [-rxh]\n" );
-    Abc_Print( -2, "\t        creates single-output miter by ORing the POs of the current network\n" );
-    Abc_Print( -2, "\t-r    : performs the reverse transform (OR decomposition) [default = %s]\n", fReverse? "yes": "no" );
-    Abc_Print( -2, "\t-x    : toggles combining the PO using XOR [default = %s]\n", fXor? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAndPos( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
-    int fComb = 0;
-    int c;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'c':
-            fComb ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "The network is not strashed.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkPoNum(pNtk) == 1 )
-    {
-        Abc_Print( -1, "The network already has one PO.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkLatchNum(pNtk) )
-    {
-        Abc_Print( -1, "The miter has latches. ORing is not performed.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( !Abc_NtkCombinePos( pNtk, 1, 0 ) )
-    {
-        Abc_Print( -1, "ANDing the POs has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: andpos [-h]\n" );
-    Abc_Print( -2, "\t        creates single-output miter by ANDing the POs of the current network\n" );
-//    Abc_Print( -2, "\t-c    : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL;
-    int c, iOutput = -1;
-    int fSkipSweep = 0;
-    int fUseConst1 = 0;
-    extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep, int fUseConst1 );
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nsoh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iOutput = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iOutput < 0 )
-                goto usage;
-            break;
-        case 's':
-            fSkipSweep ^= 1;
-            break;
-        case 'o':
-            fUseConst1 ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "The network is not strashed.\n" );
-        return 1;
-    }
-    if ( iOutput < 0 )
-    {
-        Abc_Print( -1, "The output index is not specified.\n" );
-        return 1;
-    }
-    if ( iOutput >= Abc_NtkPoNum(pNtk) )
-    {
-        Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
-        return 1;
-    }
-
-    // get the new network
-//    pNtkRes = Abc_NtkDup( pNtk );
-//    Abc_NtkDropOneOutput( pNtkRes, iOutput );
-//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    Abc_NtkDropOneOutput( pNtk, iOutput, fSkipSweep, fUseConst1 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: zeropo [-N <num>] [-soh]\n" );
-    Abc_Print( -2, "\t           replaces the PO driver by constant 0\n" );
-    Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to replace [default = %d]\n", iOutput );
-    Abc_Print( -2, "\t-s       : performs comb sweep after removimg a PO [default = %s]\n", !fSkipSweep? "yes": "no" );
-    Abc_Print( -2, "\t-o       : toggles using const 1 instead of const 0 [default = %s]\n", fUseConst1? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSwapPos( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes;
-    int c, iOutput = -1;
-    extern void Abc_NtkSwapOneOutput( Abc_Ntk_t * pNtk, int iOutput );
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iOutput = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iOutput < 0 )
-                goto usage;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "The network is not strashed.\n" );
-        return 1;
-    }
-    if ( iOutput < 0 )
-    {
-        Abc_Print( -1, "The output index is not specified.\n" );
-        return 1;
-    }
-    if ( iOutput >= Abc_NtkPoNum(pNtk) )
-    {
-        Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkDup( pNtk );
-    Abc_NtkSwapOneOutput( pNtkRes, iOutput );
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: swappos [-N <num>] [-h]\n" );
-    Abc_Print( -2, "\t           swap the 0-th PO with the <num>-th PO\n" );
-    Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to swap [default = %d]\n", iOutput );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRemovePo( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL;
-    int c, iOutput = -1;
-    int fRemoveConst0 = 1;
-    extern void Abc_NtkRemovePo( Abc_Ntk_t * pNtk, int iOutput, int fRemoveConst0 );
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nzh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iOutput = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iOutput < 0 )
-                goto usage;
-            break;
-        case 'z':
-            fRemoveConst0 ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "The network is not strashed.\n" );
-        return 1;
-    }
-    if ( iOutput < 0 )
-    {
-        Abc_Print( -1, "The output index is not specified.\n" );
-        return 1;
-    }
-    if ( iOutput >= Abc_NtkPoNum(pNtk) )
-    {
-        Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
-        return 1;
-    }
-
-    // get the new network
-//    pNtkRes = Abc_NtkDup( pNtk );
-//    Abc_NtkRemovePo( pNtkRes, iOutput );
-//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    Abc_NtkRemovePo( pNtk, iOutput, fRemoveConst0 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: removepo [-N <num>] [-zh]\n" );
-    Abc_Print( -2, "\t           remove PO with number <num> if it is const0\n" );
-    Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to remove [default = %d]\n", iOutput );
-    Abc_Print( -2, "\t-z       : toggle removing const1 instead of const0 [default = %s]\n", fRemoveConst0? "const0": "const1" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDropSat( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes = NULL;
-    int fNoSweep = 0;
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fNoSweep ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-    if ( pAbc->vCexVec == NULL )
-    {
-        Abc_Print( -1, "CEX array is not defined. Run \"bmc3 -az\", \"sim3 -az\", or \"pdr -az\".\n" );
-        return 1;
-    }
-    if ( Vec_PtrSize(pAbc->vCexVec) != Abc_NtkPoNum(pNtk) )
-    {
-        Abc_Print( -1, "CEX array size (%d) does not match the number of outputs (%d).\n", Vec_PtrSize(pAbc->vCexVec), Abc_NtkPoNum(pNtk) );
-        return 1;
-    }
-    Abc_NtkDropSatOutputs( pNtk, pAbc->vCexVec, fVerbose );
-    if ( !fNoSweep )
-    {
-        pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "Removing SAT outputs has failed.\n" );
-            return 1;
-        }
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dropsat [-sh]\n" );
-    Abc_Print( -2, "\t         replaces satisfiable POs by constant 0 and cleans up the AIG\n" );
-    Abc_Print( -2, "\t-s     : toggles skipping sequential sweep [default = %s]\n", fNoSweep? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAddPi( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes;
-    int c;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkDup( pNtk );
-    if ( Abc_NtkPiNum(pNtkRes) == 0 )
-    {
-        Abc_Obj_t * pObj = Abc_NtkCreatePi( pNtkRes );
-        Abc_ObjAssignName( pObj, "dummy_pi", NULL );
-        Abc_NtkOrderCisCos( pNtkRes );
-    }
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: addpi [-h]\n" );
-    Abc_Print( -2, "\t         if the network has no PIs, add one dummy PI\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAppend( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtk2;
-    char * FileName;
-    int fComb = 0;
-    int c;
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'c':
-            fComb ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    // get the second network
-    if ( argc != globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "The network to append is not given.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "The base network should be strashed for the appending to work.\n" );
-        return 1;
-    }
-
-    // read the second network
-    FileName = argv[globalUtilOptind];
-    pNtk2 = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
-    if ( pNtk2 == NULL )
-        return 1;
-
-    // check if the second network is combinational
-    if ( Abc_NtkLatchNum(pNtk2) )
-    {
-        Abc_NtkDelete( pNtk2 );
-        Abc_Print( -1, "The second network has latches. Appending does not work for such networks.\n" );
-        return 0;
-    }
-
-    // get the new network
-    if ( !Abc_NtkAppend( pNtk, pNtk2, 1 ) )
-    {
-        Abc_NtkDelete( pNtk2 );
-        Abc_Print( -1, "Appending the networks failed.\n" );
-        return 1;
-    }
-    Abc_NtkDelete( pNtk2 );
-    // sweep dangling logic
-    Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
-    // replace the current network
-//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: append [-h] <file>\n" );
-    Abc_Print( -2, "\t         appends a combinational network on top of the current network\n" );
-//    Abc_Print( -2, "\t-c     : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : file name with the second network\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPutOnTop( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkPutOnTop( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtk2 );
-
-    Abc_Ntk_t * pNtk, * pNtk2, * pNtkRes;
-    char * FileName;
-    int fComb = 0;
-    int c;
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'c':
-            fComb ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    // get the second network
-    if ( argc != globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "The network to append is not given.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "The base network should be in the logic form.\n" );
-        return 1;
-    }
-
-    // check if the second network is combinational
-    if ( Abc_NtkLatchNum(pNtk) )
-    {
-        Abc_Print( -1, "The current network has latches. This command does not work for such networks.\n" );
-        return 0;
-    }
-
-    // read the second network
-    FileName = argv[globalUtilOptind];
-    pNtk2 = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
-    if ( pNtk2 == NULL )
-        return 1;
-
-    // check if the second network is combinational
-    if ( Abc_NtkLatchNum(pNtk2) )
-    {
-        Abc_NtkDelete( pNtk2 );
-        Abc_Print( -1, "The second network has latches. This command does not work for such networks.\n" );
-        return 0;
-    }
-    // compare inputs/outputs
-    if ( Abc_NtkPoNum(pNtk) != Abc_NtkPiNum(pNtk2) )
-    {
-        Abc_NtkDelete( pNtk2 );
-        Abc_Print( -1, "The PO count (%d) of the first network is not equal to PI count (%d) of the second network.\n", Abc_NtkPoNum(pNtk), Abc_NtkPiNum(pNtk2) );
-        return 0;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkPutOnTop( pNtk, pNtk2 );
-    Abc_NtkDelete( pNtk2 );
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: putontop [-h] <file>\n" );
-    Abc_Print( -2, "\t         connects PIs of network in <file> to POs of current network\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : file name with the second network\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkTemp, * pNtkRes;
-    int nFrames;
-    int fInitial;
-    int fVerbose;
-    int c;
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    nFrames  = 5;
-    fInitial = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames <= 0 )
-                goto usage;
-            break;
-        case 'i':
-            fInitial ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        pNtkRes  = Abc_NtkFrames( pNtkTemp, nFrames, fInitial, fVerbose );
-        Abc_NtkDelete( pNtkTemp );
-    }
-    else
-        pNtkRes  = Abc_NtkFrames( pNtk, nFrames, fInitial, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Unrolling the network has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: frames [-F <num>] [-ivh]\n" );
-    Abc_Print( -2, "\t           unrolls the network for a number of time frames\n" );
-    Abc_Print( -2, "\t-F <num> : the number of frames to unroll [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-i       : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkTemp, * pNtkRes;
-    int nPrefix;
-    int nFrames;
-    int fInitial;
-    int fVerbose;
-    int c;
-
-    extern Abc_Ntk_t * Abc_NtkDarFrames( Abc_Ntk_t * pNtk, int nPrefix, int nFrames, int fInitial, int fVerbose );
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    nPrefix  = 5;
-    nFrames  = 5;
-    fInitial = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NFivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nPrefix = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nPrefix <= 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames <= 0 )
-                goto usage;
-            break;
-        case 'i':
-            fInitial ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( nPrefix > nFrames )
-    {
-        Abc_Print( -1, "Prefix (%d) cannot be more than the number of frames (%d).\n", nPrefix, nFrames );
-        return 1;
-    }
-
-    // get the new network
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        pNtkRes  = Abc_NtkDarFrames( pNtkTemp, nPrefix, nFrames, fInitial, fVerbose );
-        Abc_NtkDelete( pNtkTemp );
-    }
-    else
-        pNtkRes  = Abc_NtkDarFrames( pNtk, nPrefix, nFrames, fInitial, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Unrolling the network has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dframes [-NF <num>] [-ivh]\n" );
-    Abc_Print( -2, "\t         unrolls the network with simplification\n" );
-    Abc_Print( -2, "\t-N num : the number of frames to use as prefix [default = %d]\n", nPrefix );
-    Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-i     : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSop( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int fDirect;
-    int c;
-
-    // set defaults
-    fDirect = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'd':
-            fDirect ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Converting to SOP is possible only for logic networks.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkToSop(pNtk, fDirect) )
-    {
-        Abc_Print( -1, "Converting to SOP has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: sop [-dh]\n" );
-    Abc_Print( -2, "\t         converts node functions to SOP\n" );
-    Abc_Print( -2, "\t-d     : toggles using both phases or only positive [default = %s]\n", fDirect? "direct": "both" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int fReorder = 1;
-    int c;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "rh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'r':
-            fReorder ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Converting to BDD is possible only for logic networks.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsBddLogic(pNtk) )
-    {
-        Abc_Print( -1, "The logic network is already in the BDD form.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkToBdd(pNtk) )
-    {
-        Abc_Print( -1, "Converting to BDD has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: bdd [-rh]\n" );
-    Abc_Print( -2, "\t         converts node functions to BDD\n" );
-    Abc_Print( -2, "\t-r     : toggles enabling dynamic variable reordering [default = %s]\n", fReorder? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Converting to AIG is possible only for logic networks.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsAigLogic(pNtk) )
-    {
-        Abc_Print( -1, "The logic network is already in the AIG form.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkToAig(pNtk) )
-    {
-        Abc_Print( -1, "Converting to AIG has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: aig [-h]\n" );
-    Abc_Print( -2, "\t         converts node functions to AIG\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandReorder( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fVerbose;
-    extern void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose );
-
-    // set defaults
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( !Abc_NtkIsBddLogic(pNtk) )
-    {
-        Abc_Print( -1, "Variable reordering is possible when node functions are BDDs (run \"bdd\").\n" );
-        return 1;
-    }
-    Abc_NtkBddReorder( pNtk, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: reorder [-vh]\n" );
-    Abc_Print( -2, "\t         reorders local functions of the nodes using sifting\n" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBidec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fVerbose;
-    extern void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose );
-
-    // set defaults
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( !Abc_NtkIsAigLogic(pNtk) )
-    {
-        Abc_Print( -1, "Bi-decomposition only works when node functions are AIGs (run \"aig\").\n" );
-        return 1;
-    }
-    Abc_NtkBidecResyn( pNtk, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: bidec [-vh]\n" );
-    Abc_Print( -2, "\t         applies bi-decomposition to local functions of the nodes\n" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandOrder( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    FILE * pFile;
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    char * pFileName;
-    int c;
-    int fReverse;
-    int fVerbose;
-    extern void Abc_NtkImplementCiOrder( Abc_Ntk_t * pNtk, char * pFileName, int fReverse, int fVerbose );
-    extern void Abc_NtkFindCiOrder( Abc_Ntk_t * pNtk, int fReverse, int fVerbose );
-
-    // set defaults
-    fReverse = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'r':
-            fReverse ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-//    if ( Abc_NtkLatchNum(pNtk) > 0 )
-//    {
-//        Abc_Print( -1, "Currently this procedure does not work for sequential networks.\n" );
-//        return 1;
-//    }
-
-    // if the var order file is given, implement this order
-    pFileName = NULL;
-    if ( argc == globalUtilOptind + 1 )
-    {
-        pFileName = argv[globalUtilOptind];
-        pFile = fopen( pFileName, "r" );
-        if ( pFile == NULL )
-        {
-            Abc_Print( -1, "Cannot open file \"%s\" with the BDD variable order.\n", pFileName );
-            return 1;
-        }
-        fclose( pFile );
-    }
-    if ( pFileName )
-        Abc_NtkImplementCiOrder( pNtk, pFileName, fReverse, fVerbose );
-    else
-        Abc_NtkFindCiOrder( pNtk, fReverse, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: order [-rvh] <file>\n" );
-    Abc_Print( -2, "\t         computes a good static CI variable order\n" );
-    Abc_Print( -2, "\t-r     : toggle reverse ordering [default = %s]\n", fReverse? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : (optional) file with the given variable order\n" );
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMuxes( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsBddLogic(pNtk) )
-    {
-        Abc_Print( -1, "Only a BDD logic network can be converted to MUXes.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkBddToMuxes( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Converting to MUXes has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: muxes [-h]\n" );
-    Abc_Print( -2, "\t        converts the current network into a network derived by\n" );
-    Abc_Print( -2, "\t        replacing all nodes by DAGs isomorphic to the local BDDs\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCubes( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkSopToCubes( Abc_Ntk_t * pNtk );
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsSopLogic(pNtk) )
-    {
-        Abc_Print( -1, "Only a SOP logic network can be transformed into cubes.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkSopToCubes( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Converting to cubes has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cubes [-h]\n" );
-    Abc_Print( -2, "\t        converts the current network into a network derived by creating\n" );
-    Abc_Print( -2, "\t        a separate node for each product and sum in the local SOPs\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSplitSop( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkSplitSop( Abc_Ntk_t * pNtk, int nCubesMax, int fVerbose );
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, fVerbose = 0, nCubesMax = 100;
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCubesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCubesMax < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsSopLogic(pNtk) )
-    {
-        Abc_Print( -1, "Only a SOP logic network can be transformed into cubes.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkSplitSop( pNtk, nCubesMax, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Converting to cubes has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: splitsop [-N num] [-vh]\n" );
-    Abc_Print( -2, "\t         splits nodes whose SOP size is larger than the given one\n" );
-    Abc_Print( -2, "\t-N num : the maximum number of cubes after splitting [default = %d]\n", nCubesMax );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandExtSeqDcs( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fVerbose;
-    extern int Abc_NtkExtractSequentialDcs( Abc_Ntk_t * pNet, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "The current network has no latches.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Extracting sequential don't-cares works only for AIGs (run \"strash\").\n" );
-        return 0;
-    }
-    if ( !Abc_NtkExtractSequentialDcs( pNtk, fVerbose ) )
-    {
-        Abc_Print( -1, "Extracting sequential don't-cares has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: ext_seq_dcs [-vh]\n" );
-    Abc_Print( -2, "\t         create EXDC network using unreachable states\n" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandReach( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Saig_ParBbr_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    char * pLogFileName = NULL;
-
-    extern int Abc_NtkDarReach( Abc_Ntk_t * pNtk, Saig_ParBbr_t * pPars );
-
-    // set defaults
-    Bbr_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "TBFLproyvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBddMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBddMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nIterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIterMax < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'p':
-            pPars->fPartition ^= 1;
-            break;
-        case 'r':
-            pPars->fReorder ^= 1;
-            break;
-        case 'o':
-            pPars->fReorderImage ^= 1;
-            break;
-        case 'y':
-            pPars->fSkipOutCheck ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "The current network has no latches.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Reachability analysis works only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-    pAbc->Status  = Abc_NtkDarReach( pNtk, pPars );
-    pAbc->nFrames = pPars->iFrame;
-    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "reach" );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: reach [-TBF num] [-L file] [-proyvh]\n" );
-    Abc_Print( -2, "\t         verifies sequential miter using BDD-based reachability\n" );
-    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", pPars->nBddMax );
-    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-p     : enable partitioned image computation [default = %s]\n", pPars->fPartition? "yes": "no" );
-    Abc_Print( -2, "\t-r     : enable dynamic BDD variable reordering [default = %s]\n", pPars->fReorder? "yes": "no" );
-    Abc_Print( -2, "\t-o     : toggles BDD variable reordering during image computation [default = %s]\n", pPars->fReorderImage? "yes": "no" );
-    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    Abc_Obj_t * pNode, * pNodeCo;
-    int c;
-    int fUseAllCis;
-    int fUseMffc;
-    int fSeq;
-    int Output;
-    int nRange;
-
-    extern Abc_Ntk_t * Abc_NtkMakeOnePo( Abc_Ntk_t * pNtk, int Output, int nRange );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fUseAllCis = 0;
-    fUseMffc = 0;
-    fSeq = 0;
-    Output = -1;
-    nRange = -1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ORmash" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'O':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Output = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Output < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nRange = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nRange < 0 )
-                goto usage;
-            break;
-        case 'm':
-            fUseMffc ^= 1;
-            break;
-        case 'a':
-            fUseAllCis ^= 1;
-            break;
-        case 's':
-            fSeq ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently can only be applied to the logic network or an AIG.\n" );
-        return 1;
-    }
-
-    if ( argc > globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-
-    pNodeCo = NULL;
-    if ( argc == globalUtilOptind + 1 )
-    {
-        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
-        if ( pNode == NULL )
-        {
-            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
-            return 1;
-        }
-        if ( fUseMffc )
-            pNtkRes = Abc_NtkCreateMffc( pNtk, pNode, argv[globalUtilOptind] );
-        else
-            pNtkRes = Abc_NtkCreateCone( pNtk, pNode, argv[globalUtilOptind], fUseAllCis );
-    }
-    else
-    {
-        if ( Output == -1 )
-        {
-            Abc_Print( -1, "The node is not specified.\n" );
-            return 1;
-        }
-        if ( Output >= Abc_NtkCoNum(pNtk) )
-        {
-            Abc_Print( -1, "The 0-based output number (%d) is larger than the number of outputs (%d).\n", Output, Abc_NtkCoNum(pNtk) );
-            return 1;
-        }
-        pNodeCo = Abc_NtkCo( pNtk, Output );
-        if ( fSeq )
-            pNtkRes = Abc_NtkMakeOnePo( pNtk, Output, nRange );
-        else if ( fUseMffc )
-            pNtkRes = Abc_NtkCreateMffc( pNtk, Abc_ObjFanin0(pNodeCo), Abc_ObjName(pNodeCo) );
-        else
-            pNtkRes = Abc_NtkCreateCone( pNtk, Abc_ObjFanin0(pNodeCo), Abc_ObjName(pNodeCo), fUseAllCis );
-    }
-    if ( pNodeCo && Abc_ObjFaninC0(pNodeCo) && !fSeq )
-    {
-        Abc_NtkPo(pNtkRes, 0)->fCompl0  ^= 1;
-//        Abc_Print( -1, "The extracted cone represents the complement function of the CO.\n" );
-    }
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Writing the logic cone of one node has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cone [-OR num] [-amsh] <name>\n" );
-    Abc_Print( -2, "\t         replaces the current network by one logic cone\n" );
-    Abc_Print( -2, "\t-a     : toggle keeping all CIs or structral support only [default = %s]\n", fUseAllCis? "all": "structural" );
-    Abc_Print( -2, "\t-m     : toggle keeping only MFFC or complete TFI cone [default = %s]\n", fUseMffc? "MFFC": "TFI cone" );
-    Abc_Print( -2, "\t-s     : toggle comb or sequential cone (works with \"-O num\") [default = %s]\n", fSeq? "seq": "comb" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t-O num : (optional) the 0-based number of the CO to extract\n");
-    Abc_Print( -2, "\t-R num : (optional) the number of outputs to extract\n");
-    Abc_Print( -2, "\tname   : (optional) the name of the node to extract\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandNode( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    Abc_Obj_t * pNode;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-       case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Currently can only be applied to a logic network.\n" );
-        return 1;
-    }
-
-    if ( argc != globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Wrong number of auguments.\n" );
-        goto usage;
-    }
-
-    pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
-    if ( pNode == NULL )
-    {
-        Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkCreateFromNode( pNtk, pNode );
-//    pNtkRes = Abc_NtkDeriveFromBdd( pNtk->pManFunc, pNode->pData, NULL, NULL );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Splitting one node has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: node [-h] <name>\n" );
-    Abc_Print( -2, "\t         replaces the current network by the network composed of one node\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tname   : the node name\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTopmost( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, nLevels;
-    extern Abc_Ntk_t * Abc_NtkTopmost( Abc_Ntk_t * pNtk, int nLevels );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nLevels = 10;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLevels = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLevels < 0 )
-                goto usage;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-
-    if ( Abc_NtkLatchNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Currently can only works for combinational circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkPoNum(pNtk) != 1 )
-    {
-        Abc_Print( -1, "Currently expects a single-output miter.\n" );
-        return 0;
-    }
-
-    pNtkRes = Abc_NtkTopmost( pNtk, nLevels );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "The command has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: topmost [-N num] [-h]\n" );
-    Abc_Print( -2, "\t         replaces the current network by several of its topmost levels\n" );
-    Abc_Print( -2, "\t-N num : max number of levels [default = %d]\n", nLevels );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tname   : the node name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTopAnd( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkTopAnd( Abc_Ntk_t * pNtk );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-
-    if ( Abc_NtkLatchNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Currently can only works for combinational circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkPoNum(pNtk) != 1 )
-    {
-        Abc_Print( -1, "Currently expects a single-output miter.\n" );
-        return 0;
-    }
-    if ( Abc_ObjFaninC0(Abc_NtkPo(pNtk, 0)) )
-    {
-        Abc_Print( -1, "The PO driver is complemented. AND-decomposition is impossible.\n" );
-        return 0;
-    }
-    if ( !Abc_ObjIsNode(Abc_ObjChild0(Abc_NtkPo(pNtk, 0))) )
-    {
-        Abc_Print( -1, "The PO driver is not a node. AND-decomposition is impossible.\n" );
-        return 0;
-    }
-    pNtkRes = Abc_NtkTopAnd( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "The command has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: topand [-h]\n" );
-    Abc_Print( -2, "\t         performs AND-decomposition of single-output combinational miter\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tname   : the node name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTrim( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    Gia_Man_t * pGia, * pNew;
-    Aig_Man_t * pAig;
-    int c;
-    pNtk = Abc_FrameReadNtk(pAbc);
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Trimming works only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-    // convert to GIA
-    pAig = Abc_NtkToDar( pNtk, 0, 1 );
-    pGia = Gia_ManFromAigSimple( pAig );
-    Aig_ManStop( pAig );
-    // perform trimming
-    pNew = Gia_ManDupTrimmed( pGia, 1, 1, 0, -1 );
-    Gia_ManStop( pGia );
-    // convert back
-    pAig = Gia_ManToAigSimple( pNew );
-    Gia_ManStop( pNew );
-    pNtkRes = Abc_NtkFromAigPhase( pAig );
-    Aig_ManStop( pAig );
-    // duplicate the name and the spec
-    ABC_FREE( pNtkRes->pName );
-    ABC_FREE( pNtkRes->pSpec );
-    pNtkRes->pName = Extra_UtilStrsav(pNtk->pName);
-    pNtkRes->pSpec = Extra_UtilStrsav(pNtk->pSpec);
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: trim [-h]\n" );
-    Abc_Print( -2, "\t         removes POs fed by constants and PIs w/o fanout\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandShortNames( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    Abc_NtkShortNames( pNtk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: short_names [-h]\n" );
-    Abc_Print( -2, "\t         replaces PI/PO/latch names by short char strings\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandExdcFree( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( pNtk->pExdc == NULL )
-    {
-        Abc_Print( -1, "The network has no EXDC.\n" );
-        return 1;
-    }
-
-    Abc_NtkDelete( pNtk->pExdc );
-    pNtk->pExdc = NULL;
-
-    // replace the current network
-    pNtkRes = Abc_NtkDup( pNtk );
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: exdc_free [-h]\n" );
-    Abc_Print( -2, "\t         frees the EXDC network of the current network\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandExdcGet( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( pNtk->pExdc == NULL )
-    {
-        Abc_Print( -1, "The network has no EXDC.\n" );
-        return 1;
-    }
-
-    // replace the current network
-    pNtkRes = Abc_NtkDup( pNtk->pExdc );
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: exdc_get [-h]\n" );
-    Abc_Print( -2, "\t         replaces the current network by the EXDC of the current network\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandExdcSet( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    FILE * pFile;
-    Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
-    char * FileName;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( argc != globalUtilOptind + 1 )
-    {
-        goto usage;
-    }
-
-    // get the input file name
-    FileName = argv[globalUtilOptind];
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".mv", ".blif", ".pla", ".eqn", ".bench" )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-
-    // set the new network
-    pNtkNew = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
-    if ( pNtkNew == NULL )
-    {
-        Abc_Print( -1, "Reading network from file has failed.\n" );
-        return 1;
-    }
-
-    // replace the EXDC
-    if ( pNtk->pExdc )
-    {
-        Abc_NtkDelete( pNtk->pExdc );
-        pNtk->pExdc = NULL;
-    }
-    pNtkRes = Abc_NtkDup( pNtk );
-    pNtkRes->pExdc = pNtkNew;
-
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: exdc_set [-h] <file>\n" );
-    Abc_Print( -2, "\t         sets the network from file as EXDC for the current network\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : file with the new EXDC network\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCareSet( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    FILE * pFile;
-    Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
-    char * FileName;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( argc != globalUtilOptind + 1 )
-    {
-        goto usage;
-    }
-
-    // get the input file name
-    FileName = argv[globalUtilOptind];
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".mv", ".blif", ".pla", ".eqn", ".bench" )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-
-    // set the new network
-    pNtkNew = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
-    if ( pNtkNew == NULL )
-    {
-        Abc_Print( -1, "Reading network from file has failed.\n" );
-        return 1;
-    }
-
-    // replace the EXDC
-    if ( pNtk->pExcare )
-    {
-        Abc_NtkDelete( (Abc_Ntk_t *)pNtk->pExcare );
-        pNtk->pExcare = NULL;
-    }
-    pNtkRes = Abc_NtkDup( pNtk );
-    pNtkRes->pExcare = pNtkNew;
-
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: care_set [-h] <file>\n" );
-    Abc_Print( -2, "\t         sets the network from file as a care for the current network\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : file with the new care network\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cut_Params_t Params, * pParams = &Params;
-    Cut_Man_t * pCutMan;
-    Cut_Oracle_t * pCutOracle = NULL;
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fOracle;
-    extern Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams );
-    extern void Abc_NtkCutsOracle( Abc_Ntk_t * pNtk, Cut_Oracle_t * pCutOracle );
-
-    // set defaults
-    fOracle = 0;
-    memset( pParams, 0, sizeof(Cut_Params_t) );
-    pParams->nVarsMax    = 5;     // the max cut size ("k" of the k-feasible cuts)
-    pParams->nKeepMax    = 1000;  // the max number of cuts kept at a node
-    pParams->fTruth      = 1;     // compute truth tables
-    pParams->fFilter     = 1;     // filter dominated cuts
-    pParams->fDrop       = 0;     // drop cuts on the fly
-    pParams->fDag        = 1;     // compute DAG cuts
-    pParams->fTree       = 0;     // compute tree cuts
-    pParams->fGlobal     = 0;     // compute global cuts
-    pParams->fLocal      = 0;     // compute local cuts
-    pParams->fFancy      = 0;     // compute something fancy
-    pParams->fRecordAig  = 1;     // compute something fancy
-    pParams->fMap        = 0;     // compute mapping delay
-    pParams->fAdjust     = 0;     // removes useless fanouts
-    pParams->fNpnSave    = 0;     // enables dumping truth tables
-    pParams->fVerbose    = 0;     // the verbosiness flag
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KMtfdxyglzamjvosh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nVarsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nVarsMax < 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nKeepMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nKeepMax < 0 )
-                goto usage;
-            break;
-        case 't':
-            pParams->fTruth ^= 1;
-            break;
-        case 'f':
-            pParams->fFilter ^= 1;
-            break;
-        case 'd':
-            pParams->fDrop ^= 1;
-            break;
-        case 'x':
-            pParams->fDag ^= 1;
-            break;
-        case 'y':
-            pParams->fTree ^= 1;
-            break;
-        case 'g':
-            pParams->fGlobal ^= 1;
-            break;
-        case 'l':
-            pParams->fLocal ^= 1;
-            break;
-        case 'z':
-            pParams->fFancy ^= 1;
-            break;
-        case 'a':
-            pParams->fRecordAig ^= 1;
-            break;
-        case 'm':
-            pParams->fMap ^= 1;
-            break;
-        case 'j':
-            pParams->fAdjust ^= 1;
-            break;
-        case 'v':
-            pParams->fVerbose ^= 1;
-            break;
-        case 'o':
-            fOracle ^= 1;
-            break;
-        case 's':
-            pParams->fNpnSave ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Cut computation is available only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-    if ( pParams->nVarsMax < CUT_SIZE_MIN || pParams->nVarsMax > CUT_SIZE_MAX )
-    {
-        Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
-        return 1;
-    }
-    if ( pParams->fDag && pParams->fTree )
-    {
-        Abc_Print( -1, "Cannot compute both DAG cuts and tree cuts at the same time.\n" );
-        return 1;
-    }
-
-    if ( pParams->fNpnSave )
-    {
-        pParams->nVarsMax = 6;
-        pParams->fTruth = 1;
-    }
-
-    if ( fOracle )
-        pParams->fRecord = 1;
-    pCutMan = Abc_NtkCuts( pNtk, pParams );
-    if ( fOracle )
-        pCutOracle = Cut_OracleStart( pCutMan );
-    Cut_ManStop( pCutMan );
-    if ( fOracle )
-    {
-        assert(pCutOracle);
-        Abc_NtkCutsOracle( pNtk, pCutOracle );
-        Cut_OracleStop( pCutOracle );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cut [-K num] [-M num] [-tfdcovamjsvh]\n" );
-    Abc_Print( -2, "\t         computes k-feasible cuts for the AIG\n" );
-    Abc_Print( -2, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n",     CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
-    Abc_Print( -2, "\t-M num : max number of cuts stored at a node [default = %d]\n",        pParams->nKeepMax );
-    Abc_Print( -2, "\t-t     : toggle truth table computation [default = %s]\n",             pParams->fTruth?   "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle filtering of duplicated/dominated [default = %s]\n",   pParams->fFilter?  "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle dropping when fanouts are done [default = %s]\n",      pParams->fDrop?    "yes": "no" );
-    Abc_Print( -2, "\t-x     : toggle computing only DAG cuts [default = %s]\n",             pParams->fDag?     "yes": "no" );
-    Abc_Print( -2, "\t-y     : toggle computing only tree cuts [default = %s]\n",            pParams->fTree?    "yes": "no" );
-    Abc_Print( -2, "\t-g     : toggle computing only global cuts [default = %s]\n",          pParams->fGlobal?  "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle computing only local cuts [default = %s]\n",           pParams->fLocal?   "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle fancy computations [default = %s]\n",                  pParams->fFancy?   "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggle recording cut functions [default = %s]\n",             pParams->fRecordAig?"yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle delay-oriented FPGA mapping [default = %s]\n",         pParams->fMap?     "yes": "no" );
-    Abc_Print( -2, "\t-j     : toggle removing fanouts due to XOR/MUX [default = %s]\n",     pParams->fAdjust?  "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle creating library of 6-var functions [default = %s]\n", pParams->fNpnSave?  "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",        pParams->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandScut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cut_Params_t Params, * pParams = &Params;
-    Cut_Man_t * pCutMan;
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    extern Cut_Man_t * Abc_NtkSeqCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams );
-
-    // set defaults
-    memset( pParams, 0, sizeof(Cut_Params_t) );
-    pParams->nVarsMax  = 5;     // the max cut size ("k" of the k-feasible cuts)
-    pParams->nKeepMax  = 1000;  // the max number of cuts kept at a node
-    pParams->fTruth    = 0;     // compute truth tables
-    pParams->fFilter   = 1;     // filter dominated cuts
-    pParams->fSeq      = 1;     // compute sequential cuts
-    pParams->fVerbose  = 0;     // the verbosiness flag
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KMtvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nVarsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nVarsMax < 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nKeepMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nKeepMax < 0 )
-                goto usage;
-            break;
-        case 't':
-            pParams->fTruth ^= 1;
-            break;
-        case 'v':
-            pParams->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-/*
-    if ( !Abc_NtkIsSeq(pNtk) )
-    {
-        Abc_Print( -1, "Sequential cuts can be computed for sequential AIGs (run \"seq\").\n" );
-        return 1;
-    }
-*/
-    if ( pParams->nVarsMax < CUT_SIZE_MIN || pParams->nVarsMax > CUT_SIZE_MAX )
-    {
-        Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
-        return 1;
-    }
-
-    pCutMan = Abc_NtkSeqCuts( pNtk, pParams );
-    Cut_ManStop( pCutMan );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: scut [-K num] [-M num] [-tvh]\n" );
-    Abc_Print( -2, "\t         computes k-feasible cuts for the sequential AIG\n" );
-    Abc_Print( -2, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n",   CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
-    Abc_Print( -2, "\t-M num : max number of cuts stored at a node [default = %d]\n",      pParams->nKeepMax );
-    Abc_Print( -2, "\t-t     : toggle truth table computation [default = %s]\n",           pParams->fTruth?   "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",      pParams->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandEspresso( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fVerbose;
-    extern void Abc_NtkEspresso( Abc_Ntk_t * pNtk, int fVerbose );
-
-    if ( argc == 2 && !strcmp(argv[1], "-h") )
-    {
-        Abc_Print( -2, "The espresso command is currently disabled.\n" );
-        return 1;
-    }
-
-    Abc_Print( -1, "This command is currently disabled.\n" );
-    return 0;
-
-    // set defaults
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "SOP minimization is possible for logic networks (run \"renode\").\n" );
-        return 1;
-    }
-//    Abc_NtkEspresso( pNtk, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: espresso [-vh]\n" );
-    Abc_Print( -2, "\t         minimizes SOPs of the local functions using Espresso\n" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nVars;    // the number of variables
-    int nLutSize = -1; // the size of LUTs
-    int nLuts = -1;    // the number of LUTs
-    int fAdder;
-    int fSorter;
-    int fMesh;
-    int fMulti;
-    int fFpga;
-    int fOneHot;
-    int fRandom;
-    int fVerbose;
-    char * FileName;
-    char Command[1000];
-    extern void Abc_GenAdder( char * pFileName, int nVars );
-    extern void Abc_GenSorter( char * pFileName, int nVars );
-    extern void Abc_GenMesh( char * pFileName, int nVars );
-    extern void Abc_GenMulti( char * pFileName, int nVars );
-    extern void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars );
-    extern void Abc_GenOneHot( char * pFileName, int nVars );
-    extern void Abc_GenRandom( char * pFileName, int nPis );
-
-    // set defaults
-    nVars = 8;
-    fAdder = 0;
-    fSorter = 0;
-    fMesh = 0;
-    fMulti = 0;
-    fFpga = 0;
-    fOneHot = 0;
-    fRandom = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NKLasemftrvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nVars = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nVars < 0 )
-                goto usage;
-            break;
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLuts = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLuts < 0 )
-                goto usage;
-            break;
-        case 'a':
-            fAdder ^= 1;
-            break;
-        case 's':
-            fSorter ^= 1;
-            break;
-        case 'e':
-            fMesh ^= 1;
-            break;
-        case 'm':
-            fMulti ^= 1;
-            break;
-        case 'f':
-            fFpga ^= 1;
-            break;
-        case 't':
-            fOneHot ^= 1;
-            break;
-        case 'r':
-            fRandom ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( argc != globalUtilOptind + 1 )
-    {
-        goto usage;
-    }
-    if ( nVars < 1 )
-    {
-        Abc_Print( -1, "The number of variables should be a positive integer.\n" );
-        return 0;
-    }
-    // get the input file name
-    FileName = argv[globalUtilOptind];
-    if ( fAdder )
-        Abc_GenAdder( FileName, nVars );
-    else if ( fSorter )
-        Abc_GenSorter( FileName, nVars );
-    else if ( fMesh )
-        Abc_GenMesh( FileName, nVars );
-    else if ( fMulti )
-        Abc_GenMulti( FileName, nVars );
-    else if ( fFpga )
-        Abc_GenFpga( FileName, nLutSize, nLuts, nVars );
-//        Abc_GenFpga( FileName, 2, 2, 3 );
-//        Abc_GenFpga( FileName, 3, 2, 5 );
-    else if ( fOneHot )
-        Abc_GenOneHot( FileName, nVars );
-    else if ( fRandom )
-        Abc_GenRandom( FileName, nVars );
-    else
-    {
-        Abc_Print( -1, "Type of circuit is not specified.\n" );
-        return 0;
-    }
-    // read the file just produced
-    sprintf(Command, "read %s", FileName );
-    Cmd_CommandExecute( pAbc, Command );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: gen [-NKL num] [-asemftrvh] <file>\n" );
-    Abc_Print( -2, "\t         generates simple circuits\n" );
-    Abc_Print( -2, "\t-N num : the number of variables [default = %d]\n", nVars );
-    Abc_Print( -2, "\t-K num : the LUT size (to be used with switch -f) [default = %d]\n", nLutSize );
-    Abc_Print( -2, "\t-L num : the LUT count (to be used with switch -f) [default = %d]\n", nLuts );
-    Abc_Print( -2, "\t-a     : generate ripple-carry adder [default = %s]\n", fAdder? "yes": "no" );
-    Abc_Print( -2, "\t-s     : generate a sorter [default = %s]\n", fSorter? "yes": "no" );
-    Abc_Print( -2, "\t-e     : generate a mesh [default = %s]\n", fMesh? "yes": "no" );
-    Abc_Print( -2, "\t-m     : generate a multiplier [default = %s]\n", fMulti? "yes": "no" );
-    Abc_Print( -2, "\t-f     : generate a LUT FPGA structure [default = %s]\n", fFpga? "yes": "no" );
-    Abc_Print( -2, "\t-t     : generate one-hotness conditions [default = %s]\n", fOneHot? "yes": "no" );
-    Abc_Print( -2, "\t-r     : generate random single-output function [default = %s]\n", fRandom? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : output file name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandGenFsm( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_GenFsm( char * pFileName, int nIns, int nOuts, int nStates, int nLines, int ProbI, int ProbO );
-    int c, nIns, nOuts, nStates, nLines, ProbI, ProbO, fVerbose;
-    char * FileName;
-    // set defaults
-    nIns     =   30;
-    nOuts    =    1;
-    nStates  =   20;
-    nLines   =  100;
-    ProbI    =   10;
-    ProbO    =  100;
-    fVerbose =    0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "IOSLPQvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nIns = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nIns < 0 )
-                goto usage;
-            break;
-        case 'O':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nOuts = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nOuts < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nStates = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nStates < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLines = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLines < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            ProbI = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( ProbI < 0 )
-                goto usage;
-            break;
-        case 'Q':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            ProbO = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( ProbO < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( argc != globalUtilOptind + 1 )
-    {
-        goto usage;
-    }
-    if ( nIns < 1 || nStates < 1 || nLines < 1 || ProbI < 1 || ProbO < 1 )
-    {
-        Abc_Print( -1, "The number of inputs. states, lines, and probablity should be positive integers.\n" );
-        goto usage;
-    }
-    // get the input file name
-    FileName = argv[globalUtilOptind];
-    Abc_GenFsm( FileName, nIns, nOuts, nStates, nLines, ProbI, ProbO );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: genfsm [-IOSLPQ num] [-vh] <file>\n" );
-    Abc_Print( -2, "\t         generates random FSM in KISS format\n" );
-    Abc_Print( -2, "\t-I num : the number of input variables [default = %d]\n", nIns );
-    Abc_Print( -2, "\t-O num : the number of output variables [default = %d]\n", nOuts );
-    Abc_Print( -2, "\t-S num : the number of state variables [default = %d]\n", nStates );
-    Abc_Print( -2, "\t-L num : the number of lines (product terms) [default = %d]\n", nLines );
-    Abc_Print( -2, "\t-P num : percentage propability of a variable present in the input cube [default = %d]\n", ProbI );
-    Abc_Print( -2, "\t-Q num : percentage propability of a variable present in the output cube [default = %d]\n", ProbO );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : output file name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCover( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fVerbose;
-    int fUseSop;
-    int fUseEsop;
-    int fUseInvs;
-    int nFaninMax;
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    fUseSop   =  1;
-    fUseEsop  =  0;
-    fVerbose  =  0;
-    fUseInvs  =  1;
-    nFaninMax =  8;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nsxivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFaninMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFaninMax < 0 )
-                goto usage;
-            break;
-        case 's':
-            fUseSop ^= 1;
-            break;
-        case 'x':
-            fUseEsop ^= 1;
-            break;
-        case 'i':
-            fUseInvs ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for strashed networks.\n" );
-        return 1;
-    }
-
-    // run the command
-    pNtkRes = Abc_NtkSopEsopCover( pNtk, nFaninMax, fUseEsop, fUseSop, fUseInvs, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cover [-N num] [-sxvh]\n" );
-    Abc_Print( -2, "\t         decomposition into a network of SOP/ESOP PLAs\n" );
-    Abc_Print( -2, "\t-N num : maximum number of inputs [default = %d]\n", nFaninMax );
-    Abc_Print( -2, "\t-s     : toggle the use of SOPs [default = %s]\n", fUseSop? "yes": "no" );
-    Abc_Print( -2, "\t-x     : toggle the use of ESOPs [default = %s]\n", fUseEsop? "yes": "no" );
-//    Abc_Print( -2, "\t-i     : toggle the use of interters [default = %s]\n", fUseInvs? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandInter( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes = NULL;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c, fDelete1, fDelete2;
-    int fRelation;
-    int fVerbose;
-    extern Abc_Ntk_t * Abc_NtkInter( Abc_Ntk_t * pNtkOn, Abc_Ntk_t * pNtkOff, int fRelation, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fRelation = 0;
-    fVerbose  = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'r':
-            fRelation ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-        return 1;
-    if ( nArgcNew == 0 )
-    {
-        Abc_Obj_t * pObj;
-        int i;
-        Abc_Print( -1, "Deriving new circuit structure for the current network.\n" );
-        Abc_NtkForEachPo( pNtk2, pObj, i )
-            Abc_ObjXorFaninC( pObj, 0 );
-    }
-    if ( fRelation && Abc_NtkCoNum(pNtk1) != 1 )
-    {
-        Abc_Print( -1, "Computation of interplants as a relation only works for single-output functions.\n" );
-        Abc_Print( -1, "Use command \"cone\" to extract one output cone from the multi-output network.\n" );
-    }
-    else
-        pNtkRes = Abc_NtkInter( pNtk1, pNtk2, fRelation, fVerbose );
-    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: inter [-rvh] <onset.blif> <offset.blif>\n" );
-    Abc_Print( -2, "\t         derives interpolant of two networks representing onset and offset;\n" );
-    Abc_Print( -2, "\t-r     : toggle computing interpolant as a relation [default = %s]\n", fRelation? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t         \n" );
-    Abc_Print( -2, "\t         Comments:\n" );
-    Abc_Print( -2, "\t         \n" );
-    Abc_Print( -2, "\t         The networks given on the command line should have the same CIs/COs.\n" );
-    Abc_Print( -2, "\t         If only one network is given on the command line, this network\n" );
-    Abc_Print( -2, "\t         is assumed to be the offset, while the current network is the onset.\n" );
-    Abc_Print( -2, "\t         If no network is given on the command line, the current network is\n" );
-    Abc_Print( -2, "\t         assumed to be the onset and its complement is taken to be the offset.\n" );
-    Abc_Print( -2, "\t         The resulting interpolant is stored as the current network.\n" );
-    Abc_Print( -2, "\t         To verify that the interpolant agrees with the onset and the offset,\n" );
-    Abc_Print( -2, "\t         save it in file \"inter.blif\" and run the following:\n" );
-    Abc_Print( -2, "\t         (a) \"miter -i <onset.blif> <inter.blif>; iprove\"\n" );
-    Abc_Print( -2, "\t         (b) \"miter -i <inter.blif> <offset_inv.blif>; iprove\"\n" );
-    Abc_Print( -2, "\t         where <offset_inv.blif> is the network derived by complementing the\n" );
-    Abc_Print( -2, "\t         outputs of <offset.blif>: \"r <offset.blif>; st -i; w <offset_inv.blif>\"\n" );
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDouble( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int nFrames;
-    int fVerbose;
-    extern Abc_Ntk_t * Abc_NtkDouble( Abc_Ntk_t * pNtk );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nFrames    = 50;
-    fVerbose   =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsSopLogic(pNtk) )
-    {
-        Abc_Print( -1, "Only works for logic SOP networks.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkDouble( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: double [-vh]\n" );
-    Abc_Print( -2, "\t         puts together two parallel copies of the current network\n" );
-//    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBb2Wb( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_NtkConvertBb2Wb( char * pFileNameIn, char * pFileNameOut, int fSeq, int fVerbose );
-    int c;
-    int fSeq;
-    int fVerbose;
-    // set defaults
-    fSeq = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fSeq ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( argc != globalUtilOptind + 2 )
-    {
-        Abc_Print( -1, "Expecting two files names on the command line.\n" );
-        goto usage;
-    }
-    Abc_NtkConvertBb2Wb( argv[globalUtilOptind], argv[globalUtilOptind+1], fSeq, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: bb2wb [-svh] <file_in> <file_out>\n" );
-    Abc_Print( -2, "\t             replaces black boxes by white boxes with AND functions\n" );
-    Abc_Print( -2, "\t             (file names should have standard extensions, e.g. \"blif\")\n" );
-    Abc_Print( -2, "\t-s         : toggle using sequential white boxes [default = %s]\n", fSeq? "yes": "no" );
-    Abc_Print( -2, "\t-v         : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h         : print the command usage\n");
-    Abc_Print( -2, "\t<file_in>  : input file with design containing black boxes\n");
-    Abc_Print( -2, "\t<file_out> : output file with design containing white boxes\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandOutdec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkDarOutdec( Abc_Ntk_t * pNtk, int nLits, int fVerbose );
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Ntk_t * pNtkRes;
-    int c, nLits = 1;
-    int fVerbose = 0;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Lvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLits = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLits < 1 || nLits > 2 )
-            {
-                Abc_Print( 1,"Currently, command \"outdec\" works for 1-lit and 2-lit primes only.\n" );
-                goto usage;
-            }
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for strashed networks.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkDarOutdec( pNtk, nLits, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: outdec [-Lvh]\n" );
-    Abc_Print( -2, "\t         performs prime decomposition of the first output\n" );
-    Abc_Print( -2, "\t-L num : the number of literals in the primes [default = %d]\n", nLits );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandNodeDup( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkNodeDup( Abc_Ntk_t * pNtk, int nLimit, int fVerbose );
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Ntk_t * pNtkRes;
-    int c, nLimit = 30;
-    int fVerbose = 0;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for logic networks.\n" );
-        return 1;
-    }
-    if ( nLimit < 2 )
-    {
-        Abc_Print( -1, "The fanout limit should be more than 1.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkNodeDup( pNtk, nLimit, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: nodedup [-Nvh]\n" );
-    Abc_Print( -2, "\t         duplicates internal nodes with high fanout\n" );
-    Abc_Print( -2, "\t-N num : the number of fanouts to start duplication [default = %d]\n", nLimit );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTestColor( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_ColorTest();
-    Abc_ColorTest();
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int nCutMax      =  1;
-    int nLeafMax     =  4;
-    int nDivMax      =  2;
-    int nDecMax      = 20;
-    int nNumOnes     =  4;
-    int fNewAlgo     =  0;
-    int fNewOrder    =  0;
-    int fVerbose     =  0;
-    int fVeryVerbose =  0;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CKDNMaovwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCutMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutMax < 0 )
-                goto usage;
-            break;
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLeafMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLeafMax < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nDivMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nDivMax < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nDecMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nDecMax < 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nNumOnes = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nNumOnes < 0 )
-                goto usage;
-            break;
-        case 'a':
-            fNewAlgo ^= 1;
-            break;
-        case 'o':
-            fNewOrder ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-/*
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for logic networks.\n" );
-        return 1;
-    }
-*/
-/*
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "Only works for sequential networks.\n" );
-        return 1;
-    }
-*/
-
-/*
-    if ( pNtk )
-    {
-        extern Abc_Ntk_t * Au_ManPerformTest( Abc_Ntk_t * p, int nCutMax, int nLeafMax, int nDivMax, int nDecMax, int fVerbose, int fVeryVerbose );
-        Abc_Ntk_t * pNtkRes = Au_ManPerformTest( pNtk, nCutMax, nLeafMax, nDivMax, nDecMax, fVerbose, fVeryVerbose );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "Command has failed.\n" );
-            return 1;
-        }
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    }
-*/
-/*
-    if ( pNtk )
-    {
-        Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
-        Saig_ManBmcTerSimTestPo( pAig );
-        Aig_ManStop( pAig );
-    }
-*/
-/*
-    if ( !Abc_NtkIsTopo(pNtk) )
-    {
-        Abc_Print( -1, "Current network is not in a topological order.\n" );
-        return 1;
-    }
-*/
-//    if ( pNtk )
-//        Abc_NtkMakeLegit( pNtk ); 
-    {
-//        extern void Ifd_ManDsdTest();
-//        Ifd_ManDsdTest();
-    }
-/*
-    {
-        extern void Abc_EnumerateCubeStates();
-        extern void Abc_EnumerateCubeStatesZdd();
-        if ( fNewAlgo )
-            Abc_EnumerateCubeStatesZdd();
-        else
-            Abc_EnumerateCubeStates();
-        return 0;
-    }
-*/
-    {
-//        extern void Abc_EnumerateFuncs( int nDecMax, int nDivMax, int fVerbose );
-//        Abc_EnumerateFuncs( nDecMax, nDivMax, fVerbose );
-    }
-/*
-    if ( fNewAlgo )
-    {
-        extern void Abc_SuppTest( int nOnes, int nVars, int fUseSimple, int fCheck, int fVerbose );
-        Abc_SuppTest( nNumOnes, nDecMax, fNewOrder, 0, fVerbose );
-    }
-    else
-    {
-        extern void Bmc_EcoMiterTest();
-        Bmc_EcoMiterTest();
-    }
-*/
-
-    {
-//        extern void Nf_ManPrepareLibraryTest();
-//        Nf_ManPrepareLibraryTest();
-//        return 0;
-    }
-
-    if ( pNtk )
-    {
-        extern Abc_Ntk_t * Abc_NtkBarBufsOnOffTest( Abc_Ntk_t * pNtk );
-        Abc_Ntk_t * pNtkRes = Abc_NtkBarBufsOnOffTest( pNtk );
-//        extern Abc_Ntk_t * Abc_NtkPcmTest( Abc_Ntk_t * pNtk, int fNewAlgo, int fVerbose );
-//        extern Abc_Ntk_t * Abc_NtkPcmTestAig( Abc_Ntk_t * pNtk, int fVerbose );
-//        Abc_Ntk_t * pNtkRes;
-//        if ( Abc_NtkIsLogic(pNtk) )
-//            pNtkRes = Abc_NtkPcmTest( pNtk, fNewAlgo, fVerbose );
-//        else
-//            pNtkRes = Abc_NtkPcmTestAig( pNtk, fVerbose );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "Command has failed.\n" );
-            return 1;
-        }
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    }
-    return 0;
-usage:
-    Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
-    Abc_Print( -2, "\t         testbench for new procedures\n" );
-    Abc_Print( -2, "\t-C num : the max number of cuts [default = %d]\n", nCutMax );
-    Abc_Print( -2, "\t-K num : the max number of leaves [default = %d]\n", nLeafMax );
-    Abc_Print( -2, "\t-D num : the max number of divisors [default = %d]\n", nDivMax );
-    Abc_Print( -2, "\t-N num : the max number of node inputs [default = %d]\n", nDecMax );
-    Abc_Print( -2, "\t-M num : the max number of ones in the vector [default = %d]\n", nNumOnes );
-    Abc_Print( -2, "\t-a     : toggle using new algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-o     : toggle using new ordering [default = %s]\n", fNewOrder? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandQuaVar( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, iVar, fUniv, fVerbose, RetValue;
-    extern int Abc_NtkQuantify( Abc_Ntk_t * pNtk, int fUniv, int iVar, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    iVar = 0;
-    fUniv = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Iuvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iVar = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iVar < 0 )
-                goto usage;
-            break;
-        case 'u':
-            fUniv ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum( pNtk ) )
-    {
-        Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
-        return 1;
-    }
-
-    // get the strashed network
-    pNtkRes = Abc_NtkStrash( pNtk, 0, 1, 0 );
-    RetValue = Abc_NtkQuantify( pNtkRes, fUniv, iVar, fVerbose );
-    // clean temporary storage for the cofactors
-    Abc_NtkCleanData( pNtkRes );
-    Abc_AigCleanup( (Abc_Aig_t *)pNtkRes->pManFunc );
-    // check the result
-    if ( !RetValue )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: qvar [-I num] [-uvh]\n" );
-    Abc_Print( -2, "\t         quantifies one variable using the AIG\n" );
-    Abc_Print( -2, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
-    Abc_Print( -2, "\t-u     : toggle universal quantification [default = %s]\n", fUniv? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandQuaRel( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, iVar, fInputs, fVerbose;
-    extern Abc_Ntk_t * Abc_NtkTransRel( Abc_Ntk_t * pNtk, int fInputs, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    iVar = 0;
-    fInputs = 1;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Iqvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iVar = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iVar < 0 )
-                goto usage;
-            break;
-        case 'q':
-            fInputs ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum( pNtk ) )
-    {
-        Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for sequential circuits.\n" );
-        return 1;
-    }
-
-    // get the strashed network
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        pNtk = Abc_NtkStrash( pNtk, 0, 1, 0 );
-        pNtkRes = Abc_NtkTransRel( pNtk, fInputs, fVerbose );
-        Abc_NtkDelete( pNtk );
-    }
-    else
-        pNtkRes = Abc_NtkTransRel( pNtk, fInputs, fVerbose );
-    // check if the result is available
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: qrel [-qvh]\n" );
-    Abc_Print( -2, "\t         computes transition relation of the sequential network\n" );
-//    Abc_Print( -2, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
-    Abc_Print( -2, "\t-q     : perform quantification of inputs [default = %s]\n", fInputs? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandQuaReach( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, nIters, fVerbose;
-    extern Abc_Ntk_t * Abc_NtkReachability( Abc_Ntk_t * pNtk, int nIters, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nIters   = 256;
-    fVerbose =   0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nIters < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum( pNtk ) )
-    {
-        Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for combinational transition relations.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-    if ( Abc_NtkPoNum(pNtk) > 1 )
-    {
-        Abc_Print( -1, "The transition relation should have one output.\n" );
-        return 1;
-    }
-    if ( Abc_NtkPiNum(pNtk) % 2 != 0 )
-    {
-        Abc_Print( -1, "The transition relation should have an even number of inputs.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkReachability( pNtk, nIters, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: qreach [-I num] [-vh]\n" );
-    Abc_Print( -2, "\t         computes unreachable states using AIG-based quantification\n" );
-    Abc_Print( -2, "\t         assumes that the current network is a transition relation\n" );
-    Abc_Print( -2, "\t         assumes that the initial state is composed of all zeros\n" );
-    Abc_Print( -2, "\t-I num : the number of image computations to perform [default = %d]\n", nIters );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSenseInput( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Vec_Int_t * vResult;
-    int c, nConfLim, fVerbose;
-
-    extern Vec_Int_t * Abc_NtkSensitivity( Abc_Ntk_t * pNtk, int nConfLim, int fVerbose );
-    // set defaults
-    nConfLim   = 1000;
-    fVerbose   =    1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Cvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLim = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLim < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkGetChoiceNum( pNtk ) )
-    {
-        Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for combinational transition relations.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-    if ( Abc_NtkPoNum(pNtk) < 2 )
-    {
-        Abc_Print( -1, "The network should have at least two outputs.\n" );
-        return 1;
-    }
-
-    vResult = Abc_NtkSensitivity( pNtk, nConfLim, fVerbose );
-    Vec_IntFree( vResult );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: senseinput [-C num] [-vh]\n" );
-    Abc_Print( -2, "\t         computes sensitivity of POs to PIs under constraint\n" );
-    Abc_Print( -2, "\t         constraint should be represented as the last PO\n" );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfLim );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes, * pNtkTemp;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkIvyStrash( Abc_Ntk_t * pNtk );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        pNtkTemp = Abc_NtkStrash( pNtk, 0, 1, 0 );
-        pNtkRes = Abc_NtkIvyStrash( pNtkTemp );
-        Abc_NtkDelete( pNtkTemp );
-    }
-    else
-        pNtkRes = Abc_NtkIvyStrash( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: istrash [-h]\n" );
-    Abc_Print( -2, "\t         perform sequential structural hashing\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandICut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c, nInputs;
-    extern void Abc_NtkIvyCuts( Abc_Ntk_t * pNtk, int nInputs );
-
-    // set defaults
-    nInputs = 5;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Kh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nInputs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nInputs < 0 )
-                goto usage;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    Abc_NtkIvyCuts( pNtk, nInputs );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: icut [-K num] [-h]\n" );
-    Abc_Print( -2, "\t         computes sequential cuts of the given size\n" );
-    Abc_Print( -2, "\t-K num : the number of cut inputs (2 <= num <= 6) [default = %d]\n", nInputs );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, fUpdateLevel, fUseZeroCost, fVerbose;
-    extern Abc_Ntk_t * Abc_NtkIvyRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeroCost, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fUpdateLevel = 1;
-    fUseZeroCost = 0;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'z':
-            fUseZeroCost ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkIvyRewrite( pNtk, fUpdateLevel, fUseZeroCost, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: irw [-lzvh]\n" );
-    Abc_Print( -2, "\t         perform combinational AIG rewriting\n" );
-    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    Dar_RwrPar_t Pars, * pPars = &Pars;
-    int c;
-
-    extern Abc_Ntk_t * Abc_NtkDRewrite( Abc_Ntk_t * pNtk, Dar_RwrPar_t * pPars );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Dar_ManDefaultRwrParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CNflzrvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nSubgMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nSubgMax < 0 )
-                goto usage;
-            break;
-        case 'f':
-            pPars->fFanout ^= 1;
-            break;
-        case 'l':
-            pPars->fUpdateLevel ^= 1;
-            break;
-        case 'z':
-            pPars->fUseZeros ^= 1;
-            break;
-        case 'r':
-            pPars->fRecycle ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkDRewrite( pNtk, pPars );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: drw [-C num] [-N num] [-lfzrvwh]\n" );
-    Abc_Print( -2, "\t         performs combinational AIG rewriting\n" );
-    Abc_Print( -2, "\t-C num : the max number of cuts at a node [default = %d]\n", pPars->nCutsMax );
-    Abc_Print( -2, "\t-N num : the max number of subgraphs tried [default = %d]\n", pPars->nSubgMax );
-    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle representing fanouts [default = %s]\n", pPars->fFanout? "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle using cut recycling [default = %s]\n", pPars->fRecycle? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    Dar_RefPar_t Pars, * pPars = &Pars;
-    int c;
-
-    extern Abc_Ntk_t * Abc_NtkDRefactor( Abc_Ntk_t * pNtk, Dar_RefPar_t * pPars );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Dar_ManDefaultRefParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "MKCelzvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMffcMin = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMffcMin < 0 )
-                goto usage;
-            break;
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nLeafMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLeafMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'e':
-            pPars->fExtend ^= 1;
-            break;
-        case 'l':
-            pPars->fUpdateLevel ^= 1;
-            break;
-        case 'z':
-            pPars->fUseZeros ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-    if ( pPars->nLeafMax < 4 || pPars->nLeafMax > 15 )
-    {
-        Abc_Print( -1, "This command only works for cut sizes 4 <= K <= 15.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkDRefactor( pNtk, pPars );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: drf [-M num] [-K num] [-C num] [-elzvwh]\n" );
-    Abc_Print( -2, "\t         performs combinational AIG refactoring\n" );
-    Abc_Print( -2, "\t-M num : the min MFFC size to attempt refactoring [default = %d]\n", pPars->nMffcMin );
-    Abc_Print( -2, "\t-K num : the max number of cuts leaves [default = %d]\n", pPars->nLeafMax );
-    Abc_Print( -2, "\t-C num : the max number of cuts to try at a node [default = %d]\n", pPars->nCutsMax );
-    Abc_Print( -2, "\t-e     : toggle extending tbe cut below MFFC [default = %s]\n", pPars->fExtend? "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDc2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int fBalance, fVerbose, fUpdateLevel, fFanout, fPower, c;
-
-    extern Abc_Ntk_t * Abc_NtkDC2( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fBalance     = 0;
-    fVerbose     = 0;
-    fUpdateLevel = 0;
-    fFanout      = 1;
-    fPower       = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "blfpvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'b':
-            fBalance ^= 1;
-            break;
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'f':
-            fFanout ^= 1;
-            break;
-        case 'p':
-            fPower ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkDC2( pNtk, fBalance, fUpdateLevel, fFanout, fPower, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dc2 [-blfpvh]\n" );
-    Abc_Print( -2, "\t         performs combinational AIG optimization\n" );
-    Abc_Print( -2, "\t-b     : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle representing fanouts [default = %s]\n", fFanout? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle power-aware rewriting [default = %s]\n", fPower? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int fBalance, fVerbose, fUpdateLevel, fConstruct, c;
-    int nConfMax, nLevelMax;
-
-    extern Abc_Ntk_t * Abc_NtkDChoice( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fConstruct, int nConfMax, int nLevelMax, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fBalance     = 1;
-    fUpdateLevel = 1;
-    fConstruct   = 0;
-    nConfMax     = 1000;
-    nLevelMax    = 0;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CLblcvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfMax < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLevelMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLevelMax < 0 )
-                goto usage;
-            break;
-        case 'b':
-            fBalance ^= 1;
-            break;
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'c':
-            fConstruct ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkDChoice( pNtk, fBalance, fUpdateLevel, fConstruct, nConfMax, nLevelMax, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dchoice [-C num] [-L num] [-blcvh]\n" );
-    Abc_Print( -2, "\t         performs partitioned choicing using new AIG package\n" );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
-    Abc_Print( -2, "\t-L num : the max level of nodes to consider (0 = not used) [default = %d]\n", nLevelMax );
-    Abc_Print( -2, "\t-b     : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle constructive computation of choices [default = %s]\n", fConstruct? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDch( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Dch_Pars_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkDch( Abc_Ntk_t * pNtk, Dch_Pars_t * pPars );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Dch_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptgcfrvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nSatVarMax < 0 )
-                goto usage;
-            break;
-        case 's':
-            pPars->fSynthesis ^= 1;
-            break;
-        case 'p':
-            pPars->fPower ^= 1;
-            break;
-        case 't':
-            pPars->fSimulateTfo ^= 1;
-            break;
-        case 'g':
-            pPars->fUseGia ^= 1;
-            break;
-        case 'c':
-            pPars->fUseCSat ^= 1;
-            break;
-        case 'f':
-            pPars->fLightSynth ^= 1;
-            break;
-        case 'r':
-            pPars->fSkipRedSupp ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkDch( pNtk, pPars );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dch [-WCS num] [-sptgcfrvh]\n" );
-    Abc_Print( -2, "\t         computes structural choices using a new approach\n" );
-    Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
-    Abc_Print( -2, "\t-s     : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
-    Abc_Print( -2, "\t-g     : toggle using GIA to prove equivalences [default = %s]\n", pPars->fUseGia? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT vs. MiniSat [default = %s]\n", pPars->fUseCSat? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle using faster logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle skipping choices with redundant support [default = %s]\n", pPars->fSkipRedSupp? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDrwsat( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int fBalance, fVerbose, c;
-
-    extern Abc_Ntk_t * Abc_NtkDrwsat( Abc_Ntk_t * pNtk, int fBalance, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fBalance = 0;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "bvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'b':
-            fBalance ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkDrwsat( pNtk, fBalance, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: drwsat [-bvh]\n" );
-    Abc_Print( -2, "\t         performs combinational AIG optimization for SAT\n" );
-    Abc_Print( -2, "\t-b     : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIRewriteSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, fUpdateLevel, fUseZeroCost, fVerbose;
-    extern Abc_Ntk_t * Abc_NtkIvyRewriteSeq( Abc_Ntk_t * pNtk, int fUseZeroCost, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fUpdateLevel = 0;
-    fUseZeroCost = 0;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'z':
-            fUseZeroCost ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkIvyRewriteSeq( pNtk, fUseZeroCost, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: irws [-zvh]\n" );
-    Abc_Print( -2, "\t         perform sequential AIG rewriting\n" );
-//    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIResyn( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, fUpdateLevel, fVerbose;
-    extern Abc_Ntk_t * Abc_NtkIvyResyn( Abc_Ntk_t * pNtk, int fUpdateLevel, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fUpdateLevel = 1;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkIvyResyn( pNtk, fUpdateLevel, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: iresyn [-lvh]\n" );
-    Abc_Print( -2, "\t         performs combinational resynthesis\n" );
-    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandISat( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, fUpdateLevel, fVerbose;
-    int nConfLimit;
-
-    extern Abc_Ntk_t * Abc_NtkIvySat( Abc_Ntk_t * pNtk, int nConfLimit, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nConfLimit   = 100000;
-    fUpdateLevel = 1;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Clzvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLimit < 0 )
-                goto usage;
-            break;
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkIvySat( pNtk, nConfLimit, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: isat [-C num] [-vh]\n" );
-    Abc_Print( -2, "\t         tries to prove the miter constant 0\n" );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
-//    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, fProve, fVerbose, fDoSparse;
-    int nConfLimit;
-    int nPartSize;
-    int nLevelMax;
-
-    extern Abc_Ntk_t * Abc_NtkIvyFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fVerbose );
-    extern Abc_Ntk_t * Abc_NtkDarFraigPart( Abc_Ntk_t * pNtk, int nPartSize, int nConfLimit, int nLevelMax, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nPartSize    = 0;
-    nLevelMax    = 0;
-    nConfLimit   = 100;
-    fDoSparse    = 0;
-    fProve       = 0;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PCLspvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nPartSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nPartSize < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLimit < 0 )
-                goto usage;
-            break;
-         case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLevelMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLevelMax < 0 )
-                goto usage;
-            break;
-        case 's':
-            fDoSparse ^= 1;
-            break;
-        case 'p':
-            fProve ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    if ( nPartSize > 0 )
-        pNtkRes = Abc_NtkDarFraigPart( pNtk, nPartSize, nConfLimit, nLevelMax, fVerbose );
-    else
-        pNtkRes = Abc_NtkIvyFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: ifraig [-P num] [-C num] [-L num] [-spvh]\n" );
-    Abc_Print( -2, "\t         performs fraiging using a new method\n" );
-    Abc_Print( -2, "\t-P num : partition size (0 = partitioning is not used) [default = %d]\n", nPartSize );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
-    Abc_Print( -2, "\t-L num : limit on node level to fraig (0 = fraig all nodes) [default = %d]\n", nLevelMax );
-    Abc_Print( -2, "\t-s     : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, nConfLimit, fDoSparse, fProve, fSpeculate, fChoicing, fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkDarFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fSpeculate, int fChoicing, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nConfLimit   = 100;
-    fDoSparse    = 1;
-    fProve       = 0;
-    fSpeculate   = 0;
-    fChoicing    = 0;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Csprcvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLimit < 0 )
-                goto usage;
-            break;
-        case 's':
-            fDoSparse ^= 1;
-            break;
-        case 'p':
-            fProve ^= 1;
-            break;
-        case 'r':
-            fSpeculate ^= 1;
-            break;
-        case 'c':
-            fChoicing ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkDarFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fSpeculate, fChoicing, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dfraig [-C num] [-sprcvh]\n" );
-    Abc_Print( -2, "\t         performs fraiging using a new method\n" );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
-    Abc_Print( -2, "\t-s     : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle speculative reduction [default = %s]\n", fSpeculate? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle accumulation of choices [default = %s]\n", fChoicing? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, nCutsMax, nLeafMax, fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkCSweep( Abc_Ntk_t * pNtk, int nCutsMax, int nLeafMax, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nCutsMax  =  8;
-    nLeafMax  =  6;
-    fVerbose  =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CKvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLeafMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLeafMax < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( nCutsMax < 2 )
-    {
-        Abc_Print( -1, "The number of cuts cannot be less than 2.\n" );
-        return 1;
-    }
-
-    if ( nLeafMax < 3 || nLeafMax > 16 )
-    {
-        Abc_Print( -1, "The number of leaves is infeasible.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkCSweep( pNtk, nCutsMax, nLeafMax, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: csweep [-C num] [-K num] [-vh]\n" );
-    Abc_Print( -2, "\t         performs cut sweeping using a new method\n" );
-    Abc_Print( -2, "\t-C num : limit on the number of cuts (C >= 2) [default = %d]\n", nCutsMax );
-    Abc_Print( -2, "\t-K num : limit on the cut size (3 <= K <= 16) [default = %d]\n", nLeafMax );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Prove_Params_t Params, * pParams = &Params;
-    Abc_Ntk_t * pNtk, * pNtkTemp;
-    int c, RetValue, iOut = -1;
-    abctime clk;
-
-    extern int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Prove_ParamsSetDefault( pParams );
-    pParams->fUseRewriting = 1;
-    pParams->fVerbose      = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NCFGLIrfbvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nItersMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nItersMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nMiteringLimitStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nMiteringLimitStart < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nFraigingLimitStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nFraigingLimitStart < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nFraigingLimitMulti = (float)atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nFraigingLimitMulti < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nMiteringLimitLast = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nMiteringLimitLast < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nTotalInspectLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nTotalInspectLimit < 0 )
-                goto usage;
-            break;
-        case 'r':
-            pParams->fUseRewriting ^= 1;
-            break;
-        case 'f':
-            pParams->fUseFraiging ^= 1;
-            break;
-        case 'b':
-            pParams->fUseBdds ^= 1;
-            break;
-        case 'v':
-            pParams->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkLatchNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "The network has registers. Use \"dprove\".\n" );
-        return 1;
-    }
-
-    clk = Abc_Clock();
-
-    if ( Abc_NtkIsStrash(pNtk) )
-        pNtkTemp = Abc_NtkDup( pNtk );
-    else
-        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
-
-    RetValue = Abc_NtkIvyProve( &pNtkTemp, pParams );
-
-    // verify that the pattern is correct
-    if ( RetValue == 0 )
-    {
-        Abc_Obj_t * pObj;
-        int i;
-        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtkTemp->pModel );
-        Abc_NtkForEachCo( pNtk, pObj, i )
-            if ( pSimInfo[i] == 1 )
-            {
-                iOut = i;
-                break;
-            }
-        if ( i == Abc_NtkCoNum(pNtk) )
-            Abc_Print( 1, "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
-        ABC_FREE( pSimInfo );
-    }
-    pAbc->Status = RetValue;
-    if ( RetValue == -1 )
-        Abc_Print( 1, "UNDECIDED      " );
-    else if ( RetValue == 0 )
-        Abc_Print( 1, "SATISFIABLE (output = %d) ", iOut );
-    else
-        Abc_Print( 1, "UNSATISFIABLE  " );
-    //Abc_Print( -1, "\n" );
-
-    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkTemp );
-    // update counter example
-    if ( RetValue == 0 && Abc_NtkLatchNum(pNtkTemp) == 0 )
-    {
-        Abc_Cex_t * pCex = Abc_CexDeriveFromCombModel( pNtkTemp->pModel, Abc_NtkPiNum(pNtkTemp), 0, iOut );
-        Abc_FrameReplaceCex( pAbc, &pCex );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: iprove [-NCFGLI num] [-rfbvh]\n" );
-    Abc_Print( -2, "\t         performs CEC using a new method\n" );
-    Abc_Print( -2, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
-    Abc_Print( -2, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
-    Abc_Print( -2, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
-    Abc_Print( -2, "\t-G num : multiplicative coefficient for fraiging [default = %d]\n", (int)pParams->nFraigingLimitMulti );
-    Abc_Print( -2, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
-    Abc_Print( -2, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
-    Abc_Print( -2, "\t-r     : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-/*
-int Abc_CommandHaig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    FILE * stdout, * pErr;
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int nIters;
-    int nSteps;
-    int fRetimingOnly;
-    int fAddBugs;
-    int fUseCnf;
-    int fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkDarHaigRecord( Abc_Ntk_t * pNtk, int nIters, int nSteps, int fRetimingOnly, int fAddBugs, int fUseCnf, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-
-
-    // set defaults
-    nIters        = 3;
-    nSteps        = 3000;
-    fRetimingOnly = 0;
-    fAddBugs      = 0;
-    fUseCnf       = 0;
-    fVerbose      = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ISrbcvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nIters < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nSteps = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nSteps < 0 )
-                goto usage;
-            break;
-        case 'r':
-            fRetimingOnly ^= 1;
-            break;
-        case 'b':
-            fAddBugs ^= 1;
-            break;
-        case 'c':
-            fUseCnf ^= 1;
-            break;
-        case 'v':
-            fUseCnf ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for strashed networks.\n" );
-        return 1;
-    }
-
-    pNtkRes = Abc_NtkDarHaigRecord( pNtk, nIters, nSteps, fRetimingOnly, fAddBugs, fUseCnf, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: haig [-IS num] [-rbcvh]\n" );
-    Abc_Print( -2, "\t         run a few rounds of comb+seq synthesis to test HAIG recording\n" );
-    Abc_Print( -2, "\t         the current network is set to be the result of synthesis performed\n" );
-    Abc_Print( -2, "\t         (this network can be verified using command \"dsec\")\n" );
-    Abc_Print( -2, "\t         HAIG is written out into the file \"haig.blif\"\n" );
-    Abc_Print( -2, "\t         (this HAIG can be proved using \"r haig.blif; st; dprove -abc -F 16\")\n" );
-    Abc_Print( -2, "\t-I num : the number of rounds of comb+seq synthesis [default = %d]\n", nIters );
-    Abc_Print( -2, "\t-S num : the number of forward retiming moves performed [default = %d]\n", nSteps );
-    Abc_Print( -2, "\t-r     : toggle the use of retiming only [default = %s]\n", fRetimingOnly? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggle bug insertion [default = %s]\n", fAddBugs? "yes": "no" );
-    Abc_Print( -2, "\t-c     : enable CNF-based proof (no speculative reduction) [default = %s]\n", fUseCnf? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-*/
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nPars;
-    int nIters;
-    int fDumpCnf;
-    int fVerbose;
-
-    extern void Abc_NtkQbf( Abc_Ntk_t * pNtk, int nPars, int nIters, int fDumpCnf, int fVerbose );
-    // set defaults
-    nPars    =  -1;
-    nIters   = 500;
-    fDumpCnf =   0;
-    fVerbose =   1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PIdvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nPars = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nPars < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nIters < 0 )
-                goto usage;
-            break;
-        case 'd':
-            fDumpCnf ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "Works only for combinational networks.\n" );
-        return 1;
-    }
-    if ( Abc_NtkPoNum(pNtk) != 1 )
-    {
-        Abc_Print( -1, "The miter should have one primary output.\n" );
-        return 1;
-    }
-    if ( !(nPars > 0 && nPars < Abc_NtkPiNum(pNtk)) )
-    {
-        Abc_Print( -1, "The number of paramter variables is invalid (should be > 0 and < PI num).\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsStrash(pNtk) )
-        Abc_NtkQbf( pNtk, nPars, nIters, fDumpCnf, fVerbose );
-    else
-    {
-        pNtk = Abc_NtkStrash( pNtk, 0, 1, 0 );
-        Abc_NtkQbf( pNtk, nPars, nIters, fDumpCnf, fVerbose );
-        Abc_NtkDelete( pNtk );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: qbf [-PI num] [-dvh]\n" );
-    Abc_Print( -2, "\t         solves QBF problem EpVxM(p,x)\n" );
-    Abc_Print( -2, "\t-P num : number of parameters p (should be the first PIs) [default = %d]\n", nPars );
-    Abc_Print( -2, "\t-I num : quit after the given iteration even if unsolved [default = %d]\n", nIters );
-    Abc_Print( -2, "\t-d     : toggle dumping QDIMACS file instead of solving [default = %s]\n", fDumpCnf? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandNpnLoad( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Npn_ManLoad( char * pFileName );
-    char * pFileName;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( argc != globalUtilOptind + 1 )
-        goto usage;
-    pFileName = argv[globalUtilOptind];
-    Npn_ManLoad( pFileName );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: npnload <filename>\n" );
-    Abc_Print( -2, "\t         loads previously saved 6-input function library from file\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandNpnSave( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Npn_ManSave( char * pFileName );
-    char * pFileName;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( argc != globalUtilOptind + 1 )
-        goto usage;
-    pFileName = argv[globalUtilOptind];
-    Npn_ManSave( pFileName );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: npnsave <filename>\n" );
-    Abc_Print( -2, "\t         saves current 6-input function library into file\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSendAig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-//    const int BRIDGE_NETLIST = 106;
-//    const int BRIDGE_ABS_NETLIST = 107;
-
-    int c, fAndSpace = 1, fAbsNetlist = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ah" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'a':
-            fAndSpace ^= 1;
-            break;
-        case 'b':
-            fAbsNetlist ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_FrameIsBridgeMode() )
-    {
-        Abc_Print( -1, "The bridge mode is not available.\n" );
-        return 1;
-    }
-    if ( fAndSpace )
-    {
-        if ( pAbc->pGia == NULL )
-        {
-            Abc_Print( -1, "There is no AIG in the &-space.\n" );
-            return 1;
-        }
-        Gia_ManToBridgeAbsNetlist( stdout, pAbc->pGia, fAbsNetlist ? BRIDGE_ABS_NETLIST : BRIDGE_NETLIST );
-    }
-    else
-    {
-        Aig_Man_t * pAig;
-        Gia_Man_t * pGia;
-        if ( pAbc->pNtkCur == NULL )
-        {
-            Abc_Print( -1, "There is no network in the main-space.\n" );
-            return 1;
-        }
-        if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
-        {
-            Abc_Print( -1, "The main-space network is not an AIG.\n" );
-            return 1;
-        }
-        pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
-        pGia = Gia_ManFromAig( pAig );
-        Aig_ManStop( pAig );
-        Gia_ManToBridgeAbsNetlist( stdout, pGia, fAbsNetlist ? BRIDGE_ABS_NETLIST : BRIDGE_NETLIST  );
-        Gia_ManStop( pGia );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: send_aig -a\n" );
-    Abc_Print( -2, "\t         sends current AIG to the bridge\n" );
-    Abc_Print( -2, "\t-a     : toggle sending AIG from &-space [default = %s]\n", fAndSpace? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggle sending netlist tagged as \"abstraction\". [default = %s]\n", fAbsNetlist? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSendStatus( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Gia_ManToBridgeResult( FILE * pFile, int Result, Abc_Cex_t * pCex, int iPoProved );
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_FrameIsBridgeMode() )
-    {
-        Abc_Print( -1, "The bridge mode is not available.\n" );
-        return 1;
-    }
-    if ( pAbc->Status == 0 && pAbc->pCex == NULL )
-    {
-        Abc_Print( -1, "Status is \"sat\", but current CEX is not available.\n" );
-        return 1;
-    }
-    Gia_ManToBridgeResult( stdout, pAbc->Status, pAbc->pCex, 0 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: send_status\n" );
-    Abc_Print( -2, "\t         sends current status to the bridge\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[100];
-    Fraig_Params_t Params, * pParams = &Params;
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int fAllNodes;
-    int fExdc;
-    int c;
-    int fPartition = 0;
-    extern void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fExdc     = 0;
-    fAllNodes = 0;
-    memset( pParams, 0, sizeof(Fraig_Params_t) );
-    pParams->nPatsRand  = 2048; // the number of words of random simulation info
-    pParams->nPatsDyna  = 2048; // the number of words of dynamic simulation info
-    pParams->nBTLimit   =  100; // the max number of backtracks to perform
-    pParams->fFuncRed   =    1; // performs only one level hashing
-    pParams->fFeedBack  =    1; // enables solver feedback
-    pParams->fDist1Pats =    1; // enables distance-1 patterns
-    pParams->fDoSparse  =    1; // performs equiv tests for sparse functions
-    pParams->fChoicing  =    0; // enables recording structural choices
-    pParams->fTryProve  =    0; // tries to solve the final miter
-    pParams->fVerbose   =    0; // the verbosiness flag
-    pParams->fVerboseP  =    0; // the verbosiness flag
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "RDCrscptvaeh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nPatsRand = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nPatsRand < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nPatsDyna = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nPatsDyna < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nBTLimit < 0 )
-                goto usage;
-            break;
-
-        case 'r':
-            pParams->fFuncRed ^= 1;
-            break;
-        case 's':
-            pParams->fDoSparse ^= 1;
-            break;
-        case 'c':
-            pParams->fChoicing ^= 1;
-            break;
-        case 'p':
-            pParams->fTryProve ^= 1;
-            break;
-        case 'v':
-            pParams->fVerbose ^= 1;
-            break;
-        case 't':
-            fPartition ^= 1;
-            break;
-        case 'a':
-            fAllNodes ^= 1;
-            break;
-        case 'e':
-            fExdc ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Can only fraig a logic network or an AIG.\n" );
-        return 1;
-    }
-
-    // report the proof
-    pParams->fVerboseP = pParams->fTryProve;
-
-    // get the new network
-    if ( fPartition )
-    {
-        pNtkRes = Abc_NtkDup( pNtk );
-        if ( Abc_NtkIsStrash(pNtk) )
-            Abc_NtkFraigPartitionedTime( pNtk, &Params );
-        else
-        {
-            pNtk = Abc_NtkStrash( pNtk, fAllNodes, !fAllNodes, 0 );
-            Abc_NtkFraigPartitionedTime( pNtk, &Params );
-            Abc_NtkDelete( pNtk );
-        }
-    }
-    else
-    {
-        if ( Abc_NtkIsStrash(pNtk) )
-            pNtkRes = Abc_NtkFraig( pNtk, &Params, fAllNodes, fExdc );
-        else
-        {
-            pNtk = Abc_NtkStrash( pNtk, fAllNodes, !fAllNodes, 0 );
-            pNtkRes = Abc_NtkFraig( pNtk, &Params, fAllNodes, fExdc );
-            Abc_NtkDelete( pNtk );
-        }
-    }
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Fraiging has failed.\n" );
-        return 1;
-    }
-
-    if ( pParams->fTryProve ) // report the result
-        Abc_NtkMiterReport( pNtkRes );
-
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    sprintf(Buffer, "%d", pParams->nBTLimit );
-    Abc_Print( -2, "usage: fraig [-R num] [-D num] [-C num] [-rscpvtah]\n" );
-    Abc_Print( -2, "\t         transforms a logic network into a functionally reduced AIG\n" );
-    Abc_Print( -2, "\t         (known bugs: takes an UNSAT miter and returns a SAT one)\n");
-    Abc_Print( -2, "\t         (there are newer fraiging commands, \"ifraig\" and \"dfraig\")\n" );
-    Abc_Print( -2, "\t-R num : number of random patterns (127 < num < 32769) [default = %d]\n",     pParams->nPatsRand );
-    Abc_Print( -2, "\t-D num : number of systematic patterns (127 < num < 32769) [default = %d]\n", pParams->nPatsDyna );
-    Abc_Print( -2, "\t-C num : number of backtracks for one SAT problem [default = %s]\n",    pParams->nBTLimit==-1? "infinity" : Buffer );
-    Abc_Print( -2, "\t-r     : toggle functional reduction [default = %s]\n",                 pParams->fFuncRed? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle considering sparse functions [default = %s]\n",         pParams->fDoSparse? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle accumulation of choices [default = %s]\n",              pParams->fChoicing? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle proving the miter outputs [default = %s]\n",              pParams->fTryProve? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n",                       pParams->fVerbose?  "yes": "no" );
-    Abc_Print( -2, "\t-e     : toggle functional sweeping using EXDC [default = %s]\n",       fExdc? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggle between all nodes and DFS nodes [default = %s]\n",      fAllNodes? "all": "dfs" );
-    Abc_Print( -2, "\t-t     : toggle using partitioned representation [default = %s]\n",     fPartition? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFraigTrust( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fDuplicate;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fDuplicate = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'd':
-            fDuplicate ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkFraigTrust( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Fraiging in the trust mode has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: fraig_trust [-h]\n" );
-    Abc_Print( -2, "\t        transforms the current network into an AIG assuming it is FRAIG with choices\n" );
-//    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFraigStore( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fDuplicate;
-
-    // set defaults
-    fDuplicate = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'd':
-            fDuplicate ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( !Abc_NtkFraigStore( pNtk ) )
-    {
-        Abc_Print( -1, "Fraig storing has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: fraig_store [-h]\n" );
-    Abc_Print( -2, "\t        saves the current network in the AIG database\n" );
-//    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFraigRestore( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fDuplicate;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fDuplicate = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'd':
-            fDuplicate ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkFraigRestore();
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Fraig restoring has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: fraig_restore [-h]\n" );
-    Abc_Print( -2, "\t        makes the current network by fraiging the AIG database\n" );
-//    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFraigClean( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fDuplicate;
-    // set defaults
-    fDuplicate = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'd':
-            fDuplicate ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    Abc_NtkFraigStoreClean();
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: fraig_clean [-h]\n" );
-    Abc_Print( -2, "\t        cleans the internal FRAIG storage\n" );
-//    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFraigSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseInv;
-    int fExdc;
-    int fVerbose;
-    int fVeryVerbose;
-    extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
-    // set defaults
-    fUseInv   = 1;
-    fExdc     = 0;
-    fVerbose  = 0;
-    fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ievwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'i':
-            fUseInv ^= 1;
-            break;
-        case 'e':
-            fExdc ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Cannot sweep AIGs (use \"fraig\").\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Transform the current network into a logic network.\n" );
-        return 1;
-    }
-    // modify the current network
-    if ( !Abc_NtkFraigSweep( pNtk, fUseInv, fExdc, fVerbose, fVeryVerbose ) )
-    {
-        Abc_Print( -1, "Sweeping has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: fraig_sweep [-evwh]\n" );
-    Abc_Print( -2, "\t        performs technology-dependent sweep\n" );
-    Abc_Print( -2, "\t-e    : toggle functional sweeping using EXDC [default = %s]\n", fExdc? "yes": "no" );
-    Abc_Print( -2, "\t-v    : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w    : prints equivalence class information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFraigDress( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_NtkDress( Abc_Ntk_t * pNtk, char * pFileName, int fVerbose );
-    extern void Abc_NtkDress2( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConflictLimit, int fVerbose );
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtk2;
-    char * pFileName;
-    int c;
-    int nConfs;
-    int fVerbose;
-    // set defaults
-    nConfs   = 1000;
-    fVerbose =    0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Cvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfs < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for logic networks.\n" );
-        return 1;
-    }
-    if ( argc != globalUtilOptind && argc != globalUtilOptind + 1 )
-        goto usage;
-    if ( argc == globalUtilOptind && Abc_NtkSpec(pNtk) == NULL )
-    {
-        Abc_Print( -1, "The current network has no spec.\n" );
-        return 1;
-    }
-    // get the input file name
-    pFileName = (argc == globalUtilOptind + 1) ? argv[globalUtilOptind] : Abc_NtkSpec(pNtk);
-    // modify the current network
-//    Abc_NtkDress( pNtk, pFileName, fVerbose );
-    pNtk2 = Io_Read( pFileName, Io_ReadFileType(pFileName), 1, 0 );
-    Abc_NtkDress2( pNtk, pNtk2, nConfs, fVerbose );
-    Abc_NtkDelete( pNtk2 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dress [-C num] [-vh] <file>\n" );
-    Abc_Print( -2, "\t         transfers internal node names from file to the current network\n" );
-    Abc_Print( -2, "\t<file> : network with names (if not given, the current network spec is used)\n" );
-    Abc_Print( -2, "\t-C num : the maximum number of conflicts at each node [default = %d]\n", nConfs );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRecStart3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char * FileName, * pTemp;
-    char ** pArgvNew;
-    int c, nArgcNew;
-    FILE * pFile;
-    Gia_Man_t * pGia = NULL;
-    int nVars = 6;
-    int nCuts = 32;
-    int fFuncOnly = 0;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCfvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nVars = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nVars < 1 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCuts = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCuts < 1 )
-                goto usage;
-            break;
-        case 'f':
-            fFuncOnly ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !(nVars >= 3 && nVars <= 16) )
-    {
-        Abc_Print( -1, "The range of allowed values is 3 <= K <= 16.\n" );
-        return 0;
-    }
-    if ( Abc_NtkRecIsRunning3() )
-    {
-        Abc_Print( -1, "The AIG subgraph recording is already started.\n" );
-        return 0;
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-        Abc_Print( 1, "File name is not given on the command line. Starting a new record.\n" );
-    else
-    {
-        // get the input file name
-        FileName = pArgvNew[0];
-        // fix the wrong symbol
-        for ( pTemp = FileName; *pTemp; pTemp++ )
-            if ( *pTemp == '>' )
-                *pTemp = '\\';
-        if ( (pFile = fopen( FileName, "r" )) == NULL )
-        {
-            Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-            if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
-                Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-            Abc_Print( 1, "\n" );
-            return 1;
-        }
-        fclose( pFile );
-        pGia = Gia_AigerRead( FileName, 1, 0 );
-        if ( pGia == NULL )
-        {
-            Abc_Print( -1, "Reading AIGER has failed.\n" );
-            return 0;
-        }
-    }
-    Abc_NtkRecStart3( pGia, nVars, nCuts, fFuncOnly, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: rec_start3 [-K num] [-C num] [-fvh] <file>\n" );
-    Abc_Print( -2, "\t         starts recording AIG subgraphs (should be called for\n" );
-    Abc_Print( -2, "\t         an empty network or after reading in a previous record)\n" );
-    Abc_Print( -2, "\t-K num : the largest number of inputs [default = %d]\n", nVars );
-    Abc_Print( -2, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCuts );
-    Abc_Print( -2, "\t-f     : toggles recording functions without AIG subgraphs [default = %s]\n", fFuncOnly? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : AIGER file with the library\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRecStop3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_NtkRecIsRunning3() )
-    {
-        Abc_Print( -1, "This command works only after calling \"rec_start3\".\n" );
-        return 0;
-    }
-    Abc_NtkRecStop3();
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: rec_stop3 [-h]\n" );
-    Abc_Print( -2, "\t        cleans the internal storage for AIG subgraphs\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRecPs3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c, fPrintLib = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ph" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'p':
-            fPrintLib ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_NtkRecIsRunning3() )
-    {
-        Abc_Print( -1, "This command works for AIGs only after calling \"rec_start2\".\n" );
-        return 0;
-    }
-    Abc_NtkRecPs3(fPrintLib);
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: rec_ps3 [-h]\n" );
-    Abc_Print( -2, "\t        prints statistics about the recorded AIG subgraphs\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRecAdd3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fUseSOPB = 0;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "gh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'g':
-            fUseSOPB = 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works for AIGs.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkRecIsRunning3() )
-    {
-        Abc_Print( -1, "This command works for AIGs after calling \"rec_start2\".\n" );
-        return 0;
-    }
-    Abc_NtkRecAdd3( pNtk, fUseSOPB );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: rec_add3 [-h]\n" );
-    Abc_Print( -2, "\t        adds subgraphs from the current network to the set\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRecDump3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_NtkRecDumpTt3( char * pFileName, int fBinary );
-    char * FileName;
-    char ** pArgvNew;
-    int nArgcNew;
-    Gia_Man_t * pGia;
-    int fAscii = 0;
-    int fBinary = 0;
-    int c;
-
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "abh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'a':
-            fAscii ^= 1;
-            break;
-        case 'b':
-            fBinary ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_NtkRecIsRunning3() )
-    {
-        Abc_Print( -1, "The AIG subgraph recording is not started.\n" );
-        return 1;
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "File name is not given on the command line.\n" );
-        return 1;
-    }
-    // get the input file name
-    FileName = pArgvNew[0];
-    if ( fAscii )
-        Abc_NtkRecDumpTt3( FileName, 0 );
-    else if ( fBinary )
-        Abc_NtkRecDumpTt3( FileName, 1 );
-    else
-    {
-        pGia = Abc_NtkRecGetGia3();
-        if( pGia == NULL )
-        {
-            Abc_Print( 0, "Library AIG is not available.\n" );
-            return 1;
-        }
-        if( Gia_ManPoNum(pGia) == 0 )
-        {
-            Abc_Print( 0, "No structure in the library.\n" );
-            return 1;
-        }
-        Gia_AigerWrite( pGia, FileName, 0, 0 );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: rec_dump3 [-abh] <file>\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t-a     : toggles dumping TTs into an ASCII file [default = %s]\n", fAscii? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggles dumping TTs into a binary file [default = %s]\n", fBinary? "yes": "no" );
-    Abc_Print( -2, "\t<file> : AIGER file to write the library\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRecMerge3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    char * FileName, * pTemp;
-    char ** pArgvNew;
-    int nArgcNew;
-    FILE * pFile;
-    Gia_Man_t * pGia = NULL;
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_NtkRecIsRunning3() )
-    {
-        Abc_Print( -1, "This command works for AIGs only after calling \"rec_start3\".\n" );
-        return 0;
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "File name is not given on the command line.\n" );
-        return 1;
-    }
-    else
-    {
-        // get the input file name
-        FileName = pArgvNew[0];
-        // fix the wrong symbol
-        for ( pTemp = FileName; *pTemp; pTemp++ )
-            if ( *pTemp == '>' )
-                *pTemp = '\\';
-        if ( (pFile = fopen( FileName, "r" )) == NULL )
-        {
-            Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-            if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
-                Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-            Abc_Print( 1, "\n" );
-            return 1;
-        }
-        fclose( pFile );
-        pGia = Gia_AigerRead( FileName, 1, 0 );
-        if ( pGia == NULL )
-        {
-            Abc_Print( -1, "Reading AIGER has failed.\n" );
-            return 0;
-        }
-    }
-    Abc_NtkRecLibMerge3(pGia);
-    Gia_ManStop( pGia );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: rec_merge3 [-h] <file>\n" );
-    Abc_Print( -2, "\t         merge libraries\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : AIGER file with the library\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    char Buffer[100];
-    double DelayTarget;
-    double AreaMulti;
-    double DelayMulti;
-    float LogFan = 0;
-    float Slew = 0; // choose based on the library
-    float Gain = 250;
-    int nGatesMin = 4;
-    int fAreaOnly;
-    int fRecovery;
-    int fSweep;
-    int fSwitching;
-    int fVerbose;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti, double DelayMulti, float LogFan, float Slew, float Gain, int nGatesMin, int fRecovery, int fSwitching, int fVerbose );
-    extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    DelayTarget =-1;
-    AreaMulti   = 0;
-    DelayMulti  = 0;
-    fAreaOnly   = 0;
-    fRecovery   = 1;
-    fSweep      = 0;
-    fSwitching  = 0;
-    fVerbose    = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "DABFSGMarspvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            DelayTarget = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            AreaMulti = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            DelayMulti = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            LogFan = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( LogFan < 0.0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            Slew = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Slew <= 0.0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            Gain = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Gain <= 0.0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nGatesMin = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nGatesMin < 0 ) 
-                goto usage;
-            break;
-        case 'a':
-            fAreaOnly ^= 1;
-            break;
-        case 'r':
-            fRecovery ^= 1;
-            break;
-        case 's':
-            fSweep ^= 1;
-            break;
-        case 'p':
-            fSwitching ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( fAreaOnly )
-        DelayTarget = ABC_INFINITY;
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Strashing before mapping has failed.\n" );
-            return 1;
-        }
-        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Balancing before mapping has failed.\n" );
-            return 1;
-        }
-        Abc_Print( 0, "The network was strashed and balanced before mapping.\n" );
-        // get the new network
-        pNtkRes = Abc_NtkMap( pNtk, DelayTarget, AreaMulti, DelayMulti, LogFan, Slew, Gain, nGatesMin, fRecovery, fSwitching, fVerbose );
-        if ( pNtkRes == NULL )
-        {
-            Abc_NtkDelete( pNtk );
-            Abc_Print( -1, "Mapping has failed.\n" );
-            return 1;
-        }
-        Abc_NtkDelete( pNtk );
-    }
-    else
-    {
-        // get the new network
-        pNtkRes = Abc_NtkMap( pNtk, DelayTarget, AreaMulti, DelayMulti, LogFan, Slew, Gain, nGatesMin, fRecovery, fSwitching, fVerbose );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "Mapping has failed.\n" );
-            return 1;
-        }
-    }
-
-    if ( fSweep )
-    {
-        Abc_NtkFraigSweep( pNtkRes, 0, 0, 0, 0 );
-        if ( Abc_NtkHasMapping(pNtkRes) )
-        {
-            pNtkRes = Abc_NtkDupDfs( pNtk = pNtkRes );
-            Abc_NtkDelete( pNtk );
-        }
-    }
-
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    if ( DelayTarget == -1 )
-        sprintf(Buffer, "not used" );
-    else
-        sprintf(Buffer, "%.3f", DelayTarget );
-    Abc_Print( -2, "usage: map [-DABFSG float] [-M num] [-arspvh]\n" );
-    Abc_Print( -2, "\t           performs standard cell mapping of the current network\n" );
-    Abc_Print( -2, "\t-D float : sets the global required times [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-A float : \"area multiplier\" to bias gate selection [default = %.2f]\n", AreaMulti );
-    Abc_Print( -2, "\t-B float : \"delay multiplier\" to bias gate selection [default = %.2f]\n", DelayMulti );
-    Abc_Print( -2, "\t-F float : the logarithmic fanout delay parameter [default = %.2f]\n", LogFan );
-    Abc_Print( -2, "\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
-    Abc_Print( -2, "\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
-    Abc_Print( -2, "\t-M num   : skip gate classes whose size is less than this [default = %d]\n", nGatesMin );
-    Abc_Print( -2, "\t-a       : toggles area-only mapping [default = %s]\n", fAreaOnly? "yes": "no" );
-    Abc_Print( -2, "\t-r       : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
-    Abc_Print( -2, "\t-s       : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
-    Abc_Print( -2, "\t-p       : optimizes power by minimizing switching [default = %s]\n", fSwitching? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Amap_Par_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int fSweep;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkDarAmap( Abc_Ntk_t * pNtk, Amap_Par_t * pPars );
-    extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fSweep = 0;
-    Amap_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FACEQmxisvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->nIterFlow = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIterFlow < 0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->nIterArea = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIterArea < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'E':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->fEpsilon = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->fEpsilon < 0.0 || pPars->fEpsilon > 1.0 )
-                goto usage;
-            break;
-        case 'Q':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Q\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->fADratio = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->fADratio < 0.0 )
-                goto usage;
-            break;
-        case 'm':
-            pPars->fUseMuxes ^= 1;
-            break;
-        case 'x':
-            pPars->fUseXors ^= 1;
-            break;
-        case 'i':
-            pPars->fFreeInvs ^= 1;
-            break;
-        case 's':
-            fSweep ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Strashing before mapping has failed.\n" );
-            return 1;
-        }
-        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Balancing before mapping has failed.\n" );
-            return 1;
-        }
-        Abc_Print( 0, "The network was strashed and balanced before mapping.\n" );
-        // get the new network
-        pNtkRes = Abc_NtkDarAmap( pNtk, pPars );
-        if ( pNtkRes == NULL )
-        {
-            Abc_NtkDelete( pNtk );
-            Abc_Print( -1, "Mapping has failed.\n" );
-            return 1;
-        }
-        Abc_NtkDelete( pNtk );
-    }
-    else
-    {
-        // get the new network
-        pNtkRes = Abc_NtkDarAmap( pNtk, pPars );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "Mapping has failed.\n" );
-            return 1;
-        }
-    }
-
-    if ( fSweep )
-    {
-        Abc_NtkFraigSweep( pNtkRes, 0, 0, 0, 0 );
-        if ( Abc_NtkHasMapping(pNtkRes) )
-        {
-            pNtkRes = Abc_NtkDupDfs( pNtk = pNtkRes );
-            Abc_NtkDelete( pNtk );
-        }
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: amap [-FAC <num>] [-EQ <float>] [-mxisvh]\n" );
-    Abc_Print( -2, "\t           performs standard cell mapping of the current network\n" );
-    Abc_Print( -2, "\t-F num   : the number of iterations of area flow [default = %d]\n", pPars->nIterFlow );
-    Abc_Print( -2, "\t-A num   : the number of iterations of exact area [default = %d]\n", pPars->nIterArea );
-    Abc_Print( -2, "\t-C num   : the maximum number of cuts at a node [default = %d]\n", pPars->nCutsMax );
-    Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->fEpsilon );
-    Abc_Print( -2, "\t-Q float : area/delay preference ratio [default = %.2f (area-only)] \n", pPars->fADratio );
-    Abc_Print( -2, "\t-m       : toggles using MUX matching [default = %s]\n", pPars->fUseMuxes? "yes": "no" );
-    Abc_Print( -2, "\t-x       : toggles using XOR matching [default = %s]\n", pPars->fUseXors? "yes": "no" );
-    Abc_Print( -2, "\t-i       : toggles assuming inverters are free [default = %s]\n", pPars->fFreeInvs? "yes": "no" );
-    Abc_Print( -2, "\t-s       : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandUnmap( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkHasMapping(pNtk) )
-    {
-        Abc_Print( -1, "Cannot unmap the network that is not mapped.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( !Abc_NtkMapToSop( pNtk ) )
-    {
-        Abc_Print( -1, "Unmapping has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: unmap [-h]\n" );
-    Abc_Print( -2, "\t        replaces the library gates by the logic nodes represented using SOPs\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAttach( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsSopLogic(pNtk) )
-    {
-        Abc_Print( -1, "Can only attach gates if the nodes have SOP representations.\n" );
-        return 1;
-    }
-
-    // get the new network
-    if ( !Abc_NtkAttach( pNtk ) )
-    {
-        Abc_Print( -1, "Attaching gates has failed.\n" );
-        return 1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: attach [-h]\n" );
-    Abc_Print( -2, "\t        replaces the SOP functions by the gates from the library\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSuperChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkSuperChoice( Abc_Ntk_t * pNtk );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
-        return 1;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkSuperChoice( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Superchoicing has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: superc [-h]\n" );
-    Abc_Print( -2, "\t      performs superchoicing\n" );
-    Abc_Print( -2, "\t      (accumulate: \"r file.blif; rsup; b; sc; f -ac; wb file_sc.blif\")\n" );
-    Abc_Print( -2, "\t      (map without supergate library: \"r file_sc.blif; ft; map\")\n" );
-    Abc_Print( -2, "\t-h  : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int nLutSize;
-    int nCutSizeMax;
-    int fVerbose;
-    extern int Abc_NtkSuperChoiceLut( Abc_Ntk_t * pNtk, int nLutSize, int nCutSizeMax, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fVerbose = 1;
-    nLutSize = 4;
-    nCutSizeMax = 10;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KNh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nCutSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutSizeMax < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
-        return 1;
-    }
-
-    // convert the network into the SOP network
-    pNtkRes = Abc_NtkToLogic( pNtk );
-
-    // get the new network
-    if ( !Abc_NtkSuperChoiceLut( pNtkRes, nLutSize, nCutSizeMax, fVerbose ) )
-    {
-        Abc_NtkDelete( pNtkRes );
-        Abc_Print( -1, "Superchoicing has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: supercl [-K num] [-N num] [-vh]\n" );
-    Abc_Print( -2, "\t        performs superchoicing for K-LUTs\n" );
-    Abc_Print( -2, "\t        (accumulate: \"r file.blif; b; scl; f -ac; wb file_sc.blif\")\n" );
-    Abc_Print( -2, "\t        (FPGA map: \"r file_sc.blif; ft; read_lut lutlibK; fpga\")\n" );
-    Abc_Print( -2, "\t-K num : the number of LUT inputs [default = %d]\n", nLutSize );
-    Abc_Print( -2, "\t-N num : the max size of the cut [default = %d]\n", nCutSizeMax );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-#if 0 
-int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[100];
-    char LutSize[100];
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fRecovery;
-    int fSwitching;
-    int fLatchPaths;
-    int fVerbose;
-    int nLutSize;
-    float DelayTarget;
-
-    extern Abc_Ntk_t * Abc_NtkFpga( Abc_Ntk_t * pNtk, float DelayTarget, int fRecovery, int fSwitching, int fLatchPaths, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fRecovery   = 1;
-    fSwitching  = 0;
-    fLatchPaths = 0;
-    fVerbose    = 0;
-    DelayTarget =-1;
-    nLutSize    =-1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "aplvhDK" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'a':
-            fRecovery ^= 1;
-            break;
-        case 'p':
-            fSwitching ^= 1;
-            break;
-        case 'l':
-            fLatchPaths ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            DelayTarget = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 0 )
-                goto usage;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    // create the new LUT library
-    if ( nLutSize >= 3 && nLutSize <= 10 )
-        Fpga_SetSimpleLutLib( nLutSize );
-/*
-    else
-    {
-        Abc_Print( -1, "Cannot perform FPGA mapping with LUT size %d.\n", nLutSize );
-        return 1;
-    }
-*/
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        // strash and balance the network
-        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
-            return 1;
-        }
-        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
-            return 1;
-        }
-        Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
-        // get the new network
-        pNtkRes = Abc_NtkFpga( pNtk, DelayTarget, fRecovery, fSwitching, fLatchPaths, fVerbose );
-        if ( pNtkRes == NULL )
-        {
-            Abc_NtkDelete( pNtk );
-            Abc_Print( -1, "FPGA mapping has failed.\n" );
-            return 1;
-        }
-        Abc_NtkDelete( pNtk );
-    }
-    else
-    {
-        // get the new network
-        pNtkRes = Abc_NtkFpga( pNtk, DelayTarget, fRecovery, fSwitching, fLatchPaths, fVerbose );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "FPGA mapping has failed.\n" );
-            return 1;
-        }
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    if ( DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%.2f", DelayTarget );
-    if ( nLutSize == -1 )
-        sprintf(LutSize, "library" );
-    else
-        sprintf(LutSize, "%d", nLutSize );
-    Abc_Print( -2, "usage: fpga [-D float] [-K num] [-aplvh]\n" );
-    Abc_Print( -2, "\t           performs FPGA mapping of the current network\n" );
-    Abc_Print( -2, "\t-a       : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
-    Abc_Print( -2, "\t-p       : optimizes power by minimizing switching activity [default = %s]\n", fSwitching? "yes": "no" );
-    Abc_Print( -2, "\t-l       : optimizes latch paths for delay, other paths for area [default = %s]\n", fLatchPaths? "yes": "no" );
-    Abc_Print( -2, "\t-D float : sets the required time for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-K num   : the number of LUT inputs (2 < num < 11) [default = %s]%s\n", LutSize, (nLutSize == -1 ? " (type \"print_lut\")" : "") );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[100];
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fRecovery;
-    int fVerbose;
-    int nLutSize;
-    float DelayTarget;
-
-    extern Abc_Ntk_t * Abc_NtkFpgaFast( Abc_Ntk_t * pNtk, int nLutSize, int fRecovery, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fRecovery   = 1;
-    fVerbose    = 0;
-    DelayTarget =-1;
-    nLutSize    = 5;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "avhDK" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'a':
-            fRecovery ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            DelayTarget = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 0 )
-                goto usage;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        // strash and balance the network
-        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
-            return 1;
-        }
-        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
-            return 1;
-        }
-        Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
-        // get the new network
-        pNtkRes = Abc_NtkFpgaFast( pNtk, nLutSize, fRecovery, fVerbose );
-        if ( pNtkRes == NULL )
-        {
-            Abc_NtkDelete( pNtk );
-            Abc_Print( -1, "FPGA mapping has failed.\n" );
-            return 1;
-        }
-        Abc_NtkDelete( pNtk );
-    }
-    else
-    {
-        // get the new network
-        pNtkRes = Abc_NtkFpgaFast( pNtk, nLutSize, fRecovery, fVerbose );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "FPGA mapping has failed.\n" );
-            return 1;
-        }
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    if ( DelayTarget == -1 )
-        sprintf(Buffer, "not used" );
-    else
-        sprintf(Buffer, "%.2f", DelayTarget );
-    Abc_Print( -2, "usage: ffpga [-K num] [-avh]\n" );
-    Abc_Print( -2, "\t           performs fast FPGA mapping of the current network\n" );
-    Abc_Print( -2, "\t-a       : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
-//    Abc_Print( -2, "\t-D float : sets the required time for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-K num   : the number of LUT inputs (2 < num < 32) [default = %d]\n", nLutSize );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-#endif
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars );
-    char Buffer[100], LutSize[100];
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    If_Par_t Pars, * pPars = &Pars;
-    int c;
-    pNtk = Abc_FrameReadNtk(pAbc);
-    If_ManSetDefaultPars( pPars );
-    pPars->pLutLib = (If_LibLut_t *)Abc_FrameReadLibLut();
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGNDEWSTqaflepmrsdbgxyojiktncvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutSize < 0 )
-                goto usage;
-            // if the LUT size is specified, disable library
-            pPars->pLutLib = NULL;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nFlowIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFlowIters < 0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nAreaIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nAreaIters < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer no less than 3.\n" );
-                goto usage;
-            }
-            pPars->nGateSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nGateSize < 2 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer no less than 3.\n" );
-                goto usage;
-            }
-            pPars->nNonDecLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nNonDecLimit < 2 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'E':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->Epsilon < 0.0 || pPars->Epsilon > 1.0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->WireDelay = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->WireDelay < 0.0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
-                goto usage;
-            }
-            pPars->pLutStruct = argv[globalUtilOptind];
-            globalUtilOptind++;
-            if ( strlen(pPars->pLutStruct) != 2 && strlen(pPars->pLutStruct) != 3 )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
-                goto usage;
-            }
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer 0,1,or 2.\n" );
-                goto usage;
-            }
-            pPars->nStructType = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nStructType < 0 || pPars->nStructType > 2 )
-                goto usage;
-            break;
-        case 'q':
-            pPars->fPreprocess ^= 1;
-            break;
-        case 'a':
-            pPars->fArea ^= 1;
-            break;
-        case 'r':
-            pPars->fExpRed ^= 1;
-            break;
-        case 'f':
-            pPars->fFancy ^= 1;
-            break;
-        case 'l':
-            pPars->fLatchPaths ^= 1;
-            break;
-        case 'e':
-            pPars->fEdge ^= 1;
-            break;
-        case 'p':
-            pPars->fPower ^= 1;
-            break;
-        case 'm':
-            pPars->fCutMin ^= 1;
-            break;
-        case 's':
-            pPars->fDelayOptLut ^= 1;
-            break;
-        case 'd':
-            pPars->fBidec ^= 1;
-            break;
-        case 'b':
-            pPars->fUseBat ^= 1;
-            break;
-        case 'g':
-            pPars->fDelayOpt ^= 1;
-            break;
-        case 'x':
-            pPars->fDsdBalance ^= 1;
-            break;
-        case 'y':
-            pPars->fUserRecLib ^= 1;
-            break;
-        case 'o':
-            pPars->fUseBuffs ^= 1;
-            break;
-        case 'j':
-            pPars->fEnableCheck07 ^= 1;
-            break;
-        case 'i':
-            pPars->fEnableCheck08 ^= 1;
-            break;
-        case 'k':
-            pPars->fEnableCheck10 ^= 1;
-            break;
-        case 't':
-            pPars->fDoAverage ^= 1;
-            break;
-        case 'n':
-            pPars->fUseDsd ^= 1;
-            break;
-        case 'c':
-            pPars->fUseTtPerm ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( pPars->nLutSize == -1 )
-    {
-        if ( pPars->pLutLib == NULL )
-        {
-            Abc_Print( -1, "The LUT library is not given.\n" );
-            return 1;
-        }
-        pPars->nLutSize = pPars->pLutLib->LutMax;
-    }
-
-    if ( pPars->nLutSize < 2 || pPars->nLutSize > IF_MAX_LUTSIZE )
-    {
-        Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
-        return 1;
-    }
-
-    if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
-    {
-        Abc_Print( -1, "Incorrect number of cuts.\n" );
-        return 1;
-    }
-
-    // enable truth table computation if choices are selected
-    if ( (c = Abc_NtkGetChoiceNum( pNtk )) )
-    {
-//        if ( !Abc_FrameReadFlag("silentmode") )
-//            Abc_Print( 0, "Performing LUT mapping with %d choices.\n", c );
-        pPars->fExpRed = 0;
-    }
-
-    if ( pPars->fUseBat )
-    {
-        if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
-        {
-            Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
-            return 1;
-        }
-        pPars->fCutMin = 1;
-    }
-
-    if ( pPars->fEnableCheck07 + pPars->fEnableCheck08 + pPars->fEnableCheck10 + (pPars->pLutStruct != NULL) > 1 )
-    {
-        Abc_Print( -1, "Only one additional check can be performed at the same time.\n" );
-        return 1;
-    }
-    if ( pPars->fEnableCheck07 )
-    {
-        if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 )
-        {
-            Abc_Print( -1, "This feature only works for {6,7}-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = If_CutPerformCheck07;
-        pPars->fCutMin = 1;
-    }
-    if ( pPars->fEnableCheck08 )
-    {
-        if ( pPars->nLutSize < 6 || pPars->nLutSize > 8 )
-        {
-            Abc_Print( -1, "This feature only works for {6,7,8}-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = If_CutPerformCheck08;
-        pPars->fCutMin = 1;
-    }
-    if ( pPars->fEnableCheck10 )
-    {
-        if ( pPars->nLutSize < 6 || pPars->nLutSize > 10 )
-        {
-            Abc_Print( -1, "This feature only works for {6,7,8,9,10}-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = If_CutPerformCheck10;
-        pPars->fCutMin = 1;
-    }
-    if ( pPars->pLutStruct )
-    {
-        if ( pPars->fDsdBalance )
-        {
-            Abc_Print( -1, "Incompatible options (-S and -x).\n" );
-            return 1;
-        }
-        if ( pPars->nLutSize < 6 || pPars->nLutSize > 16 )
-        {
-            Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck16;
-        pPars->fCutMin = 1;
-    }
-
-    // enable truth table computation if cut minimization is selected
-    if ( pPars->fCutMin )
-    {
-        pPars->fTruth = 1;
-        pPars->fExpRed = 0;
-    }
-    // modify the subgraph recording
-    if ( pPars->fUserRecLib )
-    {
-        pPars->fTruth      =  1;
-        pPars->fCutMin     =  1;
-        pPars->fExpRed     =  0;
-        pPars->fUsePerm    =  1;
-        pPars->pLutLib     =  NULL;
-    }
-    // modify for delay optimization
-    if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fDelayOptLut )
-    {
-        pPars->fTruth      =  1;
-        pPars->fCutMin     =  1;
-        pPars->fExpRed     =  0;
-        pPars->fUseDsd     =  pPars->fDsdBalance || pPars->fDelayOptLut;
-        pPars->pLutLib     =  NULL;
-    }
-    // modify for delay optimization
-    if ( pPars->nGateSize > 0 )
-    {
-        pPars->fTruth      =  1;
-        pPars->fCutMin     =  1;
-        pPars->fExpRed     =  0;
-        pPars->fUsePerm    =  1;
-        pPars->pLutLib     =  NULL;
-        pPars->nLutSize    =  pPars->nGateSize;
-    }
-
-    if ( pPars->fUseDsd || pPars->fUseTtPerm )
-    {
-        pPars->fTruth      =  1;
-        pPars->fCutMin     =  1;
-        pPars->fExpRed     =  0;
-    }
-
-    if ( pPars->fUseDsd )
-    {
-        int LutSize = (pPars->pLutStruct && pPars->pLutStruct[2] == 0)? pPars->pLutStruct[0] - '0' : 0;
-        If_DsdMan_t * p = (If_DsdMan_t *)Abc_FrameReadManDsd();
-        if ( pPars->pLutStruct && pPars->pLutStruct[2] != 0 )
-        {
-            printf( "DSD only works for LUT structures XY.\n" );
-            return 0;
-        }
-        if ( p && pPars->nLutSize > If_DsdManVarNum(p) )
-        {
-            printf( "DSD manager has incompatible number of variables.\n" );
-            return 0;
-        }
-        if ( p && LutSize != If_DsdManLutSize(p) && !pPars->fDsdBalance )
-        {
-            printf( "DSD manager has different LUT size.\n" );
-            return 0;
-        }
-        if ( p == NULL )
-            Abc_FrameSetManDsd( If_DsdManAlloc(pPars->nLutSize, LutSize) );
-    }
-
-    if ( pPars->fUserRecLib )
-    {
-        if ( !Abc_NtkRecIsRunning3() )
-        {
-            printf( "LMS manager is not running (use \"rec_start3\").\n" );
-            return 0;
-        }
-        if ( Abc_NtkRecInputNum3() != pPars->nLutSize )
-        {
-            printf( "The number of library inputs (%d) different from the K parameters (%d).\n", Abc_NtkRecInputNum3(), pPars->nLutSize );
-            return 0;
-        }
-    }
- 
-    // complain if truth tables are requested but the cut size is too large
-    if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
-    {
-        Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
-        return 1;
-    }
-
-    // disable cut-expansion if edge-based heuristics are selected
-//    if ( pPars->fEdge )
-//        pPars->fExpRed = 0;
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        // strash and balance the network
-        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
-            return 1;
-        }
-        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
-            return 1;
-        }
-        if ( !Abc_FrameReadFlag("silentmode") )
-            Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
-        // get the new network
-        pNtkRes = Abc_NtkIf( pNtk, pPars );
-        if ( pNtkRes == NULL )
-        {
-            Abc_NtkDelete( pNtk );
-            Abc_Print( -1, "FPGA mapping has failed.\n" );
-            return 0;
-        }
-        Abc_NtkDelete( pNtk );
-    }
-    else
-    {
-        // get the new network
-        pNtkRes = Abc_NtkIf( pNtk, pPars );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "FPGA mapping has failed.\n" );
-            return 0;
-        }
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    if ( pPars->DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%.2f", pPars->DelayTarget );
-    if ( pPars->nLutSize == -1 )
-        sprintf(LutSize, "library" );
-    else
-        sprintf(LutSize, "%d", pPars->nLutSize );
-    Abc_Print( -2, "usage: if [-KCFANGT num] [-DEW float] [-S str] [-qarlepmsdbgxyojiktncvh]\n" );
-    Abc_Print( -2, "\t           performs FPGA technology mapping of the network\n" );
-    Abc_Print( -2, "\t-K num   : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
-    Abc_Print( -2, "\t-F num   : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
-    Abc_Print( -2, "\t-A num   : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
-    Abc_Print( -2, "\t-N num   : the max size of non-decomposable nodes [default = unused]\n", pPars->nNonDecLimit );
-    Abc_Print( -2, "\t-G num   : the max AND/OR gate size for mapping (0 = unused) [default = %d]\n", pPars->nGateSize );
-    Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
-    Abc_Print( -2, "\t-W float : sets wire delay between adjects LUTs [default = %f]\n", pPars->WireDelay );
-    Abc_Print( -2, "\t-S str   : string representing the LUT structure [default = %s]\n", pPars->pLutStruct ? pPars->pLutStruct : "not used" );
-    Abc_Print( -2, "\t-T num   : the type of LUT structures [default = any]\n", pPars->nStructType );
-    Abc_Print( -2, "\t-q       : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
-    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
-    Abc_Print( -2, "\t-r       : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
-    Abc_Print( -2, "\t-l       : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
-    Abc_Print( -2, "\t-e       : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
-    Abc_Print( -2, "\t-p       : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
-    Abc_Print( -2, "\t-m       : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
-    Abc_Print( -2, "\t-s       : toggles delay-oriented mapping used with -S <NN> [default = %s]\n", pPars->fDelayOptLut? "yes": "no" );
-    Abc_Print( -2, "\t-d       : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
-    Abc_Print( -2, "\t-b       : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
-    Abc_Print( -2, "\t-g       : toggles delay optimization by SOP balancing [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
-    Abc_Print( -2, "\t-x       : toggles delay optimization by DSD balancing [default = %s]\n", pPars->fDsdBalance? "yes": "no" );
-    Abc_Print( -2, "\t-y       : toggles delay optimization with recorded library [default = %s]\n", pPars->fUserRecLib? "yes": "no" );
-    Abc_Print( -2, "\t-o       : toggles using buffers to decouple combinational outputs [default = %s]\n", pPars->fUseBuffs? "yes": "no" );
-    Abc_Print( -2, "\t-j       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck07? "yes": "no" );
-    Abc_Print( -2, "\t-i       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck08? "yes": "no" );
-    Abc_Print( -2, "\t-k       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck10? "yes": "no" );
-    Abc_Print( -2, "\t-t       : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
-    Abc_Print( -2, "\t-n       : toggles computing DSDs of the cut functions [default = %s]\n", pPars->fUseDsd? "yes": "no" );
-    Abc_Print( -2, "\t-c       : toggles computing truth tables in a new way [default = %s]\n", pPars->fUseTtPerm? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIfif( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_NtkPerformIfif( Abc_Ntk_t * pNtk, Ifif_Par_t * pPars );
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Ifif_Par_t Pars, * pPars = &Pars;
-    int c, fError;
-
-    pPars->nLutSize     =  -1;    // the LUT size
-    pPars->pLutLib      = (If_LibLut_t *)Abc_FrameReadLibLut();       // the LUT library
-    pPars->DelayWire    = (float)0.5;    // wire delay
-    pPars->nDegree      =   0;    // structure degree
-    pPars->fCascade     =   0;    // cascade
-    pPars->fVerbose     =   0;    // verbose
-    pPars->fVeryVerbose =   0;    // verbose
-
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "DNcvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayWire = atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayWire < 0.0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->nDegree = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nDegree < 0 )
-                goto usage;
-            break;
-        case 'c':
-            pPars->fCascade ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "Need mapped network.\n" );
-        return 1;
-    }
-    if ( pPars->pLutLib == NULL )
-    {
-        Abc_Print( -1, "LUT library is not given.\n" );
-        return 1;
-    }
-
-    pPars->nLutSize = Abc_NtkGetFaninMax( pNtk );
-    if ( pPars->nLutSize > pPars->pLutLib->LutMax )
-    {
-        Abc_Print( -1, "The max node size (%d) exceeds the LUT size (%d).\n", pPars->nLutSize, pPars->pLutLib->LutMax );
-        return 1;
-    }
-    if ( pPars->nLutSize < pPars->pLutLib->LutMax )
-        Abc_Print( 0, "Node size (%d) is less than LUT size (%d).\n", pPars->nLutSize, pPars->pLutLib->LutMax );
-    // check delay information
-    fError = 0;
-    for ( c = 0; c < pPars->pLutLib->LutMax; c++ )
-    {
-        pPars->pLutDelays[c] = ( pPars->pLutLib->fVarPinDelays ? pPars->pLutLib->pLutDelays[pPars->pLutLib->LutMax][c] : pPars->pLutLib->pLutDelays[pPars->pLutLib->LutMax][0] );
-        if ( pPars->DelayWire >= pPars->pLutDelays[c] )
-        {
-            fError = 1;
-            printf(" Wire delay (%.2f) exceeds pin+wire delay (%.2f) for pin %d in the LUT library.\n", pPars->DelayWire, pPars->pLutDelays[c], c );
-        }
-    }
-    if ( fError )
-        return 1;
-
-    // call the mapper
-    Abc_NtkPerformIfif( pNtk, pPars );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: ifif [-DNcvwh]\n" );
-    Abc_Print( -2, "\t           technology mapper into N-node K-LUT structures\n" );
-    Abc_Print( -2, "\t           (takes a LUT network and maps it into a delay-optimal network\n" );
-    Abc_Print( -2, "\t            of N-node K-LUT structures using the current LUT library)\n" );
-    Abc_Print( -2, "\t-D float : wire delay (should be less than the LUT delay) [default = %.2f]\n", pPars->DelayWire );
-    Abc_Print( -2, "\t-N num   : degree of the LUT structure [default = %d]\n", pPars->nDegree );
-    Abc_Print( -2, "\t-c       : toggles using LUT cascade vs LUT cluster [default = %s]\n", pPars->fCascade? "cascade": "cluster" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDsdSave( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char * FileName;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c;
-
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( !Abc_FrameReadManDsd() )
-    {
-        Abc_Print( -1, "The DSD manager is not started.\n" );
-        return 1;
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "File name is not given on the command line.\n" );
-        return 1;
-    }
-    // get the input file name
-    FileName = (nArgcNew == 1) ? pArgvNew[0] : NULL;
-    If_DsdManSave( (If_DsdMan_t *)Abc_FrameReadManDsd(), FileName );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsd_save [-h] <file>\n" );
-    Abc_Print( -2, "\t         saves DSD manager into a file\n");
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : (optional) file name to write\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDsdLoad( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char * FileName, * pTemp;
-    char ** pArgvNew;
-    int c, nArgcNew;
-    FILE * pFile;
-    If_DsdMan_t * pDsdMan;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "File name is not given on the command line.\n" );
-        return 1;
-    }
-    // get the input file name
-    FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-    Abc_FrameSetManDsd( NULL );
-    pDsdMan = If_DsdManLoad(FileName);
-    if ( pDsdMan == NULL )
-        return 1;
-    Abc_FrameSetManDsd( pDsdMan );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsd_load [-h] <file>\n" );
-    Abc_Print( -2, "\t         loads DSD manager from file\n");
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : file name to read\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDsdFree( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_FrameReadManDsd() )
-    {
-        Abc_Print( 1, "The DSD manager is not started.\n" );
-        return 0;
-    }
-    Abc_FrameSetManDsd( NULL );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsd_ps [-h]\n" );
-    Abc_Print( -2, "\t        deletes DSD manager\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDsdPs( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c, Number = 0, Support = 0, fOccurs = 0, fTtDump = 0, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NSotvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            Number = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Number < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            Support = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Support < 0 )
-                goto usage;
-            break;
-        case 'o':
-            fOccurs ^= 1;
-            break;
-        case 't':
-            fTtDump ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_FrameReadManDsd() )
-    {
-        Abc_Print( 1, "The DSD manager is not started.\n" );
-        return 0;
-    }
-    If_DsdManPrint( (If_DsdMan_t *)Abc_FrameReadManDsd(), NULL, Number, Support, fOccurs, fTtDump, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsd_ps [-NS num] [-ovh]\n" );
-    Abc_Print( -2, "\t         prints statistics of DSD manager\n" );
-    Abc_Print( -2, "\t-N num : show structures whose ID divides by N [default = %d]\n",   Number );
-    Abc_Print( -2, "\t-S num : show structures whose support size is S [default = %d]\n", Support );
-    Abc_Print( -2, "\t-o     : toggles printing occurence distribution [default = %s]\n", fOccurs? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggles dumping truth tables [default = %s]\n",            fTtDump? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n",                  fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDsdTune( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c, fVerbose = 0, fFast = 0, fAdd = 0, fSpec = 0, LutSize = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Kfasvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            LutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( LutSize < 4 || LutSize > 6 )
-                goto usage;
-            break;
-        case 'f':
-            fFast ^= 1;
-            break;
-        case 'a':
-            fAdd ^= 1;
-            break;
-        case 's':
-            fSpec ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_FrameReadManDsd() )
-    {
-        Abc_Print( 1, "The DSD manager is not started.\n" );
-        return 0;
-    }
-    If_DsdManTune( (If_DsdMan_t *)Abc_FrameReadManDsd(), LutSize, fFast, fAdd, fSpec, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsd_tune [-K num] [-fasvh]\n" );
-    Abc_Print( -2, "\t         tunes DSD manager for the given LUT size\n" );
-    Abc_Print( -2, "\t-K num : LUT size used for tuning [default = %d]\n",        LutSize );
-    Abc_Print( -2, "\t-f     : toggles using fast check [default = %s]\n",        fFast? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggles adding tuning to the current one [default = %s]\n",    fAdd? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggles using specialized check [default = %s]\n", fSpec? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n",          fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDsdMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char * FileName, * pTemp;
-    char ** pArgvNew;
-    int c, nArgcNew;
-    FILE * pFile;
-    If_DsdMan_t * pDsdMan;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_FrameReadManDsd() )
-    {
-        Abc_Print( 1, "The DSD manager is not started.\n" );
-        return 0;
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "File name is not given on the command line.\n" );
-        return 1;
-    }
-    // get the input file name
-    FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-    pDsdMan = If_DsdManLoad(FileName);
-    if ( pDsdMan == NULL )
-        return 1;
-    If_DsdManMerge( (If_DsdMan_t *)Abc_FrameReadManDsd(), pDsdMan );
-    If_DsdManFree( pDsdMan, 0 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsd_merge [-h] <file>\n" );
-    Abc_Print( -2, "\t         merges DSD manager from file with the current one\n");
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : file name to read\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDsdClean( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( !Abc_FrameReadManDsd() )
-    {
-        Abc_Print( 1, "The DSD manager is not started.\n" );
-        return 0;
-    }
-    If_DsdManClean( (If_DsdMan_t *)Abc_FrameReadManDsd(), fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsd_clean [-K num] [-vh]\n" );
-    Abc_Print( -2, "\t         cleans the occurrence counters\n" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n",          fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandInit( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Abc_Obj_t * pObj;
-    int c, i;
-    int fZeros;
-    int fOnes;
-    int fRandom;
-    int fDontCare;
-    char * pInitStr;
-    // set defaults
-    fZeros    = 0;
-    fOnes     = 0;
-    fRandom   = 0;
-    fDontCare = 0;
-    pInitStr  = NULL;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Szordh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pInitStr = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'z':
-            fZeros ^= 1;
-            break;
-        case 'o':
-            fOnes ^= 1;
-            break;
-        case 'r':
-            fRandom ^= 1;
-            break;
-        case 'd':
-            fDontCare ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The current network is combinational.\n" );
-        return 0;
-    }
-
-    if ( pInitStr != NULL )
-    {
-        if ( (int)strlen(pInitStr) != Abc_NtkLatchNum(pNtk) )
-        {
-            Abc_Print( -1, "The length of init string (%d) differs from the number of flops (%d).\n", strlen(pInitStr), Abc_NtkLatchNum(pNtk) );
-            return 1;
-        }
-        Abc_NtkForEachLatch( pNtk, pObj, i )
-            if ( pInitStr[i] == '0' )
-                Abc_LatchSetInit0( pObj );
-            else if ( pInitStr[i] == '1' )
-                Abc_LatchSetInit1( pObj );
-            else 
-                Abc_LatchSetInitDc( pObj );
-        return 0;
-    }
-
-    if ( fZeros )
-    {
-        Abc_NtkForEachLatch( pNtk, pObj, i )
-            Abc_LatchSetInit0( pObj );
-    }
-    else if ( fOnes )
-    {
-        Abc_NtkForEachLatch( pNtk, pObj, i )
-            Abc_LatchSetInit1( pObj );
-    }
-    else if ( fRandom )
-    {
-        srand( time(NULL) );
-        Abc_NtkForEachLatch( pNtk, pObj, i )
-            if ( rand() & 1 )
-                Abc_LatchSetInit1( pObj );
-            else
-                Abc_LatchSetInit0( pObj );
-    }
-    else if ( fDontCare )
-    {
-        Abc_NtkForEachLatch( pNtk, pObj, i )
-            Abc_LatchSetInitDc( pObj );
-    }
-    else
-        Abc_Print( -1, "The initial states remain unchanged.\n" );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: init [-zordh] [-S <init_string>]\n" );
-    Abc_Print( -2, "\t         resets initial states of all latches\n" );
-    Abc_Print( -2, "\t-z     : set zeros initial states [default = %s]\n", fZeros? "yes": "no" );
-    Abc_Print( -2, "\t-o     : set ones initial states [default = %s]\n", fOnes? "yes": "no" );
-    Abc_Print( -2, "\t-d     : set don't-care initial states [default = %s]\n", fDontCare? "yes": "no" );
-    Abc_Print( -2, "\t-r     : set random initial states [default = %s]\n", fRandom? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t-S str : (optional) initial state  [default = unused]\n" );
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandZero( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The current network is combinational.\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for AIGs.\n" );
-        return 0;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkRestrashZero( pNtk, 0 );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Converting to sequential AIG has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: zero [-h]\n" );
-    Abc_Print( -2, "\t        converts latches to have const-0 initial value\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandUndc( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c, fUseCex = 0;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'c':
-            fUseCex ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( fUseCex )
-    {
-        char * pInit; 
-        Abc_Cex_t * pTemp;
-        int k, nFlopsX = 0;
-        if ( pAbc->pCex == NULL )
-        {
-            Abc_Print( -1, "Current CEX is not available.\n" );
-            return 1;
-        }
-        pInit = Abc_NtkCollectLatchValuesStr( pAbc->pNtkCur );
-        // count the number of X-valued flops
-        for ( k = 0; k < Abc_NtkLatchNum(pAbc->pNtkCur); k++ )
-            nFlopsX += (int)(pInit[k] == 'x');
-        // compare this value
-        if ( Abc_NtkPiNum(pNtk) + nFlopsX != pAbc->pCex->nPis )
-        {
-            Abc_Print( -1, "The number of PIs (%d) plus X-valued flops (%d) in the original network does not match the number of PIs in the current CEX (%d).\n", 
-                Abc_NtkPiNum(pNtk), Abc_NtkLatchNum(pNtk), pAbc->pCex->nPis );
-            return 1;
-        }
-        pAbc->pCex = Abc_CexTransformUndc( pTemp = pAbc->pCex, pInit );
-        assert( pAbc->pCex->nPis == Abc_NtkPiNum(pAbc->pNtkCur) );
-        assert( pAbc->pCex->nRegs == Abc_NtkLatchNum(pAbc->pNtkCur) );
-        Abc_CexFree( pTemp );
-        ABC_FREE( pInit );
-        return 0;
-    }
-
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The current network is combinational.\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for logic networks.\n" );
-        return 0;
-    }
-
-    // get the new network
-    Abc_NtkConvertDcLatches( pNtk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: undc [-ch]\n" );
-    Abc_Print( -2, "\t        converts latches with DC init values into free PIs\n" );
-    Abc_Print( -2, "\t-c    : toggles transforming CEX after \"logic;undc;st;zero\" [default = %s]\n", fUseCex? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandOneHot( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkConvertOnehot( Abc_Ntk_t * pNtk );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The current network is combinational.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for logic networks.\n" );
-        return 0;
-    }
-    // get the new network
-    pNtkRes = Abc_NtkConvertOnehot( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Converting to one-hot encoding has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: onehot [-h]\n" );
-    Abc_Print( -2, "\t        converts natural encoding into one-hot encoding\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPipe( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nLatches;
-    extern void Abc_NtkLatchPipe( Abc_Ntk_t * pNtk, int nLatches );
-    // set defaults
-    nLatches = 5;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Lh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nLatches = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLatches < 0 )
-                goto usage;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The current network is combinational.\n" );
-        return 0;
-    }
-
-    // update the network
-    Abc_NtkLatchPipe( pNtk, nLatches );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: pipe [-L num] [-h]\n" );
-    Abc_Print( -2, "\t         inserts the given number of latches at each PI for pipelining\n" );
-    Abc_Print( -2, "\t-L num : the number of latches to insert [default = %d]\n", nLatches );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "The network has no latches.\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Conversion to sequential AIG works only for combinational AIGs (run \"strash\").\n" );
-        return 1;
-    }
-
-    // get the new network
-//    pNtkRes = Abc_NtkAigToSeq( pNtk );
-    pNtkRes = NULL;
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Converting to sequential AIG has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: seq [-h]\n" );
-    Abc_Print( -2, "\t        converts AIG into sequential AIG\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandUnseq( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fShare;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fShare = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fShare ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-/*
-    if ( !Abc_NtkIsSeq(pNtk) )
-    {
-        Abc_Print( -1, "Conversion to combinational AIG works only for sequential AIG (run \"seq\").\n" );
-        return 1;
-    }
-*/
-    // share the latches on the fanout edges
-//    if ( fShare )
-//        Seq_NtkShareFanouts(pNtk);
-
-    // get the new network
-//    pNtkRes = Abc_NtkSeqToLogicSop( pNtk );
-    pNtkRes = NULL;
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Converting sequential AIG into an SOP logic network has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: unseq [-sh]\n" );
-    Abc_Print( -2, "\t        converts sequential AIG into an SOP logic network\n" );
-    Abc_Print( -2, "\t-s    : toggle sharing latches [default = %s]\n", fShare? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, nMaxIters;
-    int fForward;
-    int fBackward;
-    int fOneStep;
-    int fVerbose;
-    int Mode;
-    int nDelayLim;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Mode      =  5;
-    nDelayLim =  0;
-    fForward  =  0;
-    fBackward =  0;
-    fOneStep  =  0;
-    fVerbose  =  0;
-    nMaxIters = 15;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "MDfbsvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            Mode = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Mode < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nDelayLim = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nDelayLim < 0 )
-                goto usage;
-            break;
-        case 'f':
-            fForward ^= 1;
-            break;
-        case 'b':
-            fBackward ^= 1;
-            break;
-        case 's':
-            fOneStep ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( fForward && fBackward )
-    {
-        Abc_Print( -1, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkLatchNum(pNtk) )
-    {
-//        Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
-        return 0;
-    }
-
-    if ( Mode < 0 || Mode > 6 )
-    {
-        Abc_Print( -1, "The mode (%d) is incorrect. Retiming is not performed.\n", Mode );
-        return 0;
-    }
-
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        if ( Abc_NtkGetChoiceNum(pNtk) )
-        {
-            Abc_Print( -1, "Retiming with choice nodes is not implemented.\n" );
-            return 0;
-        }
-        // convert the network into an SOP network
-        pNtkRes = Abc_NtkToLogic( pNtk );
-        // perform the retiming
-        Abc_NtkRetime( pNtkRes, Mode, nDelayLim, fForward, fBackward, fOneStep, fVerbose );
-        // replace the current network
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-        return 0;
-    }
-
-    // get the network in the SOP form
-    if ( !Abc_NtkToSop(pNtk, 0) )
-    {
-        Abc_Print( -1, "Converting to SOPs has failed.\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "The network is not a logic network. Retiming is not performed.\n" );
-        return 0;
-    }
-
-    // perform the retiming
-    Abc_NtkRetime( pNtk, Mode, nDelayLim, fForward, fBackward, fOneStep, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: retime [-MD num] [-fbvh]\n" );
-    Abc_Print( -2, "\t         retimes the current network using one of the algorithms:\n" );
-    Abc_Print( -2, "\t             1: most forward retiming\n" );
-    Abc_Print( -2, "\t             2: most backward retiming\n" );
-    Abc_Print( -2, "\t             3: forward and backward min-area retiming\n" );
-    Abc_Print( -2, "\t             4: forward and backward min-delay retiming\n" );
-    Abc_Print( -2, "\t             5: mode 3 followed by mode 4\n" );
-    Abc_Print( -2, "\t             6: Pan's optimum-delay retiming using binary search\n" );
-    Abc_Print( -2, "\t-M num : the retiming algorithm to use [default = %d]\n", Mode );
-    Abc_Print( -2, "\t-D num : the minimum delay target (0=unused) [default = %d]\n", nDelayLim );
-    Abc_Print( -2, "\t-f     : enables forward-only retiming in modes 3,4,5 [default = %s]\n", fForward? "yes": "no" );
-    Abc_Print( -2, "\t-b     : enables backward-only retiming in modes 3,4,5 [default = %s]\n", fBackward? "yes": "no" );
-    Abc_Print( -2, "\t-s     : enables retiming one step only in mode 4 [default = %s]\n", fOneStep? "yes": "no" );
-    Abc_Print( -2, "\t-v     : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-//    Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
-//    Abc_Print( -2, "\t-f     : toggle forward retiming (for AIGs) [default = %s]\n", fForward? "yes": "no" );
-//    Abc_Print( -2, "\t-b     : toggle backward retiming (for AIGs) [default = %s]\n", fBackward? "yes": "no" );
-//    Abc_Print( -2, "\t-i     : toggle computation of initial state [default = %s]\n", fInitial? "yes": "no" );
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int fMinArea;
-    int fForwardOnly;
-    int fBackwardOnly;
-    int fInitial;
-    int nStepsMax;
-    int fFastAlgo;
-    int fVerbose;
-    int c, nMaxIters;
-    extern Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
-    extern Abc_Ntk_t * Abc_NtkDarRetimeF( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
-    extern Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
-    extern Abc_Ntk_t * Abc_NtkDarRetimeMostFwd( Abc_Ntk_t * pNtk, int nMaxIters, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fMinArea  = 1;
-    fForwardOnly = 0;
-    fBackwardOnly = 0;
-    fInitial = 1;
-    nStepsMax = 100000;
-    fFastAlgo = 0;
-    nMaxIters = 20;
-    fVerbose  = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NSmfbiavh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nMaxIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nMaxIters < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nStepsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nStepsMax < 0 )
-                goto usage;
-            break;
-        case 'm':
-            fMinArea ^= 1;
-            break;
-        case 'f':
-            fForwardOnly ^= 1;
-            break;
-        case 'b':
-            fBackwardOnly ^= 1;
-            break;
-        case 'i':
-            fInitial ^= 1;
-            break;
-        case 'a':
-            fFastAlgo ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkLatchNum(pNtk) )
-    {
-//        Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
-        return 0;
-    }
-
-    // perform the retiming
-    if ( fMinArea )
-        pNtkRes = Abc_NtkDarRetimeMinArea( pNtk, nMaxIters, fForwardOnly, fBackwardOnly, fInitial, fVerbose );
-    else if ( fFastAlgo )
-        pNtkRes = Abc_NtkDarRetime( pNtk, nStepsMax, fVerbose );
-    else
-//        pNtkRes = Abc_NtkDarRetimeF( pNtk, nStepsMax, fVerbose );
-        pNtkRes = Abc_NtkDarRetimeMostFwd( pNtk, nMaxIters, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Retiming has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dretime [-NS num] [-mfbiavh]\n" );
-    Abc_Print( -2, "\t         new implementation of min-area (or most-forward) retiming\n" );
-    Abc_Print( -2, "\t-m     : toggle min-area retiming and most-forward retiming [default = %s]\n", fMinArea? "min-area": "most-fwd" );
-    Abc_Print( -2, "\t-f     : enables forward-only retiming [default = %s]\n", fForwardOnly? "yes": "no" );
-    Abc_Print( -2, "\t-b     : enables backward-only retiming [default = %s]\n", fBackwardOnly? "yes": "no" );
-    Abc_Print( -2, "\t-i     : enables init state computation [default = %s]\n", fInitial? "yes": "no" );
-    Abc_Print( -2, "\t-N num : the max number of one-frame iterations to perform [default = %d]\n", nMaxIters );
-    Abc_Print( -2, "\t-S num : the max number of forward retiming steps to perform [default = %d]\n", nStepsMax );
-    Abc_Print( -2, "\t-a     : enables a fast most-forward algorithm [default = %s]\n", fFastAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-v     : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c, nMaxIters;
-    int fForward;
-    int fBackward;
-    int fVerbose;
-    int fComputeInit, fGuaranteeInit, fBlockConst;
-    int fFastButConservative;
-    int maxDelay;
-
-    if ( argc == 2 && !strcmp(argv[1], "-h") )
-    {
-        Abc_Print( -2, "The fretime command is temporarily disabled.\n" );
-        return 1;
-    }
-
-    Abc_Print( -1, "This command is temporarily disabled.\n" );
-    return 0;
-//    extern Abc_Ntk_t* Abc_FlowRetime_MinReg( Abc_Ntk_t * pNtk, int fVerbose,
-//                                             int fComputeInit, int fGuaranteeInit, int fBlockConst,
-//                                             int fForward, int fBackward, int nMaxIters,
-//                                             int maxDelay, int fFastButConservative);
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fForward  =  0;
-    fFastButConservative = 0;
-    fBackward =  0;
-    fComputeInit =  1;
-    fGuaranteeInit =  0;
-    fVerbose  =  0;
-    fBlockConst  =  0;
-    nMaxIters = 999;
-    maxDelay  = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "MDfcgbkivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nMaxIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nMaxIters < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            maxDelay = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( maxDelay < 0 )
-                goto usage;
-           break;
-        case 'f':
-            fForward ^= 1;
-            break;
-        case 'c':
-            fFastButConservative ^= 1;
-            break;
-        case 'i':
-            fComputeInit ^= 1;
-            break;
-        case 'b':
-            fBackward ^= 1;
-            break;
-        case 'g':
-            fGuaranteeInit ^= 1;
-            break;
-        case 'k':
-            fBlockConst ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( fForward && fBackward )
-    {
-        Abc_Print( -1, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
-        return 1;
-    }
-
-    if ( fGuaranteeInit && !fComputeInit )
-    {
-      Abc_Print( -1, "Initial state guarantee (-g) requires initial state computation (-i).\n" );
-      return 1;
-    }
-
-    if ( !Abc_NtkLatchNum(pNtk) )
-    {
-//        Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
-        return 0;
-    }
-
-    if ( Abc_NtkGetChoiceNum(pNtk) )
-      {
-        Abc_Print( -1, "Retiming with choice nodes is not implemented.\n" );
-        return 0;
-      }
-
-    // perform the retiming
-//    pNtkRes = Abc_FlowRetime_MinReg( pNtk, fVerbose, fComputeInit,
-//                                     fGuaranteeInit, fBlockConst,
-//                                     fForward, fBackward,
-//                                     nMaxIters, maxDelay, fFastButConservative );
-
-    if (pNtkRes != pNtk)
-      Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: fretime [-M num] [-D num] [-fbvih]\n" );
-    Abc_Print( -2, "\t         retimes the current network using flow-based algorithm\n" );
-    Abc_Print( -2, "\t-M num : the maximum number of iterations [default = %d]\n", nMaxIters );
-    Abc_Print( -2, "\t-D num : the maximum delay [default = none]\n" );
-    Abc_Print( -2, "\t-i     : enables init state computation [default = %s]\n", fComputeInit? "yes": "no" );
-    Abc_Print( -2, "\t-k     : blocks retiming over const nodes [default = %s]\n", fBlockConst? "yes": "no" );
-    Abc_Print( -2, "\t-g     : guarantees init state computation [default = %s]\n", fGuaranteeInit? "yes": "no" );
-    Abc_Print( -2, "\t-c     : very fast (but conserv.) delay constraints [default = %s]\n", fFastButConservative? "yes": "no" );
-    Abc_Print( -2, "\t-f     : enables forward-only retiming  [default = %s]\n", fForward? "yes": "no" );
-    Abc_Print( -2, "\t-b     : enables backward-only retiming [default = %s]\n", fBackward? "yes": "no" );
-    Abc_Print( -2, "\t-v     : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fVerbose;
-    extern Abc_Ntk_t * Abc_NtkCRetime( Abc_Ntk_t * pNtk, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fVerbose    = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for logic networks.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkLatchNum(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    // modify the current network
-    pNtkRes = Abc_NtkCRetime( pNtk, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Sequential cleanup has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cretime [-vh]\n" );
-    Abc_Print( -2, "\t         performs most-forward retiming with equiv classes\n" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
-    int c, nMaxIters;
-    int fVerbose;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nMaxIters = 15;
-    fVerbose  =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nMaxIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nMaxIters < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkHasAig(pNtk) )
-    {
-/*
-        // quit if there are choice nodes
-        if ( Abc_NtkGetChoiceNum(pNtk) )
-        {
-            Abc_Print( -1, "Currently cannot map/retime networks with choice nodes.\n" );
-            return 0;
-        }
-*/
-//        if ( Abc_NtkIsStrash(pNtk) )
-//            pNtkNew = Abc_NtkAigToSeq(pNtk);
-//        else
-//            pNtkNew = Abc_NtkDup(pNtk);
-        pNtkNew = NULL;
-    }
-    else
-    {
-        // strash and balance the network
-        pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        if ( pNtkNew == NULL )
-        {
-            Abc_Print( -1, "Strashing before FPGA mapping/retiming has failed.\n" );
-            return 1;
-        }
-
-        pNtkNew = Abc_NtkBalance( pNtkRes = pNtkNew, 0, 0, 1 );
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtkNew == NULL )
-        {
-            Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
-            return 1;
-        }
-
-        // convert into a sequential AIG
-//        pNtkNew = Abc_NtkAigToSeq( pNtkRes = pNtkNew );
-        pNtkNew = NULL;
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtkNew == NULL )
-        {
-            Abc_Print( -1, "Converting into a seq AIG before FPGA mapping/retiming has failed.\n" );
-            return 1;
-        }
-
-        Abc_Print( 1, "The network was strashed and balanced before FPGA mapping/retiming.\n" );
-    }
-
-    // get the new network
-//    pNtkRes = Seq_NtkFpgaMapRetime( pNtkNew, nMaxIters, fVerbose );
-    pNtkRes = NULL;
-    if ( pNtkRes == NULL )
-    {
-//        Abc_Print( -1, "Sequential FPGA mapping has failed.\n" );
-        Abc_NtkDelete( pNtkNew );
-        return 0;
-    }
-    Abc_NtkDelete( pNtkNew );
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: sfpga [-I num] [-vh]\n" );
-    Abc_Print( -2, "\t         performs integrated sequential FPGA mapping/retiming\n" );
-    Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
-    int c, nMaxIters;
-    int fVerbose;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nMaxIters = 15;
-    fVerbose  =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nMaxIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nMaxIters < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkHasAig(pNtk) )
-    {
-/*
-        // quit if there are choice nodes
-        if ( Abc_NtkGetChoiceNum(pNtk) )
-        {
-            Abc_Print( -1, "Currently cannot map/retime networks with choice nodes.\n" );
-            return 0;
-        }
-*/
-//        if ( Abc_NtkIsStrash(pNtk) )
-//            pNtkNew = Abc_NtkAigToSeq(pNtk);
-//        else
-//            pNtkNew = Abc_NtkDup(pNtk);
-        pNtkNew = NULL;
-    }
-    else
-    {
-        // strash and balance the network
-        pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
-        if ( pNtkNew == NULL )
-        {
-            Abc_Print( -1, "Strashing before SC mapping/retiming has failed.\n" );
-            return 1;
-        }
-
-        pNtkNew = Abc_NtkBalance( pNtkRes = pNtkNew, 0, 0, 1 );
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtkNew == NULL )
-        {
-            Abc_Print( -1, "Balancing before SC mapping/retiming has failed.\n" );
-            return 1;
-        }
-
-        // convert into a sequential AIG
-//        pNtkNew = Abc_NtkAigToSeq( pNtkRes = pNtkNew );
-        pNtkNew = NULL;
-        Abc_NtkDelete( pNtkRes );
-        if ( pNtkNew == NULL )
-        {
-            Abc_Print( -1, "Converting into a seq AIG before SC mapping/retiming has failed.\n" );
-            return 1;
-        }
-
-        Abc_Print( -1, "The network was strashed and balanced before SC mapping/retiming.\n" );
-    }
-
-    // get the new network
-//    pNtkRes = Seq_MapRetime( pNtkNew, nMaxIters, fVerbose );
-    pNtkRes = NULL;
-    if ( pNtkRes == NULL )
-    {
-//        Abc_Print( -1, "Sequential FPGA mapping has failed.\n" );
-        Abc_NtkDelete( pNtkNew );
-        return 0;
-    }
-    Abc_NtkDelete( pNtkNew );
-
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: smap [-I num] [-vh]\n" );
-    Abc_Print( -2, "\t         performs integrated sequential standard-cell mapping/retiming\n" );
-    Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    Fra_Ssw_t Pars, * pPars = &Pars;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkDarSeqSweep( Abc_Ntk_t * pNtk, Fra_Ssw_t * pPars );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    pPars->nPartSize  = 0;
-    pPars->nOverSize  = 0;
-    pPars->nFramesP   = 0;
-    pPars->nFramesK   = 1;
-    pPars->nMaxImps   = 5000;
-    pPars->nMaxLevs   = 0;
-    pPars->fUseImps   = 0;
-    pPars->fRewrite   = 0;
-    pPars->fFraiging  = 0;
-    pPars->fLatchCorr = 0;
-    pPars->fWriteImps = 0;
-    pPars->fUse1Hot   = 0;
-    pPars->fVerbose   = 0;
-    pPars->TimeLimit  = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PQNFILirfletvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nPartSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nPartSize < 2 )
-                goto usage;
-            break;
-        case 'Q':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nOverSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nOverSize < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesP = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesP < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesK = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesK <= 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxImps = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxImps <= 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxLevs <= 0 )
-                goto usage;
-            break;
-        case 'i':
-            pPars->fUseImps ^= 1;
-            break;
-        case 'r':
-            pPars->fRewrite ^= 1;
-            break;
-        case 'f':
-            pPars->fFraiging ^= 1;
-            break;
-        case 'l':
-            pPars->fLatchCorr ^= 1;
-            break;
-        case 'e':
-            pPars->fWriteImps ^= 1;
-            break;
-        case 't':
-            pPars->fUse1Hot ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
-        return 0;
-    }
-
-    if ( pPars->nFramesK > 1 && pPars->fUse1Hot )
-    {
-        Abc_Print( -1, "Currrently can only use one-hotness for simple induction (K=1).\n" );
-        return 0;
-    }
-
-    if ( pPars->nFramesP && pPars->fUse1Hot )
-    {
-        Abc_Print( -1, "Currrently can only use one-hotness without prefix.\n" );
-        return 0;
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkDarSeqSweep( pNtk, pPars );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Sequential sweeping has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: ssweep [-PQNFL <num>] [-lrfetvh]\n" );
-    Abc_Print( -2, "\t         performs sequential sweep using K-step induction\n" );
-    Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
-    Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
-    Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
-    Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
-    Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
-//    Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
-//    Abc_Print( -2, "\t-i     : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
-    Abc_Print( -2, "\t-e     : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    Ssw_Pars_t Pars, * pPars = &Pars;
-    int nConstrs = 0;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkDarSeqSweep2( Abc_Ntk_t * pNtk, Ssw_Pars_t * pPars );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Ssw_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PQFCLSIVMNcmplkofdseqvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nPartSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nPartSize < 2 )
-                goto usage;
-            break;
-        case 'Q':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nOverSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nOverSize < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesK = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesK <= 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit <= 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxLevs <= 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesAddSim = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesAddSim < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nItersStop = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nItersStop < 0 )
-                goto usage;
-            break;
-        case 'V':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nSatVarMax2 = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nSatVarMax2 < 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRecycleCalls2 = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRecycleCalls2 < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConstrs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConstrs < 0 )
-                goto usage;
-            break;
-        case 'c':
-            pPars->fConstrs ^= 1;
-            break;
-        case 'm':
-            pPars->fMergeFull ^= 1;
-            break;
-        case 'p':
-            pPars->fPolarFlip ^= 1;
-            break;
-        case 'l':
-            pPars->fLatchCorr ^= 1;
-            break;
-        case 'k':
-            pPars->fConstCorr ^= 1;
-            break;
-        case 'o':
-            pPars->fOutputCorr ^= 1;
-            break;
-        case 'f':
-            pPars->fSemiFormal ^= 1;
-            break;
-        case 'd':
-            pPars->fDynamic ^= 1;
-            break;
-        case 's':
-            pPars->fLocalSim ^= 1;
-            break;
-        case 'e':
-            pPars->fEquivDump ^= 1;
-            break;
-        case 'q':
-            pPars->fStopWhenGone ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fFlopVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
-        return 0;
-    }
-
-    if ( Abc_NtkPiNum(pNtk) == 0 )
-    {
-        Abc_Print( 0, "This command works only for designs with primary inputs.\n" );
-        return 0;
-    }
-
-    // if constraints are to be used, network should have no constraints
-    if ( nConstrs > 0 )
-    {
-        if ( Abc_NtkConstrNum(pNtk) > 0 )
-        {
-            Abc_Print( -1, "The network already has %d constraints.\n", Abc_NtkConstrNum(pNtk) );
-            return 0;
-        }
-        else
-        {
-            Abc_Print( 0, "Setting the number of constraints to be %d.\n", nConstrs );
-            pNtk->nConstrs = nConstrs;
-        }
-    }
-
-    if ( pPars->fConstrs )
-    {
-        if ( Abc_NtkConstrNum(pNtk) > 0 )
-            Abc_Print( 0, "Performing scorr with %d constraints.\n", Abc_NtkConstrNum(pNtk) );
-        else
-            Abc_Print( 0, "Performing constraint-based scorr without constraints.\n" );
-    }
-
-    // get the new network
-    pNtkRes = Abc_NtkDarSeqSweep2( pNtk, pPars );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Sequential sweeping has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: scorr [-PQFCLSIVMN <num>] [-cmplkodseqvwh]\n" );
-    Abc_Print( -2, "\t         performs sequential sweep using K-step induction\n" );
-    Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
-    Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
-    Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
-    Abc_Print( -2, "\t-C num : max number of conflicts at a node (0=inifinite) [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
-    Abc_Print( -2, "\t-N num : number of last POs treated as constraints (0=none) [default = %d]\n", pPars->fConstrs );
-    Abc_Print( -2, "\t-S num : additional simulation frames for c-examples (0=none) [default = %d]\n", pPars->nFramesAddSim );
-    Abc_Print( -2, "\t-I num : iteration number to stop and output SR-model (-1=none) [default = %d]\n", pPars->nItersStop );
-    Abc_Print( -2, "\t-V num : min var num needed to recycle the SAT solver [default = %d]\n", pPars->nSatVarMax2 );
-    Abc_Print( -2, "\t-M num : min call num needed to recycle the SAT solver [default = %d]\n", pPars->nRecycleCalls2 );
-    Abc_Print( -2, "\t-N num : set last <num> POs to be constraints (use with -c) [default = %d]\n", nConstrs );
-    Abc_Print( -2, "\t-c     : toggle using explicit constraints [default = %s]\n", pPars->fConstrs? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle full merge if constraints are present [default = %s]\n", pPars->fMergeFull? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle alighning polarity of SAT variables [default = %s]\n", pPars->fPolarFlip? "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle doing latch correspondence [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
-    Abc_Print( -2, "\t-k     : toggle doing constant correspondence [default = %s]\n", pPars->fConstCorr? "yes": "no" );
-    Abc_Print( -2, "\t-o     : toggle doing \'PO correspondence\' [default = %s]\n", pPars->fOutputCorr? "yes": "no" );
-//    Abc_Print( -2, "\t-f     : toggle filtering using iterative BMC [default = %s]\n", pPars->fSemiFormal? "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle dynamic addition of constraints [default = %s]\n", pPars->fDynamic? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle local simulation in the cone of influence [default = %s]\n", pPars->fLocalSim? "yes": "no" );
-    Abc_Print( -2, "\t-e     : toggle dumping disproved internal equivalences [default = %s]\n", pPars->fEquivDump? "yes": "no" );
-    Abc_Print( -2, "\t-q     : toggle quitting when PO is not a constant candidate [default = %s]\n", pPars->fStopWhenGone? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printout of flop equivalences [default = %s]\n", pPars->fFlopVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTestSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char * pFileName;
-    Fra_Ssw_t Pars, * pPars = &Pars;
-    int c;
-//    extern Abc_Ntk_t * Abc_NtkDarSeqSweep( Abc_Ntk_t * pNtk, Fra_Ssw_t * pPars );
-    extern int Fra_FraigInductionTest( char * pFileName, Fra_Ssw_t * pParams );
-
-    // set defaults
-    pPars->nPartSize  = 0;
-    pPars->nOverSize  = 0;
-    pPars->nFramesP   = 0;
-    pPars->nFramesK   = 1;
-    pPars->nMaxImps   = 5000;
-    pPars->nMaxLevs   = 0;
-    pPars->fUseImps   = 0;
-    pPars->fRewrite   = 0;
-    pPars->fFraiging  = 0;
-    pPars->fLatchCorr = 0;
-    pPars->fWriteImps = 0;
-    pPars->fUse1Hot   = 0;
-    pPars->fVerbose   = 0;
-    pPars->TimeLimit  = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PQNFILirfletvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nPartSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nPartSize < 2 )
-                goto usage;
-            break;
-        case 'Q':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nOverSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nOverSize < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesP = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesP < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesK = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesK <= 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxImps = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxImps <= 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMaxLevs <= 0 )
-                goto usage;
-            break;
-        case 'i':
-            pPars->fUseImps ^= 1;
-            break;
-        case 'r':
-            pPars->fRewrite ^= 1;
-            break;
-        case 'f':
-            pPars->fFraiging ^= 1;
-            break;
-        case 'l':
-            pPars->fLatchCorr ^= 1;
-            break;
-        case 'e':
-            pPars->fWriteImps ^= 1;
-            break;
-        case 't':
-            pPars->fUse1Hot ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    // get the input file name
-    if ( argc == globalUtilOptind + 1 )
-        pFileName = argv[globalUtilOptind];
-    else
-    {
-        Abc_Print( -1, "File name should be given on the command line.\n" );
-        return 1;
-    }
-    Fra_FraigInductionTest( pFileName, pPars );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: testssw [-PQNFL num] [-lrfetvh] <file>\n" );
-    Abc_Print( -2, "\t         performs sequential sweep using K-step induction\n" );
-    Abc_Print( -2, "\t         (outputs a file with a set of pairs of equivalent nodes)\n" );
-    Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
-    Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
-    Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
-    Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
-    Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
-//    Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
-//    Abc_Print( -2, "\t-i     : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
-    Abc_Print( -2, "\t-e     : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTestScorr( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkTestScorr( char * pFileNameIn, char * pFileNameOut, int nStepsMax, int nBTLimit, int fNewAlgo, int fFlopOnly, int fFfNdOnly, int fVerbose );
-
-    Abc_Ntk_t * pNtkRes;
-    int c;
-    int nConfMax;
-    int nStepsMax;
-    int fNewAlgo;
-    int fFlopOnly;
-    int fFfNdOnly;
-    int fVerbose;
-    // set defaults
-    nConfMax  = 100;
-    nStepsMax =  -1;
-    fNewAlgo  =   0;
-    fFlopOnly =   0;
-    fFfNdOnly =   0;
-    fVerbose  =   0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CSnfsvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfMax < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nStepsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nStepsMax < 0 )
-                goto usage;
-            break;
-        case 'n':
-            fNewAlgo ^= 1;
-            break;
-        case 'f':
-            fFlopOnly ^= 1;
-            break;
-        case 's':
-            fFfNdOnly ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( argc != globalUtilOptind + 2 )
-    {
-        Abc_Print( -1, "Expecting two files names on the command line.\n" );
-        goto usage;
-    }
-    if ( fFlopOnly && fFfNdOnly )
-    {
-        Abc_Print( -1, "These two options (-f and -s) are incompatible.\n" );
-        goto usage;
-    }
-    // get the new network
-    pNtkRes = Abc_NtkTestScorr( argv[globalUtilOptind], argv[globalUtilOptind+1], nStepsMax, nConfMax, fNewAlgo, fFlopOnly, fFfNdOnly, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Sequential sweeping has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: testscorr [-CS num] [-nfsvh] <file_in> <file_out>\n" );
-    Abc_Print( -2, "\t             outputs the list of sequential equivalences into a file\n" );
-    Abc_Print( -2, "\t             (if <file_in> is in BENCH, init state file should be the same directory)\n" );
-    Abc_Print( -2, "\t-C num     : limit on the number of conflicts [default = %d]\n", nConfMax );
-    Abc_Print( -2, "\t-S num     : limit on refinement iterations (-1=no limit, 0=after BMC, etc) [default = %d]\n", nStepsMax );
-    Abc_Print( -2, "\t-n         : toggle between \"scorr\" and \"&scorr\" [default = %s]\n", fNewAlgo? "&scorr": "scorr" );
-    Abc_Print( -2, "\t-f         : toggle reporting only flop/flop equivs [default = %s]\n", fFlopOnly? "yes": "no" );
-    Abc_Print( -2, "\t-s         : toggle reporting only flop/flop and flop/node equivs [default = %s]\n", fFfNdOnly? "yes": "no" );
-    Abc_Print( -2, "\t-v         : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h         : print the command usage\n");
-    Abc_Print( -2, "\t<file_in>  : input file with design for sequential equivalence computation\n");
-    Abc_Print( -2, "\t<file_out> : output file with the list of pairs of equivalent signals\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int nFramesP;
-    int nConfMax;
-    int nVarsMax;
-    int fNewAlgor;
-    int fVerbose;
-    extern Abc_Ntk_t * Abc_NtkDarLcorr( Abc_Ntk_t * pNtk, int nFramesP, int nConfMax, int fVerbose );
-    extern Abc_Ntk_t * Abc_NtkDarLcorrNew( Abc_Ntk_t * pNtk, int nVarsMax, int nConfMax, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-
-
-    // set defaults
-    nFramesP   =     0;
-    nConfMax   =  1000;
-    nVarsMax   =  1000;
-    fNewAlgor  =     1;
-    fVerbose   =     0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PCSnvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFramesP = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFramesP < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfMax < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nVarsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nVarsMax < 0 )
-                goto usage;
-            break;
-        case 'n':
-            fNewAlgor ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
-        return 0;
-    }
-
-    // get the new network
-    if ( fNewAlgor )
-        pNtkRes = Abc_NtkDarLcorrNew( pNtk, nVarsMax, nConfMax, fVerbose );
-    else
-        pNtkRes = Abc_NtkDarLcorr( pNtk, nFramesP, nConfMax, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Sequential sweeping has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: lcorr [-PCS num] [-nvh]\n" );
-    Abc_Print( -2, "\t         computes latch correspondence using 1-step induction\n" );
-    Abc_Print( -2, "\t-P num : number of time frames to use as the prefix [default = %d]\n", nFramesP );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfMax );
-    Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", nVarsMax );
-    Abc_Print( -2, "\t-n     : toggle using new algorithm [default = %s]\n", fNewAlgor? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSeqCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int c;
-    int fLatchConst  =   1;
-    int fLatchEqual  =   1;
-    int fSaveNames   =   1;
-    int fUseMvSweep  =   0;
-    int nFramesSymb  =   1;
-    int nFramesSatur = 512;
-    int fVerbose     =   0;
-    int fVeryVerbose =   0;
-    pNtk = Abc_FrameReadNtk(pAbc);
-
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "cenmFSvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'c':
-            fLatchConst ^= 1;
-            break;
-        case 'e':
-            fLatchEqual ^= 1;
-            break;
-        case 'n':
-            fSaveNames ^= 1;
-            break;
-        case 'm':
-            fUseMvSweep ^= 1;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFramesSymb = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFramesSymb < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFramesSatur = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFramesSatur < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for structrally hashed networks.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkLatchNum(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    // modify the current network
-    pNtkRes = Abc_NtkDarLatchSweep( pNtk, fLatchConst, fLatchEqual, fSaveNames, fUseMvSweep, nFramesSymb, nFramesSatur, fVerbose, fVeryVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Sequential cleanup has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: scleanup [-cenmFSvwh]\n" );
-    Abc_Print( -2, "\t         performs sequential cleanup of the current network\n" );
-    Abc_Print( -2, "\t         by removing nodes and latches that do not feed into POs\n" );
-    Abc_Print( -2, "\t-c     : sweep stuck-at latches detected by ternary simulation [default = %s]\n", fLatchConst? "yes": "no" );
-    Abc_Print( -2, "\t-e     : merge equal latches (same data inputs and init states) [default = %s]\n", fLatchEqual? "yes": "no" );
-    Abc_Print( -2, "\t-n     : toggle preserving latch names [default = %s]\n", fSaveNames? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle using hybrid ternary/symbolic simulation [default = %s]\n", fUseMvSweep? "yes": "no" );
-    Abc_Print( -2, "\t-F num : the number of first frames simulated symbolically [default = %d]\n", nFramesSymb );
-    Abc_Print( -2, "\t-S num : the number of frames when symbolic saturation begins [default = %d]\n", nFramesSatur );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle very verbose output [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nFrames;
-    int fUseXval;
-    int fVerbose;
-    extern void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVerbose );
-    extern void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
-    // set defaults
-    nFrames    = 100;
-    fUseXval   =   0;
-    fVerbose   =   0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fxvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'x':
-            fUseXval ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) && !Abc_NtkIsSopLogic(pNtk) )
-    {
-        Abc_Print( -1, "Only works for strashed networks or logic SOP networks.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkLatchNum(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    if ( fUseXval && !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "X-valued simulation only works for AIGs. Run \"strash\".\n" );
-        return 0;
-    }
-    if ( fUseXval )
-        Abc_NtkCycleInitState( pNtk, nFrames, 1, fVerbose );
-    else if ( Abc_NtkIsStrash(pNtk) )
-        Abc_NtkCycleInitState( pNtk, nFrames, 0, fVerbose );
-    else
-        Abc_NtkCycleInitStateSop( pNtk, nFrames, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cycle [-F num] [-xvh]\n" );
-    Abc_Print( -2, "\t         cycles sequential circuit for the given number of timeframes\n" );
-    Abc_Print( -2, "\t         to derive a new initial state (which may be on the envelope)\n" );
-    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-x     : use x-valued primary inputs [default = %s]\n", fUseXval? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandXsim( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nFrames;
-    int fXInputs;
-    int fXState;
-    int fVerbose;
-    extern void Abc_NtkXValueSimulate( Abc_Ntk_t * pNtk, int nFrames, int fXInputs, int fXState, int fVerbose );
-    // set defaults
-    nFrames    = 10;
-    fXInputs   =  0;
-    fXState    =  0;
-    fVerbose   =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fisvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'i':
-            fXInputs ^= 1;
-            break;
-        case 's':
-            fXState ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for strashed networks.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkLatchNum(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    Abc_NtkXValueSimulate( pNtk, nFrames, fXInputs, fXState, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: xsim [-F num] [-isvh]\n" );
-    Abc_Print( -2, "\t         performs X-valued simulation of the AIG\n" );
-    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-i     : toggle X-valued representation of inputs [default = %s]\n", fXInputs? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle X-valued representation of state [default = %s]\n", fXState? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSim( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int fNew;
-    int fComb;
-    int nFrames;
-    int nWords;
-    int TimeOut;
-    int fMiter;
-    int fVerbose;
-    char * pFileSim;
-    extern int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, int fNew, int fMiter, int fVerbose, char * pFileSim );
-    // set defaults
-    fNew       =  0;
-    fComb      =  0;
-    nFrames    = 32;
-    nWords     =  8;
-    TimeOut    = 30;
-    fMiter     =  1;
-    fVerbose   =  0;
-    pFileSim   = NULL;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FWTAnmvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nWords < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            TimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( TimeOut < 0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pFileSim = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'n':
-            fNew ^= 1;
-            break;
-        case 'm':
-            fMiter ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for strashed networks.\n" );
-        return 1;
-    }
-    if ( pFileSim != NULL && Abc_NtkLatchNum(pNtk) )
-    {
-        Abc_Print( -1, "Currently simulation with user-specified patterns works only for comb miters.\n" );
-        return 1;
-    }
-    ABC_FREE( pNtk->pSeqModel );
-    pAbc->Status = Abc_NtkDarSeqSim( pNtk, nFrames, nWords, TimeOut, fNew, fMiter, fVerbose, pFileSim );
-    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: sim [-FWT num] [-A file] [-nmvh]\n" );
-    Abc_Print( -2, "\t          performs random simulation of the sequential miter\n" );
-    Abc_Print( -2, "\t-F num  : the number of frames to simulate [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-W num  : the number of words to simulate [default = %d]\n", nWords );
-    Abc_Print( -2, "\t-T num  : approximate runtime limit in seconds [default = %d]\n", TimeOut );
-    Abc_Print( -2, "\t-A file : text file name with user's patterns [default = random simulation]\n" );
-    Abc_Print( -2, "\t          (patterns are listed, one per line, as sequences of 0s and 1s)\n" );
-    Abc_Print( -2, "\t-n      : toggle new vs. old implementation [default = %s]\n", fNew? "new": "old" );
-    Abc_Print( -2, "\t-m      : toggle miter vs. any circuit [default = %s]\n", fMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-v      : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h      : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSim3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Abc_NtkDarSeqSim3( Abc_Ntk_t * pNtk, Ssw_RarPars_t * pPars );
-    Ssw_RarPars_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
-    Vec_Ptr_t * vSeqModelVec; 
-    int c;
-    Ssw_RarSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTGadivzh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBinSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBinSize < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRestart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRestart < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRandSeed = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRandSeed < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOut < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOutGap < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fSolveAll ^= 1;
-            break;
-        case 'd':
-            pPars->fDropSatOuts ^= 1;
-            break;
-        case 'i':
-            pPars->fSetLastState ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'z':
-            pPars->fNotVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for strashed networks.\n" );
-        return 1;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "Only works for sequential networks.\n" );
-        return 1;
-    }
-    ABC_FREE( pNtk->pSeqModel );
-    pAbc->Status = Abc_NtkDarSeqSim3( pNtk, pPars );
-    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    vSeqModelVec = pNtk->vSeqModelVec;  pNtk->vSeqModelVec = NULL;
-    if ( pPars->fSetLastState && pAbc->pNtkCur->pData )
-    {
-        Abc_Obj_t * pObj;
-        Vec_Int_t * vInit = (Vec_Int_t *)pAbc->pNtkCur->pData;
-        pAbc->pNtkCur->pData = NULL;
-        Abc_NtkForEachLatch( pAbc->pNtkCur, pObj, c )
-            if ( Vec_IntEntry(vInit, c) )
-                Abc_LatchSetInit1( pObj );
-        Vec_IntFree( vInit );
-        pNtkRes = Abc_NtkRestrashZero( pAbc->pNtkCur, 0 );
-        if ( pNtkRes == NULL )
-        {
-            Abc_Print( -1, "Removing SAT outputs has failed.\n" );
-            return 1;
-        }
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-        pNtk = Abc_FrameReadNtk(pAbc);
-    }
-    if ( pPars->fSolveAll && pPars->fDropSatOuts )
-    {
-        if ( vSeqModelVec == NULL )
-            Abc_Print( 1,"The array of counter-examples is not available.\n" );
-        else if ( Vec_PtrSize(vSeqModelVec) != Abc_NtkPoNum(pNtk) )
-            Abc_Print( 1,"The array size does not match the number of outputs.\n" );
-        else
-        {
-            extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
-            Abc_NtkDropSatOutputs( pNtk, vSeqModelVec, pPars->fVerbose );
-            pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
-            if ( pNtkRes == NULL )
-            {
-                Abc_Print( -1, "Removing SAT outputs has failed.\n" );
-                return 1;
-            }
-            Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-        }
-    }
-    if ( vSeqModelVec )
-    {
-        Abc_FrameReplaceCexVec( pAbc, &vSeqModelVec );
-        pAbc->nFrames = -1;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: sim3 [-FWBRSNTG num] [-advzh]\n" );
-    Abc_Print( -2, "\t         performs random simulation of the sequential miter\n" );
-    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n",                         pPars->nFrames );
-    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n",                          pPars->nWords );
-    Abc_Print( -2, "\t-B num : the number of flops in one bin [default = %d]\n",                           pPars->nBinSize );
-    Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n",                          pPars->nRounds );
-    Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n",                    pPars->nRestart );
-    Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n",                    pPars->nRandSeed );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n",                     pPars->TimeOut );
-    Abc_Print( -2, "\t-G num : approximate runtime gap in seconds since the last CEX [default = %d]\n",    pPars->TimeOutGap );
-    Abc_Print( -2, "\t-a     : toggle solving all outputs (do not stop when one is SAT) [default = %s]\n", pPars->fSolveAll?    "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle dropping (replacing by 0) SAT outputs [default = %s]\n",             pPars->fDropSatOuts? "yes": "no" );
-    Abc_Print( -2, "\t-i     : toggle changing init state to a last rare state [default = %s]\n",          pPars->fVerbose?     "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",                      pPars->fVerbose?     "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle suppressing report about solved outputs [default = %s]\n",           pPars->fNotVerbose?  "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int nFrames, nPref;
-    int fIgnore;
-    int fPrint;
-    int fUpdateCex;
-    int c, fVerbose;
-    extern Abc_Ntk_t * Abc_NtkPhaseAbstract( Abc_Ntk_t * pNtk, int nFrames, int nPref, int fIgnore, int fPrint, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nFrames     = 0;
-    nPref       = 0;
-    fIgnore     = 0;
-    fPrint      = 0;
-    fUpdateCex  = 0;
-    fVerbose    = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FPipcvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nPref = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nPref < 0 )
-                goto usage;
-            break;
-        case 'i':
-            fIgnore ^= 1;
-            break;
-        case 'p':
-            fPrint ^= 1;
-            break;
-        case 'c':
-            fUpdateCex ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for structrally hashed networks.\n" );
-        return 1;
-    }
-    if ( fUpdateCex )
-    {
-        Abc_Cex_t * pCexNew;
-        if ( pAbc->pCex == NULL )
-        {
-            Abc_Print( -1, "Counter-example is not available.\n" );
-            return 1;
-        }
-        if ( pAbc->pCex->nPis % Abc_NtkPiNum(pNtk) != 0 )
-        {
-            Abc_Print( -1, "PI count of the CEX is not a multiple of PI count of the current AIG.\n" );
-            return 1;
-        }
-        pCexNew = Abc_CexTransformPhase( pAbc->pCex, Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkLatchNum(pNtk) );
-        {
-            Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
-            Gia_Man_t * pGia = Gia_ManFromAig( pAig );
-            int iPo = Gia_ManSetFailedPoCex( pGia, pCexNew );
-            Gia_ManStop( pGia );
-            Aig_ManStop( pAig );
-            if ( iPo == -1 )
-            {
-                Abc_Print( -1, "The counter-example does not fail any of the outputs of the original AIG.\n" );
-                return 1;
-            }
-        }
-        Abc_FrameReplaceCex( pAbc, &pCexNew );
-        return 0;
-    }
-    if ( !Abc_NtkLatchNum(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    if ( fPrint )
-    {
-        Abc_NtkPhaseAbstract( pNtk, 0, nPref, fIgnore, 1, fVerbose );
-        return 0;
-    }
-    // modify the current network
-    pNtkRes = Abc_NtkPhaseAbstract( pNtk, nFrames, nPref, fIgnore, 0, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-//        Abc_Print( -1, "Phase abstraction has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: phase [-FP <num>] [-ipcvh]\n" );
-    Abc_Print( -2, "\t         performs sequential cleanup of the current network\n" );
-    Abc_Print( -2, "\t         by removing nodes and latches that do not feed into POs\n" );
-    Abc_Print( -2, "\t-F num : the number of frames to abstract [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-P num : the number of prefix frames to skip [default = %d]\n", nPref );
-    Abc_Print( -2, "\t-i     : toggle ignoring the initial state [default = %s]\n", fIgnore? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle printing statistics about generators [default = %s]\n", fPrint? "yes": "no" );
-    Abc_Print( -2, "\t-c     : update the current CEX derived for a new AIG after \"phase\"\n" );
-    Abc_Print( -2, "\t         to match the current AIG (the one before \"phase\") [default = %s]\n", fUpdateCex? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSynch( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtkRes, * pNtk1, * pNtk2, * pNtk;
-    char ** pArgvNew;
-    int nArgcNew;
-    int fDelete1, fDelete2;
-    int c;
-    int nWords;
-    int fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkDarSynch( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nWords, int fVerbose );
-    extern Abc_Ntk_t * Abc_NtkDarSynchOne( Abc_Ntk_t * pNtk, int nWords, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nWords   =  32;
-    fVerbose =   1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Wvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nWords <= 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew == 0 )
-    {
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Empty network.\n" );
-            return 1;
-        }
-        pNtkRes = Abc_NtkDarSynchOne( pNtk, nWords, fVerbose );
-    }
-    else
-    {
-        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-            return 1;
-        if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
-        {
-            if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-            if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-            Abc_Print( -1, "The network has no latches..\n" );
-            return 0;
-        }
-
-        // modify the current network
-        pNtkRes = Abc_NtkDarSynch( pNtk1, pNtk2, nWords, fVerbose );
-        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-    }
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Synchronization has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: synch [-W <num>] [-vh] <file1> <file2>\n" );
-    Abc_Print( -2, "\t         derives and applies synchronization sequence\n" );
-    Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", nWords );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tfile1  : (optional) the file with the first design\n");
-    Abc_Print( -2, "\tfile2  : (optional) the file with the second design\n\n");
-    Abc_Print( -2, "\t         If no designs are given on the command line,\n" );
-    Abc_Print( -2, "\t         assumes the current network has no initial state,\n" );
-    Abc_Print( -2, "\t         derives synchronization sequence and applies it.\n\n" );
-    Abc_Print( -2, "\t         If two designs are given on the command line\n" );
-    Abc_Print( -2, "\t         assumes both of them have no initial state,\n" );
-    Abc_Print( -2, "\t         derives sequences for both designs, synchorinizes\n" );
-    Abc_Print( -2, "\t         them, and creates SEC miter comparing two designs.\n\n" );
-    Abc_Print( -2, "\t         If only one design is given on the command line,\n" );
-    Abc_Print( -2, "\t         considers the second design to be the current network,\n" );
-    Abc_Print( -2, "\t         and derives SEC miter for them, as described above.\n" );
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cgt_Par_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtkRes, * pNtk, * pNtkCare;
-    int c;
-
-    extern Abc_Ntk_t * Abc_NtkDarClockGate( Abc_Ntk_t * pNtk, Abc_Ntk_t * pCare, Cgt_Par_t * pPars );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Cgt_SetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "LNDCVKavwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nLevelMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLevelMax <= 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nCandMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCandMax <= 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nOdcMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nOdcMax <= 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nConfMax <= 0 )
-                goto usage;
-            break;
-        case 'V':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nVarsMin = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nVarsMin <= 0 )
-                goto usage;
-            break;
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFlopsMin = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFlopsMin <= 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fAreaOnly ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( argc == globalUtilOptind + 1 )
-    {
-        pNtkCare = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
-        if ( pNtkCare == NULL )
-        {
-            Abc_Print( -1, "Reading care network has failed.\n" );
-            return 1;
-        }
-        // modify the current network
-        pNtkRes = Abc_NtkDarClockGate( pNtk, pNtkCare, pPars );
-        Abc_NtkDelete( pNtkCare );
-    }
-    else if ( argc == globalUtilOptind )
-    {
-        pNtkRes = Abc_NtkDarClockGate( pNtk, NULL, pPars );
-    }
-    else
-    {
-        Abc_Print( -1, "Wrong number of arguments.\n" );
-        return 0;
-    }
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Clock gating has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: clockgate [-LNDCVK <num>] [-avwh] <file>\n" );
-    Abc_Print( -2, "\t         sequential clock gating with observability don't-cares\n" );
-    Abc_Print( -2, "\t-L num : max level number of a clock gate [default = %d]\n", pPars->nLevelMax );
-    Abc_Print( -2, "\t-N num : max number of candidates for a flop [default = %d]\n", pPars->nCandMax );
-    Abc_Print( -2, "\t-D num : max number of ODC levels to consider [default = %d]\n", pPars->nOdcMax );
-    Abc_Print( -2, "\t-C num : max number of conflicts at a node [default = %d]\n", pPars->nConfMax );
-    Abc_Print( -2, "\t-V num : min number of vars to recycle SAT solver [default = %d]\n", pPars->nVarsMin );
-    Abc_Print( -2, "\t-K num : min number of flops to recycle SAT solver [default = %d]\n", pPars->nFlopsMin );
-    Abc_Print( -2, "\t-a     : toggle minimizing area-only [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle even more detailed output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tfile   : (optional) constraints for primary inputs and register outputs\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandExtWin( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtkRes, * pNtk;
-    int c;
-    int nObjId;
-    int nDist;
-    int fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkDarExtWin( Abc_Ntk_t * pNtk, int nObjId, int nDist, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nObjId   = -1;
-    nDist    =  5;
-    fVerbose =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NDvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nObjId = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nObjId <= 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nDist = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nDist <= 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for structrally hashed networks.\n" );
-        return 1;
-    }
-
-    if ( argc != globalUtilOptind )
-    {
-        Abc_Print( -1, "Not enough command-line arguments.\n" );
-        return 1;
-    }
-    // modify the current network
-    pNtkRes = Abc_NtkDarExtWin( pNtk, nObjId, nDist, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Extracting sequential window has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: extwin [-ND <num>] [-vh]\n" );
-    Abc_Print( -2, "\t         extracts sequential window from the AIG\n" );
-    Abc_Print( -2, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
-    Abc_Print( -2, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtkRes, * pNtk, * pNtkCare;
-    int c;
-    int nObjId;
-    int nDist;
-    int fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkDarInsWin( Abc_Ntk_t * pNtk, Abc_Ntk_t * pWnd, int nObjId, int nDist, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nObjId   = -1;
-    nDist    =  5;
-    fVerbose =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NDvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nObjId = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nObjId <= 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nDist = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nDist <= 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Only works for structrally hashed networks.\n" );
-        return 1;
-    }
-
-    if ( argc != globalUtilOptind + 1 )
-    {
-        Abc_Print( -1, "Not enough command-line arguments.\n" );
-        return 1;
-    }
-    pNtkCare = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
-    if ( pNtkCare == NULL )
-    {
-        Abc_Print( -1, "Reading care network has failed.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtkCare) )
-    {
-        Abc_Ntk_t * pNtkTemp;
-        pNtkCare = Abc_NtkStrash( pNtkTemp = pNtkCare, 0, 1, 0 );
-        Abc_NtkDelete( pNtkTemp );
-    }
-    // modify the current network
-    pNtkRes = Abc_NtkDarInsWin( pNtk, pNtkCare, nObjId, nDist, fVerbose );
-    Abc_NtkDelete( pNtkCare );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Inserting sequential window has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: inswin [-ND <num>] [-vh] <file>\n" );
-    Abc_Print( -2, "\t         inserts sequential window into the AIG\n" );
-    Abc_Print( -2, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
-    Abc_Print( -2, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tfile   : file with the AIG to be inserted\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPermute( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkRestrashRandom( Abc_Ntk_t * pNtk );
-    Abc_Ntk_t * pNtk = pAbc->pNtkCur, * pNtkRes = NULL;
-    char * pFlopPermFile = NULL;
-    int fInputs = 1;
-    int fOutputs = 1;
-    int fFlops = 1;
-    int fNodes = 1;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fiofnh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pFlopPermFile = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'i':
-            fInputs ^= 1;
-            break;
-        case 'o':
-            fOutputs ^= 1;
-            break;
-        case 'f':
-            fFlops ^= 1;
-            break;
-        case 'n':
-            fNodes ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( fNodes && !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "To permute nodes, the network should be structurally hashed.\n" );
-        return 1;
-    }
-    if ( fNodes )
-        pNtkRes = Abc_NtkRestrashRandom( pNtk );
-    else
-        pNtkRes = Abc_NtkDup( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command \"permute\" has failed.\n" );
-        return 1;
-    }
-    Abc_NtkPermute( pNtkRes, fInputs, fOutputs, fFlops, pFlopPermFile );
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: permute [-iofnh] [-F filename]\n" );
-    Abc_Print( -2, "\t                performs random permutation of inputs/outputs/flops\n" );
-    Abc_Print( -2, "\t-i            : toggle permuting primary inputs [default = %s]\n", fInputs? "yes": "no" );
-    Abc_Print( -2, "\t-o            : toggle permuting primary outputs [default = %s]\n", fOutputs? "yes": "no" );
-    Abc_Print( -2, "\t-f            : toggle permuting flip-flops [default = %s]\n", fFlops? "yes": "no" );
-    Abc_Print( -2, "\t-n            : toggle deriving new topological ordering of nodes [default = %s]\n", fNodes? "yes": "no" );
-    Abc_Print( -2, "\t-h            : print the command usage\n");
-    Abc_Print( -2, "\t-F <filename> : (optional) file with the flop permutation\n" );
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandUnpermute( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = pAbc->pNtkCur, * pNtkRes = NULL;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    pNtkRes = Abc_NtkDup( pNtk );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Command \"unpermute\" has failed.\n" );
-        return 1;
-    }
-    Abc_NtkUnpermute( pNtkRes );
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: unpermute [-h]\n" );
-    Abc_Print( -2, "\t        restores inputs/outputs/flops before the last permutation\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCubeEnum( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Abc_EnumerateCubeStates();
-    extern void Abc_EnumerateCubeStatesZdd();
-    int c, fZddAlgo = 0, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "zvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'z':
-            fZddAlgo ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-    if ( fZddAlgo )
-        Abc_EnumerateCubeStatesZdd();
-    else
-        Abc_EnumerateCubeStates();
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cubeenum [-vh]\n" );
-    Abc_Print( -2, "\t         enumerates reachable states of 2x2x2 cube\n" );
-    Abc_Print( -2, "\t         (http://en.wikipedia.org/wiki/Pocket_Cube)\n" );
-    Abc_Print( -2, "\t-z     : toggle using ZDD-based algorithm [default = %s]\n", fZddAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[16];
-    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
-    int fDelete1, fDelete2;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c;
-    int fSat;
-    int fVerbose;
-    int nSeconds;
-    int nPartSize;
-    int nConfLimit;
-    int nInsLimit;
-    int fPartition;
-    int fIgnoreNames;
-
-    extern void Abc_NtkCecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nInsLimit );
-    extern void Abc_NtkCecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose );
-    extern void Abc_NtkCecFraigPart( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nPartSize, int fVerbose );
-    extern void Abc_NtkCecFraigPartAuto( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fSat     =  0;
-    fVerbose =  0;
-    nSeconds = 20;
-    nPartSize  = 0;
-    nConfLimit = 10000;
-    nInsLimit  = 0;
-    fPartition = 0;
-    fIgnoreNames = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "TCIPpsnvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nSeconds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nSeconds < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLimit < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nInsLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nInsLimit < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nPartSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nPartSize < 0 )
-                goto usage;
-            break;
-        case 'p':
-            fPartition ^= 1;
-            break;
-        case 's':
-            fSat ^= 1;
-            break;
-        case 'n':
-            fIgnoreNames ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk && pNtk->vPhases != NULL )
-    {
-        Abc_Print( -1, "Cannot compare networks with phases defined.\n" );
-        return 1;
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-        return 1;
-
-    if ( fIgnoreNames )
-    {
-        if ( !fDelete1 )
-        {
-            pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
-            fDelete1 = 1;
-        }
-        if ( !fDelete2 )
-        {
-            pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
-            fDelete2 = 1;
-        }
-        Abc_NtkShortNames( pNtk1 );
-        Abc_NtkShortNames( pNtk2 );
-    }
-
-    // perform equivalence checking
-    if ( fPartition )
-        Abc_NtkCecFraigPartAuto( pNtk1, pNtk2, nSeconds, fVerbose );
-    else if ( nPartSize )
-        Abc_NtkCecFraigPart( pNtk1, pNtk2, nSeconds, nPartSize, fVerbose );
-    else if ( fSat )
-        Abc_NtkCecSat( pNtk1, pNtk2, nConfLimit, nInsLimit );
-    else
-        Abc_NtkCecFraig( pNtk1, pNtk2, nSeconds, fVerbose );
-
-    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-    return 0;
-
-usage:
-    if ( nPartSize == 0 )
-        strcpy( Buffer, "unused" );
-    else
-        sprintf(Buffer, "%d", nPartSize );
-    Abc_Print( -2, "usage: cec [-T num] [-C num] [-I num] [-P num] [-psnvh] <file1> <file2>\n" );
-    Abc_Print( -2, "\t         performs combinational equivalence checking\n" );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
-    Abc_Print( -2, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
-    Abc_Print( -2, "\t-P num : partition size for multi-output networks [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-p     : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle \"SAT only\" and \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
-    Abc_Print( -2, "\t-n     : toggle ignoring names when matching CIs/COs [default = %s]\n", fIgnoreNames? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
-    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
-    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
-    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
-    int fDelete1, fDelete2;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c;
-    int fSat;
-    int fVerbose;
-    int nSeconds;
-    int nConfLimit;
-    int nInsLimit;
-    int fPartition;
-    int fMiter;
-
-    extern int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose );
-    extern int Abc_NtkDarCec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int fPartition, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fSat     =  0;
-    fVerbose =  0;
-    nSeconds = 20;
-    nConfLimit = 10000;
-    nInsLimit  = 0;
-    fPartition = 0;
-    fMiter     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "TCIpmsvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nSeconds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nSeconds < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLimit < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nInsLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nInsLimit < 0 )
-                goto usage;
-            break;
-        case 'p':
-            fPartition ^= 1;
-            break;
-        case 'm':
-            fMiter ^= 1;
-            break;
-        case 's':
-            fSat ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( fMiter )
-    {
-        if ( pNtk == NULL )
-        {
-            Abc_Print( -1, "Empty network.\n" );
-            return 1;
-        }
-        if ( Abc_NtkIsStrash(pNtk) )
-        {
-            pNtk1 = pNtk;
-            fDelete1 = 0;
-        }
-        else
-        {
-            pNtk1 = Abc_NtkStrash( pNtk, 0, 1, 0 );
-            fDelete1 = 1;
-        }
-        pNtk2 = NULL;
-        fDelete2 = 0;
-    }
-    else
-    {
-        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-            return 1;
-    }
-
-    if ( (pNtk1 && Abc_NtkLatchNum(pNtk1)) || (pNtk2 && Abc_NtkLatchNum(pNtk2)) )
-    {
-        if ( pNtk1 && fDelete1 ) Abc_NtkDelete( pNtk1 );
-        if ( pNtk2 && fDelete2 ) Abc_NtkDelete( pNtk2 );
-        Abc_Print( -1, "Currently this command only works for networks without latches. Run \"comb\".\n" );
-        return 1;
-    }
-
-    // perform equivalence checking
-    if ( fSat && fMiter )
-        Abc_NtkDSat( pNtk1, nConfLimit, nInsLimit, 0, 0, 0, 0, 0, 0, fVerbose );
-    else
-        Abc_NtkDarCec( pNtk1, pNtk2, nConfLimit, fPartition, fVerbose );
-
-    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dcec [-T num] [-C num] [-I num] [-mpsvh] <file1> <file2>\n" );
-    Abc_Print( -2, "\t         performs combinational equivalence checking\n" );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
-    Abc_Print( -2, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
-    Abc_Print( -2, "\t-m     : toggle working on two networks or a miter [default = %s]\n", fMiter? "miter": "two networks" );
-    Abc_Print( -2, "\t-p     : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle \"SAT only\" (miter) or \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
-    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
-    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
-    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Fra_Sec_t SecPar, * pSecPar = &SecPar;
-    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
-    int fDelete1, fDelete2;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c;
-    int fIgnoreNames;
-
-    extern void Fra_SecSetDefaultParams( Fra_Sec_t * p );
-    extern int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Fra_Sec_t * p );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Fra_SecSetDefaultParams( pSecPar );
-    pSecPar->TimeLimit = 0;
-    fIgnoreNames = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FTarmfnwvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nFramesMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pSecPar->fPhaseAbstract ^= 1;
-            break;
-        case 'r':
-            pSecPar->fRetimeFirst ^= 1;
-            break;
-        case 'm':
-            pSecPar->fRetimeRegs ^= 1;
-            break;
-        case 'f':
-            pSecPar->fFraiging ^= 1;
-            break;
-        case 'n':
-            fIgnoreNames ^= 1;
-            break;
-        case 'w':
-            pSecPar->fVeryVerbose ^= 1;
-            break;
-        case 'v':
-            pSecPar->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-        return 1;
-    if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
-    {
-        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-        Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
-        return 0;
-    }
-
-    if ( fIgnoreNames )
-    {
-        if ( !fDelete1 )
-        {
-            pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
-            fDelete1 = 1;
-        }
-        if ( !fDelete2 )
-        {
-            pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
-            fDelete2 = 1;
-        }
-        Abc_NtkShortNames( pNtk1 );
-        Abc_NtkShortNames( pNtk2 );
-    }
-
-    // perform verification
-    Abc_NtkDarSec( pNtk1, pNtk2, pSecPar );
-
-    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsec [-F num] [-T num] [-armfnwvh] <file1> <file2>\n" );
-    Abc_Print( -2, "\t         performs inductive sequential equivalence checking\n" );
-    Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
-    Abc_Print( -2, "\t-T num : the approximate runtime limit (in seconds) [default = %d]\n", pSecPar->TimeLimit );
-    Abc_Print( -2, "\t-a     : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
-    Abc_Print( -2, "\t-n     : toggle ignoring names when matching PIs/POs [default = %s]\n", fIgnoreNames? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
-    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
-    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
-    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Fra_Sec_t SecPar, * pSecPar = &SecPar;
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    char * pLogFileName = NULL;
-    int nBmcFramesMax = 20;
-    int nBmcConfMax = 2000;
-
-    extern void Fra_SecSetDefaultParams( Fra_Sec_t * p );
-    extern int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar, int nBmcFramesMax, int nBmcConfMax );
-    // set defaults
-    Fra_SecSetDefaultParams( pSecPar );
-//    pSecPar->TimeLimit = 300;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "cbAEFCGDVBRTLarmfijkoupwvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'c':
-            pSecPar->fTryComb ^= 1;
-            break;
-        case 'b':
-            pSecPar->fTryBmc ^= 1;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nBmcFramesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nBmcFramesMax < 0 )
-                goto usage;
-            break;
-        case 'E':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-E\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nBmcConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nBmcConfMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nFramesMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nBTLimitGlobal = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nBTLimitGlobal < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nBTLimitInter = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nBTLimitInter < 0 )
-                goto usage;
-            break;
-        case 'V':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nBddVarsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nBddVarsMax < 0 )
-                goto usage;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nBddMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nBddMax < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nBddIterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nBddIterMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pSecPar->nPdrTimeout = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pSecPar->nPdrTimeout < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'a':
-            pSecPar->fPhaseAbstract ^= 1;
-            break;
-        case 'r':
-            pSecPar->fRetimeFirst ^= 1;
-            break;
-        case 'm':
-            pSecPar->fRetimeRegs ^= 1;
-            break;
-        case 'f':
-            pSecPar->fFraiging ^= 1;
-            break;
-        case 'i':
-            pSecPar->fInduction ^= 1;
-            break;
-        case 'j':
-            pSecPar->fInterpolation ^= 1;
-            break;
-        case 'k':
-            pSecPar->fInterSeparate ^= 1;
-            break;
-        case 'o':
-            pSecPar->fReorderImage ^= 1;
-            break;
-        case 'u':
-            pSecPar->fReadUnsolved ^= 1;
-            break;
-        case 'p':
-            pSecPar->fUsePdr ^= 1;
-            break;
-        case 'w':
-            pSecPar->fVeryVerbose ^= 1;
-            break;
-        case 'v':
-            pSecPar->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
-        return 0;
-    }
-
-    // perform verification
-    pAbc->Status = Abc_NtkDarProve( pNtk, pSecPar, nBmcFramesMax, nBmcConfMax );
-    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "dprove" );
-
-    // read back the resulting unsolved reduced sequential miter
-    if ( pSecPar->fReadUnsolved && pSecPar->nSMnumber >= 0 )
-    {
-        char FileName[100];
-        sprintf(FileName, "sm%02d.aig", pSecPar->nSMnumber );
-        pNtk = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
-        if ( pNtk == NULL )
-            Abc_Print( -1, "Cannot read back unsolved reduced sequential miter \"%s\",\n", FileName );
-        else
-            Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dprove [-AEFCGDVBRT num] [-L file] [-cbarmfijoupvwh]\n" );
-    Abc_Print( -2, "\t         performs SEC on the sequential miter\n" );
-    Abc_Print( -2, "\t-A num : the limit on the depth of BMC [default = %d]\n", nBmcFramesMax );
-    Abc_Print( -2, "\t-E num : the conflict limit during BMC [default = %d]\n", nBmcConfMax );
-    Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
-    Abc_Print( -2, "\t-C num : the conflict limit at a node during induction [default = %d]\n", pSecPar->nBTLimit );
-    Abc_Print( -2, "\t-G num : the global conflict limit during induction [default = %d]\n", pSecPar->nBTLimitGlobal );
-    Abc_Print( -2, "\t-D num : the conflict limit during interpolation [default = %d]\n", pSecPar->nBTLimitInter );
-    Abc_Print( -2, "\t-V num : the flop count limit for BDD-based reachablity [default = %d]\n", pSecPar->nBddVarsMax );
-    Abc_Print( -2, "\t-B num : the BDD size limit in BDD-based reachablity [default = %d]\n", pSecPar->nBddMax );
-    Abc_Print( -2, "\t-R num : the max number of reachability iterations [default = %d]\n", pSecPar->nBddIterMax );
-    Abc_Print( -2, "\t-T num : the timeout for property directed reachability [default = %d]\n", pSecPar->nPdrTimeout );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-c     : toggles using CEC before attempting SEC [default = %s]\n", pSecPar->fTryComb? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggles using BMC before attempting SEC [default = %s]\n", pSecPar->fTryBmc? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
-    Abc_Print( -2, "\t-i     : toggles the use of induction [default = %s]\n", pSecPar->fInduction? "yes": "no" );
-    Abc_Print( -2, "\t-j     : toggles the use of interpolation [default = %s]\n", pSecPar->fInterpolation? "yes": "no" );
-    Abc_Print( -2, "\t-k     : toggles applying interpolation to each output [default = %s]\n", pSecPar->fInterSeparate? "yes": "no" );
-    Abc_Print( -2, "\t-o     : toggles using BDD variable reordering during image computation [default = %s]\n", pSecPar->fReorderImage? "yes": "no" );
-    Abc_Print( -2, "\t-u     : toggles reading back unsolved reduced sequential miter [default = %s]\n", pSecPar->fReadUnsolved? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggles trying property directed reachability in the end [default = %s]\n", pSecPar->fUsePdr? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\tCommand \"dprove\" can also be used for sequential synthesis (dprove -brjopu)\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
-    int fDelete1, fDelete2;
-    char ** pArgvNew;
-    int nArgcNew;
-    int fMiter, nFrames, fVerbose, c;
-
-    extern int Abc_NtkDarAbSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fMiter   = 1;
-    nFrames  = 2;
-    fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'm':
-            fMiter ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( fMiter )
-    {
-//        pNtk = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
-        if ( argc == globalUtilOptind + 1 )
-        {
-            Abc_Print( -1, "The miter cannot be given on the command line. Use \"read\".\n" );
-            return 0;
-        }
-        if ( !Abc_NtkIsStrash(pNtk) )
-        {
-            Abc_Print( -1, "The miter should be structurally hashed. Use \"st\"\n" );
-            return 0;
-        }
-        if ( Abc_NtkDarAbSec( pNtk, NULL, nFrames, fVerbose ) == 1 )
-            pAbc->Status = 1;
-        else
-            pAbc->Status = -1;
-    }
-    else
-    {
-        pArgvNew = argv + globalUtilOptind;
-        nArgcNew = argc - globalUtilOptind;
-        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-            return 1;
-        if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
-        {
-            if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-            if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-            Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
-            return 0;
-        }
-        // perform verification
-        if ( Abc_NtkDarAbSec( pNtk1, pNtk2, nFrames, fVerbose ) == 1 )
-            pAbc->Status = 1;
-        else
-            pAbc->Status = -1;
-        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: absec [-F num] [-mv] <file1> <file2>\n" );
-    Abc_Print( -2, "\t         performs SEC by applying CEC to several timeframes\n" );
-    Abc_Print( -2, "\t-F num : the total number of timeframes to use [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-m     : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
-    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
-    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
-    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Ssw_Pars_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
-    int fDelete1, fDelete2;
-    char ** pArgvNew;
-    int nArgcNew, c;
-    int fMiter;
-
-    extern int Abc_NtkDarSimSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Ssw_Pars_t * pPars );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fMiter = 1;
-    Ssw_ManSetDefaultParams( pPars );
-    pPars->fPartSigCorr = 1;
-    pPars->fVerbose     = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FDcymvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesK = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesK < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nIsleDist = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIsleDist < 0 )
-                goto usage;
-            break;
-        case 'm':
-            fMiter ^= 1;
-            break;
-        case 'c':
-            pPars->fPartSigCorr ^= 1;
-            break;
-        case 'y':
-            pPars->fDumpSRInit ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( fMiter )
-    {
-//        Abc_Ntk_t * pNtkA, * pNtkB;
-        if ( !Abc_NtkIsStrash(pNtk) )
-        {
-            Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
-            return 0;
-        }
-        Abc_NtkDarSimSec( pNtk, NULL, pPars );
-/*
-        pNtkA = Abc_NtkDup( pNtk );
-        pNtkB = Abc_NtkDup( pNtk );
-        Abc_NtkDarSimSec( pNtkA, pNtkB, pPars );
-        Abc_NtkDelete( pNtkA );
-        Abc_NtkDelete( pNtkB );
-*/
-    }
-    else
-    {
-        pArgvNew = argv + globalUtilOptind;
-        nArgcNew = argc - globalUtilOptind;
-        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-            return 1;
-        if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
-        {
-            if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-            if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-            Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
-            return 0;
-        }
-        // perform verification
-        Abc_NtkDarSimSec( pNtk1, pNtk2, pPars );
-        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: simsec [-FD num] [-mcyv] <file1> <file2>\n" );
-    Abc_Print( -2, "\t         performs SEC using structural similarity\n" );
-    Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pPars->nFramesK );
-    Abc_Print( -2, "\t-D num : the distance for extending islands [default = %d]\n", pPars->nIsleDist );
-    Abc_Print( -2, "\t-m     : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
-    Abc_Print( -2, "\t-c     : uses partial vs. full signal correspondence [default = %s]\n", pPars->fPartSigCorr? "partial": "full" );
-    Abc_Print( -2, "\t-y     : dumps speculatively reduced miter of the classes [default = %s]\n", pPars->fDumpSRInit? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
-    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
-    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
-    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes;
-    int fDelete1, fDelete2;
-    char ** pArgvNew;
-    int nArgcNew, c;
-    int fMiter;
-    int nDist;
-    int fVerbose;
-
-    extern Abc_Ntk_t * Abc_NtkDarMatch( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nDist, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fMiter = 0;
-    nDist = 0;
-    fVerbose = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Dmvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nDist = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nDist < 0 )
-                goto usage;
-            break;
-        case 'm':
-            fMiter ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( fMiter )
-    {
-//        Abc_Ntk_t * pNtkA, * pNtkB;
-        if ( !Abc_NtkIsStrash(pNtk) )
-        {
-            Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
-            return 0;
-        }
-        pNtkRes = Abc_NtkDarMatch( pNtk, NULL, nDist, fVerbose );
-/*
-        pNtkA = Abc_NtkDup( pNtk );
-        pNtkB = Abc_NtkDup( pNtk );
-        Abc_NtkDarSimSec( pNtkA, pNtkB, pPars );
-        Abc_NtkDelete( pNtkA );
-        Abc_NtkDelete( pNtkB );
-*/
-    }
-    else
-    {
-        pArgvNew = argv + globalUtilOptind;
-        nArgcNew = argc - globalUtilOptind;
-        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-            return 1;
-        if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
-        {
-            if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-            if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-            Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
-            return 0;
-        }
-        // perform verification
-        pNtkRes = Abc_NtkDarMatch( pNtk1, pNtk2, nDist, fVerbose );
-        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-    }
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Matching has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: match [-D num] [-mv] <file1> <file2>\n" );
-    Abc_Print( -2, "\t         detects structural similarity using simulation\n" );
-    Abc_Print( -2, "\t         replaces the current network by the miter of differences\n" );
-    Abc_Print( -2, "\t-D num : the distance for extending differences [default = %d]\n", nDist );
-    Abc_Print( -2, "\t-m     : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
-    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
-    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
-    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
-    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSat( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int RetValue;
-    int fVerbose;
-    int nConfLimit;
-    int nInsLimit;
-    abctime clk;
-    // set defaults
-    fVerbose   = 0;
-    nConfLimit = 0;
-    nInsLimit  = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CIvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLimit < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nInsLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nInsLimit < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkLatchNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
-        return 0;
-    }
-
-    clk = Abc_Clock();
-    if ( Abc_NtkIsStrash(pNtk) )
-    {
-        RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, fVerbose, NULL, NULL );
-    }
-    else
-    {
-        assert( Abc_NtkIsLogic(pNtk) );
-        Abc_NtkToBdd( pNtk );
-        RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, fVerbose, NULL, NULL );
-    }
-
-    // verify that the pattern is correct
-    if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
-    {
-        //int i;
-        //Abc_Obj_t * pObj;
-        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
-        if ( pSimInfo[0] != 1 )
-            Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
-        ABC_FREE( pSimInfo );
-        /*
-        // print model
-        Abc_NtkForEachPi( pNtk, pObj, i )
-        {
-            Abc_Print( -1, "%d", (int)(pNtk->pModel[i] > 0) );
-            if ( i == 70 )
-                break;
-        }
-        Abc_Print( -1, "\n" );
-        */
-    }
-    pAbc->Status = RetValue;
-    if ( RetValue == -1 )
-        Abc_Print( 1, "UNDECIDED      " );
-    else if ( RetValue == 0 )
-        Abc_Print( 1, "SATISFIABLE    " );
-    else
-        Abc_Print( 1, "UNSATISFIABLE  " );
-    //Abc_Print( -1, "\n" );
-    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: sat [-C num] [-I num] [-vh]\n" );
-    Abc_Print( -2, "\t         solves the combinational miter using SAT solver MiniSat-1.14\n" );
-    Abc_Print( -2, "\t         derives CNF from the current network and leave it unchanged\n" );
-    Abc_Print( -2, "\t         (there is also a newer SAT solving command \"dsat\")\n" );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
-    Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int RetValue;
-    int fAlignPol;
-    int fAndOuts;
-    int fNewSolver;
-    int fVerbose;
-    int nConfLimit;
-    int nLearnedStart;
-    int nLearnedDelta;
-    int nLearnedPerce;
-    int nInsLimit;
-    abctime clk;
-
-    extern int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose );
-    // set defaults
-    fAlignPol  = 0;
-    fAndOuts   = 0;
-    fNewSolver = 0;
-    fVerbose   = 0;
-    nConfLimit = 0;
-    nInsLimit  = 0;
-    nLearnedStart = 0;
-    nLearnedDelta = 0;
-    nLearnedPerce = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CILDEpanvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLimit < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nInsLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nInsLimit < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLearnedStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLearnedStart < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLearnedDelta = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLearnedDelta < 0 )
-                goto usage;
-            break;
-        case 'E':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-E\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLearnedPerce = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLearnedPerce < 0 )
-                goto usage;
-            break;
-        case 'p':
-            fAlignPol ^= 1;
-            break;
-        case 'a':
-            fAndOuts ^= 1;
-            break;
-        case 'n':
-            fNewSolver ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( argc == globalUtilOptind + 1 )
-    {
-        extern int Cnf_DataSolveFromFile( char * pFileName, int nConfLimit, int fVerbose );
-        // get the input file name
-        char * pFileName = argv[globalUtilOptind];
-        FILE * pFile = fopen( pFileName, "rb" );
-        if ( pFile == NULL )
-        {
-            printf( "Cannot open file \"%s\" for writing.\n", pFileName );
-            return 0;
-        }
-        fclose( pFile );
-        Cnf_DataSolveFromFile( pFileName, nConfLimit, fVerbose );
-        return 0;
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkLatchNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
-        return 0;
-    }
-
-    if ( Abc_NtkPoNum(pNtk) != 1 )
-    {
-        Abc_Print( -1, "Currently expects a single-output miter.\n" );
-        return 0;
-    }
-
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    clk = Abc_Clock();
-    RetValue = Abc_NtkDSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, nLearnedStart, nLearnedDelta, nLearnedPerce, fAlignPol, fAndOuts, fNewSolver, fVerbose );
-    // verify that the pattern is correct
-    if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
-    {
-        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
-        if ( pSimInfo[0] != 1 )
-            Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
-        ABC_FREE( pSimInfo );
-        pAbc->pCex = Abc_CexCreate( 0, Abc_NtkPiNum(pNtk), pNtk->pModel, 0, 0, 0 );
-    }
-    pAbc->Status = RetValue;
-    if ( RetValue == -1 )
-        Abc_Print( 1, "UNDECIDED      " );
-    else if ( RetValue == 0 )
-        Abc_Print( 1, "SATISFIABLE    " );
-    else
-        Abc_Print( 1, "UNSATISFIABLE  " );
-    //Abc_Print( -1, "\n" );
-    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dsat [-CILDE num] [-panvh]\n" );
-    Abc_Print( -2, "\t         solves the combinational miter using SAT solver MiniSat-1.14\n" );
-    Abc_Print( -2, "\t         derives CNF from the current network and leave it unchanged\n" );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
-    Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
-    Abc_Print( -2, "\t-L num : starting value for learned clause removal [default = %d]\n", nLearnedStart );
-    Abc_Print( -2, "\t-D num : delta value for learned clause removal [default = %d]\n", nLearnedDelta );
-    Abc_Print( -2, "\t-E num : ratio percentage for learned clause removal [default = %d]\n", nLearnedPerce );
-    Abc_Print( -2, "\t-p     : alighn polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggle ANDing/ORing of miter outputs [default = %s]\n", fAndOuts? "ANDing": "ORing" );
-    Abc_Print( -2, "\t-n     : toggle using new solver [default = %s]\n", fNewSolver? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int RetValue;
-    int c;
-    int nAlgo;
-    int nPartSize;
-    int nConfPart;
-    int nConfTotal;
-    int fAlignPol;
-    int fSynthesize;
-    int fVerbose;
-    abctime clk;
-
-    extern int Abc_NtkPartitionedSat( Abc_Ntk_t * pNtk, int nAlgo, int nPartSize, int nConfPart, int nConfTotal, int fAlignPol, int fSynthesize, int fVerbose );
-    // set defaults
-    nAlgo       =        0;
-    nPartSize   =    10000;
-    nConfPart   =        0;
-    nConfTotal  =  1000000;
-    fAlignPol   =        1;
-    fSynthesize =        0;
-    fVerbose    =        1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "APCpsvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nAlgo = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nAlgo < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nPartSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nPartSize < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfTotal = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfTotal < 0 )
-                goto usage;
-            break;
-        case 'p':
-            fAlignPol ^= 1;
-            break;
-        case 's':
-            fSynthesize ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkLatchNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-
-    clk = Abc_Clock();
-    RetValue = Abc_NtkPartitionedSat( pNtk, nAlgo, nPartSize, nConfPart, nConfTotal, fAlignPol, fSynthesize, fVerbose );
-    // verify that the pattern is correct
-    if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
-    {
-        //int i;
-        //Abc_Obj_t * pObj;
-        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
-        if ( pSimInfo[0] != 1 )
-            Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
-        ABC_FREE( pSimInfo );
-        /*
-        // print model
-        Abc_NtkForEachPi( pNtk, pObj, i )
-        {
-            Abc_Print( -1, "%d", (int)(pNtk->pModel[i] > 0) );
-            if ( i == 70 )
-                break;
-        }
-        Abc_Print( -1, "\n" );
-        */
-    }
-
-    if ( RetValue == -1 )
-        Abc_Print( 1, "UNDECIDED      " );
-    else if ( RetValue == 0 )
-        Abc_Print( 1, "SATISFIABLE    " );
-    else
-        Abc_Print( 1, "UNSATISFIABLE  " );
-    //Abc_Print( -1, "\n" );
-    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: psat [-APC num] [-psvh]\n" );
-    Abc_Print( -2, "\t         solves the combinational miter using partitioning\n" );
-    Abc_Print( -2, "\t         (derives CNF from the current network and leave it unchanged)\n" );
-    Abc_Print( -2, "\t         for multi-output miters, tries to prove that the AND of POs is always 0\n" );
-    Abc_Print( -2, "\t         (if POs should be ORed instead of ANDed, use command \"orpos\")\n" );
-    Abc_Print( -2, "\t-A num : partitioning algorithm [default = %d]\n", nAlgo );
-    Abc_Print( -2, "\t         0 : no partitioning\n" );
-    Abc_Print( -2, "\t         1 : partitioning by level\n" );
-    Abc_Print( -2, "\t         2 : DFS post-order\n" );
-    Abc_Print( -2, "\t         3 : DFS pre-order\n" );
-    Abc_Print( -2, "\t         4 : bit-slicing\n" );
-    Abc_Print( -2, "\t         partitions are ordered by level (high level first)\n" );
-    Abc_Print( -2, "\t-P num : limit on the partition size [default = %d]\n", nPartSize );
-    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfTotal );
-    Abc_Print( -2, "\t-p     : align polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
-    Abc_Print( -2, "\t-s     : apply logic synthesis to each partition [default = %s]\n", fSynthesize? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkTemp;
-    Prove_Params_t Params, * pParams = &Params;
-    int c, RetValue;
-    abctime clk;
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    Prove_ParamsSetDefault( pParams );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NCFGLIrfbvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nItersMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nItersMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nMiteringLimitStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nMiteringLimitStart < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nFraigingLimitStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nFraigingLimitStart < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nFraigingLimitMulti = (float)atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nFraigingLimitMulti < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nMiteringLimitLast = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nMiteringLimitLast < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pParams->nTotalInspectLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pParams->nTotalInspectLimit < 0 )
-                goto usage;
-            break;
-        case 'r':
-            pParams->fUseRewriting ^= 1;
-            break;
-        case 'f':
-            pParams->fUseFraiging ^= 1;
-            break;
-        case 'b':
-            pParams->fUseBdds ^= 1;
-            break;
-        case 'v':
-            pParams->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkLatchNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkCoNum(pNtk) != 1 )
-    {
-        Abc_Print( -1, "Currently can only solve the miter with one output.\n" );
-        return 0;
-    }
-    clk = Abc_Clock();
-
-    if ( Abc_NtkIsStrash(pNtk) )
-        pNtkTemp = Abc_NtkDup( pNtk );
-    else
-        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
-
-    RetValue = Abc_NtkMiterProve( &pNtkTemp, pParams );
-
-    // verify that the pattern is correct
-    if ( RetValue == 0 )
-    {
-        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtkTemp->pModel );
-        if ( pSimInfo[0] != 1 )
-            Abc_Print( 1, "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
-        ABC_FREE( pSimInfo );
-    }
-    pAbc->Status = RetValue;
-    if ( RetValue == -1 )
-        Abc_Print( 1, "UNDECIDED      " );
-    else if ( RetValue == 0 )
-        Abc_Print( 1, "SATISFIABLE    " );
-    else
-        Abc_Print( 1, "UNSATISFIABLE  " );
-    //Abc_Print( -1, "\n" );
-
-    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: prove [-NCFGLI num] [-rfbvh]\n" );
-    Abc_Print( -2, "\t         solves combinational miter by rewriting, FRAIGing, and SAT\n" );
-    Abc_Print( -2, "\t         replaces the current network by the cone modified by rewriting\n" );
-    Abc_Print( -2, "\t         (there is also newer CEC command \"iprove\")\n" );
-    Abc_Print( -2, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
-    Abc_Print( -2, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
-    Abc_Print( -2, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
-    Abc_Print( -2, "\t-G num : multiplicative coefficient for fraiging [default = %d]\n", (int)pParams->nFraigingLimitMulti );
-    Abc_Print( -2, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
-    Abc_Print( -2, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
-    Abc_Print( -2, "\t-r     : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDebug( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    extern void Abc_NtkAutoDebug( Abc_Ntk_t * pNtk, int (*pFuncError) (Abc_Ntk_t *) );
-    extern int Abc_NtkRetimeDebug( Abc_Ntk_t * pNtk );
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsLogic(pNtk) )
-    {
-        Abc_Print( -1, "This command is applicable to logic networks.\n" );
-        return 1;
-    }
-
-    Abc_NtkAutoDebug( pNtk, Abc_NtkRetimeDebug );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: debug [-h]\n" );
-    Abc_Print( -2, "\t        performs automated debugging of the given procedure\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nFrames;
-    int nSizeMax;
-    int nBTLimit;
-    int nBTLimitAll;
-    int nNodeDelta;
-    int fRewrite;
-    int fNewAlgo;
-    int nCofFanLit;
-    int fVerbose;
-    int iFrames;
-    char * pLogFileName = NULL;
-
-    extern int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int fOrDecomp, int nCofFanLit, int fVerbose, int * piFrames );
-    // set defaults
-    nFrames     =       20;
-    nSizeMax    =   100000;
-    nBTLimit    =        0;
-    nBTLimitAll =        0;
-    nNodeDelta  =     1000;
-    fRewrite    =        0;
-    fNewAlgo    =        1;
-    nCofFanLit  =        0;
-    fVerbose    =        0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FNCGDLrvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nSizeMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nBTLimitAll = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nBTLimitAll < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nNodeDelta = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nNodeDelta < 0 )
-                goto usage;
-            break;
-/*
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCofFanLit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCofFanLit < 0 )
-                goto usage;
-            break;
-*/
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'r':
-            fRewrite ^= 1;
-            break;
-        case 'a':
-            fNewAlgo ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "Does not work for combinational networks.\n" );
-        return 0;
-    }
-    pAbc->Status = Abc_NtkDarBmc( pNtk, 0, nFrames, nSizeMax, nNodeDelta, 0, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, 0, nCofFanLit, fVerbose, &iFrames );
-    pAbc->nFrames = iFrames;
-    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc" );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: bmc [-FNC num] [-L file] [-rcvh]\n" );
-    Abc_Print( -2, "\t         performs bounded model checking with static unrolling\n" );
-    Abc_Print( -2, "\t-F num : the number of time frames [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-N num : the max number of nodes in the frames [default = %d]\n", nSizeMax );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
-//    Abc_Print( -2, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-r     : toggle the use of rewriting [default = %s]\n", fRewrite? "yes": "no" );
-//    Abc_Print( -2, "\t-a     : toggle SAT sweeping and SAT solving [default = %s]\n", fNewAlgo? "SAT solving": "SAT sweeping" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    int nStart;
-    int nFrames;
-    int nSizeMax;
-    int nBTLimit;
-    int nBTLimitAll;
-    int nNodeDelta;
-    int nTimeOut;
-    int fRewrite;
-    int fNewAlgo;
-    int fOrDecomp;
-    int fVerbose;
-    int iFrames;
-    char * pLogFileName = NULL;
-
-    extern int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int fOrDecomp, int nCofFanLit, int fVerbose, int * piFrames );
-
-    // set defaults
-    nStart      =        0;
-    nFrames     =        0;
-    nSizeMax    =   200000;
-    nBTLimit    =        0;
-    nBTLimitAll =        0;
-    nNodeDelta  =     2000;
-    nTimeOut    =        0;
-    fRewrite    =        0;
-    fNewAlgo    =        0;
-    fOrDecomp   =        0;
-    fVerbose    =        0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "SFNTCGDLruvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nStart < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nSizeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nSizeMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nTimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nTimeOut < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nBTLimitAll = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nBTLimitAll < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nNodeDelta = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nNodeDelta < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'r':
-            fRewrite ^= 1;
-            break;
-        case 'a':
-            fNewAlgo ^= 1;
-            break;
-        case 'u':
-            fOrDecomp ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "Does not work for combinational networks.\n" );
-        return 0;
-    }
-    pAbc->Status = Abc_NtkDarBmc( pNtk, nStart, nFrames, nSizeMax, nNodeDelta, nTimeOut, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, fOrDecomp, 0, fVerbose, &iFrames );
-    pAbc->nFrames = iFrames;
-    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc2" );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: bmc2 [-SFTCGD num] [-L file] [-uvh]\n" );
-    Abc_Print( -2, "\t         performs bounded model checking with dynamic unrolling\n" );
-    Abc_Print( -2, "\t-S num : the starting time frame [default = %d]\n", nStart );
-    Abc_Print( -2, "\t-F num : the max number of time frames (0 = unused) [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nTimeOut );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
-    Abc_Print( -2, "\t-G num : the max number of conflicts globally [default = %d]\n", nBTLimitAll );
-    Abc_Print( -2, "\t-D num : the delta in the number of nodes [default = %d]\n", nNodeDelta );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-u     : toggle performing structural OR-decomposition [default = %s]\n", fOrDecomp? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBmc3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp );
-    Saig_ParBmc_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
-    Vec_Ptr_t * vSeqModelVec = NULL;
-    Vec_Int_t * vStatuses = NULL;
-    char * pLogFileName = NULL;
-    int fOrDecomp = 0;
-    int c;
-    Saig_ParBmcSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "SFTHGCDJIPQRLWaxdruvzh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nStart < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nTimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nTimeOut < 0 )
-                goto usage;
-            break;
-        case 'H':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nTimeOutOne = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nTimeOutOne < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nTimeOutGap = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nTimeOutGap < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nConfLimit < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nConfLimitJump = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nConfLimitJump < 0 )
-                goto usage;
-            break;
-        case 'J':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-J\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesJump = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesJump < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nPisAbstract = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nPisAbstract < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nLearnedStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLearnedStart < 0 )
-                goto usage;
-            break;
-        case 'Q':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nLearnedDelta = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLearnedDelta < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nLearnedPerce = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLearnedPerce < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pPars->pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'a':
-            pPars->fSolveAll ^= 1;
-            break;
-        case 'x':
-            pPars->fStoreCex ^= 1;
-            break;
-        case 'd':
-            pPars->fDropSatOuts ^= 1;
-            break;
-        case 'u':
-            fOrDecomp ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'z':
-            pPars->fNotVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "Does not work for combinational networks.\n" );
-        return 0;
-    }
-    if ( Abc_NtkConstrNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Constraints have to be folded (use \"fold\").\n" );
-        return 0;
-    }
-    pPars->fUseBridge = pAbc->fBridgeMode;
-    pAbc->Status = Abc_NtkDarBmc3( pNtk, pPars, fOrDecomp );
-    pAbc->nFrames = pNtk->vSeqModelVec ? -1 : pPars->iFrame;
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc3" );
-    vSeqModelVec = pNtk->vSeqModelVec;  pNtk->vSeqModelVec = NULL;
-    if ( pPars->fSolveAll && pPars->fDropSatOuts )
-    {
-        if ( vSeqModelVec == NULL )
-            Abc_Print( 1,"The array of counter-examples is not available.\n" );
-        else if ( Vec_PtrSize(vSeqModelVec) != Abc_NtkPoNum(pNtk) )
-            Abc_Print( 1,"The array size does not match the number of outputs.\n" );
-        else
-        {
-            extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
-            Abc_NtkDropSatOutputs( pNtk, vSeqModelVec, pPars->fVerbose );
-            pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
-            if ( pNtkRes == NULL )
-            {
-                Abc_Print( -1, "Removing SAT outputs has failed.\n" );
-                return 1;
-            }
-            Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-        }
-    }
-    vStatuses = Abc_FrameDeriveStatusArray( vSeqModelVec );
-    Abc_FrameReplacePoStatuses( pAbc, &vStatuses );        
-    if ( vSeqModelVec )
-        Abc_FrameReplaceCexVec( pAbc, &vSeqModelVec );
-    else
-        Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: bmc3 [-SFTHGCDJIPQR num] [-LW file] [-axduvzh]\n" );
-    Abc_Print( -2, "\t         performs bounded model checking with dynamic unrolling\n" );
-    Abc_Print( -2, "\t-S num : the starting time frame [default = %d]\n", pPars->nStart );
-    Abc_Print( -2, "\t-F num : the max number of time frames (0 = unused) [default = %d]\n",      pPars->nFramesMax );
-    Abc_Print( -2, "\t-T num : runtime limit, in seconds [default = %d]\n",                       pPars->nTimeOut );
-    Abc_Print( -2, "\t-H num : runtime limit per output, in miliseconds (with \"-a\") [default = %d]\n",    pPars->nTimeOutOne );
-    Abc_Print( -2, "\t-G num : runtime gap since the last CEX, in seconds [default = %d]\n",      pPars->nTimeOutGap );
-    Abc_Print( -2, "\t-C num : max conflicts at an output [default = %d]\n",                      pPars->nConfLimit );
-    Abc_Print( -2, "\t-D num : max conflicts after jumping (0 = infinity) [default = %d]\n",      pPars->nConfLimitJump );
-    Abc_Print( -2, "\t-J num : the number of timeframes to jump (0 = not used) [default = %d]\n", pPars->nFramesJump );
-    Abc_Print( -2, "\t-I num : the number of PIs to abstract [default = %d]\n",                   pPars->nPisAbstract );
-    Abc_Print( -2, "\t-P num : the max number of learned clauses to keep (0=unused) [default = %d]\n", pPars->nLearnedStart );
-    Abc_Print( -2, "\t-Q num : delta value for learned clause removal [default = %d]\n",          pPars->nLearnedDelta );
-    Abc_Print( -2, "\t-R num : percentage to keep for learned clause removal [default = %d]\n",   pPars->nLearnedPerce );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n",                               pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-W file: the log file name with per-output details [default = %s]\n",       pPars->pLogFileName ? pPars->pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-a     : solve all outputs (do not stop when one is SAT) [default = %s]\n", pPars->fSolveAll? "yes": "no" );
-    Abc_Print( -2, "\t-x     : toggle storing CEXes when solving all outputs [default = %s]\n",   pPars->fStoreCex? "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle dropping (replacing by 0) SAT outputs [default = %s]\n",    pPars->fDropSatOuts? "yes": "no" );
-    Abc_Print( -2, "\t-u     : toggle performing structural OR-decomposition [default = %s]\n",   fOrDecomp? "yes": "not" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n",                           pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle suppressing report about solved outputs [default = %s]\n",  pPars->fNotVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Inter_ManParams_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    char * pLogFileName = NULL;
-
-    extern int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars, Abc_Ntk_t ** ppNtkRes );
-    // set defaults
-    Inter_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CFTKLIrtpomcgbqkdivh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nSecLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nSecLimit < 0 )
-                goto usage;
-            break;
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFramesK = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFramesK < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pPars->pFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'r':
-            pPars->fRewrite ^= 1;
-            break;
-        case 't':
-            pPars->fTransLoop ^= 1;
-            break;
-        case 'p':
-            pPars->fUsePudlak ^= 1;
-            break;
-        case 'o':
-            pPars->fUseOther ^= 1;
-            break;
-        case 'm':
-            pPars->fUseMiniSat ^= 1;
-            break;
-        case 'c':
-            pPars->fCheckKstep ^= 1;
-            break;
-        case 'g':
-            pPars->fUseBias ^= 1;
-            break;
-        case 'b':
-            pPars->fUseBackward ^= 1;
-            break;
-        case 'q':
-            pPars->fUseTwoFrames ^= 1;
-            break;
-        case 'k':
-            pPars->fUseSeparate ^= 1;
-            break;
-        case 'd':
-            pPars->fDropSatOuts ^= 1;
-            break;
-        case 'i':
-            pPars->fDropInvar ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -1, "Does not work for combinational networks.\n" );
-        return 0;
-    }
-    if ( Abc_NtkConstrNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Cannot run interpolation with constraints. Use \"fold\".\n" );
-        return 0;
-    }
-    if ( Abc_NtkPoNum(pNtk)-Abc_NtkConstrNum(pNtk) != 1 )
-    {
-        if ( Abc_NtkConstrNum(pNtk) > 0 )
-        {
-            Abc_Print( 1,"Cannot solve multiple-output miter with constraints.\n" );
-            return 0;
-        }
-        if ( pPars->fUseSeparate )
-        {
-            Abc_Print( 0, "Each of %d outputs will be solved separately.\n", Abc_NtkPoNum(pNtk) );
-            pAbc->Status = Abc_NtkDarBmcInter( pNtk, pPars, &pNtkRes );
-            Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-            if ( pNtkRes == NULL )
-            {
-                Abc_Print( -1, "Generating resulting network has failed.\n" );
-                return 0;
-            }
-            Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-        }
-        else
-        {
-            Abc_Ntk_t * pNtkNew = Abc_NtkDup( pNtk );
-            Abc_Print( 0, "All %d outputs will be ORed together.\n", Abc_NtkPoNum(pNtk) );
-            if ( !Abc_NtkCombinePos( pNtkNew, 0, 0 ) )
-            {
-                Abc_NtkDelete( pNtkNew );
-                Abc_Print( -1, "ORing outputs has failed.\n" );
-                return 0;
-            }
-            pAbc->Status = Abc_NtkDarBmcInter( pNtkNew, pPars, NULL );
-            if ( pAbc->Status == 0 )
-            {
-                Aig_Man_t * pMan = Abc_NtkToDar( pNtk, 0, 1 );
-                pNtkNew->pSeqModel->iPo = Saig_ManFindFailedPoCex( pMan, pNtkNew->pSeqModel );
-                Aig_ManStop( pMan );
-            }
-            Abc_FrameReplaceCex( pAbc, &pNtkNew->pSeqModel );
-            Abc_NtkDelete( pNtkNew );
-        }
-        pAbc->nFrames = -1;
-    }
-    else
-    {
-        pAbc->Status  = Abc_NtkDarBmcInter( pNtk, pPars, NULL );
-        pAbc->nFrames = pPars->iFrameMax;
-        Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    }
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "int" );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: int [-CFTK num] [-LI file] [-irtpomcgbqkdvh]\n" );
-    Abc_Print( -2, "\t         uses interpolation to prove the property\n" );
-    Abc_Print( -2, "\t-C num : the limit on conflicts for one SAT run [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-F num : the limit on number of frames to unroll [default = %d]\n", pPars->nFramesMax );
-    Abc_Print( -2, "\t-T num : the limit on runtime per output in seconds [default = %d]\n", pPars->nSecLimit );
-    Abc_Print( -2, "\t-K num : the number of steps in inductive checking [default = %d]\n", pPars->nFramesK );
-    Abc_Print( -2, "\t         (K = 1 works in all cases; K > 1 works without -t and -b)\n" );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-I file: the file name for dumping interpolant [default = \"%s\"]\n", pPars->pFileName ? pPars->pFileName : "invar.aig" );
-    Abc_Print( -2, "\t-i     : toggle dumping interpolant/invariant into a file [default = %s]\n", pPars->fDropInvar? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle rewriting of the unrolled timeframes [default = %s]\n", pPars->fRewrite? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle adding transition into the initial state [default = %s]\n", pPars->fTransLoop? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle using original Pudlak's interpolation procedure [default = %s]\n", pPars->fUsePudlak? "yes": "no" );
-    Abc_Print( -2, "\t-o     : toggle using optimized Pudlak's interpolation procedure [default = %s]\n", pPars->fUseOther? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle using MiniSat-1.14p (now, Windows-only) [default = %s]\n", pPars->fUseMiniSat? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle using inductive containment check [default = %s]\n", pPars->fCheckKstep? "yes": "no" );
-    Abc_Print( -2, "\t-g     : toggle using bias for global variables using SAT [default = %s]\n", pPars->fUseBias? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggle using backward interpolation (works with -t) [default = %s]\n", pPars->fUseBackward? "yes": "no" );
-    Abc_Print( -2, "\t-q     : toggle using property in two last timeframes [default = %s]\n", pPars->fUseTwoFrames? "yes": "no" );
-    Abc_Print( -2, "\t-k     : toggle solving each output separately [default = %s]\n", pPars->fUseSeparate? "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle dropping (replacing by 0) SAT outputs (with -k is used) [default = %s]\n", pPars->fDropSatOuts? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int nFrames;
-    int nPref;
-    int nClauses;
-    int nLutSize;
-    int nLevels;
-    int nCutsMax;
-    int nBatches;
-    int fStepUp;
-    int fBmc;
-    int fRegs;
-    int fTarget;
-    int fVerbose;
-    int fVeryVerbose;
-    int c;
-    extern int Abc_NtkDarClau( Abc_Ntk_t * pNtk, int nFrames, int nPref, int nClauses, int nLutSize, int nLevels, int nCutsMax, int nBatches, int fStepUp, int fBmc, int fRegs, int fTarget, int fVerbose, int fVeryVerbose );
-    // set defaults
-    nFrames      =    1;
-    nPref        =    0;
-    nClauses     = 5000;
-    nLutSize     =    4;
-    nLevels      =    8;
-    nCutsMax     =   16;
-    nBatches     =    1;
-    fStepUp      =    0;
-    fBmc         =    1;
-    fRegs        =    1;
-    fTarget      =    1;
-    fVerbose     =    0;
-    fVeryVerbose =    0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FPCMLNBsbrtvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nPref = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nPref < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nClauses = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nClauses < 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLevels = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLevels < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nBatches = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nBatches < 0 )
-                goto usage;
-            break;
-        case 's':
-            fStepUp ^= 1;
-            break;
-        case 'b':
-            fBmc ^= 1;
-            break;
-        case 'r':
-            fRegs ^= 1;
-            break;
-        case 't':
-            fTarget ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( nLutSize > 12 )
-    {
-        Abc_Print( -1, "The cut size should be not exceed 12.\n" );
-        return 0;
-    }
-    Abc_NtkDarClau( pNtk, nFrames, nPref, nClauses, nLutSize, nLevels, nCutsMax, nBatches, fStepUp, fBmc, fRegs, fTarget, fVerbose, fVeryVerbose );
-    return 0;
-usage:
-    Abc_Print( -2, "usage: indcut [-FPCMLNB num] [-sbrtvh]\n" );
-    Abc_Print( -2, "\t         K-step induction strengthened with cut properties\n" );
-    Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-P num : number of time frames in the prefix (0=no prefix) [default = %d]\n", nPref );
-    Abc_Print( -2, "\t-C num : the max number of clauses to use for strengthening [default = %d]\n", nClauses );
-    Abc_Print( -2, "\t-M num : the cut size (2 <= M <= 12) [default = %d]\n", nLutSize );
-    Abc_Print( -2, "\t-L num : the max number of levels for cut computation [default = %d]\n", nLevels );
-    Abc_Print( -2, "\t-N num : the max number of cuts to compute at a node [default = %d]\n", nCutsMax );
-    Abc_Print( -2, "\t-B num : the max number of invariant batches to try [default = %d]\n", nBatches );
-    Abc_Print( -2, "\t-s     : toggle increment cut size in each batch [default = %s]\n", fStepUp? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggle enabling BMC check [default = %s]\n", fBmc? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle enabling register clauses [default = %s]\n", fRegs? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle proving target / computing don't-cares [default = %s]\n", fTarget? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-//    Abc_Print( -2, "\t-w     : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandEnlarge( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int nFrames;
-    int fVerbose;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nFrames      = 5;
-    fVerbose     = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 1 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-
-    // modify the current network
-    pNtkRes = Abc_NtkDarEnlarge( pNtk, nFrames, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Target enlargement has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-usage:
-    Abc_Print( -2, "usage: enlarge [-F <num>] [-vh]\n" );
-    Abc_Print( -2, "\t           performs structural K-step target enlargement\n" );
-    Abc_Print( -2, "\t-F <num> : the number of timeframes to unroll (<num> > 0) [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-v       : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTempor( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkDarTempor( Abc_Ntk_t * pNtk, int nFrames, int TimeOut, int nConfLimit, int fUseBmc, int fUseTransSigs, int fVerbose, int fVeryVerbose );
-    Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
-    int nFrames       =       0;
-    int TimeOut       =     300;
-    int nConfMax      =  100000;
-    int fUseBmc       =       1;
-    int fUseTransSigs =       0;
-    int fUpdateCex    =       0;
-    int fVerbose      =       0;
-    int fVeryVerbose  =       0;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FTCbscvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            TimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( TimeOut < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfMax < 0 )
-                goto usage;
-            break;
-        case 'b':
-            fUseBmc ^= 1;
-            break;
-        case 's':
-            fUseTransSigs ^= 1;
-            break;
-        case 'c':
-            fUpdateCex ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -2, "There is no current network.\n");
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -2, "The current network is not an AIG (run \"strash\").\n");
-        return 0;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -2, "The current network is combinational.\n");
-        return 0;
-    }
-    if ( fUpdateCex )
-    {
-        Abc_Cex_t * pCexNew;
-        if ( pAbc->pCex == NULL )
-        {
-            Abc_Print( -1, "Counter-example is not available.\n" );
-            return 1;
-        }
-        if ( pAbc->pCex->nPis % Abc_NtkPiNum(pNtk) != 0 )
-        {
-            Abc_Print( -1, "PI count of the CEX is not a multiple of PI count of the current AIG.\n" );
-            return 1;
-        }
-        pCexNew = Abc_CexTransformTempor( pAbc->pCex, Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkLatchNum(pNtk) );
-        Abc_FrameReplaceCex( pAbc, &pCexNew );
-        return 0;
-    }
-    // modify the current network
-    pNtkRes = Abc_NtkDarTempor( pNtk, nFrames, TimeOut, nConfMax, fUseBmc, fUseTransSigs, fVerbose, fVeryVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( -1, "Temporal decomposition has failed.\n" );
-        return 1;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: tempor [-FTC <num>] [-bscvwh]\n" );
-    Abc_Print( -2, "\t           performs temporal decomposition\n" );
-    Abc_Print( -2, "\t-F <num> : init logic timeframe count (0 = use leading length) [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-T <num> : runtime limit in seconds for BMC (0=unused) [default = %d]\n", TimeOut );
-    Abc_Print( -2, "\t-C <num> : max number of SAT conflicts in BMC (0=unused) [default = %d]\n", nConfMax );
-    Abc_Print( -2, "\t-b       : toggle running BMC2 on the init frames [default = %s]\n", fUseBmc? "yes": "no" );
-    Abc_Print( -2, "\t-s       : toggle using transient signals [default = %s]\n", fUseTransSigs? "yes": "no" );
-    Abc_Print( -2, "\t-c       : update the current CEX derived for a new AIG after \"tempor\"\n" );
-    Abc_Print( -2, "\t           to match the current AIG (the one before \"tempor\") [default = %s]\n", fUpdateCex? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle printing verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printing ternary state space [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandInduction( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int nTimeOut;
-    int nFramesMax;
-    int nConfMax;
-    int fUnique;
-    int fUniqueAll;
-    int fGetCex;
-    int fVerbose;
-    int fVeryVerbose;
-    int c;
-    extern int Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nTimeOut, int nFramesMax, int nConfMax, int fUnique, int fUniqueAll, int fGetCex, int fVerbose, int fVeryVerbose );
-    // set defaults
-    nTimeOut     =     0;
-    nFramesMax   =     0;
-    nConfMax     =     0;
-    fUnique      =     0;
-    fUniqueAll   =     0;
-    fGetCex      =     0;
-    fVerbose     =     0;
-    fVeryVerbose =     0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FCTuaxvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFramesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFramesMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nTimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nTimeOut < 0 )
-                goto usage;
-            break;
-        case 'u':
-            fUnique ^= 1;
-            break;
-        case 'a':
-            fUniqueAll ^= 1;
-            break;
-        case 'x':
-            fGetCex ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkPoNum(pNtk) != 1 )
-    {
-        Abc_Print( -1, "Currently this command works only for single-output miter.\n" );
-        return 0;
-    }
-    if ( fUnique && fUniqueAll )
-    {
-        Abc_Print( -1, "Only one of the options, \"-u\" or \"-a\", should be selected.\n" );
-        return 0;
-    }
-
-    // modify the current network
-    pAbc->Status = Abc_NtkDarInduction( pNtk, nTimeOut, nFramesMax, nConfMax, fUnique, fUniqueAll, fGetCex, fVerbose, fVeryVerbose );
-    if ( fGetCex )
-    {
-        Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-        Abc_Print( 1,"The current CEX in ABC is set to be the CEX to induction.\n" );
-    }
-    return 0;
-usage:
-    Abc_Print( -2, "usage: ind [-FCT num] [-uaxvwh]\n" );
-    Abc_Print( -2, "\t         runs the inductive case of the K-step induction\n" );
-    Abc_Print( -2, "\t-F num : the max number of timeframes [default = %d]\n", nFramesMax );
-    Abc_Print( -2, "\t-C num : the max number of conflicts by SAT solver [default = %d]\n", nConfMax );
-    Abc_Print( -2, "\t-T num : the limit on runtime per output in seconds [default = %d]\n", nTimeOut );
-    Abc_Print( -2, "\t-u     : toggle adding uniqueness constraints on demand [default = %s]\n", fUnique? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggle adding uniqueness constraints always [default = %s]\n", fUniqueAll? "yes": "no" );
-    Abc_Print( -2, "\t-x     : toggle returning CEX to induction for the top frame [default = %s]\n", fGetCex? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing additional verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk;
-    int c;
-    int nFrames;
-    int nConfs;
-    int nProps;
-    int fRemove;
-    int fStruct;
-    int fInvert;
-    int fOldAlgo;
-    int fVerbose;
-    int nConstrs;
-    extern void Abc_NtkDarConstr( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nFrames   =      1;
-    nConfs    =   1000;
-    nProps    =   1000;
-    fRemove   =      0;
-    fStruct   =      0;
-    fInvert   =      0;
-    fOldAlgo  =      0;
-    fVerbose  =      0;
-    nConstrs  =     -1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FCPNrsiavh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfs < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nProps = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nProps < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConstrs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConstrs < 0 )
-                goto usage;
-            break;
-        case 'r':
-            fRemove ^= 1;
-            break;
-        case 's':
-            fStruct ^= 1;
-            break;
-        case 'i':
-            fInvert ^= 1;
-            break;
-        case 'a':
-            fOldAlgo ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( fRemove )
-    {
-        if ( Abc_NtkConstrNum(pNtk) == 0 )
-        {
-            Abc_Print( -1, "Constraints are not defined.\n" );
-            return 0;
-        }
-        Abc_Print( 1, "Constraints are converted to be primary outputs.\n" );
-        pNtk->nConstrs = 0;
-        return 0;
-    }
-    // consider the case of manual constraint definition
-    if ( nConstrs >= 0 )
-    {
-        if ( Abc_NtkIsComb(pNtk) )
-            Abc_Print( 0, "The network is combinational.\n" );
-        if ( Abc_NtkConstrNum(pNtk) > 0 )
-            Abc_Print( 0, "The network currently has %d constraints.\n", Abc_NtkConstrNum(pNtk) );
-        if ( nConstrs >= Abc_NtkPoNum(pNtk) )
-        {
-            Abc_Print( -1, "The number of constraints specified (%d) should be less than POs (%d).\n", nConstrs, Abc_NtkPoNum(pNtk) );
-            return 0;
-        }
-        Abc_Print( 1, "Setting the last %d POs as constraint outputs.\n", nConstrs );
-        pNtk->nConstrs = nConstrs;
-        return 0;
-    }
-    // consider the case of already defined constraints
-    if ( Abc_NtkConstrNum(pNtk) > 0 )
-    {
-        extern void Abc_NtkDarConstrProfile( Abc_Ntk_t * pNtk, int fVerbose );
-        if ( fInvert )
-        {
-            Abc_NtkInvertConstraints( pNtk );
-            if ( Abc_NtkConstrNum(pNtk) == 1 )
-                Abc_Print( 1, "The output of %d constraint is complemented.\n", Abc_NtkConstrNum(pNtk) );
-            else
-                Abc_Print( 1, "The outputs of %d constraints are complemented.\n", Abc_NtkConstrNum(pNtk) );
-        }
-        if ( fVerbose )
-            Abc_NtkDarConstrProfile( pNtk, fVerbose );
-        return 0;
-    }
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    // detect constraints using functional/structural methods
-    Abc_NtkDarConstr( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
-    return 0;
-usage:
-    Abc_Print( -2, "usage: constr [-FCPN num] [-risavh]\n" );
-    Abc_Print( -2, "\t         a toolkit for constraint manipulation\n" );
-    Abc_Print( -2, "\t         if constraints are absent, detect them functionally\n" );
-    Abc_Print( -2, "\t         if constraints are present, profiles them using random simulation\n" );
-    Abc_Print( -2, "\t-F num : the max number of timeframes to consider [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
-    Abc_Print( -2, "\t-P num : the max number of propagations in SAT solving [default = %d]\n", nProps );
-    Abc_Print( -2, "\t-N num : manually set the last <num> POs to be constraints [default = %d]\n", nConstrs );
-    Abc_Print( -2, "\t-r     : manually remove the constraints [default = %s]\n", fRemove? "yes": "no" );
-    Abc_Print( -2, "\t-i     : toggle inverting already defined constraints [default = %s]\n", fInvert? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle using structural detection methods [default = %s]\n", fStruct? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandUnfold( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int nFrames;
-    int nConfs;
-    int nProps;
-    int fStruct;
-    int fOldAlgo;
-    int fVerbose;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkDarUnfold( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    nFrames   =      1;
-    nConfs    =   1000;
-    nProps    =   1000;
-    fStruct   =      0;
-    fOldAlgo  =      0;
-    fVerbose  =      0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FCPsavh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfs < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nProps = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nProps < 0 )
-                goto usage;
-            break;
-        case 's':
-            fStruct ^= 1;
-            break;
-        case 'a':
-            fOldAlgo ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Abc_NtkIsComb(pNtk) && Abc_NtkPoNum(pNtk) > 1 )
-    {
-        Abc_Print( -1, "Combinational miter has more than one PO.\n" );
-        return 0;
-    }
-    if ( Abc_NtkIsComb(pNtk) )
-    {
-        extern Gia_Man_t * Gia_ManDupWithConstr( Gia_Man_t * p );
-        Gia_Man_t * pNew;
-        Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 0 );
-        Gia_Man_t * pGia = Gia_ManFromAigSimple( pAig );
-        Aig_ManStop( pAig );
-        pNew = Gia_ManDupWithConstr( pGia );
-        if ( pNew == NULL )
-        {
-            Abc_Print( -1, "Cannot extract constrains from the miter.\n" );
-            return 0;
-        }
-        Gia_ManStop( pGia );
-        pAig = Gia_ManToAigSimple( pNew );
-        Gia_ManStop( pNew );
-        pNtkRes = Abc_NtkFromAigPhase( pAig );
-        Aig_ManStop( pAig );
-        ABC_FREE( pNtkRes->pName );
-        pNtkRes->pName = Extra_UtilStrsav( pNtk->pName );
-        // replace the current network
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkConstrNum(pNtk) > 0 )
-    {
-        Abc_Print( -1, "Constraints are already extracted.\n" );
-        return 0;
-    }
-    if ( Abc_NtkPoNum(pNtk) > 1 && !fStruct )
-    {
-        Abc_Print( -1, "Functional constraint extraction works for single-output miters (use \"orpos\").\n" );
-        return 0;
-    }
-    // modify the current network
-    pNtkRes = Abc_NtkDarUnfold( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( 1,"Transformation has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-usage:
-    Abc_Print( -2, "usage: unfold [-FCP num] [-savh]\n" );
-    Abc_Print( -2, "\t         unfold hidden constraints as separate outputs\n" );
-    Abc_Print( -2, "\t-F num : the max number of timeframes to consider [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
-    Abc_Print( -2, "\t-P num : the max number of constraint propagations [default = %d]\n", nProps );
-    Abc_Print( -2, "\t-s     : toggle detecting structural constraints [default = %s]\n", fStruct? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandFold( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkRes;
-    int fCompl;
-    int fVerbose;
-    int c;
-    extern Abc_Ntk_t * Abc_NtkDarFold( Abc_Ntk_t * pNtk, int fCompl, int fVerbose );
-    pNtk = Abc_FrameReadNtk(pAbc);
-    // set defaults
-    fCompl    =   0;
-    fVerbose  =   0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "cvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'c':
-            fCompl ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
-        return 0;
-    }
-    if ( Abc_NtkConstrNum(pNtk) == 0 )
-    {
-        Abc_Print( 0, "The network has no constraints.\n" );
-        return 0;
-    }
-    if ( Abc_NtkIsComb(pNtk) )
-        Abc_Print( 0, "The network is combinational.\n" );
-    // modify the current network
-    pNtkRes = Abc_NtkDarFold( pNtk, fCompl, fVerbose );
-    if ( pNtkRes == NULL )
-    {
-        Abc_Print( 1,"Transformation has failed.\n" );
-        return 0;
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
-    return 0;
-usage:
-    Abc_Print( -2, "usage: fold [-cvh]\n" );
-    Abc_Print( -2, "\t         folds constraints represented as separate outputs\n" );
-    Abc_Print( -2, "\t-c     : toggle complementing constraints while folding [default = %s]\n", fCompl? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBm( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    FILE * pOut, * pErr;
-    Abc_Ntk_t *pNtk, *pNtk1, *pNtk2;
-    int fDelete1, fDelete2;
-    char ** pArgvNew;
-    int c, nArgcNew;
-    int p_equivalence = FALSE;
-    extern void bmGateWay( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int p_equivalence );
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    pOut = Abc_FrameReadOut(pAbc);
-    pErr = Abc_FrameReadErr(pAbc);
-
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Ph" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        case 'P':
-            p_equivalence = 1;
-            break;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew , &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-        return 1;
-
-    if( (unsigned)Abc_NtkPiNum(pNtk1) != (unsigned)Abc_NtkPiNum(pNtk2) || (unsigned)Abc_NtkPoNum(pNtk1) != (unsigned)Abc_NtkPoNum(pNtk2) )
-    {
-        Abc_Print( -2, "Mismatch in the number of inputs or outputs\n");
-        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-        return 1;
-    }
-
-    bmGateWay( pNtk1, pNtk2, p_equivalence );
-
-    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: bm [-P] <file1> <file2>\n" );
-    Abc_Print( -2, "\t        performs Boolean matching (P-equivalence & PP-equivalence)\n" );
-    Abc_Print( -2, "\t        for equivalent circuits, I/O matches are printed in IOmatch.txt\n" );
-    Abc_Print( -2, "\t-P    : performs P-equivalnce checking\n");
-    Abc_Print( -2, "\t        default is PP-equivalence checking (when -P is not provided)\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    Abc_Print( -2, "\tfile1 : the file with the first network\n");
-    Abc_Print( -2, "\tfile2 : the file with the second network\n");
-
-    Abc_Print( -2, "\t        \n" );
-    Abc_Print( -2, "\t        This command was contributed by Hadi Katebi from U Michigan.\n" );
-    Abc_Print( -2, "\t        The paper describing the method: H. Katebi and I. L. Markov.\n" );
-    Abc_Print( -2, "\t        \"Large-scale Boolean matching\". Proc. DATE 2010. \n" );
-    Abc_Print( -2, "\t        http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
-//    Abc_Print( -2, "\t        \n" );
-
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBm2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{   
-    FILE * pOut, * pErr;
-    Abc_Ntk_t *pNtk, *pNtk1, *pNtk2;
-    int fDelete1, fDelete2; 
-    Abc_Obj_t * pObj;
-    char ** pArgvNew;
-    int c, nArgcNew, i; 
-
-    extern void saucyGateWay( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo, FILE * gFile, int fBooleanMatching,
-                              int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree);
-
-    pNtk = Abc_FrameReadNtk(pAbc);
-    pOut = Abc_FrameReadOut(pAbc);
-    pErr = Abc_FrameReadErr(pAbc);  
-    
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;        
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-    
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew , &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
-        return 1;
-        
-    if( (unsigned)Abc_NtkPiNum(pNtk1) != (unsigned)Abc_NtkPiNum(pNtk2) || 
-        (unsigned)Abc_NtkPoNum(pNtk1) != (unsigned)Abc_NtkPoNum(pNtk2) )
-    {
-        Abc_Print( -2, "Mismatch in the number of inputs or outputs\n");
-        Abc_Print( -2, "*** Networks are NOT equivalent ***\n");
-        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
-        return 1;
-    }
-    
-    Abc_NtkPermute(pNtk2, 1, 1, 0, NULL );
-    Abc_NtkShortNames(pNtk2);
-
-    Abc_NtkForEachCi( pNtk1, pObj, i ) {
-        char * newName = Abc_ObjNamePrefix( pObj, "N1:" );
-        Nm_ManDeleteIdName( pNtk1->pManName, pObj->Id);
-        Abc_ObjAssignName( pObj, newName, NULL );
-    }
-    Abc_NtkForEachCo( pNtk1, pObj, i ) {
-        char * newName = Abc_ObjNamePrefix( pObj, "N1:" );
-        Nm_ManDeleteIdName( pNtk1->pManName, pObj->Id);
-        Abc_ObjAssignName( pObj, newName, NULL );
-    }
-
-    Abc_NtkForEachCi( pNtk2, pObj, i ) {
-        char * newName = Abc_ObjNamePrefix( pObj, "N2:" );
-        Nm_ManDeleteIdName( pNtk2->pManName, pObj->Id);
-        Abc_ObjAssignName( pObj, newName, NULL );
-    }
-    Abc_NtkForEachCo( pNtk2, pObj, i ) {
-        char * newName = Abc_ObjNamePrefix( pObj, "N2:" );
-        Nm_ManDeleteIdName( pNtk2->pManName, pObj->Id);
-        Abc_ObjAssignName( pObj, newName, NULL );
-    }
-
-    Abc_NtkAppend( pNtk1, pNtk2, 1 );
-    saucyGateWay( pNtk1, NULL, NULL, 1, 0, 0, 0, 0, 0);
-
-    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
-    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );     
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: bm2  <file1> <file2>\n" );
-    Abc_Print( -2, "\t        performs Boolean matching (PP-equivalence)\n" );
-    Abc_Print( -2, "\t        for equivalent circuits, permutation that maps one circuit\n" );
-    Abc_Print( -2, "\t        to another is printed to standard output (PIs and POs of the\n" );
-    Abc_Print( -2, "\t        first network have prefix \"N1:\", while PIs and POs of the\n" ); 
-    Abc_Print( -2, "\t        second network have prefix \"N2:\")\n" ); 
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    Abc_Print( -2, "\tfile1 : the file with the first network\n");
-    Abc_Print( -2, "\tfile2 : the file with the second network\n");
-
-    Abc_Print( -2, "\t        \n" );
-    Abc_Print( -2, "\t        This command was contributed by Hadi Katebi from U Michigan.\n" );
-    Abc_Print( -2, "\t        The paper describing the method: H. Katebi, K. Sakallah and\n");
-    Abc_Print( -2, "\t        I. L. Markov.\n" );
-    Abc_Print( -2, "\t        \"Generalized Boolean Symmetries Through Nested Partition\n");
-    Abc_Print( -2, "\t        Refinement\". Proc. ICCAD 2013. \n" );
-    //Abc_Print( -2, "\t        http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
-//    Abc_Print( -2, "\t        \n" );
-
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-               
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandSaucy( Abc_Frame_t * pAbc, int argc, char ** argv )
-{   
-    Abc_Ntk_t *pNtk;
-    char * outputName = NULL;
-    FILE * gFile = NULL;
-    int fOutputsOneAtTime = 0;
-    int fFixOutputs = 0;
-    int fFixInputs = 0;
-    int fLookForSwaps = 0;
-    int fQuiet = 0;
-    int fPrintTree = 0;
-    int c;
-
-    extern void saucyGateWay( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo, FILE * gFile, int fBooleanMatching,
-                              int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree);
-
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "OFiosqvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'O':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-O\" should be followed by an output name or the keyword all.\n" );
-                goto usage;
-            }
-            outputName = argv[globalUtilOptind];
-            if ( !strcmp(argv[globalUtilOptind], "all") )
-                fOutputsOneAtTime ^= 1;
-            globalUtilOptind++;         
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a file name.\n" );
-                goto usage;
-            }           
-            if ( (gFile = fopen( argv[globalUtilOptind], "w" )) == NULL )
-            {
-                Abc_Print( -1, "Cannot create output file \"%s\". ", argv[globalUtilOptind] );              
-                return 1;
-            }
-            globalUtilOptind++;         
-            break;
-        case 'i':
-            fFixOutputs ^= 1;
-            break;
-        case 'o':
-            fFixInputs ^= 1;
-            break;
-        case 's':
-            fLookForSwaps ^= 1;
-            break;
-        case 'q':
-            fQuiet ^= 1;
-            break;
-        case 'v':
-            fPrintTree ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }    
-    
-    pNtk = Abc_FrameReadNtk(pAbc);  
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
-        return 1;
-    }
-
-    pNtk = Abc_NtkDup( pNtk );
-    Abc_NtkOrderObjsByName( pNtk, 1 );
-
-    if (fOutputsOneAtTime) {
-        int i;
-        Abc_Obj_t * pNodePo;
-        FILE * hadi = fopen("hadi.txt", "w");
-        Abc_NtkForEachPo( pNtk, pNodePo, i ) {
-            printf("Ouput %s\n\n", Abc_ObjName(pNodePo));
-            saucyGateWay( pNtk, pNodePo, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
-            printf("----------------------------------------\n");           
-        }
-        fclose(hadi);
-    } else if (outputName != NULL) {
-        int i;
-        Abc_Obj_t * pNodePo;        
-        Abc_NtkForEachPo( pNtk, pNodePo, i ) {
-            if (!strcmp(Abc_ObjName(pNodePo), outputName)) {
-                saucyGateWay( pNtk, pNodePo, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
-                Abc_NtkDelete( pNtk );
-                return 0;
-            }   
-        }
-        Abc_Print( -1, "Output not found\n" );
-        return 1;       
-    } else
-        saucyGateWay( pNtk, NULL, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
-
-    if (gFile != NULL) fclose(gFile);
-    Abc_NtkDelete( pNtk );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: saucy3 [-O <name>] [-F <file>] [-iosqvh]\n\n" );
-    Abc_Print( -2, "\t            computes functional symmetries of the netowrk\n" );
-    Abc_Print( -2, "\t            prints symmetry generators to the standard output\n" );   
-    Abc_Print( -2, "\t-O <name> : (optional) compute symmetries only for output given by name\n");
-    Abc_Print( -2, "\t            only inputs in the output cone are permuted\n");  
-    Abc_Print( -2, "\t            (special case) name=all, compute symmetries for each\n" );
-    Abc_Print( -2, "\t            output, but only one output at a time\n" );
-    Abc_Print( -2, "\t            [default = compute symmetries by permuting all I/Os]\n" );
-    Abc_Print( -2, "\t-F <file> : print symmetry generators to file [default = stdout]\n");
-    Abc_Print( -2, "\t-i        : permute just the inputs (fix the outputs) [default = no]\n");
-    Abc_Print( -2, "\t-o        : permute just the outputs (fix the inputs) [default = no]\n");
-    Abc_Print( -2, "\t-s        : only look for swaps of inputs [default = no]\n");
-    Abc_Print( -2, "\t-q        : quiet (do not print symmetry generators) [default = no]\n");
-    Abc_Print( -2, "\t-v        : verbose (print the search tree) [default = no]\n");   
-    Abc_Print( -2, "\t-h        : print the command usage\n"); 
-
-    Abc_Print( -2, "\t            \n" );
-    Abc_Print( -2, "\t            This command was contributed by Hadi Katebi from U Michigan.\n" );
-    Abc_Print( -2, "\t            The paper describing the method: H. Katebi, K. Sakallah and\n");
-    Abc_Print( -2, "\t            I. L. Markov.\n" );
-    Abc_Print( -2, "\t            \"Generalized Boolean Symmetries Through Nested Partition\n");
-    Abc_Print( -2, "\t            Refinement\". Proc. ICCAD 2013. \n" );
-    //Abc_Print( -2, "\t          http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
-    Abc_Print( -2, "\t            Saucy webpage: http://vlsicad.eecs.umich.edu/BK/SAUCY/\n" );
-
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTestCex( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk;
-    int c;
-    int nOutputs = 0;
-    int fCheckAnd = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Oah" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'O':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nOutputs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nOutputs < 0 )
-                goto usage;
-            break;
-        case 'a':
-            fCheckAnd ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pCex == NULL )
-    {
-        Abc_Print( 1, "There is no current cex.\n");
-        return 0;
-    }
-
-    if ( !fCheckAnd )
-    {
-        // check the main AIG
-        pNtk = Abc_FrameReadNtk(pAbc);
-        if ( pNtk == NULL )
-            Abc_Print( 1, "Main AIG: There is no current network.\n");
-        else if ( !Abc_NtkIsStrash(pNtk) )
-            Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
-        else if ( Abc_NtkPiNum(pNtk) != pAbc->pCex->nPis )
-            Abc_Print( 1, "Main AIG: The number of PIs (%d) is different from cex (%d).\n", Abc_NtkPiNum(pNtk), pAbc->pCex->nPis );
-        else
-        {
-            extern int Abc_NtkVerifyCex( Abc_Ntk_t * pNtk, Abc_Cex_t * p );
-            int iPoOld = pAbc->pCex->iPo;
-            pAbc->pCex->iPo = Abc_NtkVerifyCex( pNtk, pAbc->pCex );
-            if ( pAbc->pCex->iPo == -1 )
-                Abc_Print( 1, "Main AIG: The cex does not fail any outputs.\n" );
-            else if ( iPoOld != pAbc->pCex->iPo )
-                Abc_Print( 1, "Main AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
-            else
-                Abc_Print( 1, "Main AIG: The cex is correct.\n" );
-        }
-    }
-    else
-    {
-        // check the AND AIG
-        if ( pAbc->pGia == NULL )
-            Abc_Print( 1, "And  AIG: There is no current network.\n");
-        else if ( Gia_ManPiNum(pAbc->pGia) != pAbc->pCex->nPis )
-            Abc_Print( 1, "And  AIG: The number of PIs (%d) is different from cex (%d).\n", Gia_ManPiNum(pAbc->pGia), pAbc->pCex->nPis );
-        else
-        {
-            int iPoOld = pAbc->pCex->iPo;
-            pAbc->pCex->iPo = Gia_ManFindFailedPoCex( pAbc->pGia, pAbc->pCex, nOutputs );
-            if ( pAbc->pCex->iPo == -1 )
-                Abc_Print( 1, "And  AIG: The cex does not fail any outputs.\n" );
-            else if ( iPoOld != pAbc->pCex->iPo )
-                Abc_Print( 1, "And  AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
-            else
-                Abc_Print( 1, "And  AIG: The cex is correct.\n" );
-        }
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: testcex [-O num] [-ah]\n" );
-    Abc_Print( -2, "\t         tests the current cex against the current AIG or the &-AIG\n" );
-    Abc_Print( -2, "\t-O num : the number of real POs in the PO list [default = %d]\n", nOutputs );
-    Abc_Print( -2, "\t-a     : toggle checking the current AIG or the &-AIG [default = %s]\n", fCheckAnd ? "&-AIG": "current AIG" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars );
-    Pdr_Par_t Pars, * pPars = &Pars;
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    Pdr_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "MFCRTHGaxrmsipdgvwzh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRecycle = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRecycle < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrameMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrameMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nConfLimit < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRestLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRestLimit < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nTimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nTimeOut < 0 )
-                goto usage;
-            break;
-        case 'H':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nTimeOutOne = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nTimeOutOne < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nTimeOutGap = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nTimeOutGap < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fSolveAll ^= 1;
-            break;
-        case 'x':
-            pPars->fStoreCex ^= 1;
-            break;
-        case 'r':
-            pPars->fTwoRounds ^= 1;
-            break;
-        case 'm':
-            pPars->fMonoCnf ^= 1;
-            break;
-        case 's':
-            pPars->fShortest ^= 1;
-            break;
-        case 'i':
-            pPars->fShiftStart ^= 1;
-            break;
-        case 'p':
-            pPars->fReuseProofOblig ^= 1;
-            break;
-        case 'd':
-            pPars->fDumpInv ^= 1;
-            break;
-        case 'g':
-            pPars->fSkipGeneral ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'z':
-            pPars->fNotVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -2, "There is no current network.\n");
-        return 0;
-    }
-    if ( Abc_NtkLatchNum(pNtk) == 0 )
-    {
-        Abc_Print( -2, "The current network is combinational.\n");
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -2, "The current network is not an AIG (run \"strash\").\n");
-        return 0;
-    }
-    // run the procedure
-    pPars->fUseBridge = pAbc->fBridgeMode;
-    pAbc->Status  = Abc_NtkDarPdr( pNtk, pPars );
-    pAbc->nFrames = pNtk->vSeqModelVec ? -1 : pPars->iFrame;
-    Abc_FrameReplacePoStatuses( pAbc, &pPars->vOutMap );
-    if ( pNtk->vSeqModelVec )
-        Abc_FrameReplaceCexVec( pAbc, &pNtk->vSeqModelVec );
-    else
-        Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: pdr [-MFCRTHG <num>] [-axrmsipdgvwzh]\n" );
-    Abc_Print( -2, "\t         model checking using property directed reachability (aka IC3)\n" );
-    Abc_Print( -2, "\t         pioneered by Aaron Bradley (http://ecee.colorado.edu/~bradleya/ic3/)\n" );
-    Abc_Print( -2, "\t         with improvements by Niklas Een (http://een.se/niklas/)\n" );
-    Abc_Print( -2, "\t-M num : limit on unused vars to trigger SAT solver recycling [default = %d]\n",       pPars->nRecycle );
-    Abc_Print( -2, "\t-F num : limit on timeframes explored to stop computation [default = %d]\n",           pPars->nFrameMax );
-    Abc_Print( -2, "\t-C num : limit on conflicts in one SAT call (0 = no limit) [default = %d]\n",          pPars->nConfLimit );
-    Abc_Print( -2, "\t-R num : limit on proof obligations before a restart (0 = no limit) [default = %d]\n", pPars->nRestLimit );
-    Abc_Print( -2, "\t-T num : runtime limit, in seconds (0 = no limit) [default = %d]\n",                   pPars->nTimeOut );
-    Abc_Print( -2, "\t-H num : runtime limit per output, in miliseconds (with \"-a\") [default = %d]\n",     pPars->nTimeOutOne );
-    Abc_Print( -2, "\t-G num : runtime gap since the last CEX (0 = no limit) [default = %d]\n",              pPars->nTimeOutGap );
-    Abc_Print( -2, "\t-a     : toggle solving all outputs even if one of them is SAT [default = %s]\n",      pPars->fSolveAll? "yes": "no" );
-    Abc_Print( -2, "\t-x     : toggle storing CEXes when solving all outputs [default = %s]\n",              pPars->fStoreCex? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle using more effort in generalization [default = %s]\n",                 pPars->fTwoRounds? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle using monolythic CNF computation [default = %s]\n",                    pPars->fMonoCnf? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle creating only shortest counter-examples [default = %s]\n",             pPars->fShortest? "yes": "no" );
-    Abc_Print( -2, "\t-i     : toggle clause pushing from an intermediate timeframe [default = %s]\n",       pPars->fShiftStart? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle reusing proof-obligations in the last timeframe [default = %s]\n",     pPars->fReuseProofOblig? "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle dumping invariant (valid if init state is all-0) [default = %s]\n",    pPars->fDumpInv? "yes": "no" );
-    Abc_Print( -2, "\t-g     : toggle skipping expensive generalization step [default = %s]\n",              pPars->fSkipGeneral? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing optimization summary [default = %s]\n",                       pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing detailed stats default = %s]\n",                              pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle suppressing report about solved outputs [default = %s]\n",             pPars->fNotVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandReconcile( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Cex_t * Llb4_Nonlin4NormalizeCex( Aig_Man_t * pAigOrg, Aig_Man_t * pAigRpm, Abc_Cex_t * pCexRpm );
-    Abc_Cex_t * pCex;
-    Abc_Ntk_t * pNtk1 = NULL, * pNtk2 = NULL;
-    Aig_Man_t * pAig1 = NULL, * pAig2 = NULL;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    if ( argc != globalUtilOptind + 2 && argc != globalUtilOptind )
-    {
-        Abc_Print( 1,"Does not seen to have two files names as arguments.\n" );
-        return 1;
-    }
-    if ( pAbc->pCex == NULL )
-    {
-        Abc_Print( 1,"There is no current counter-example.\n" );
-        return 1;
-    }
-
-    if ( argc == globalUtilOptind + 2 )
-    {
-        // derive networks
-        pNtk1 = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
-        if ( pNtk1 == NULL )
-            return 1;
-        pNtk2 = Io_Read( argv[globalUtilOptind+1], Io_ReadFileType(argv[globalUtilOptind+1]), 1, 0 );
-        if ( pNtk2 == NULL )
-        {
-            Abc_NtkDelete( pNtk1 );
-            return 1;
-        }
-        // create counter-examples
-        pAig1 = Abc_NtkToDar( pNtk1, 0, 0 );
-        pAig2 = Abc_NtkToDar( pNtk2, 0, 0 );
-    }
-    else if ( argc == globalUtilOptind )
-    {
-        if ( pAbc->pNtkCur == NULL )
-        {
-            Abc_Print( 1, "There is no AIG in the main-space.\n");
-            return 0;
-        }
-        if ( pAbc->pGia == NULL )
-        {
-            Abc_Print( 1, "There is no AIG in the &-space.\n");
-            return 0;
-        }
-        // create counter-examples
-        pAig1 = Abc_NtkToDar( pAbc->pNtkCur, 0, 0 );
-        pAig2 = Gia_ManToAigSimple( pAbc->pGia );
-    }
-    else assert( 0 );
-    pCex = Llb4_Nonlin4NormalizeCex( pAig1, pAig2, pAbc->pCex );
-    Aig_ManStop( pAig1 );
-    Aig_ManStop( pAig2 );
-    if ( pNtk2 )  Abc_NtkDelete( pNtk2 );
-    if ( pCex == NULL )
-    {
-        Abc_Print( 1,"Counter-example computation has failed.\n" );
-        if ( pNtk1 )  Abc_NtkDelete( pNtk1 );
-        return 1;
-    }
-
-    // replace the current network
-    if ( pNtk1 )
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtk1 );
-    // update the counter-example
-    pAbc->nFrames = pCex->iFrame;
-    Abc_FrameReplaceCex( pAbc, &pCex );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: reconcile [-h] <fileOrigin> <fileReparam>\n" );
-    Abc_Print( -2, "\t        reconciles current CEX with <fileOrigin>\n" );
-    Abc_Print( -2, "\t        More specifically:\n" );
-    Abc_Print( -2, "\t        (i) assumes that <fileReparam> is an AIG derived by input\n" );
-    Abc_Print( -2, "\t        reparametrization of <fileOrigin> without seq synthesis;\n" );
-    Abc_Print( -2, "\t        (ii) assumes that current CEX is valid for <fileReparam>;\n" );
-    Abc_Print( -2, "\t        (iii) derives new CEX for <fileOrigin> and sets this CEX\n" );
-    Abc_Print( -2, "\t        and <fileOrigin> to be current CEX and current network\n" );
-    Abc_Print( -2, "\t<fileOrigin>   : file name with the original AIG\n");
-    Abc_Print( -2, "\t<fileReparam>  : file name with the reparametrized AIG\n");
-    Abc_Print( -2, "\t        (if both file names are not given on the command line,\n");
-    Abc_Print( -2, "\t        original/reparam AIG has to be in the main-space/&-space)\n");
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCexSave( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pCex == NULL )
-    {
-        Abc_Print( -1, "Current CEX is not available..\n" );
-        return 1;
-    }
-    ABC_FREE( pAbc->pCex2 );
-    pAbc->pCex2 = Abc_CexDup( pAbc->pCex, -1 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cexsave [-h]\n" );
-    Abc_Print( -2, "\t        saves the current CEX into the internal storage\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCexLoad( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pCex2 == NULL )
-    {
-        Abc_Print( -1, "Saved CEX is not available.\n" );
-        return 1;
-    }
-    ABC_FREE( pAbc->pCex );
-    pAbc->pCex = Abc_CexDup( pAbc->pCex2, -1 );
-    // update status
-    pAbc->nFrames = pAbc->pCex2->iFrame;
-    pAbc->Status = 0;
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cexload [-h]\n" );
-    Abc_Print( -2, "\t        loads the current CEX from the internal storage\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCexCut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtkNew;
-    int c, iFrStart = 0;
-    int iFrStop     = ABC_INFINITY;
-    int fCombOnly   = 0;
-    int fUseOne     = 0;
-    int fAllFrames  = 0;
-    int fVerbose    = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FGcnmvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iFrStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iFrStart < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iFrStop = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iFrStop < 0 )
-                goto usage;
-            break;
-        case 'c':
-            fCombOnly ^= 1;
-            break;
-        case 'n':
-            fUseOne ^= 1;
-            break;
-        case 'm':
-            fAllFrames ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pCex == NULL )
-    {
-        Abc_Print( 1, "There is no current cex.\n");
-        return 0;
-    }
-    if ( pAbc->pNtkCur == NULL )
-    {
-        Abc_Print( 1, "There is no AIG in the &-space.\n");
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
-    {
-        Abc_Print( 1, "Current network is not an AIG.\n");
-        return 0;
-    }
-    if ( iFrStop == ABC_INFINITY )
-        iFrStop = pAbc->pCex->iFrame;
-
-    {
-        Aig_Man_t * pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
-        Aig_Man_t * pAigNew = Bmc_AigTargetStates( pAig, pAbc->pCex, iFrStart, iFrStop, fCombOnly, fUseOne, fAllFrames, fVerbose );
-        Aig_ManStop( pAig );
-        if ( pAigNew == NULL )
-        {
-            Abc_Print( 1, "Command has failed.\n");
-            return 0;
-        }
-        pNtkNew = Abc_NtkFromAigPhase( pAigNew );
-        pNtkNew->pName = Extra_UtilStrsav( pAbc->pNtkCur->pName );
-        Aig_ManStop( pAigNew );
-        // update the network
-        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
-    }
-/*
-    pGiaNew = Bmc_GiaTargetStates( pAbc->pGia, pAbc->pCex, iFrStart, iFrStop, fCombOnly, fUseOne, fVerbose );
-    if ( pGiaNew == NULL )
-    {
-        Abc_Print( 1, "Command has failed.\n");
-        return 0;
-    }
-    Abc_FrameUpdateGia( pAbc, pGiaNew );
-*/
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cexcut [-FG num] [-cnmvh]\n" );
-    Abc_Print( -2, "\t         creates logic for bad states using the current CEX\n" );
-    Abc_Print( -2, "\t-F num : 0-based number of the starting frame [default = %d]\n", iFrStart );
-    Abc_Print( -2, "\t-G num : 0-based number of the ending frame [default = %d]\n",   iFrStop );
-    Abc_Print( -2, "\t-c     : toggle outputting unate combinational circuit [default = %s]\n",  fCombOnly? "yes": "no" );
-    Abc_Print( -2, "\t-n     : toggle generating only one bad state [default = %s]\n", fUseOne? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle generating bad states for all frames after G [default = %s]\n", fAllFrames? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",  fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCexMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Cex_t * pCexNew;
-    int c;
-    int iFrStart = 0;
-    int iFrStop  = ABC_INFINITY;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FGvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iFrStart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iFrStart < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iFrStop = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iFrStop < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pCex == NULL )
-    {
-        Abc_Print( 1, "There is no current cex.\n");
-        return 0;
-    }
-    if ( pAbc->pCex2 == NULL )
-    {
-        Abc_Print( 1, "There is no saved cex.\n");
-        return 0;
-    }
-    if ( iFrStop - iFrStart + pAbc->pCex->iPo < pAbc->pCex->iFrame )
-    {
-        Abc_Print( 1, "Current CEX does not allow to shorten the saved CEX.\n");
-        return 0;
-    }
-    pCexNew = Abc_CexMerge( pAbc->pCex2, pAbc->pCex, iFrStart, iFrStop );
-    if ( pCexNew == NULL )
-    {
-        Abc_Print( 1, "Merging CEXes has failed.\n");
-        return 0;
-    }
-    // replace the saved CEX
-    ABC_FREE( pAbc->pCex2 );
-    pAbc->pCex2 = pCexNew;
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cexmerge [-FG num] [-vh]\n" );
-    Abc_Print( -2, "\t         merges the current CEX into the saved one\n" );
-    Abc_Print( -2, "\t         and sets the resulting CEX as the saved one\n" );
-    Abc_Print( -2, "\t-F num : 0-based number of the starting frame [default = %d]\n", iFrStart );
-    Abc_Print( -2, "\t-G num : 0-based number of the ending frame [default = %d]\n",   iFrStop );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandCexMin( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk;
-    Abc_Cex_t * vCexNew = NULL;
-    int c;
-    int nConfLimit = 1000;
-    int nRounds    =    1;
-    int fVerbose   =    0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CRvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfLimit < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nRounds < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pCex == NULL )
-    {
-        Abc_Print( 1, "There is no current cex.\n");
-        return 0;
-    }
-
-    // check the main AIG
-    pNtk = Abc_FrameReadNtk(pAbc);
-    if ( pNtk == NULL )
-        Abc_Print( 1, "Main AIG: There is no current network.\n");
-    else if ( !Abc_NtkIsStrash(pNtk) )
-        Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
-    else if ( Abc_NtkPiNum(pNtk) != pAbc->pCex->nPis )
-        Abc_Print( 1, "Main AIG: The number of PIs (%d) is different from cex (%d).\n", Abc_NtkPiNum(pNtk), pAbc->pCex->nPis );
-//      else if ( Abc_NtkLatchNum(pNtk) != pAbc->pCex->nRegs )
-//          Abc_Print( 1, "Main AIG: The number of registers (%d) is different from cex (%d).\n", Abc_NtkLatchNum(pNtk), pAbc->pCex->nRegs );
-//      else if ( Abc_NtkPoNum(pNtk) <= pAbc->pCex->iPo )
-//          Abc_Print( 1, "Main AIG: The number of POs (%d) is less than the PO index in cex (%d).\n", Abc_NtkPoNum(pNtk), pAbc->pCex->iPo );
-    else
-    {
-        Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
-        Gia_Man_t * pGia = Gia_ManFromAigSimple( pAig );
-//        if ( !Gia_ManVerifyCex( pGia, pAbc->pCex, 0 ) )
-        int iPoOld = pAbc->pCex->iPo;
-        pAbc->pCex->iPo = Gia_ManFindFailedPoCex( pGia, pAbc->pCex, 0 );
-        Gia_ManStop( pGia );
-        if ( pAbc->pCex->iPo == -1 )
-        {
-            pAbc->pCex->iPo = iPoOld;
-            Abc_Print( -1, "Main AIG: The cex does not fail any outputs.\n" );
-            return 0;
-        }
-        else if ( iPoOld != pAbc->pCex->iPo )
-            Abc_Print( 0, "Main AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
-        // perform minimization
-        vCexNew = Saig_ManCexMinPerform( pAig, pAbc->pCex );
-        Aig_ManStop( pAig );
-        Abc_CexFree( vCexNew );
-//        Abc_FrameReplaceCex( pAbc, &vCexNew );
-
-//        Abc_Print( 1,"Implementation of this command is not finished.\n" );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: cexmin [-CR num] [-vh]\n" );
-    Abc_Print( -2, "\t         reduces the length of the counter-example\n" );
-    Abc_Print( -2, "\t-C num : the maximum number of conflicts [default = %d]\n", nConfLimit );
-    Abc_Print( -2, "\t-R num : the number of minimization rounds [default = %d]\n", nRounds );
-    Abc_Print( -2, "\t-v     : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandDualRail( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Vec_Int_t * Abc_NtkFindDcLatches( Abc_Ntk_t * pNtk );
-    Abc_Ntk_t * pNtk, * pNtkNew = NULL;
-    Aig_Man_t * pAig, * pAigNew;
-    Vec_Int_t * vDcFlops = NULL;
-    int c;
-    int nDualPis   = 0;
-    int fDualFfs   = 0;
-    int fDualDcFfs = 0;
-    int fMiterFfs  = 0;
-    int fComplPo   = 0;
-    int fCheckZero = 0;
-    int fCheckOne  = 0;
-    int fVerbose   = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Itxfczovh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nDualPis = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nDualPis < 0 )
-                goto usage;
-            break;
-        case 't':
-            fDualFfs ^= 1;
-            break;
-        case 'x':
-            fDualDcFfs ^= 1;
-            break;
-        case 'f':
-            fMiterFfs ^= 1;
-            break;
-        case 'c':
-            fComplPo ^= 1;
-            break;
-        case 'z':
-            fCheckZero ^= 1;
-            break;
-        case 'o':
-            fCheckOne ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    // check the main AIG
-    pNtk = Abc_FrameReadNtk(pAbc);
-    if ( pNtk == NULL )
-    {
-        Abc_Print( 1, "Main AIG: There is no current network.\n");
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
-        return 0;
-    }
-
-    if ( fDualDcFfs )
-        vDcFlops = Abc_NtkFindDcLatches( pNtk );
-
-    // transform
-    pAig = Abc_NtkToDar( pNtk, 0, 1 );
-    pAigNew = Saig_ManDupDual( pAig, vDcFlops, nDualPis, fDualFfs, fMiterFfs, fComplPo, fCheckZero, fCheckOne );
-    Aig_ManStop( pAig );
-    pNtkNew = Abc_NtkFromAigPhase( pAigNew );
-    pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
-    Aig_ManStop( pAigNew );
-    Vec_IntFreeP( &vDcFlops );
-
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: dualrail [-I num] [-txfczovh]\n" );
-    Abc_Print( -2, "\t         transforms the current AIG into a dual-rail miter\n" );
-    Abc_Print( -2, "\t         expressing the property \"at least one PO has ternary value\"\n" );
-    Abc_Print( -2, "\t         (to compute an initialization sequence, use switches \"-tfc\")\n" );
-    Abc_Print( -2, "\t-I num : the number of first PIs interpreted as ternary [default = %d]\n", nDualPis );
-    Abc_Print( -2, "\t-t     : toggle ternary flop init values for all flops [default = %s]\n", fDualFfs? "yes": "const0 init values" );
-    Abc_Print( -2, "\t-x     : toggle ternary flop init values for DC-valued flops [default = %s]\n", fDualDcFfs? "yes": "const0 init values" );
-    Abc_Print( -2, "\t-f     : toggle mitering flops instead of POs [default = %s]\n", fMiterFfs? "flops": "POs" );
-    Abc_Print( -2, "\t-c     : toggle complementing the miter output [default = %s]\n", fComplPo? "yes": "no" );
-    Abc_Print( -2, "\t-z     : toggle checking PO==0 instead of PO==X [default = %s]\n", fCheckZero? "yes": "no" );
-    Abc_Print( -2, "\t-o     : toggle checking PO==1 instead of PO==X [default = %s]\n", fCheckOne? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandBlockPo( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkNew = NULL;
-    Aig_Man_t * pAig;
-    int c;
-    int nCycles = 0;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCycles = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCycles < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    // check the main AIG
-    pNtk = Abc_FrameReadNtk(pAbc);
-    if ( pNtk == NULL )
-    {
-        Abc_Print( 1, "Main AIG: There is no current network.\n");
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
-        return 0;
-    }
-    if ( nCycles == 0 )
-    {
-        Abc_Print( 1, "The number of time frame is 0. The circuit is left unchanged.\n" );
-        return 0;
-    }
-
-    // transform
-    pAig = Abc_NtkToDar( pNtk, 0, 1 );
-    Saig_ManBlockPo( pAig, nCycles );
-    pNtkNew = Abc_NtkFromAigPhase( pAig );
-    Aig_ManStop( pAig );
-    // transfer the name
-    pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
-    pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: blockpo [-F num] [-fvh]\n" );
-    Abc_Print( -2, "\t         forces the miter outputs to be \"true\" in the first F frames\n" );
-    Abc_Print( -2, "\t-F num : the number of time frames [default = %d]\n", nCycles );
-    Abc_Print( -2, "\t-v     : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandIso( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk, * pNtkNew = NULL;
-    Aig_Man_t * pAig, * pTemp;
-    Vec_Ptr_t * vPosEquivs = NULL;
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            Abc_Print( -2, "Unknown switch.\n");
-            goto usage;
-        }
-    }
-
-    // check the main AIG
-    pNtk = Abc_FrameReadNtk(pAbc);
-    if ( pNtk == NULL )
-    {
-        Abc_Print( 1, "Main AIG: There is no current network.\n");
-        return 0;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
-        return 0;
-    }
-    if ( Abc_NtkPoNum(pNtk) == 1 )
-    {
-        Abc_Print( 1, "Current AIG has only one PO. Transformation is not performed.\n");
-        return 0;
-    }
-
-    // transform
-    pAig = Abc_NtkToDar( pNtk, 0, 1 );
-    pTemp = Saig_ManIsoReduce( pAig, &vPosEquivs, fVerbose );
-    pNtkNew = Abc_NtkFromAigPhase( pTemp );
-    Aig_ManStop( pTemp );
-    Aig_ManStop( pAig );
-
-    // update the internal storage of PO equivalences
-    Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
-
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: iso [-vh]\n" );
-    Abc_Print( -2, "\t         removes POs with isomorphic sequential COI\n" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTraceStart( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command is applicable to AIGs.\n" );
-        return 1;
-    }
-/*
-    Abc_HManStart();
-    if ( !Abc_HManPopulate( pNtk ) )
-    {
-        Abc_Print( -1, "Failed to start the tracing database.\n" );
-        return 1;
-    }
-*/
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: trace_start [-h]\n" );
-    Abc_Print( -2, "\t        starts verification tracing\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandTraceCheck( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pNtk == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash(pNtk) )
-    {
-        Abc_Print( -1, "This command is applicable to AIGs.\n" );
-        return 1;
-    }
-/*
-    if ( !Abc_HManIsRunning(pNtk) )
-    {
-        Abc_Print( -1, "The tracing database is not available.\n" );
-        return 1;
-    }
-
-    if ( !Abc_HManVerify( 1, pNtk->Id ) )
-        Abc_Print( -1, "Verification failed.\n" );
-    Abc_HManStop();
-*/
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: trace_check [-h]\n" );
-    Abc_Print( -2, "\t        checks the current network using verification trace\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Read( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pAig;
-    FILE * pFile;
-    char ** pArgvNew;
-    char * FileName, * pTemp;
-    int c, nArgcNew;
-    int fUseMini = 0;
-    int fVerbose = 0;
-    int fSkipStrash = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "smvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fSkipStrash ^= 1;
-            break;
-        case 'm':
-            fUseMini ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "There is no file name.\n" );
-        return 1;
-    }
-
-    // get the input file name
-    FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", ".blif", ".pla", ".eqn", ".bench" )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-
-    if ( fUseMini )
-        pAig = Gia_ManReadMiniAig( FileName );
-    else
-        pAig = Gia_AigerRead( FileName, fSkipStrash, 0 );
-    Abc_FrameUpdateGia( pAbc, pAig );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &r [-smvh] <file>\n" );
-    Abc_Print( -2, "\t         reads the current AIG from the AIGER file\n" );
-    Abc_Print( -2, "\t-s     : toggles structural hashing while reading [default = %s]\n", !fSkipStrash? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggles reading MiniAIG rather than AIGER file [default = %s]\n", fUseMini? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : the file name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9ReadBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose );
-    Gia_Man_t * pAig;
-    FILE * pFile;
-    char ** pArgvNew;
-    char * FileName, * pTemp;
-    int nArgcNew;
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "There is no file name.\n" );
-        return 1;
-    }
-
-    // get the input file name
-    FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".blif", NULL, NULL, NULL, NULL )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-
-    pAig = Abc_NtkHieCecTest( FileName, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pAig );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &read_blif [-vh] <file>\n" );
-    Abc_Print( -2, "\t         a specialized reader for hierarchical BLIF files\n" );
-    Abc_Print( -2, "\t         (for general-purpose BLIFs, please use \"read_blif\")\n" );
-    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : the file name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9ReadCBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, char * pModelName, int fVerbose );
-    Gia_Man_t * pAig;
-    FILE * pFile;
-    char ** pArgvNew;
-    char * FileName, * pTemp;
-    char * pModelName = NULL;
-    int nArgcNew;
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Mvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pModelName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "There is no file name.\n" );
-        return 1;
-    }
-
-    // get the input file name
-    FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".cblif", NULL, NULL, NULL, NULL )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-
-    pAig = Abc_NtkHieCecTest2( FileName, pModelName, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pAig );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &read_cblif [-M name] [-vh] <file>\n" );
-    Abc_Print( -2, "\t         reads CBLIF file and collapse it into an AIG\n" );
-    Abc_Print( -2, "\t-M name: module name to collapse [default = <root_module>]\n" );
-    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : the file name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9ReadStg( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pAig;
-    FILE * pFile;
-    char * FileName, ** pArgvNew;
-    int c, nArgcNew;
-    int kHot = 1;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Kvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            kHot = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( kHot < 1 || kHot > 5 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "There is no file name.\n" );
-        return 1;
-    }
-
-    // get the input file name
-    FileName = pArgvNew[0];
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        return 1;
-    }
-    fclose( pFile );
-
-    pAig = Gia_ManStgRead( FileName, kHot, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pAig );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &read_stg [-K <num>] [-vh] <file>\n" );
-    Abc_Print( -2, "\t         reads STG file and generates K-hot-encoded AIG\n" );
-    Abc_Print( -2, "\t-K num : the K parameter for hotness of the encoding (1 <= K <= 5) [default = %d]\n", kHot );
-    Abc_Print( -2, "\t-v     : toggles printing state codes [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : the file name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Get( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Aig_Man_t * Abc_NtkToDarChoices( Abc_Ntk_t * pNtk );
-    extern Vec_Ptr_t * Abc_NtkCollectCiNames( Abc_Ntk_t * pNtk );
-    extern Vec_Ptr_t * Abc_NtkCollectCoNames( Abc_Ntk_t * pNtk );
-    Abc_Ntk_t * pStrash;
-    Aig_Man_t * pAig;
-    Gia_Man_t * pGia, * pTemp;
-    char * pInits;
-    int c, fMapped = 0, fNames = 0, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "mnvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'm':
-            fMapped ^= 1;
-            break;
-        case 'n':
-            fNames ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pNtkCur == NULL )
-    {
-        Abc_Print( -1, "There is no current network\n" );
-        return 1;
-    }
-    if ( !Abc_NtkIsStrash( pAbc->pNtkCur ) )
-    {
-        if ( fMapped )
-        {
-            assert( Abc_NtkIsLogic(pAbc->pNtkCur) );
-            Abc_NtkToAig( pAbc->pNtkCur );
-            pGia = Abc_NtkAigToGia( pAbc->pNtkCur );
-        }
-        else
-        {
-            // derive comb GIA
-            pStrash = Abc_NtkStrash( pAbc->pNtkCur, 0, 1, 0 );
-            pAig = Abc_NtkToDar( pStrash, 0, 0 );
-            Abc_NtkDelete( pStrash );
-            pGia = Gia_ManFromAig( pAig );
-            Aig_ManStop( pAig );
-            // perform undc/zero
-            pInits = Abc_NtkCollectLatchValuesStr( pAbc->pNtkCur );
-            pGia = Gia_ManDupZeroUndc( pTemp = pGia, pInits, fVerbose );
-            Gia_ManStop( pTemp );
-            ABC_FREE( pInits );
-        }
-    }
-    else
-    {
-        if ( Abc_NtkGetChoiceNum(pAbc->pNtkCur) )
-            pAig = Abc_NtkToDarChoices( pAbc->pNtkCur );
-        else
-            pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
-        pGia = Gia_ManFromAig( pAig );
-        Aig_ManStop( pAig );
-    }
-    // replace
-    if ( fNames )
-    {
-        pGia->vNamesIn  = Abc_NtkCollectCiNames( pAbc->pNtkCur );
-        pGia->vNamesOut = Abc_NtkCollectCoNames( pAbc->pNtkCur );
-    }
-    Abc_FrameUpdateGia( pAbc, pGia );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &get [-mnvh] <file>\n" );
-    Abc_Print( -2, "\t         converts the current network into GIA and moves it to the &-space\n" );
-    Abc_Print( -2, "\t         (if the network is a sequential logic network, normalizes the flops\n" );
-    Abc_Print( -2, "\t         to have const-0 initial values, equivalent to \"undc; st; zero\")\n" );
-    Abc_Print( -2, "\t-m     : toggles preserving the current mapping [default = %s]\n", fMapped? "yes": "no" );
-    Abc_Print( -2, "\t-n     : toggles saving CI/CO names of the AIG [default = %s]\n", fNames? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : the file name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Abc_NtkFromDarChoices( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan );
-    Aig_Man_t * pMan;
-    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    int c, fVerbose = 0;
-    int fStatusClear = 1;
-
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 's':
-            fStatusClear ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Empty network.\n" );
-        return 1;
-    }
-    if ( Gia_ManHasMapping(pAbc->pGia) )
-    {
-        extern Abc_Ntk_t * Abc_NtkFromMappedGia( Gia_Man_t * p );
-        pNtk = Abc_NtkFromMappedGia( pAbc->pGia );
-    }
-    else if ( Gia_ManHasCellMapping(pAbc->pGia) )
-    {
-        extern Abc_Ntk_t * Abc_NtkFromCellMappedGia( Gia_Man_t * p );
-        pNtk = Abc_NtkFromCellMappedGia( pAbc->pGia );
-    }
-    else if ( Gia_ManHasDangling(pAbc->pGia) == 0 )
-    {
-        pMan = Gia_ManToAig( pAbc->pGia, 0 );
-        pNtk = Abc_NtkFromAigPhase( pMan );
-        pNtk->pName = Extra_UtilStrsav(pMan->pName);
-        Aig_ManStop( pMan );
-    }
-    else
-    {
-        Abc_Ntk_t * pNtkNoCh;
-//        Abc_Print( -1, "Transforming AIG with %d choice nodes.\n", Gia_ManEquivCountClasses(pAbc->pGia) );
-        // create network without choices
-        pMan = Gia_ManToAig( pAbc->pGia, 0 );
-        pNtkNoCh = Abc_NtkFromAigPhase( pMan );
-        pNtkNoCh->pName = Extra_UtilStrsav(pMan->pName);
-        Aig_ManStop( pMan );
-        // derive network with choices
-        pMan = Gia_ManToAig( pAbc->pGia, 1 );
-        pNtk = Abc_NtkFromDarChoices( pNtkNoCh, pMan );
-        Abc_NtkDelete( pNtkNoCh );
-        Aig_ManStop( pMan );
-    }
-    // transfer PI names to pNtk
-    if ( pAbc->pGia->vNamesIn )
-    {
-        Abc_Obj_t * pObj;
-        int i;
-        Abc_NtkForEachCi( pNtk, pObj, i ) {
-            if (i < Vec_PtrSize(pAbc->pGia->vNamesIn)) {
-                Nm_ManDeleteIdName(pNtk->pManName, pObj->Id);
-                Abc_ObjAssignName( pObj, (char *)Vec_PtrEntry(pAbc->pGia->vNamesIn, i), NULL );
-            }
-        }
-    }
-    // transfer PO names to pNtk
-    if ( pAbc->pGia->vNamesOut )
-    {
-        Abc_Obj_t * pObj;
-        int i;
-        Abc_NtkForEachCo( pNtk, pObj, i ) {
-            if (i < Vec_PtrSize(pAbc->pGia->vNamesOut)) {
-                Nm_ManDeleteIdName(pNtk->pManName, pObj->Id);
-                Abc_ObjAssignName( pObj, (char *)Vec_PtrEntry(pAbc->pGia->vNamesOut, i), NULL );
-            }
-        }
-    }
-    // replace the current network
-    Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
-    if ( fStatusClear )
-        Abc_FrameClearVerifStatus( pAbc );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &put [-svh]\n" );
-    Abc_Print( -2, "\t         transfer the current network into the old ABC\n" );
-    Abc_Print( -2, "\t-s     : toggle clearning verification status [default = %s]\n", fStatusClear? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char * pFileName;
-    char ** pArgvNew;
-    int c, nArgcNew;
-    int fUnique = 0;
-    int fMiniAig = 0;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "umvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'u':
-            fUnique ^= 1;
-            break;
-        case 'm':
-            fMiniAig ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "There is no file name.\n" );
-        return 1;
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Write(): There is no AIG to write.\n" );
-        return 1;
-    }
-    pFileName = argv[globalUtilOptind];
-    if ( fUnique )
-    {
-        Gia_Man_t * pGia = Gia_ManIsoCanonicize( pAbc->pGia, fVerbose );
-        Gia_AigerWriteSimple( pGia, pFileName );
-        Gia_ManStop( pGia );
-    }
-    else if ( fMiniAig )
-        Gia_ManWriteMiniAig( pAbc->pGia, pFileName );
-    else
-        Gia_AigerWrite( pAbc->pGia, pFileName, 0, 0 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &w [-umvh] <file>\n" );
-    Abc_Print( -2, "\t         writes the current AIG into the AIGER file\n" );
-    Abc_Print( -2, "\t-u     : toggle writing canonical AIG structure [default = %s]\n", fUnique? "yes" : "no" );
-    Abc_Print( -2, "\t-m     : toggle writing MiniAIG rather than AIGER [default = %s]\n", fMiniAig? "yes" : "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : the file name\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gps_Par_t Pars, * pPars = &Pars;
-    int c;
-    memset( pPars, 0, sizeof(Gps_Par_t) );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Dtpcnlmash" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 't':
-            pPars->fTents ^= 1;
-            break;
-        case 'p':
-            pPars->fSwitch ^= 1;
-            break;
-        case 'c':
-            pPars->fCut ^= 1;
-            break;
-        case 'n':
-            pPars->fNpn ^= 1;
-            break;
-        case 'l':
-            pPars->fLutProf ^= 1;
-            break;
-        case 'm':
-            pPars->fMuxXor ^= 1;
-            break;
-        case 'a':
-            pPars->fMiter ^= 1;
-            break;
-        case 's':
-            pPars->fSkipMap ^= 1;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pPars->pDumpFile = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Ps(): There is no AIG.\n" );
-        return 1;
-    }
-    Gia_ManPrintStats( pAbc->pGia, pPars );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &ps [-tpcnlmash] [-D file]\n" );
-    Abc_Print( -2, "\t          prints stats of the current AIG\n" );
-    Abc_Print( -2, "\t-t      : toggle printing BMC tents [default = %s]\n",                pPars->fTents? "yes": "no" );
-    Abc_Print( -2, "\t-p      : toggle printing switching activity [default = %s]\n",       pPars->fSwitch? "yes": "no" );
-    Abc_Print( -2, "\t-c      : toggle printing the size of frontier cut [default = %s]\n", pPars->fCut? "yes": "no" );
-    Abc_Print( -2, "\t-n      : toggle printing NPN classes of functions [default = %s]\n", pPars->fNpn? "yes": "no" );
-    Abc_Print( -2, "\t-l      : toggle printing LUT size profile [default = %s]\n",         pPars->fLutProf? "yes": "no" );
-    Abc_Print( -2, "\t-m      : toggle printing MUX/XOR statistics [default = %s]\n",       pPars->fMuxXor? "yes": "no" );
-    Abc_Print( -2, "\t-a      : toggle printing miter statistics [default = %s]\n",         pPars->fMiter? "yes": "no" );
-    Abc_Print( -2, "\t-s      : skip mapping statistics even if mapped [default = %s]\n",   pPars->fSkipMap? "yes": "no" );
-    Abc_Print( -2, "\t-D file : file name to dump statistics [default = none]\n" );
-    Abc_Print( -2, "\t-h      : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9PFan( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    int nNodes = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nNodes = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nNodes < 0 )
-                goto usage;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9PFan(): There is no AIG.\n" );
-        return 1;
-    }
-    Gia_ManPrintFanio( pAbc->pGia, nNodes );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &pfan [-N num] [-h]\n" );
-    Abc_Print( -2, "\t         prints fanin/fanout statistics\n" );
-    Abc_Print( -2, "\t-N num : the number of high-fanout nodes to explore [default = %d]\n", nNodes );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9PSig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    int fSetReset = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "rh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'r':
-            fSetReset ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9PSigs(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9PSigs(): Works only for sequential circuits.\n" );
-        return 1;
-    }
-    Gia_ManDetectSeqSignals( pAbc->pGia, fSetReset, 1 );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &psig [-rh]\n" );
-    Abc_Print( -2, "\t         prints enable/set/reset statistics\n" );
-    Abc_Print( -2, "\t-r     : toggle printing set/reset signals [default = %s]\n", fSetReset? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Status( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Status(): There is no AIG.\n" );
-        return 1;
-    }
-    Gia_ManPrintMiterStatus( pAbc->pGia );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &status [-h]\n" );
-    Abc_Print( -2, "\t         prints status of the miter\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9MuxProfile( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Gia_ManMuxProfiling( Gia_Man_t * p );
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9MuxProfile(): There is no AIG.\n" );
-        return 1;
-    }
-    Gia_ManMuxProfiling( pAbc->pGia );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &mux_profile [-h]\n" );
-    Abc_Print( -2, "\t         profile MUXes appearing in the design\n" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Show( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Aig_Man_t * pMan;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Show(): There is no AIG.\n" );
-        return 1;
-    }
-    pMan = Gia_ManToAigSimple( pAbc->pGia );
-    Aig_ManShow( pMan, 0, NULL );
-    Aig_ManStop( pMan );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &show [-h]\n" );
-    Abc_Print( -2, "\t        shows the current AIG using GSView\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Strash( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, Limit = 2;
-    int fAddStrash = 0;
-    int fCollapse = 0;
-    int fAddMuxes = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Lacmh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Limit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Limit < 0 )
-                goto usage;
-            break;
-        case 'a':
-            fAddStrash ^= 1;
-            break;
-        case 'c':
-            fCollapse ^= 1;
-            break;
-        case 'm':
-            fAddMuxes ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Strash(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManHasMapping(pAbc->pGia) )
-    {
-        pTemp = (Gia_Man_t *)Dsm_ManDeriveGia( pAbc->pGia, fAddMuxes );
-        if ( !Abc_FrameReadFlag("silentmode") )
-            printf( "Performed delay-oriented unmapping.\n" );
-    }
-    else if ( fAddMuxes )
-    {
-        if ( pAbc->pGia->pMuxes )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9Strash(): The AIG already has MUXes.\n" );
-            return 1;
-        }
-        pTemp = Gia_ManDupMuxes( pAbc->pGia, Limit );
-        if ( !Abc_FrameReadFlag("silentmode") )
-            printf( "Generated AND/XOR/MUX graph.\n" );
-    }
-    else if ( fCollapse && pAbc->pGia->pAigExtra )
-    {
-        Gia_Man_t * pNew = Gia_ManDupUnnormalize( pAbc->pGia );
-        pNew->pManTime = pAbc->pGia->pManTime;
-        pTemp = Gia_ManDupCollapse( pNew, pAbc->pGia->pAigExtra, NULL );
-        pNew->pManTime = NULL;
-        Gia_ManStop( pNew );
-        if ( !Abc_FrameReadFlag("silentmode") )
-            printf( "Collapsed AIG with boxes with logic of the boxes.\n" );
-    }
-    else if ( pAbc->pGia->pMuxes )
-    {
-        pTemp = Gia_ManDupNoMuxes( pAbc->pGia );
-        if ( !Abc_FrameReadFlag("silentmode") )
-            printf( "Generated AIG from AND/XOR/MUX graph.\n" );
-    }
-    else
-    {
-        pTemp = Gia_ManRehash( pAbc->pGia, fAddStrash );
-        if ( !Abc_FrameReadFlag("silentmode") )
-            printf( "Rehashed the current AIG.\n" );
-    }
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &st [-L num] [-acmh]\n" );
-    Abc_Print( -2, "\t         performs structural hashing\n" );
-    Abc_Print( -2, "\t-a     : toggle additional hashing [default = %s]\n", fAddStrash? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle collapsing hierarchical AIG [default = %s]\n", fCollapse? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle converting to larger gates [default = %s]\n", fAddMuxes? "yes": "no" );
-    Abc_Print( -2, "\t-L num : create MUX when sum of refs does not exceed this limit [default = %d]\n", Limit );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Topand( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, fVerbose = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Topand(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) > 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Topand(): Can only be applied to a combinational miter.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManDupTopAnd( pAbc->pGia, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &topand [-vh]\n" );
-    Abc_Print( -2, "\t        performs AND decomposition for combinational miter\n" );
-    Abc_Print( -2, "\t-v    : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Add1Hot( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, fVerbose = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Add1Hot(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManDupOneHot( pAbc->pGia );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &add1hot [-vh]\n" );
-    Abc_Print( -2, "\t        adds 1-hotness constraints as additional primary outputs\n" );
-    Abc_Print( -2, "\t-v    : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Cof( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, fVerbose = 0;
-    int iVar = 0, nLimFan = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "VLvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'V':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iVar = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iVar < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLimFan = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLimFan < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Cof(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( nLimFan )
-    {
-        Abc_Print( -1, "Cofactoring all variables whose fanout count is higher than %d.\n", nLimFan );
-        pTemp = Gia_ManDupCofAll( pAbc->pGia, nLimFan, fVerbose );
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    }
-    else if ( iVar )
-    {
-        Abc_Print( -1, "Cofactoring one variable with object ID %d.\n", iVar );
-        pTemp = Gia_ManDupCof( pAbc->pGia, iVar );
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    }
-    else
-    {
-        Abc_Print( -1, "One of the paramters, -V <num> or -L <num>, should be set on the command line.\n" );
-        goto usage;
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &cof [-VL num] [-vh]\n" );
-    Abc_Print( -2, "\t         performs cofactoring w.r.t. variable(s)\n" );
-    Abc_Print( -2, "\t-V num : the zero-based ID of one variable to cofactor [default = %d]\n", iVar );
-    Abc_Print( -2, "\t-L num : cofactor vars with fanout count higher than this [default = %d]\n", nLimFan );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp, * pTemp2;
-    int c;
-    int OutValue = -1;
-    int fTrimCis = 1;
-    int fTrimCos = 1;
-    int fDualOut = 0;
-    int fPoFedByPi = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Viocdh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'V':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            OutValue = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( OutValue < 0 )
-                goto usage;
-            break;
-        case 'i':
-            fTrimCis ^= 1;
-            break;
-        case 'o':
-            fTrimCos ^= 1;
-            break;
-        case 'c':
-            fPoFedByPi ^= 1;
-            break;
-        case 'd':
-            fDualOut ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Trim(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManDupTrimmed( pAbc->pGia, fTrimCis, fTrimCos, fDualOut, OutValue );
-    if ( fPoFedByPi )
-    {
-        extern Gia_Man_t * Gia_ManDupTrimmed2( Gia_Man_t * p );
-        pTemp = Gia_ManDupTrimmed2( pTemp2 = pTemp );
-        Gia_ManStop( pTemp2 );
-    }
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &trim [-V num] [-iocdh]\n" );
-    Abc_Print( -2, "\t         removes PIs without fanout and PO driven by constants\n" );
-    Abc_Print( -2, "\t-V num : the value (0 or 1) of POs to remove [default = both]\n" );
-    Abc_Print( -2, "\t-i     : toggle removing PIs [default = %s]\n", fTrimCis? "yes": "no" );
-    Abc_Print( -2, "\t-o     : toggle removing POs [default = %s]\n", fTrimCos? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle additionally removing POs fed by PIs [default = %s]\n", fPoFedByPi? "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle using dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Dfs( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c;
-    int fNormal  = 0;
-    int fReverse = 0;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "nrvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'n':
-            fNormal ^= 1;
-            break;
-        case 'r':
-            fReverse ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Dfs(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( fNormal )
-    {
-        pTemp = Gia_ManDupOrderAiger( pAbc->pGia );
-        if ( fVerbose )
-            Abc_Print( -1, "AIG objects are reordered as follows: CIs, ANDs, COs.\n" );
-    }
-    else if ( fReverse )
-    {
-        pTemp = Gia_ManDupOrderDfsReverse( pAbc->pGia );
-        if ( fVerbose )
-            Abc_Print( -1, "AIG objects are reordered in the reserve DFS order.\n" );
-    }
-    else
-    {
-        pTemp = Gia_ManDupOrderDfs( pAbc->pGia );
-        if ( fVerbose )
-            Abc_Print( -1, "AIG objects are reordered in the DFS order.\n" );
-    }
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &dfs [-nrvh]\n" );
-    Abc_Print( -2, "\t        orders objects in the DFS order\n" );
-    Abc_Print( -2, "\t-n    : toggle using normalized ordering [default = %s]\n", fNormal? "yes": "no" );
-    Abc_Print( -2, "\t-r    : toggle using reverse DFS ordering [default = %s]\n", fReverse? "yes": "no" );
-    Abc_Print( -2, "\t-v    : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Sim( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_ParSim_t Pars, * pPars = &Pars;
-    char * pFileName = NULL;
-    int c;
-    Gia_ManSimSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FWNTImvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIters < 0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->RandSeed = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->RandSeed < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            if ( pFileName == NULL )
-                goto usage;
-            break;
-        case 'm':
-            pPars->fCheckMiter ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Sim(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    if ( pFileName != NULL )
-    {
-        extern void Gia_ManSimSimulatePattern( Gia_Man_t * p, char * pFileIn, char * pFileOut );
-        char pFileNameOut[1000];
-        char * pNameGeneric = Extra_FileNameGeneric(pFileName);
-        assert( strlen(pNameGeneric) < 900 );
-        sprintf( pFileNameOut, "%s_out.%s", pNameGeneric, Extra_FileNameExtension(pFileName) );
-        ABC_FREE( pNameGeneric );
-        Gia_ManSimSimulatePattern( pAbc->pGia, pFileName, pFileNameOut );
-        return 1;
-    }
-
-    pAbc->nFrames = -1;
-    if ( Gia_ManSimSimulate( pAbc->pGia, pPars ) )
-        pAbc->Status =  0;
-    else
-        pAbc->Status = -1;
-    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
-//    if ( pLogFileName )
-//        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&sim" );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &sim [-FWNT num] [-mvh] -I <file>\n" );
-    Abc_Print( -2, "\t         performs random simulation of the sequential miter\n" );
-    Abc_Print( -2, "\t         (if candidate equivalences are defined, performs refinement)\n" );
-    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nIters );
-    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
-    Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n", pPars->RandSeed );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t-I file: (optional) file with input patterns (one line per frame, as many as PIs)\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Sim3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Ssw_RarSimulateGia( Gia_Man_t * p, Ssw_RarPars_t * pPars );
-    Ssw_RarPars_t Pars, * pPars = &Pars;
-    int c;
-    Ssw_RarSetDefaultParams( pPars );
-    // parse command line
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTGgvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBinSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBinSize < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRestart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRestart < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRandSeed = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRandSeed < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOut < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOutGap < 0 )
-                goto usage;
-            break;
-        case 'g':
-            pPars->fUseFfGrouping ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Sim3(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Sim3(): This command works only for sequential AIGs.\n" );
-        return 0;
-    }
-    pAbc->Status = Ssw_RarSimulateGia( pAbc->pGia, pPars );
-    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &sim3 [-FWBRNT num] [-gvh]\n" );
-    Abc_Print( -2, "\t         performs random simulation of the sequential miter\n" );
-    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n",       pPars->nFrames );
-    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n",        pPars->nWords );
-    Abc_Print( -2, "\t-B num : the number of flops in one bin [default = %d]\n",         pPars->nBinSize );
-    Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n",        pPars->nRounds );
-    Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n",  pPars->nRestart );
-    Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n",  pPars->nRandSeed );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n",   pPars->TimeOut );
-    Abc_Print( -2, "\t-g     : toggle heuristic flop grouping [default = %s]\n",    pPars->fUseFfGrouping? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",    pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Resim( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParSim_t Pars, * pPars = &Pars;
-    int c, RetValue;
-    Cec_ManSimSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'm':
-            pPars->fCheckMiter ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Resim(): There is no AIG.\n" );
-        return 1;
-    }
-    RetValue = Cec_ManSeqResimulateCounter( pAbc->pGia, pPars, pAbc->pCex );
-    pAbc->Status  = RetValue ? 0 : -1;
-    pAbc->nFrames = pAbc->pCex->iFrame;
-//    Abc_FrameReplaceCex( pAbc, &pAbc->pCex );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &resim [-F num] [-mvh]\n" );
-    Abc_Print( -2, "\t         resimulates equivalence classes using counter-example\n" );
-    Abc_Print( -2, "\t-F num : the number of additinal frames to simulate [default = %d]\n", pPars->nFrames );
-    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9SpecI( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Gia_CommandSpecI( Gia_Man_t * pGia, int nFrames, int nBTLimit, int fUseStart, int fCheckMiter, int fVerbose );
-    int nFrames     =   100;
-    int nBTLimit    = 25000;
-    int fUseStart   =     1;
-    int fCheckMiter =     1;
-    int fVerbose    =     0;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FCfmvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'f':
-            fUseStart ^= 1;
-            break;
-        case 'm':
-            fCheckMiter ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9SpecI(): There is no AIG.\n" );
-        return 1;
-    }
-    Gia_CommandSpecI( pAbc->pGia, nFrames, nBTLimit, fUseStart, fCheckMiter, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &speci [-FC num] [-fmvh]\n" );
-    Abc_Print( -2, "\t         refines equivalence classes using speculative reduction\n" );
-    Abc_Print( -2, "\t-F num : the max number of time frames [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
-    Abc_Print( -2, "\t-f     : toggle starting BMC from a later frame [default = %s]\n", fUseStart? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", fCheckMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Equiv( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParSim_t Pars, * pPars = &Pars;
-    int c;
-    Cec_ManSimSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WFRSTsmdvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nNonRefines = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nNonRefines < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 's':
-            pPars->fSeqSimulate ^= 1;
-            break;
-        case 'm':
-            pPars->fCheckMiter ^= 1;
-            break;
-        case 'd':
-            pPars->fDualOut ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Equiv(): There is no AIG.\n" );
-        return 1;
-    }
-    Cec_ManSimulation( pAbc->pGia, pPars );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &equiv [-WFRST num] [-smdvh]\n" );
-    Abc_Print( -2, "\t         computes candidate equivalence classes\n" );
-    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
-    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nFrames );
-    Abc_Print( -2, "\t-R num : the max number of simulation rounds [default = %d]\n", pPars->nRounds );
-    Abc_Print( -2, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-s     : toggle seq vs. comb simulation [default = %s]\n", pPars->fSeqSimulate? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-d     : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Equiv2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Ssw_SignalFilterGia( Gia_Man_t * p, int nFramesMax, int nConfMax, int nRounds, int TimeLimit, int TimeLimit2, Abc_Cex_t * pCex, int fLatchOnly, int fVerbose );
-    int nFramesMax =   20;
-    int nConfMax   =  500;
-    int nRounds    =   10;
-    int TimeLimit  =    0;
-    int TimeLimit2 =    0;
-    int fUseCex    =    0;
-    int fLatchOnly =    0;
-    int fVerbose   =    0;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FCRTSxlvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFramesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFramesMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfMax < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nRounds < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            TimeLimit2 = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( TimeLimit2 < 0 )
-                goto usage;
-            break;
-        case 'x':
-            fUseCex ^= 1;
-            break;
-        case 'l':
-            fLatchOnly ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Equiv2(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( 0, "Abc_CommandAbc9Equiv2(): There is no flops. Nothing is done.\n" );
-        return 0;
-    }
-    if ( fUseCex )
-    {
-        if ( pAbc->pCex == NULL )
-        {
-            Abc_Print( 0, "Abc_CommandAbc9Equiv2(): Counter-example is not available.\n" );
-            return 0;
-        }
-        if ( pAbc->pCex->nPis != Gia_ManPiNum(pAbc->pGia) )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9Equiv2(): The number of PIs differs in cex (%d) and in AIG (%d).\n",
-                pAbc->pCex->nPis, Gia_ManPiNum(pAbc->pGia) );
-            return 1;
-        }
-    }
-    Ssw_SignalFilterGia( pAbc->pGia, nFramesMax, nConfMax, nRounds, TimeLimit, TimeLimit2, fUseCex? pAbc->pCex: NULL, fLatchOnly, fVerbose );
-    pAbc->Status  = -1;
-//    pAbc->nFrames = pAbc->pCex->iFrame;
-//    Abc_FrameReplaceCex( pAbc, &pAbc->pCex );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &equiv2 [-FCRTS num] [-xlvh]\n" );
-    Abc_Print( -2, "\t         computes candidate equivalence classes\n" );
-    Abc_Print( -2, "\t-F num : the max number of frames for BMC [default = %d]\n", nFramesMax );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
-    Abc_Print( -2, "\t-R num : the max number of BMC rounds [default = %d]\n", nRounds );
-    Abc_Print( -2, "\t-T num : runtime limit in seconds for all rounds [default = %d]\n", TimeLimit );
-    Abc_Print( -2, "\t-S num : runtime limit in seconds for one round [default = %d]\n", TimeLimit2 );
-    Abc_Print( -2, "\t-x     : toggle using the current cex to perform refinement [default = %s]\n", fUseCex? "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle considering only latch output equivalences [default = %s]\n", fLatchOnly? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Equiv3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Ssw_RarSignalFilterGia( Gia_Man_t * p, Ssw_RarPars_t * pPars );
-    Ssw_RarPars_t Pars, * pPars = &Pars;
-    int c;
-    Ssw_RarSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTmxlvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBinSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBinSize < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRestart = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRestart < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRandSeed = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRandSeed < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOut < 0 )
-                goto usage;
-            break;
-        case 'm':
-            pPars->fMiter ^= 1;
-            break;
-        case 'x':
-            pPars->fUseCex ^= 1;
-            break;
-        case 'l':
-            pPars->fLatchOnly ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Equiv3(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( 0, "Abc_CommandAbc9Equiv3(): There is no flops. Nothing is done.\n" );
-        return 0;
-    }
-    if ( pPars->fUseCex )
-    {
-        if ( pPars->fMiter )
-        {
-            Abc_Print( 0, "Abc_CommandAbc9Equiv3(): Considering the miter as a circuit because the CEX is given.\n" );
-            pPars->fMiter = 0;
-        }
-        if ( pAbc->pCex == NULL )
-        {
-            Abc_Print( 0, "Abc_CommandAbc9Equiv3(): Counter-example is not available.\n" );
-            return 0;
-        }
-        if ( pAbc->pCex->nPis != Gia_ManPiNum(pAbc->pGia) )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9Equiv3(): The number of PIs differs in cex (%d) and in AIG (%d).\n",
-                pAbc->pCex->nPis, Gia_ManPiNum(pAbc->pGia) );
-            return 1;
-        }
-        pPars->pCex = pAbc->pCex;
-    }
-    pAbc->Status = Ssw_RarSignalFilterGia( pAbc->pGia, pPars );
-//    pAbc->nFrames = pAbc->pGia->pCexSeq->iFrame;
-    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &equiv3 [-FWRSNT num] [-mxlvh]\n" );
-    Abc_Print( -2, "\t         computes candidate equivalence classes\n" );
-    Abc_Print( -2, "\t-F num : the max number of frames for BMC [default = %d]\n",                   pPars->nFrames );
-    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n",                    pPars->nWords );
-    Abc_Print( -2, "\t-R num : the max number of simulation rounds [default = %d]\n",                pPars->nRounds );
-    Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n",              pPars->nRestart );
-    Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n",              pPars->nRandSeed );
-    Abc_Print( -2, "\t-T num : runtime limit in seconds for all rounds [default = %d]\n",            pPars->TimeOut );
-    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n",                       pPars->fMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-x     : toggle using the current CEX to perform refinement [default = %s]\n", pPars->fUseCex? "yes": "no" );
-    Abc_Print( -2, "\t-l     : toggle considering only latch output equivalences [default = %s]\n",  pPars->fLatchOnly? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",                pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParSmf_t Pars, * pPars = &Pars;
-    int c;
-    Cec_ManSmfSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WRFSMCTmdvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nNonRefines = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nNonRefines < 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nMinOutputs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nMinOutputs < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'm':
-            pPars->fCheckMiter ^= 1;
-            break;
-        case 'd':
-            pPars->fDualOut ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Resim(): There is no AIG.\n" );
-        return 1;
-    }
-    Cec_ManSeqSemiformal( pAbc->pGia, pPars );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &semi [-WRFSMCT num] [-mdvh]\n" );
-    Abc_Print( -2, "\t         performs semiformal refinement of equivalence classes\n" );
-    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
-    Abc_Print( -2, "\t-R num : the max number of rounds to simulate [default = %d]\n", pPars->nRounds );
-    Abc_Print( -2, "\t-F num : the max number of frames to unroll [default = %d]\n", pPars->nFrames );
-    Abc_Print( -2, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
-    Abc_Print( -2, "\t-M num : the min number of outputs of bounded SRM [default = %d]\n", pPars->nMinOutputs );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-d     : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Times( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, nTimes = 2, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nTimes = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nTimes < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Times(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManDupTimes( pAbc->pGia, nTimes );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &times [-N <num>] [-vh]\n" );
-    Abc_Print( -2, "\t         creates several \"parallel\" copies of the design\n" );
-    Abc_Print( -2, "\t-N num : number of copies to create [default = %d]\n", nTimes );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Frames( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Gia_Man_t * Gia_ManFrames2( Gia_Man_t * pAig, Gia_ParFra_t * pPars );
-
-    Gia_Man_t * pTemp;
-    Gia_ParFra_t Pars, * pPars = &Pars;
-    int c;
-    int nCofFanLit = 0;
-    int fNewAlgo = 0;
-    int fInitSpecial = 0;
-    Gia_ManFraSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FLsoibavh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCofFanLit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCofFanLit < 0 )
-                goto usage;
-            break;
-        case 's':
-            pPars->fDisableSt ^= 1;
-            break;
-        case 'o':
-            pPars->fOrPos ^= 1;
-            break;
-        case 'i':
-            pPars->fInit ^= 1;
-            break;
-        case 'b':
-            fInitSpecial ^= 1;
-            break;
-        case 'a':
-            fNewAlgo ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Frames(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    if ( fInitSpecial )
-        pTemp = Gia_ManFramesInitSpecial( pAbc->pGia, pPars->nFrames, pPars->fVerbose );
-    else if ( nCofFanLit )
-        pTemp = Gia_ManUnrollAndCofactor( pAbc->pGia, pPars->nFrames, nCofFanLit, pPars->fVerbose );
-    else if ( fNewAlgo )
-        pTemp = Gia_ManFrames2( pAbc->pGia, pPars );
-    else
-        pTemp = Gia_ManFrames( pAbc->pGia, pPars );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &frames [-FL <num>] [-soibavh]\n" );
-    Abc_Print( -2, "\t         unrolls the design for several timeframes\n" );
-    Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", pPars->nFrames );
-    Abc_Print( -2, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
-    Abc_Print( -2, "\t-s     : toggle disabling structural hashing [default = %s]\n", pPars->fDisableSt? "yes": "no" );
-    Abc_Print( -2, "\t-o     : toggle ORing corresponding POs [default = %s]\n", pPars->fOrPos? "yes": "no" );
-    Abc_Print( -2, "\t-i     : toggle initializing registers [default = %s]\n", pPars->fInit? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggle computing special AIG for BMC [default = %s]\n", fInitSpecial? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggle using new algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Retime( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c;
-    int nMaxIters = 100;
-    int fVerbose  =   0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nMaxIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nMaxIters < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Retime(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    pTemp = Gia_ManRetimeForward( pAbc->pGia, nMaxIters, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &retime [-N <num>] [-vh]\n" );
-    Abc_Print( -2, "\t         performs most-forward retiming\n" );
-    Abc_Print( -2, "\t-N num : the number of incremental iterations [default = %d]\n", nMaxIters );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Enable( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c;
-    int fRemove  = 0;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'r':
-            fRemove ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Enable(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( fRemove )
-        pTemp = Gia_ManRemoveEnables( pAbc->pGia );
-    else
-        pTemp = Gia_ManDupSelf( pAbc->pGia );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &enable [-rvh]\n" );
-    Abc_Print( -2, "\t         adds or removes flop enable signals\n" );
-    Abc_Print( -2, "\t-r     : toggle adding vs. removing enables [default = %s]\n", fRemove? "remove": "add" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Dc2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, fVerbose = 0;
-    int fUpdateLevel = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Dc2(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManCompress2( pAbc->pGia, fUpdateLevel, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &dc2 [-lvh]\n" );
-    Abc_Print( -2, "\t         performs heavy rewriting of the AIG\n" );
-    Abc_Print( -2, "\t-l     : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Bidec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, fVerbose = 0;
-    int fUpdateLevel = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUpdateLevel ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Bidec(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( !Gia_ManHasMapping(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Bidec(): Mapping of the AIG is not defined.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManPerformBidec( pAbc->pGia, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &bidec [-vh]\n" );
-    Abc_Print( -2, "\t         performs heavy rewriting of the AIG\n" );
-//    Abc_Print( -2, "\t-l     : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Shrink( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp = NULL;
-    int nLutSize;
-    int c,fVerbose = 0;
-    int fKeepLevel = 0;
-    int nFanoutMax = 50;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nlvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by a char string.\n" );
-                goto usage;
-            }
-            nFanoutMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFanoutMax < 0 )
-                goto usage;
-            break;
-        case 'l':
-            fKeepLevel ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Shrink(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( !Gia_ManHasMapping(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.\n" );
-        return 1;
-    }
-    nLutSize = Gia_ManLutSizeMax( pAbc->pGia );
-    if ( nLutSize <= 4 )
-        pTemp = Gia_ManMapShrink4( pAbc->pGia, fKeepLevel, fVerbose );
-    else if ( nLutSize <= 6 )
-        pTemp = Gia_ManMapShrink6( pAbc->pGia, nFanoutMax, fKeepLevel, fVerbose );
-    else
-        Abc_Print( -1, "Abc_CommandAbc9Shrink(): Works only for 4-LUTs and 6-LUTs.\n" );
-    if ( pTemp )
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &shrink [-N num] [-lvh]\n" );
-    Abc_Print( -2, "\t         performs fast shrinking using current mapping\n" );
-    Abc_Print( -2, "\t-N num : the max fanout count to skip a divisor [default = %d]\n", nFanoutMax );
-    Abc_Print( -2, "\t-l     : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int nNewNodesMax = 1000000;
-    int LitCountMax  =       0;
-    int fReverse     =       0;
-    int c, fVerbose  =       0;
-    int fVeryVerbose =       0;
-    // set the defaults
-    Extra_UtilGetoptReset();
-    while ( (c = Extra_UtilGetopt(argc, argv, "NMrvwh")) != EOF )
-    {
-        switch (c)
-        {
-            case 'N':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                    goto usage;
-                }
-                nNewNodesMax = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( nNewNodesMax < 0 )
-                    goto usage;
-                break;
-            case 'M':
-                if ( globalUtilOptind >= argc )
-                {
-                    Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                    goto usage;
-                }
-                LitCountMax = atoi(argv[globalUtilOptind]);
-                globalUtilOptind++;
-                if ( LitCountMax < 0 )
-                    goto usage;
-                break;
-            case 'r':
-                fReverse ^= 1;
-                break;
-            case 'v':
-                fVerbose ^= 1;
-                break;
-            case 'w':
-                fVeryVerbose ^= 1;
-                break;
-            case 'h':
-                goto usage;
-                break;
-            default:
-                goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Shrink(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( !Gia_ManHasMapping(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManPerformFx( pAbc->pGia, nNewNodesMax, LitCountMax, fReverse, fVerbose, fVeryVerbose );
-    if ( pTemp != NULL )
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    else
-        Abc_Print( -1, "Abc_CommandAbc9Fx(): Command has failed.\n" );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &fx [-NM <num>] [-vh]\n");
-    Abc_Print( -2, "\t           extract shared logic using the classical \"fast_extract\" algorithm\n");
-    Abc_Print( -2, "\t-N <num> : max number of divisors to extract during this run [default = %d]\n", nNewNodesMax );
-    Abc_Print( -2, "\t-M <num> : upper bound on literal count of divisors to extract [default = %d]\n", LitCountMax );
-    Abc_Print( -2, "\t-r       : reversing variable order during ISOP computation [default = %s]\n", fReverse? "yes": "no" );
-    Abc_Print( -2, "\t-v       : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp = NULL;
-    int nNewNodesMax = ABC_INFINITY;
-    int fDelayOnly   = 0;
-    int fSimpleAnd   = 0;
-    int fKeepLevel   = 0;
-    int c, fVerbose  = 0;
-    int fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Ndalvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by a char string.\n" );
-                goto usage;
-            }
-            nNewNodesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nNewNodesMax < 0 )
-                goto usage;
-            break;
-        case 'd':
-            fDelayOnly ^= 1;
-            break;
-        case 'a':
-            fSimpleAnd ^= 1;
-            break;
-        case 'l':
-            fKeepLevel ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Balance(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( fDelayOnly )
-        pTemp = Gia_ManBalance( pAbc->pGia, fSimpleAnd, fVerbose );
-    else
-        pTemp = Gia_ManAreaBalance( pAbc->pGia, fSimpleAnd, nNewNodesMax, fVerbose, fVeryVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &b [-N num] [-davwh]\n" );
-    Abc_Print( -2, "\t         performs AIG balancing to reduce delay and area\n" );
-    Abc_Print( -2, "\t-N num : the max fanout count to skip a divisor [default = %d]\n", nNewNodesMax );
-    Abc_Print( -2, "\t-d     : toggle delay only balancing [default = %s]\n", fDelayOnly? "yes": "no" );
-    Abc_Print( -2, "\t-a     : toggle using AND instead of AND/XOR/MUX [default = %s]\n", fSimpleAnd? "yes": "no" );
-//    Abc_Print( -2, "\t-l     : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9BalanceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Gia_Man_t * Gia_ManBalanceLut( Gia_Man_t * p, int nLutSize, int nCutNum, int fVerbose );
-    extern Gia_Man_t * Gia_ManLutBalance( Gia_Man_t * p, int nLutSize, int fUseMuxes, int fRecursive, int fOptArea, int fVerbose );
-    Gia_Man_t * pTemp = NULL;
-    int fUseOld      = 0;
-    int nLutSize     = 6;
-    int nCutNum      = 8;
-    int fUseMuxes    = 1;
-    int fRecursive   = 1;
-    int fOptArea     = 1;
-    int c, fVerbose  = 0;
-    int fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCnmravwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a char string.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a char string.\n" );
-                goto usage;
-            }
-            nCutNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutNum < 0 )
-                goto usage;
-            break;
-        case 'n':
-            fUseOld ^= 1;
-            break;
-        case 'm':
-            fUseMuxes ^= 1;
-            break;
-        case 'r':
-            fRecursive ^= 1;
-            break;
-        case 'a':
-            fOptArea ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9BalanceLut(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( fUseOld )
-        pTemp = Gia_ManBalanceLut( pAbc->pGia, nLutSize, nCutNum, fVerbose );
-    else
-        pTemp = Gia_ManLutBalance( pAbc->pGia, nLutSize, fUseMuxes, fRecursive, fOptArea, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &blut [-KC num] [-mravh]\n" );
-    Abc_Print( -2, "\t           performs AIG balancing for the given LUT size\n" );
-    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", 6, nLutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", 8, nCutNum );
-    Abc_Print( -2, "\t-m       : toggle performing MUX restructuring [default = %s]\n", fUseMuxes? "yes": "no" );
-    Abc_Print( -2, "\t-r       : toggle performing recursive restructuring [default = %s]\n", fRecursive? "yes": "no" );
-    Abc_Print( -2, "\t-a       : toggle performing area-oriented restructuring [default = %s]\n", fOptArea? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-//    Abc_Print( -2, "\t-w       : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Syn2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, fVerbose = 0;
-    int fOldAlgo = 0;
-    int fCoarsen = 1;
-    int fCutMin = 0;
-    int nRelaxRatio = 20;
-    int fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Rakmvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-		case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			nRelaxRatio = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( nRelaxRatio < 0 ) 
-				goto usage;
-            break;
-        case 'a':
-            fOldAlgo ^= 1;
-            break;
-        case 'k':
-            fCoarsen ^= 1;
-            break;
-        case 'm':
-            fCutMin ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Syn2(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManAigSyn2( pAbc->pGia, fOldAlgo, fCoarsen, fCutMin, nRelaxRatio, fVerbose, fVeryVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &syn2 [-R num] [-akmlvh]\n" );
-    Abc_Print( -2, "\t           performs AIG optimization\n" );
-    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n",  nRelaxRatio );
-    Abc_Print( -2, "\t-a       : toggles using the old algorithm [default = %s]\n",        fOldAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n",   fCoarsen? "yes": "no" );
-    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n",               fCutMin? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggle printing verbose information [default = %s]\n",    fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Syn3( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, fVerbose = 0;
-    int fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Syn3(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManAigSyn3( pAbc->pGia, fVerbose, fVeryVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &syn3 [-lvh]\n" );
-    Abc_Print( -2, "\t         performs AIG optimization\n" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Syn4( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, fVerbose = 0;
-    int fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Syn4(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManAigSyn4( pAbc->pGia, fVerbose, fVeryVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &syn4 [-lvh]\n" );
-    Abc_Print( -2, "\t         performs AIG optimization\n" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9False( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Gia_Man_t * Gia_ManCheckFalse( Gia_Man_t * p, int nSlackMax, int nTimeOut, int fVerbose, int fVeryVerbose );
-    Gia_Man_t * pTemp;
-    int nSlackMax = 0;
-    int nTimeOut = 0;
-    int c, fVerbose = 0;
-    int fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "STvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a char string.\n" );
-                goto usage;
-            }
-            nSlackMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nSlackMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by a char string.\n" );
-                goto usage;
-            }
-            nTimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nTimeOut < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9False(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManCheckFalse( pAbc->pGia, nSlackMax, nTimeOut, fVerbose, fVeryVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &false [-ST num] [-vwh]\n" );
-    Abc_Print( -2, "\t         detecting and elimintation false paths\n" );
-    Abc_Print( -2, "\t-S num : maximum slack to identify false paths [default = %d]\n",  nSlackMax );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n",   nTimeOut );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",    fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    FILE * pFile;
-    Gia_Man_t * pAux;
-    Gia_Man_t * pSecond;
-    char * FileName, * pTemp;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c;
-    int nInsDup  = 0;
-    int fDualOut = 0;
-    int fSeq     = 0;
-    int fTrans   = 0;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Idstvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by a char string.\n" );
-                goto usage;
-            }
-            nInsDup = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nInsDup < 0 )
-                goto usage;
-            break;
-        case 'd':
-            fDualOut ^= 1;
-            break;
-        case 's':
-            fSeq ^= 1;
-            break;
-        case 't':
-            fTrans ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( fTrans )
-    {
-        if ( (Gia_ManPoNum(pAbc->pGia) & 1) == 1 )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9Miter(): The number of outputs should be even.\n" );
-            return 0;
-        }
-        if ( pAbc->pGia == NULL )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9Miter(): There is no AIG.\n" );
-            return 1;
-        }
-        pAux = Gia_ManTransformMiter( pAbc->pGia );
-        Abc_FrameUpdateGia( pAbc, pAux );
-        Abc_Print( 1, "The miter (current AIG) is transformed by XORing POs pair-wise.\n" );
-        return 0;
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "File name is not given on the command line.\n" );
-        return 1;
-    }
-
-    // get the input file name
-    FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-    pSecond = Gia_AigerRead( FileName, 0, 0 );
-    if ( pSecond == NULL )
-    {
-        Abc_Print( -1, "Reading AIGER has failed.\n" );
-        return 0;
-    }
-    // compute the miter
-    pAux = Gia_ManMiter( pAbc->pGia, pSecond, nInsDup, fDualOut, fSeq, 0, fVerbose );
-    Gia_ManStop( pSecond );
-    Abc_FrameUpdateGia( pAbc, pAux );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &miter [-I num] [-dstvh] <file>\n" );
-    Abc_Print( -2, "\t         creates miter of two designs (current AIG vs. <file>)\n" );
-    Abc_Print( -2, "\t-I num : the number of last PIs to replicate [default = %d]\n", nInsDup );
-    Abc_Print( -2, "\t-d     : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
-    Abc_Print( -2, "\t-s     : toggle creating sequential miter [default = %s]\n", fSeq? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : AIGER file with the design to miter\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Miter2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    FILE * pFile;
-    Gia_Man_t * pAux;
-    char * FileName, * pTemp, * pInit;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "File name is not given on the command line.\n" );
-        return 1;
-    }
-    // get the input file name
-    FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-    // extract string
-    pInit = Extra_FileReadContents( FileName );
-    Extra_StringClean( pInit, "01xX" );
-    if ( (int)strlen(pInit) != Gia_ManCiNum(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Init string length (%d) differs from PI and flop count (%d).\n", strlen(pInit), Gia_ManCiNum(pAbc->pGia) );
-        ABC_FREE( pInit );
-        return 1;
-    }
-    // compute the miter
-    pAux = Gia_ManMiter2( pAbc->pGia, pInit, fVerbose );
-    ABC_FREE( pInit );
-    Abc_FrameUpdateGia( pAbc, pAux );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &miter2 [-vh] <file>\n" );
-    Abc_Print( -2, "\t         creates miter of two copies of the design\n" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : file name with flop initial values (0/1/x/X) [default = required]\n" );
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Append( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    FILE * pFile;
-    Gia_Man_t * pSecond;
-    char * FileName, * pTemp;
-    char ** pArgvNew;
-    int nArgcNew;
-    int c;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        Abc_Print( -1, "File name is not given on the command line.\n" );
-        return 1;
-    }
-
-    // get the input file name
-    FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-    pSecond = Gia_AigerRead( FileName, 0, 0 );
-    if ( pSecond == NULL )
-    {
-        Abc_Print( -1, "Reading AIGER has failed.\n" );
-        return 0;
-    }
-    // compute the miter
-    Gia_ManDupAppend( pAbc->pGia, pSecond );
-    Gia_ManStop( pSecond );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &append [-vh] <file>\n" );
-    Abc_Print( -2, "\t         appends <file> to the current AIG using new PIs and POs\n" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    Abc_Print( -2, "\t<file> : AIGER file with the design to miter\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c;
-    int fConst = 1;
-    int fEquiv = 1;
-    int fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "cevh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'c':
-            fConst ^= 1;
-            break;
-        case 'e':
-            fEquiv ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Scl(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManSeqStructSweep( pAbc->pGia, fConst, fEquiv, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &scl [-cevh]\n" );
-    Abc_Print( -2, "\t         performs structural sequential cleanup\n" );
-    Abc_Print( -2, "\t-c     : toggle removing stuck-at constant registers [default = %s]\n", fConst? "yes": "no" );
-    Abc_Print( -2, "\t-e     : toggle removing equivalent-driver registers [default = %s]\n", fEquiv? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParCor_t Pars, * pPars = &Pars;
-    Gia_Man_t * pTemp;
-    int c;
-    Cec_ManCorSetDefaultParams( pPars );
-    pPars->fLatchCorr = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FCPrcvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nPrefix = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nPrefix < 0 )
-                goto usage;
-            break;
-        case 'r':
-            pPars->fUseRings ^= 1;
-            break;
-        case 'c':
-            pPars->fUseCSat ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Lcorr(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    pTemp = Cec_ManLSCorrespondence( pAbc->pGia, pPars );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &lcorr [-FCP num] [-rcvh]\n" );
-    Abc_Print( -2, "\t         performs latch correpondence computation\n" );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
-    Abc_Print( -2, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
-    Abc_Print( -2, "\t-r     : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParCor_t Pars, * pPars = &Pars;
-    Gia_Man_t * pTemp;
-    int c;
-    Cec_ManCorSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FCPkrecqwvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFrames < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nPrefix = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nPrefix < 0 )
-                goto usage;
-            break;
-        case 'k':
-            pPars->fConstCorr ^= 1;
-            break;
-        case 'r':
-            pPars->fUseRings ^= 1;
-            break;
-        case 'e':
-            pPars->fMakeChoices ^= 1;
-            break;
-        case 'c':
-            pPars->fUseCSat ^= 1;
-            break;
-        case 'q':
-            pPars->fStopWhenGone ^= 1;
-            break;
-        case 'w':
-            pPars->fVerboseFlops ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Scorr(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "The network is combinational.\n" );
-        return 0;
-    }
-    pTemp = Cec_ManLSCorrespondence( pAbc->pGia, pPars );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &scorr [-FCP num] [-krecqwvh]\n" );
-    Abc_Print( -2, "\t         performs signal correpondence computation\n" );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
-    Abc_Print( -2, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
-    Abc_Print( -2, "\t-k     : toggle using constant correspondence [default = %s]\n", pPars->fConstCorr? "yes": "no" );
-    Abc_Print( -2, "\t-r     : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
-    Abc_Print( -2, "\t-e     : toggle using equivalences as choices [default = %s]\n", pPars->fMakeChoices? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
-    Abc_Print( -2, "\t-q     : toggle quitting when PO is not a constant candidate [default = %s]\n", pPars->fStopWhenGone? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing verbose info about equivalent flops [default = %s]\n", pPars->fVerboseFlops? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Choice( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParChc_t Pars, * pPars = &Pars;
-    Gia_Man_t * pTemp;
-    int c;
-    Cec_ManChcSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Ccvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'c':
-            pPars->fUseCSat ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Choice(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Cec_ManChoiceComputation( pAbc->pGia, pPars );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &choice [-C num] [-cvh]\n" );
-    Abc_Print( -2, "\t         performs computation of structural choices\n" );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParSat_t ParsSat, * pPars = &ParsSat;
-    Gia_Man_t * pTemp;
-    int c;
-    int fCSat = 0;
-    Cec_ManSatSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CSNnmtcvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nSatVarMax < 0 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nCallsRecycle = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCallsRecycle < 0 )
-                goto usage;
-            break;
-        case 'n':
-            pPars->fNonChrono ^= 1;
-            break;
-        case 'm':
-            pPars->fCheckMiter ^= 1;
-            break;
-        case 't':
-            pPars->fLearnCls ^= 1;
-            break;
-        case 'c':
-            fCSat ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Sat(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( fCSat )
-    {
-        Vec_Int_t * vCounters;
-        Vec_Str_t * vStatus;
-        if ( pPars->fLearnCls )
-            vCounters = Tas_ManSolveMiterNc( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
-        else if ( pPars->fNonChrono )
-            vCounters = Cbs_ManSolveMiterNc( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
-        else
-            vCounters = Cbs_ManSolveMiter( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
-        Vec_IntFree( vCounters );
-        Vec_StrFree( vStatus );
-    }
-    else
-    {
-        pTemp = Cec_ManSatSolving( pAbc->pGia, pPars );
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &sat [-CSN <num>] [-nmctvh]\n" );
-    Abc_Print( -2, "\t         performs SAT solving for the combinational outputs\n" );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-S num : the min number of variables to recycle the solver [default = %d]\n", pPars->nSatVarMax );
-    Abc_Print( -2, "\t-N num : the min number of calls to recycle the solver [default = %d]\n", pPars->nCallsRecycle );
-    Abc_Print( -2, "\t-n     : toggle using non-chronological backtracking [default = %s]\n", pPars->fNonChrono? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT solver [default = %s]\n", fCSat? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle using learning in curcuit-based solver [default = %s]\n", pPars->fLearnCls? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParFra_t ParsFra, * pPars = &ParsFra;
-    Gia_Man_t * pTemp;
-    int c;
-    Cec_ManFraSetDefaultParams( pPars );
-    pPars->fSatSweeping = 1;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WRILDCrmdwvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nItersMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nItersMax < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nLevelMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLevelMax < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nDepthMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nDepthMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'r':
-            pPars->fRewriting ^= 1;
-            break;
-        case 'm':
-            pPars->fCheckMiter ^= 1;
-            break;
-        case 'd':
-            pPars->fDualOut ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Fraig(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Cec_ManSatSweeping( pAbc->pGia, pPars );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &fraig [-WRILDC <num>] [-rmdwvh]\n" );
-    Abc_Print( -2, "\t         performs combinational SAT sweeping\n" );
-    Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", pPars->nWords );
-    Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n", pPars->nRounds );
-    Abc_Print( -2, "\t-I num : the number of sweeping iterations [default = %d]\n", pPars->nItersMax );
-    Abc_Print( -2, "\t-L num : the max number of levels of nodes to consider [default = %d]\n", pPars->nLevelMax );
-    Abc_Print( -2, "\t-D num : the max number of steps of speculative reduction [default = %d]\n", pPars->nDepthMax );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-r     : toggle the use of AIG rewriting [default = %s]\n", pPars->fRewriting? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
-    Abc_Print( -2, "\t-d     : toggle using double output miters [default = %s]\n", pPars->fDualOut? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing even more verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9CFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c;
-    Ssc_Pars_t Pars, * pPars = &Pars;
-    Ssc_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WCacvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fAppend ^= 1;
-            break;
-        case 'c':
-            pPars->fVerify ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9CFraig(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Ssc_PerformSweepingConstr( pAbc->pGia, pPars );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &cfraig [-WC <num>] [-acvh]\n" );
-    Abc_Print( -2, "\t         performs combinational SAT sweeping under constraints\n" );
-    Abc_Print( -2, "\t         which are present in the AIG or set manually using \"constr\"\n" );
-    Abc_Print( -2, "\t         (constraints are listed as last POs and true when they are 0)\n" );
-    Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", pPars->nWords );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-a     : toggle appending constraints to the result [default = %s]\n", pPars->fAppend? "yes": "no" );
-    Abc_Print( -2, "\t-c     : toggle performing internal verification [default = %s]\n", pPars->fVerify? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char * pFileNameIn = NULL;
-    char pFileName[10] = "gsrm.aig", pFileName2[10] = "gsyn.aig";
-    Gia_Man_t * pTemp, * pAux;
-    int c, fVerbose = 0;
-    int fSynthesis = 0;
-    int fSpeculate = 1;
-    int fSkipSome = 0;
-    int fDualOut = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Adrsfvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pFileNameIn = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'd':
-            fDualOut ^= 1;
-            break;
-        case 'r':
-            fSynthesis ^= 1;
-            break;
-        case 's':
-            fSpeculate ^= 1;
-            break;
-        case 'f':
-            fSkipSome ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Srm(): There is no AIG.\n" );
-        return 1;
-    }
-    sprintf(pFileName,  "gsrm%s.aig", fSpeculate? "" : "s" );
-    sprintf(pFileName2, "gsyn%s.aig", fSpeculate? "" : "s" );
-    pTemp = Gia_ManSpecReduce( pAbc->pGia, fDualOut, fSynthesis, fSpeculate, fSkipSome, fVerbose );
-    if ( pTemp )
-    {
-        if ( fSpeculate )
-        {
-            pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
-            Gia_ManStop( pAux );
-        }
-        Gia_AigerWrite( pTemp, pFileNameIn ? pFileNameIn : pFileName, 0, 0 );
-        Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
-        Gia_ManPrintStatsShort( pTemp );
-        Gia_ManStop( pTemp );
-    }
-    if ( fSynthesis )
-    {
-        pTemp = Gia_ManEquivReduce( pAbc->pGia, 1, fDualOut, 0, fVerbose );
-        if ( pTemp )
-        {
-            pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
-            Gia_ManStop( pAux );
-
-            Gia_AigerWrite( pTemp, pFileName2, 0, 0 );
-            Abc_Print( 1, "Reduced original network was written into file \"%s\".\n", pFileName2 );
-            Gia_ManPrintStatsShort( pTemp );
-            Gia_ManStop( pTemp );
-        }
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &srm [-A file] [-drsfvh]\n" );
-    Abc_Print( -2, "\t          writes speculatively reduced model into file \"%s\"\n", pFileName );
-    Abc_Print( -2, "\t-A file : file name for dumping speculative-reduced model [default = \"gsrm.aig\"]\n" );
-    Abc_Print( -2, "\t-d      : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
-    Abc_Print( -2, "\t-r      : toggle writing reduced network for synthesis [default = %s]\n", fSynthesis? "yes": "no" );
-    Abc_Print( -2, "\t-s      : toggle using speculation at the internal nodes [default = %s]\n", fSpeculate? "yes": "no" );
-    Abc_Print( -2, "\t-f      : toggle filtering to remove redundant equivalences [default = %s]\n", fSkipSome? "yes": "no" );
-    Abc_Print( -2, "\t-v      : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h      : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Srm2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char pFileName[10], * pFileName1, * pFileName2;
-    Gia_Man_t * pTemp, * pAux;
-    int fLatchA = 0, fLatchB = 0;
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "abvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'a':
-            fLatchA ^= 1;
-            break;
-        case 'b':
-            fLatchB ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Srm2(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( pAbc->pGia->pReprs == NULL || pAbc->pGia->pNexts == NULL )
-    {
-        Abc_Print( -1, "Equivalences are not defined.\n" );
-        return 0;
-    }
-    if ( argc != globalUtilOptind + 2 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Srm2(): Expecting two file names on the command line.\n" );
-        return 1;
-    }
-    // get the input file name
-    pFileName1 = argv[globalUtilOptind];
-    pFileName2 = argv[globalUtilOptind+1];
-    // create file name
-    sprintf(pFileName,  "gsrm.aig" );
-    pTemp = Gia_ManDup( pAbc->pGia );
-    // copy equivalences
-    pTemp->pReprs = ABC_ALLOC( Gia_Rpr_t, Gia_ManObjNum(pTemp) );
-    memcpy( pTemp->pReprs, pAbc->pGia->pReprs, sizeof(Gia_Rpr_t) * Gia_ManObjNum(pTemp) );
-    pTemp->pNexts = ABC_ALLOC( int, Gia_ManObjNum(pTemp) );
-    memcpy( pTemp->pNexts, pAbc->pGia->pNexts, sizeof(int) * Gia_ManObjNum(pTemp) );
-//Gia_ManPrintStats( pTemp, 0 );
-    // filter the classes
-    if ( !Gia_ManFilterEquivsForSpeculation( pTemp, pFileName1, pFileName2, fLatchA, fLatchB ) )
-    {
-        Gia_ManStop( pTemp );
-        Abc_Print( -1, "Filtering equivalences has failed.\n" );
-        return 1;
-    }
-//Gia_ManPrintStats( pTemp, 0 );
-    pTemp = Gia_ManSpecReduce( pAux = pTemp, 0, 0, 1, 0, 0 );
-    Gia_ManStop( pAux );
-    if ( pTemp )
-    {
-        pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
-        Gia_ManStop( pAux );
-
-        Gia_AigerWrite( pTemp, pFileName, 0, 0 );
-        Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
-        Gia_ManPrintStatsShort( pTemp );
-        Gia_ManStop( pTemp );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &srm2 [-abvh] <PartA_FileName> <PartB_FileName>\n" );
-    Abc_Print( -2, "\t         writes speculatively reduced model into file \"%s\"\n", pFileName );
-    Abc_Print( -2, "\t         only preserves equivalences across PartA and PartB\n" );
-    Abc_Print( -2, "\t-a     : toggle using latches only in PartA [default = %s]\n", fLatchA? "yes": "no" );
-    Abc_Print( -2, "\t-b     : toggle using latches only in PartB [default = %s]\n", fLatchB? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Filter( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char * pFileName1 = NULL, * pFileName2 = NULL;
-    int fFlopsOnly = 0, fFlopsWith = 0;
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "fgvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'f':
-            fFlopsOnly ^= 1;
-            break;
-        case 'g':
-            fFlopsWith ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Srm2(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( pAbc->pGia->pReprs == NULL || pAbc->pGia->pNexts == NULL )
-    {
-        Abc_Print( -1, "Equivalences are not defined.\n" );
-        return 0;
-    }
-    if ( argc != globalUtilOptind && argc != globalUtilOptind + 2 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Srm2(): Expecting two file names on the command line.\n" );
-        return 1;
-    }
-    // filter using one of the choices
-    if ( fFlopsOnly ^ fFlopsWith )
-        Gia_ManFilterEquivsUsingLatches( pAbc->pGia, fFlopsOnly, fFlopsWith );
-    // get the input file name
-    if ( argc == globalUtilOptind + 2 )
-    {
-        pFileName1 = argv[globalUtilOptind];
-        pFileName2 = argv[globalUtilOptind+1];
-        if ( !Gia_ManFilterEquivsUsingParts( pAbc->pGia, pFileName1, pFileName2 ) )
-        {
-            Abc_Print( -1, "Filtering equivalences using PartA and PartB has failed.\n" );
-            return 1;
-        }
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &filter [-fgvh] <PartA_FileName> <PartB_FileName>\n" );
-    Abc_Print( -2, "\t         performs filtering of equivalence classes\n" );
-    Abc_Print( -2, "\t         (if Parts A/B are given, removes classes composed of one part)\n" );
-    Abc_Print( -2, "\t-f     : toggle removing all elements except flops [default = %s]\n", fFlopsOnly? "yes": "no" );
-    Abc_Print( -2, "\t-g     : toggle removing removing classes without flops [default = %s]\n", fFlopsWith? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Reduce( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp, * pTemp2;
-    int c, fVerbose = 0;
-    int fUseAll = 0;
-    int fDualOut = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "advh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'a':
-            fUseAll ^= 1;
-            break;
-        case 'd':
-            fDualOut ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Reduce(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( fUseAll )
-    {
-        pTemp = Gia_ManEquivReduce( pAbc->pGia, fUseAll, fDualOut, 0, fVerbose );
-        pTemp = Gia_ManSeqStructSweep( pTemp2 = pTemp, 1, 1, 0 );
-        Gia_ManStop( pTemp2 );
-    }
-    else
-        pTemp = Gia_ManEquivReduceAndRemap( pAbc->pGia, 1, fDualOut );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &reduce [-advh]\n" );
-    Abc_Print( -2, "\t         reduces the circuit using equivalence classes\n" );
-    Abc_Print( -2, "\t-a     : toggle merging all equivalences [default = %s]\n", fUseAll? "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle using dual-output merging [default = %s]\n", fDualOut? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9EquivMark( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Gia_ManEquivMark( Gia_Man_t * p, char * pFileName, int fSkipSome, int fVerbose );
-    char * pFileName;
-    int c, fVerbose = 0;
-    int fSkipSome = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "fvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'f':
-            fSkipSome ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9EquivMark(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( argc != globalUtilOptind + 1 )
-        goto usage;
-    // get the input file name
-    pFileName = argv[globalUtilOptind];
-    // mark equivalences
-    Gia_ManEquivMark( pAbc->pGia, pFileName, fSkipSome, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &equiv_mark [-fvh] <miter.aig>\n" );
-    Abc_Print( -2, "\t              marks equivalences using an external miter\n" );
-    Abc_Print( -2, "\t-f          : toggle the use of filtered equivalences [default = %s]\n", fSkipSome? "yes": "no" );
-    Abc_Print( -2, "\t-v          : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h          : print the command usage\n");
-    Abc_Print( -2, "\t<miter.aig> : file with the external miter to read\n");
-    Abc_Print( -2, "\t              \n" );
-    Abc_Print( -2, "\t              The external miter should be generated by &srm -s\n" );
-    Abc_Print( -2, "\t              and (partially) solved by any verification engine(s).\n" );
-    Abc_Print( -2, "\t              The external miter should have as many POs as\n" );
-    Abc_Print( -2, "\t              the number of POs in the current AIG plus\n" );
-    Abc_Print( -2, "\t              the number of equivalences in the current AIG.\n" );
-    Abc_Print( -2, "\t              If some POs are proved, the corresponding equivs\n" );
-    Abc_Print( -2, "\t              are marked as proved, to be reduced by &reduce.\n" );
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9EquivFilter( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Gia_ManEquivFilter( Gia_Man_t * p, Vec_Int_t * vPoIds, int fVerbose );
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9EquivFilter(): There is no AIG.\n" );
-        return 1;
-    }
-    Gia_ManEquivFilter( pAbc->pGia, pAbc->vAbcObjIds, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &equiv_filter [-vh]\n" );
-    Abc_Print( -2, "\t              filters equivalence candidates after disproving some SRM outputs\n" );
-    Abc_Print( -2, "\t              (the array of disproved outputs should be given as pAbc->vAbcObjIds)\n" );
-    Abc_Print( -2, "\t-v          : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h          : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParCec_t ParsCec, * pPars = &ParsCec;
-    FILE * pFile;
-    Gia_Man_t * pSecond, * pMiter;
-    char * FileName, * pTemp;
-    char ** pArgvNew;
-    int c, nArgcNew, fMiter = 0;
-    int fDumpMiter = 0;
-    Cec_ManCecSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CTmdvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'm':
-            fMiter ^= 1;
-            break;
-        case 'd':
-            fDumpMiter ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( fMiter )
-    {
-        if ( Gia_ManPoNum(pAbc->pGia) & 1 )
-        {
-            Abc_Print( -1, "The dual-output miter should have an even number of outputs.\n" );
-            return 1;
-        }
-        Abc_Print( 1, "Assuming the current network is a double-output miter. (Conflict limit = %d.)\n", pPars->nBTLimit );
-        pAbc->Status = Cec_ManVerify( pAbc->pGia, pPars );
-        Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexComb );
-        return 0;
-    }
-
-    pArgvNew = argv + globalUtilOptind;
-    nArgcNew = argc - globalUtilOptind;
-    if ( nArgcNew != 1 )
-    {
-        if ( pAbc->pGia->pSpec == NULL )
-        {
-            Abc_Print( -1, "File name is not given on the command line.\n" );
-            return 1;
-        }
-        FileName = pAbc->pGia->pSpec;
-    }
-    else
-        FileName = pArgvNew[0];
-    // fix the wrong symbol
-    for ( pTemp = FileName; *pTemp; pTemp++ )
-        if ( *pTemp == '>' )
-            *pTemp = '\\';
-    if ( (pFile = fopen( FileName, "r" )) == NULL )
-    {
-        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
-        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
-            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
-        Abc_Print( 1, "\n" );
-        return 1;
-    }
-    fclose( pFile );
-    pSecond = Gia_AigerRead( FileName, 0, 0 );
-    if ( pSecond == NULL )
-    {
-        Abc_Print( -1, "Reading AIGER has failed.\n" );
-        return 0;
-    }
-    // compute the miter
-    pMiter = Gia_ManMiter( pAbc->pGia, pSecond, 0, 1, 0, 0, pPars->fVerbose );
-    if ( pMiter )
-    {
-        if ( fDumpMiter )
-        {
-            Abc_Print( 0, "The verification miter is written into file \"%s\".\n", "cec_miter.aig" );
-            Gia_AigerWrite( pMiter, "cec_miter.aig", 0, 0 );
-        }
-        pAbc->Status = Cec_ManVerify( pMiter, pPars );
-        Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexComb );
-        Gia_ManStop( pMiter );
-    }
-    Gia_ManStop( pSecond );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &cec [-CT num] [-mdvh]\n" );
-    Abc_Print( -2, "\t         new combinational equivalence checker\n" );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-m     : toggle miter vs. two circuits [default = %s]\n", fMiter? "miter":"two circuits");
-    Abc_Print( -2, "\t-d     : toggle dumping dual-output miter [default = %s]\n", fDumpMiter? "yes":"no");
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Verify( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Cec_ParCec_t ParsCec, * pPars = &ParsCec;
-    int c;
-    Cec_ManCecSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "CTvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    Gia_ManVerifyWithBoxes( pAbc->pGia, pPars );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &verify [-CT num] [-vh]\n" );
-    Abc_Print( -2, "\t         performs verification of combinational design\n" );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Sweep( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    Dch_Pars_t Pars, * pPars = &Pars;
-    int c;
-    // set defaults
-    Dch_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptfvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nSatVarMax < 0 )
-                goto usage;
-            break;
-        case 's':
-            pPars->fSynthesis ^= 1;
-            break;
-        case 'p':
-            pPars->fPower ^= 1;
-            break;
-        case 't':
-            pPars->fSimulateTfo ^= 1;
-            break;
-        case 'f':
-            pPars->fLightSynth ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Sweep(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManFraigSweep( pAbc->pGia, pPars );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &sweep [-WCS num] [-sptfvh]\n" );
-    Abc_Print( -2, "\t         computes structural choices using a new approach\n" );
-    Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
-    Abc_Print( -2, "\t-s     : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Force( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int nIters     = 20;
-    int fClustered =  1;
-    int fVerbose   =  1;
-    int c;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Icvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nIters < 0 )
-                goto usage;
-            break;
-        case 'c':
-            fClustered ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Force(): There is no AIG.\n" );
-        return 1;
-    }
-    For_ManExperiment( pAbc->pGia, nIters, fClustered, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &force [-I <num>] [-cvh]\n" );
-    Abc_Print( -2, "\t         one-dimensional placement algorithm FORCE introduced by\n" );
-    Abc_Print( -2, "\t         F. A. Aloul, I. L. Markov, and K. A. Sakallah (GLSVLSI�03).\n" );
-    Abc_Print( -2, "\t-I num : the number of refinement iterations [default = %d]\n", nIters );
-    Abc_Print( -2, "\t-c     : toggle clustered representation [default = %s]\n", fClustered? "yes":"no");
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes":"no");
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Embed( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Emb_Par_t Pars, * pPars = &Pars;
-    int c;
-    pPars->nDims      = 30;
-    pPars->nIters     = 10;
-    pPars->nSols      =  2;
-    pPars->fRefine    =  0;
-    pPars->fCluster   =  0;
-    pPars->fDump      =  0;
-    pPars->fDumpLarge =  0;
-    pPars->fShowImage =  0;
-    pPars->fVerbose   =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "DIrcdlsvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nDims = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nDims < 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIters < 0 )
-                goto usage;
-            break;
-        case 'r':
-            pPars->fRefine ^= 1;
-            break;
-        case 'c':
-            pPars->fCluster ^= 1;
-            break;
-        case 'd':
-            pPars->fDump ^= 1;
-            break;
-        case 'l':
-            pPars->fDumpLarge ^= 1;
-            break;
-        case 's':
-            pPars->fShowImage ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Embed(): There is no AIG.\n" );
-        return 1;
-    }
-    Gia_ManSolveProblem( pAbc->pGia, pPars );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &embed [-DI <num>] [-rdlscvh]\n" );
-    Abc_Print( -2, "\t         fast placement based on high-dimensional embedding from\n" );
-    Abc_Print( -2, "\t         D. Harel and Y. Koren, \"Graph drawing by high-dimensional\n" );
-    Abc_Print( -2, "\t         embedding\", J. Graph Algs & Apps, 2004, Vol 8(2), pp. 195-217\n" );
-    Abc_Print( -2, "\t-D num : the number of dimensions for embedding [default = %d]\n", pPars->nDims );
-    Abc_Print( -2, "\t-I num : the number of refinement iterations [default = %d]\n", pPars->nIters );
-    Abc_Print( -2, "\t-r     : toggle the use of refinement [default = %s]\n", pPars->fRefine? "yes":"no");
-    Abc_Print( -2, "\t-c     : toggle clustered representation [default = %s]\n", pPars->fCluster? "yes":"no");
-    Abc_Print( -2, "\t-d     : toggle dumping placement into a Gnuplot file [default = %s]\n", pPars->fDump? "yes":"no");
-    Abc_Print( -2, "\t-l     : toggle dumping Gnuplot for large placement [default = %s]\n", pPars->fDumpLarge? "yes":"no");
-    Abc_Print( -2, "\t-s     : toggle showing image if Gnuplot is installed [default = %s]\n", pPars->fShowImage? "yes":"no");
-    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Sopb( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int nLevelMax   = 0;
-    int nLevelRatio = 0;
-    int nCutNum     = 8;
-    int nRelaxRatio = 0;
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "LQCRvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLevelMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLevelMax < 0 )
-                goto usage;
-            break;
-        case 'Q':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nLevelRatio = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLevelRatio < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCutNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutNum < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nRelaxRatio = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nRelaxRatio < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Sopb(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( nLevelMax || nLevelRatio )
-        pTemp = Gia_ManPerformSopBalanceWin( pAbc->pGia, nLevelMax, nLevelRatio, nCutNum, nRelaxRatio, fVerbose );
-    else
-        pTemp = Gia_ManPerformSopBalance( pAbc->pGia, nCutNum, nRelaxRatio, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &sopb [-LQCR num] [-vh]\n" );
-    Abc_Print( -2, "\t         performs SOP balancing\n" );
-    Abc_Print( -2, "\t-L num : optimize paths above this level [default = %d]\n", nLevelMax );
-    Abc_Print( -2, "\t-Q num : optimize paths falling into this window [default = %d]\n", nLevelRatio );
-    Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
-    Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", nRelaxRatio );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[200];
-    char LutSize[200];
-    Gia_Man_t * pNew;
-    If_Par_t Pars, * pPars = &Pars;
-    int c;
-    // set defaults
-    Gia_ManSetIfParsDefault( pPars );
-    if ( pAbc->pLibLut == NULL )
-    {
-        Abc_Print( -1, "LUT library is not given. Using default LUT library.\n" );
-        pAbc->pLibLut = If_LibLutSetSimple( 6 );
-    }
-    pPars->pLutLib = (If_LibLut_t *)pAbc->pLibLut;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGRDEWSTqalepmrsdbgxyojikfuztncvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutSize < 0 )
-                goto usage;
-            // if the LUT size is specified, disable library
-            pPars->pLutLib = NULL;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutsMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nFlowIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nFlowIters < 0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nAreaIters = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nAreaIters < 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer no less than 3.\n" );
-                goto usage;
-            }
-            pPars->nGateSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nGateSize < 2 )
-                goto usage;
-            break;
-		case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nRelaxRatio < 0 ) 
-				goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'E':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->Epsilon < 0.0 || pPars->Epsilon > 1.0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->WireDelay = (float)atof(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->WireDelay < 0.0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
-                goto usage;
-            }
-            pPars->pLutStruct = argv[globalUtilOptind];
-            globalUtilOptind++;
-            if ( strlen(pPars->pLutStruct) != 2 && strlen(pPars->pLutStruct) != 3 )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
-                goto usage;
-            }
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer 0,1,or 2.\n" );
-                goto usage;
-            }
-            pPars->nStructType = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nStructType < 0 || pPars->nStructType > 2 )
-                goto usage;
-            break;
-        case 'q':
-            pPars->fPreprocess ^= 1;
-            break;
-        case 'a':
-            pPars->fArea ^= 1;
-            break;
-        case 'r':
-            pPars->fExpRed ^= 1;
-            break;
-        case 'l':
-            pPars->fLatchPaths ^= 1;
-            break;
-        case 'e':
-            pPars->fEdge ^= 1;
-            break;
-        case 'p':
-            pPars->fPower ^= 1;
-            break;
-        case 'm':
-            pPars->fCutMin ^= 1;
-            break;
-        case 's':
-            pPars->fDelayOptLut ^= 1;
-            break;
-        case 'd':
-            pPars->fBidec ^= 1;
-            break;
-        case 'b':
-            pPars->fUseBat ^= 1;
-            break;
-        case 'g':
-            pPars->fDelayOpt ^= 1;
-            break;
-        case 'x':
-            pPars->fDsdBalance ^= 1;
-            break;
-        case 'y':
-            pPars->fUserRecLib ^= 1;
-            break;
-        case 'o':
-            pPars->fUseBuffs ^= 1;
-            break;
-        case 'j':
-            pPars->fEnableCheck07 ^= 1;
-            break;
-        case 'i':
-            pPars->fEnableCheck08 ^= 1;
-            break;
-        case 'k':
-            pPars->fEnableCheck10 ^= 1;
-            break;
-        case 'f':
-            pPars->fEnableCheck75 ^= 1;
-            break;
-        case 'u':
-            pPars->fEnableCheck75u ^= 1;
-            break;
-        case 'z':
-            pPars->fDeriveLuts ^= 1;
-            break;
-        case 't':
-            pPars->fDoAverage ^= 1;
-            break;
-        case 'n':
-            pPars->fUseDsd ^= 1;
-            break;
-        case 'c':
-            pPars->fUseTtPerm ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Empty GIA network.\n" );
-        return 1;
-    }
-
-    if ( pPars->nLutSize == -1 )
-    {
-        if ( pPars->pLutLib == NULL )
-        {
-            Abc_Print( -1, "The LUT library is not given.\n" );
-            return 1;
-        }
-        // get LUT size from the library
-        pPars->nLutSize = pPars->pLutLib->LutMax;
-        // if variable pin delay, force truth table computation
-//        if ( pPars->pLutLib->fVarPinDelays )
-//            pPars->fTruth = 1;
-    }
-
-    if ( pPars->nLutSize < 2 || pPars->nLutSize > IF_MAX_LUTSIZE )
-    {
-        Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
-        return 1;
-    }
-
-    if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
-    {
-        Abc_Print( -1, "Incorrect number of cuts.\n" );
-        return 1;
-    }
-
-    // enable truth table computation if choices are selected
-    if ( Gia_ManHasChoices(pAbc->pGia) )
-    {
-//        if ( !Abc_FrameReadFlag("silentmode") )
-//            Abc_Print( 0, "Performing LUT mapping with choices.\n" );
-        pPars->fExpRed = 0;
-    }
-
-    if ( pPars->fUseBat )
-    {
-        if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
-        {
-            Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
-            return 1;
-        }
-        pPars->fCutMin = 1;
-    }
-
-    if ( pPars->fEnableCheck07 + pPars->fEnableCheck08 + pPars->fEnableCheck10 + pPars->fEnableCheck75 + pPars->fEnableCheck75u + (pPars->pLutStruct != NULL) > 1 )
-    {
-        Abc_Print( -1, "Only one additional check can be performed at the same time.\n" );
-        return 1;
-    }
-    if ( pPars->fEnableCheck07 )
-    {
-        if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 )
-        {
-            Abc_Print( -1, "This feature only works for {6,7}-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = If_CutPerformCheck07;
-        pPars->fCutMin = 1;
-    }
-    if ( pPars->fEnableCheck08 )
-    {
-        if ( pPars->nLutSize < 6 || pPars->nLutSize > 8 )
-        {
-            Abc_Print( -1, "This feature only works for {6,7,8}-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = If_CutPerformCheck08;
-        pPars->fCutMin = 1;
-    }
-    if ( pPars->fEnableCheck10 )
-    {
-        if ( pPars->nLutSize < 6 || pPars->nLutSize > 10 )
-        {
-            Abc_Print( -1, "This feature only works for {6,7,8,9,10}-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = If_CutPerformCheck10;
-        pPars->fCutMin = 1;
-    }
-    if ( pPars->fEnableCheck75 || pPars->fEnableCheck75u )
-    {
-        if ( pPars->fEnableCheck75 && pPars->fEnableCheck75u )
-        {
-            Abc_Print( -1, "Switches -f and -u are not compatible.\n" );
-            return 1;
-        }
-        if ( pPars->nLutSize < 5 || pPars->nLutSize > 8 )
-        {
-            Abc_Print( -1, "This feature only works for {6,7,8}-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = If_CutPerformCheck75;
-        pPars->fCutMin = 1;
-    }
-    if ( pPars->pLutStruct )
-    {
-        if ( pPars->fDsdBalance )
-        {
-            Abc_Print( -1, "Incompatible options (-S and -x).\n" );
-            return 1;
-        }
-        if ( pPars->nLutSize < 6 || pPars->nLutSize > 16 )
-        {
-            Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
-            return 1;
-        }
-        pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck16;
-        pPars->fCutMin = 1;
-    }
-
-    // enable truth table computation if cut minimization is selected
-    if ( pPars->fCutMin || pPars->fDeriveLuts )
-    {
-        pPars->fTruth = 1;
-        pPars->fExpRed = 0;
-        if ( pPars->pLutStruct == NULL )
-            pPars->fDeriveLuts = 1;
-    }
-    // modify the subgraph recording
-    if ( pPars->fUserRecLib )
-    {
-        pPars->fTruth      =  1;
-        pPars->fCutMin     =  1;
-        pPars->fExpRed     =  0;
-        pPars->fUsePerm    =  1;
-        pPars->pLutLib     =  NULL;
-    }
-    // modify for delay optimization
-    if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fDelayOptLut )
-    {
-        pPars->fTruth      =  1;
-        pPars->fCutMin     =  1;
-        pPars->fExpRed     =  0;
-        pPars->fUseDsd     =  pPars->fDsdBalance || pPars->fDelayOptLut;
-        pPars->pLutLib     =  NULL;
-    }
-    // modify for delay optimization
-    if ( pPars->nGateSize > 0 )
-    {
-        pPars->fTruth      =  1;
-        pPars->fCutMin     =  1;
-        pPars->fExpRed     =  0;
-        pPars->fUsePerm    =  1;
-        pPars->pLutLib     =  NULL;
-        pPars->nLutSize    =  pPars->nGateSize;
-    }
-
-    if ( pPars->fUseDsd || pPars->fUseTtPerm )
-    {
-        pPars->fTruth      =  1;
-        pPars->fCutMin     =  1;
-        pPars->fExpRed     =  0;
-    }
-
-    if ( pPars->fUseDsd )
-    {
-        int LutSize = (pPars->pLutStruct && pPars->pLutStruct[2] == 0)? pPars->pLutStruct[0] - '0' : 0;
-        If_DsdMan_t * p = (If_DsdMan_t *)Abc_FrameReadManDsd();
-        if ( pPars->pLutStruct && pPars->pLutStruct[2] != 0 )
-        {
-            printf( "DSD only works for LUT structures XY.\n" );
-            return 0;
-        }
-        if ( p && pPars->nLutSize > If_DsdManVarNum(p) )
-        {
-            printf( "DSD manager has incompatible number of variables.\n" );
-            return 0;
-        }
-        if ( p && LutSize != If_DsdManLutSize(p) && !pPars->fDsdBalance )
-        {
-            printf( "DSD manager has different LUT size.\n" );
-            return 0;
-        }
-        if ( p == NULL )
-            Abc_FrameSetManDsd( If_DsdManAlloc(pPars->nLutSize, LutSize) );
-    }
-
-    if ( pPars->fUserRecLib )
-    {
-        if ( !Abc_NtkRecIsRunning3() )
-        {
-            printf( "LMS manager is not running (use \"rec_start3\").\n" );
-            return 0;
-        }
-        if ( Abc_NtkRecInputNum3() != pPars->nLutSize )
-        {
-            printf( "The number of library inputs (%d) different from the K parameters (%d).\n", Abc_NtkRecInputNum3(), pPars->nLutSize );
-            return 0;
-        }
-    }
-
-    // complain if truth tables are requested but the cut size is too large
-    if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
-    {
-        Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
-        return 1;
-    }
-    if ( pAbc->pGia->pManTime && pAbc->pLibBox == NULL )
-    {
-        Abc_Print( -1, "Design has boxes but box library is not entered.\n" );
-        return 1;
-    }
-
-    // perform mapping
-    pNew = Gia_ManPerformMapping( pAbc->pGia, pPars, 1 );
-    if ( pNew == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9If(): Mapping of GIA has failed.\n" );
-        return 1;
-    }
-    Abc_FrameUpdateGia( pAbc, pNew );
-    return 0;
-
-usage:
-    if ( pPars->DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%.2f", pPars->DelayTarget );
-    if ( pPars->nLutSize == -1 )
-        sprintf(LutSize, "library" );
-    else
-        sprintf(LutSize, "%d", pPars->nLutSize );
-    Abc_Print( -2, "usage: &if [-KCFAGRT num] [-DEW float] [-S str] [-qarlepmsdbgxyojikfuztncvh]\n" );
-    Abc_Print( -2, "\t           performs FPGA technology mapping of the network\n" );
-    Abc_Print( -2, "\t-K num   : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
-    Abc_Print( -2, "\t-F num   : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
-    Abc_Print( -2, "\t-A num   : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
-    Abc_Print( -2, "\t-G num   : the max AND/OR gate size for mapping (0 = unused) [default = %d]\n", pPars->nGateSize );
-    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
-    Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
-    Abc_Print( -2, "\t-W float : sets wire delay between adjects LUTs [default = %f]\n", pPars->WireDelay );
-    Abc_Print( -2, "\t-S str   : string representing the LUT structure [default = %s]\n", pPars->pLutStruct ? pPars->pLutStruct : "not used" );
-    Abc_Print( -2, "\t-T num   : the type of LUT structures [default = any]\n", pPars->nStructType );
-    Abc_Print( -2, "\t-q       : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
-    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
-    Abc_Print( -2, "\t-r       : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
-    Abc_Print( -2, "\t-l       : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
-    Abc_Print( -2, "\t-e       : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
-    Abc_Print( -2, "\t-p       : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
-    Abc_Print( -2, "\t-m       : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
-    Abc_Print( -2, "\t-s       : toggles delay-oriented mapping used with -S <NN> [default = %s]\n", pPars->fDelayOptLut? "yes": "no" );
-    Abc_Print( -2, "\t-d       : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
-    Abc_Print( -2, "\t-b       : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
-    Abc_Print( -2, "\t-g       : toggles delay optimization by SOP balancing [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
-    Abc_Print( -2, "\t-x       : toggles delay optimization by DSD balancing [default = %s]\n", pPars->fDsdBalance? "yes": "no" );
-    Abc_Print( -2, "\t-y       : toggles delay optimization with recorded library [default = %s]\n", pPars->fUserRecLib? "yes": "no" );
-    Abc_Print( -2, "\t-o       : toggles using buffers to decouple combinational outputs [default = %s]\n", pPars->fUseBuffs? "yes": "no" );
-    Abc_Print( -2, "\t-j       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck07? "yes": "no" );
-    Abc_Print( -2, "\t-i       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck08? "yes": "no" );
-    Abc_Print( -2, "\t-k       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck10? "yes": "no" );
-    Abc_Print( -2, "\t-f       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck75? "yes": "no" );
-    Abc_Print( -2, "\t-u       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck75u? "yes": "no" );
-    Abc_Print( -2, "\t-z       : toggles deriving LUTs when mapping into LUT structures [default = %s]\n", pPars->fDeriveLuts? "yes": "no" );
-    Abc_Print( -2, "\t-t       : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
-    Abc_Print( -2, "\t-n       : toggles computing DSDs of the cut functions [default = %s]\n", pPars->fUseDsd? "yes": "no" );
-    Abc_Print( -2, "\t-c       : toggles computing truth tables in a new way [default = %s]\n", pPars->fUseTtPerm? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Iff( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Gia_ManIffTest( Gia_Man_t * pGia, If_LibLut_t * pLib, int fVerbose );
-    int c, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Iff(): There is no AIG to map.\n" );
-        return 1;
-    }
-    if ( !Gia_ManHasMapping(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Iff(): Mapping of the AIG is not defined.\n" );
-        return 1;
-    }
-    if ( pAbc->pLibLut == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Iff(): LUT library is not defined.\n" );
-        return 1;
-    }
-    Gia_ManIffTest( pAbc->pGia, (If_LibLut_t *)pAbc->pLibLut, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &iff [-vh]\n" );
-    Abc_Print( -2, "\t           performs structural mapping into LUT structures\n" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9If2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Abc_Ntk_t * Mpm_ManCellMapping( Gia_Man_t * p, Mpm_Par_t * pPars, void * pMio );
-    extern Gia_Man_t * Mpm_ManLutMapping( Gia_Man_t * p, Mpm_Par_t * pPars );
-    char Buffer[200];
-    Abc_Ntk_t * pTemp;
-    Gia_Man_t * pNew;
-    Mpm_Par_t Pars, * pPars = &Pars;
-    int c, nLutSize = 6;
-    // set defaults
-    Mpm_ManSetParsDefault( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCDtmzrcuxvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nLutSize < 2 || nLutSize > 16 )
-            {
-                Abc_Print( -1, "LUT size %d is not supported.\n", nLutSize );
-                goto usage;
-            }
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nNumCuts = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nNumCuts < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 't':
-            pPars->fUseGates ^= 1;
-            break;
-        case 'm':
-            pPars->fCutMin ^= 1;
-            break;
-        case 'z':
-            pPars->fDeriveLuts ^= 1;
-            break;
-        case 'r':
-            pPars->fOneRound ^= 1;
-            break;
-        case 'c':
-            pPars->fMap4Cnf ^= 1;
-            break;
-        case 'u':
-            pPars->fMap4Aig ^= 1;
-            break;
-        case 'x':
-            pPars->fMap4Gates ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Empty GIA network.\n" );
-        return 1;
-    }
-
-    if ( pPars->fMap4Cnf )
-        pPars->fUseDsd = 1;
-    if ( pPars->fCutMin )
-        pPars->fUseDsd = 1;
-//        pPars->fUseTruth = 1;
-    if ( pPars->fMap4Gates )
-    {
-        pPars->fUseDsd = 1;
-        if ( pAbc->pLibScl == NULL )
-        {
-            Abc_Print( -1, "There is no SCL library available.\n" );
-            return 1;
-        }
-        pPars->pScl = pAbc->pLibScl;
-    }
-    if ( pPars->fUseDsd || pPars->fUseTruth )
-        pPars->fDeriveLuts = 1;
-    if ( pPars->fUseDsd && nLutSize != 6 )
-    {
-        Abc_Print( -1, "Currently DSD can only be used with 6-input cuts.\n" );
-        return 1;
-    }
-    // perform mapping
-    assert( pPars->pLib == NULL );
-    if ( pPars->fMap4Gates )
-    {
-        if ( Abc_FrameReadLibGen() == NULL )
-        {
-            Abc_Print( -1, "There is no GENLIB library available.\n" );
-            return 1;
-        }
-        pPars->pLib = Mpm_LibLutSetSimple( nLutSize );
-        pTemp = Mpm_ManCellMapping( pAbc->pGia, pPars, Abc_FrameReadLibGen() );
-        Mpm_LibLutFree( pPars->pLib );
-        if ( pTemp == NULL )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9If2(): Mapping into standard cells has failed.\n" );
-            return 1;
-        }
-        Abc_FrameReplaceCurrentNetwork( pAbc, pTemp );
-    }
-    else
-    {
-        pPars->pLib = Mpm_LibLutSetSimple( nLutSize );
-        pNew = Mpm_ManLutMapping( pAbc->pGia, pPars );
-        Mpm_LibLutFree( pPars->pLib );
-        if ( pNew == NULL )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9If2(): Mapping into LUTs has failed.\n" );
-            return 1;
-        }
-        Abc_FrameUpdateGia( pAbc, pNew );
-    }
-    return 0;
-
-usage:
-    if ( pPars->DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%d", pPars->DelayTarget );
-    Abc_Print( -2, "usage: &if2 [-KCD num] [-tmzrcuxvwh]\n" );
-    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
-    Abc_Print( -2, "\t-K num   : sets the LUT size for the mapping [default = %d]\n", nLutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nNumCuts );
-    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-t       : enables using AND/XOR/MUX nodes instead of simple AIG [default = %s]\n", pPars->fUseGates? "yes": "no" );
-    Abc_Print( -2, "\t-m       : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
-    Abc_Print( -2, "\t-z       : toggles deriving LUTs when mapping into LUT structures [default = %s]\n", pPars->fDeriveLuts? "yes": "no" );
-    Abc_Print( -2, "\t-r       : toggles using one round of mapping [default = %s]\n", pPars->fOneRound? "yes": "no" );
-    Abc_Print( -2, "\t-c       : toggles mapping for CNF computation [default = %s]\n", pPars->fMap4Cnf? "yes": "no" );
-    Abc_Print( -2, "\t-u       : toggles mapping for AIG computation [default = %s]\n", pPars->fMap4Aig? "yes": "no" );
-    Abc_Print( -2, "\t-x       : toggles mapping for standard cells [default = %s]\n", pPars->fMap4Gates? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Jf( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[200];
-    Jf_Par_t Pars, * pPars = &Pars;
-    Gia_Man_t * pNew; int c;
-    Jf_ManSetDefaultPars( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCDWaekmdcgvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
-            {
-                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
-                goto usage;
-            }
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nCutNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
-            {
-                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
-                goto usage;
-            }
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nVerbLimit < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fAreaOnly ^= 1;
-            break;
-        case 'e':
-            pPars->fOptEdge ^= 1;
-            break;
-        case 'k':
-            pPars->fCoarsen ^= 1;
-            break;
-        case 'm':
-            pPars->fCutMin ^= 1;
-            break;
-        case 'd':
-            pPars->fFuncDsd ^= 1;
-            break;
-        case 'c':
-            pPars->fGenCnf ^= 1;
-            break;
-        case 'g':
-            pPars->fPureAig ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Empty GIA network.\n" );
-        return 1;
-    }
-
-    if ( (pPars->fFuncDsd || pPars->fGenCnf) && pPars->nLutSize > 6 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Jf(): DSD computation works for LUT6 or less.\n" );
-        return 1;
-    }
-
-    if ( (pPars->fFuncDsd || pPars->fGenCnf) && !Sdm_ManCanRead() )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Jf(): Cannot input DSD data from file.\n" );
-        return 1;
-    }
-
-    pNew = Jf_ManPerformMapping( pAbc->pGia, pPars );
-    if ( pNew == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Jf(): Mapping into LUTs has failed.\n" );
-        return 1;
-    }
-    Abc_FrameUpdateGia( pAbc, pNew );
-    return 0;
-
-usage:
-    if ( pPars->DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%d", pPars->DelayTarget );
-    Abc_Print( -2, "usage: &jf [-KCDW num] [-akmdcgvwh]\n" );
-    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
-    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
-    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-W num   : min frequency when printing functions with \"-w\" [default = %d]\n", pPars->nVerbLimit );
-    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
-    Abc_Print( -2, "\t-e       : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
-    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
-    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
-    Abc_Print( -2, "\t-d       : toggles using DSD to represent cut functions [default = %s]\n", pPars->fFuncDsd? "yes": "no" );
-    Abc_Print( -2, "\t-c       : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
-    Abc_Print( -2, "\t-g       : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-
-#ifdef ABC_USE_PTHREADS
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Kf( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Kf_ManSetDefaultPars( Jf_Par_t * pPars );
-    extern Gia_Man_t * Kf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars );
-    char Buffer[200];
-    Jf_Par_t Pars, * pPars = &Pars;
-    Gia_Man_t * pNew; int c;
-    Kf_ManSetDefaultPars( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCPDWaekmdcgtsvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
-            {
-                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
-                goto usage;
-            }
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nCutNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
-            {
-                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
-                goto usage;
-            }
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nProcNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nProcNum < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nVerbLimit < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fAreaOnly ^= 1;
-            break;
-        case 'e':
-            pPars->fOptEdge ^= 1;
-            break;
-        case 'k':
-            pPars->fCoarsen ^= 1;
-            break;
-        case 'm':
-            pPars->fCutMin ^= 1;
-            break;
-        case 'd':
-            pPars->fFuncDsd ^= 1;
-            break;
-        case 'c':
-            pPars->fGenCnf ^= 1;
-            break;
-        case 'g':
-            pPars->fPureAig ^= 1;
-            break;
-        case 't':
-            pPars->fCutHashing ^= 1;
-            break;
-        case 's':
-            pPars->fCutSimple ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Empty GIA network.\n" );
-        return 1;
-    }
-
-    pNew = Kf_ManPerformMapping( pAbc->pGia, pPars );
-    if ( pNew == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Kf(): Mapping into LUTs has failed.\n" );
-        return 1;
-    }
-    Abc_FrameUpdateGia( pAbc, pNew );
-    return 0;
-
-usage:
-    if ( pPars->DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%d", pPars->DelayTarget );
-    Abc_Print( -2, "usage: &kf [-KCPDW num] [-akmdcgtsvwh]\n" );
-    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
-    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
-    Abc_Print( -2, "\t-P num   : the number of cut computation processes (0 <= P <= %d) [default = %d]\n", pPars->nProcNumMax, pPars->nProcNum );
-    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-W num   : min frequency when printing functions with \"-w\" [default = %d]\n", pPars->nVerbLimit );
-    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
-    Abc_Print( -2, "\t-e       : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
-    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
-    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
-    Abc_Print( -2, "\t-d       : toggles using DSD to represent cut functions [default = %s]\n", pPars->fFuncDsd? "yes": "no" );
-    Abc_Print( -2, "\t-c       : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
-    Abc_Print( -2, "\t-g       : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
-    Abc_Print( -2, "\t-t       : toggles cut computation using hash table [default = %s]\n", pPars->fCutHashing? "yes": "no" );
-    Abc_Print( -2, "\t-s       : toggles cut computation using a simple method [default = %s]\n", pPars->fCutSimple? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-#endif
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Lf( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[200];
-    Jf_Par_t Pars, * pPars = &Pars;
-    Gia_Man_t * pNew; int c;
-    Lf_ManSetDefaultPars( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWaekmupgtvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
-            {
-                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
-                goto usage;
-            }
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nCutNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
-            {
-                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
-                goto usage;
-            }
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRoundsEla < 0 )
-                goto usage;
-            break;
-		case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nRelaxRatio < 0 ) 
-				goto usage;
-            break;
-		case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nCoarseLimit < 0 ) 
-				goto usage;
-            break;
-		case 'E':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nAreaTuner < 0 ) 
-				goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nVerbLimit < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fAreaOnly ^= 1;
-            break;
-        case 'e':
-            pPars->fOptEdge ^= 1;
-            break;
-        case 'k':
-            pPars->fCoarsen ^= 1;
-            break;
-        case 'm':
-            pPars->fCutMin ^= 1;
-            break;
-        case 'u':
-            pPars->fUseMux7 ^= 1;
-            break;
-        case 'p':
-            pPars->fPower ^= 1;
-            break;
-        case 'g':
-            pPars->fPureAig ^= 1;
-            break;
-        case 't':
-            pPars->fDoAverage ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Empty GIA network.\n" );
-        return 1;
-    }
-
-    pNew = Lf_ManPerformMapping( pAbc->pGia, pPars );
-    if ( pNew == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Lf(): Mapping into LUTs has failed.\n" );
-        return 1;
-    }
-    Abc_FrameUpdateGia( pAbc, pNew );
-    return 0;
-
-usage:
-    if ( pPars->DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%d", pPars->DelayTarget );
-    Abc_Print( -2, "usage: &lf [-KCFARLED num] [-kmupgtvwh]\n" );
-    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
-    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
-    Abc_Print( -2, "\t-F num   : the number of area flow rounds [default = %d]\n", pPars->nRounds );
-    Abc_Print( -2, "\t-A num   : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
-    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
-    Abc_Print( -2, "\t-L num   : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
-    Abc_Print( -2, "\t-E num   : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
-    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
-//    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
-    Abc_Print( -2, "\t-e       : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
-    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
-    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
-    Abc_Print( -2, "\t-u       : toggles using additional MUXes [default = %s]\n", pPars->fUseMux7? "yes": "no" );
-    Abc_Print( -2, "\t-p       : toggles power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
-    Abc_Print( -2, "\t-g       : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
-    Abc_Print( -2, "\t-t       : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Mf( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    char Buffer[200];
-    Jf_Par_t Pars, * pPars = &Pars;
-    Gia_Man_t * pNew; int c;
-    Mf_ManSetDefaultPars( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWaekmcgvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
-            {
-                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
-                goto usage;
-            }
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nCutNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
-            {
-                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
-                goto usage;
-            }
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRoundsEla < 0 )
-                goto usage;
-            break;
-		case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nRelaxRatio < 0 ) 
-				goto usage;
-            break;
-		case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nCoarseLimit < 0 ) 
-				goto usage;
-            break;
-		case 'E':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nAreaTuner < 0 ) 
-				goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nVerbLimit < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fAreaOnly ^= 1;
-            break;
-        case 'e':
-            pPars->fOptEdge ^= 1;
-            break;
-        case 'k':
-            pPars->fCoarsen ^= 1;
-            break;
-        case 'm':
-            pPars->fCutMin ^= 1;
-            break;
-        case 'c':
-            pPars->fGenCnf ^= 1;
-            break;
-        case 'g':
-            pPars->fPureAig ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Empty GIA network.\n" );
-        return 1;
-    }
-
-    pNew = Mf_ManPerformMapping( pAbc->pGia, pPars );
-    if ( pNew == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Lf(): Mapping into LUTs has failed.\n" );
-        return 1;
-    }
-    if ( pPars->fGenCnf )
-        Cnf_DataFree( pAbc->pGia->pData ), pAbc->pGia->pData = NULL;
-    Abc_FrameUpdateGia( pAbc, pNew );
-    return 0;
-
-usage:
-    if ( pPars->DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%d", pPars->DelayTarget );
-    Abc_Print( -2, "usage: &mf [-KCFARLED num] [-akmcgvwh]\n" );
-    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
-    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
-    Abc_Print( -2, "\t-F num   : the number of area flow rounds [default = %d]\n", pPars->nRounds );
-    Abc_Print( -2, "\t-A num   : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
-    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
-    Abc_Print( -2, "\t-L num   : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
-    Abc_Print( -2, "\t-E num   : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
-    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
-    Abc_Print( -2, "\t-e       : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
-    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
-    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
-    Abc_Print( -2, "\t-c       : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
-    Abc_Print( -2, "\t-g       : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Nf( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Nf_ManSetDefaultPars( Jf_Par_t * pPars );
-    extern Gia_Man_t * Nf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars );
-    char Buffer[200];
-    Jf_Par_t Pars, * pPars = &Pars;
-    Gia_Man_t * pNew; int c;
-    Nf_ManSetDefaultPars( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWakvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'K':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nLutSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
-            {
-                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
-                goto usage;
-            }
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nCutNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
-            {
-                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
-                goto usage;
-            }
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nRounds = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRounds < 0 )
-                goto usage;
-            break;
-        case 'A':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nRoundsEla < 0 )
-                goto usage;
-            break;
-		case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nRelaxRatio < 0 ) 
-				goto usage;
-            break;
-		case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nCoarseLimit < 0 ) 
-				goto usage;
-            break;
-		case 'E':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
-                return 0;
-            }
-			pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
-			globalUtilOptind++;
-			if ( pPars->nAreaTuner < 0 ) 
-				goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
-                goto usage;
-            }
-            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->DelayTarget <= 0.0 )
-                goto usage;
-            break;
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nVerbLimit < 0 )
-                goto usage;
-            break;
-        case 'a':
-            pPars->fAreaOnly ^= 1;
-            break;
-        case 'k':
-            pPars->fCoarsen ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Empty GIA network.\n" );
-        return 1;
-    }
-    if ( Abc_FrameReadLibGen() == NULL )
-    {
-        Abc_Print( -1, "Current library is not available.\n" );
-        return 1;
-    }
-    pNew = Nf_ManPerformMapping( pAbc->pGia, pPars );
-    if ( pNew == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Nf(): Mapping into LUTs has failed.\n" );
-        return 1;
-    }
-    Abc_FrameUpdateGia( pAbc, pNew );
-    return 0;
-
-usage:
-    if ( pPars->DelayTarget == -1 )
-        sprintf(Buffer, "best possible" );
-    else
-        sprintf(Buffer, "%d", pPars->DelayTarget );
-    Abc_Print( -2, "usage: &nf [-KCFARLED num] [-akvwh]\n" );
-    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
-    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
-    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
-    Abc_Print( -2, "\t-F num   : the number of area flow rounds [default = %d]\n", pPars->nRounds );
-    Abc_Print( -2, "\t-A num   : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
-    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
-    Abc_Print( -2, "\t-L num   : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
-    Abc_Print( -2, "\t-E num   : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
-    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
-    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
-    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
-    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : prints the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Struct( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Gia_ManTestStruct( Gia_Man_t * p );
-    int c, fVerbose;
-    // set defaults
-    fVerbose   = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Struct(): There is no AIG to map.\n" );
-        return 1;
-    }
-    if ( !Gia_ManHasMapping(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Struct(): Mapping of the AIG is not defined.\n" );
-        return 1;
-    }
-    if ( Gia_ManLutSizeMax(pAbc->pGia) >= 8 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Struct(): Can only handle nodes with less than 8 inputs.\n" );
-        return 1;
-    }
-    Gia_ManTestStruct( pAbc->pGia );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &struct [-vh]\n" );
-    Abc_Print( -2, "\t           checks decomposition structures of the current mapping\n" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Trace( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    int fUseLutLib;
-    int fVerbose;
-    // set defaults
-    fUseLutLib = 0;
-    fVerbose   = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'l':
-            fUseLutLib ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Speedup(): There is no AIG to map.\n" );
-        return 1;
-    }
-    if ( !Gia_ManHasMapping(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Speedup(): Mapping of the AIG is not defined.\n" );
-        return 1;
-    }
-    pAbc->pGia->pLutLib = fUseLutLib ? pAbc->pLibLut : NULL;
-    Gia_ManDelayTraceLutPrint( pAbc->pGia, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &trace [-lvh]\n" );
-    Abc_Print( -2, "\t           performs delay trace of LUT-mapped network\n" );
-    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Speedup( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int fUseLutLib;
-    int Percentage;
-    int Degree;
-    int fVerbose;
-    int c, fVeryVerbose;
-
-    // set defaults
-    fUseLutLib   = 0;
-    Percentage   = 5;
-    Degree       = 2;
-    fVerbose     = 0;
-    fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Percentage = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Percentage < 1 || Percentage > 100 )
-                goto usage;
-            break;
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            Degree = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( Degree < 1 || Degree > 5 )
-                goto usage;
-            break;
-        case 'l':
-            fUseLutLib ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Speedup(): There is no AIG to map.\n" );
-        return 1;
-    }
-    if ( !Gia_ManHasMapping(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Speedup(): Mapping of the AIG is not defined.\n" );
-        return 1;
-    }
-    pAbc->pGia->pLutLib = fUseLutLib ? pAbc->pLibLut : NULL;
-    pTemp = Gia_ManSpeedup( pAbc->pGia, Percentage, Degree, fVerbose, fVeryVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &speedup [-P num] [-N num] [-lvwh]\n" );
-    Abc_Print( -2, "\t           transforms LUT-mapped network into an AIG with choices;\n" );
-    Abc_Print( -2, "\t           the choices are added to speedup the next round of mapping\n" );
-    Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
-    Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
-    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
-    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h       : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Era( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-//    Gia_Man_t * pTemp = NULL;
-    int c, fVerbose = 0;
-    int fUseCubes = 1;
-    int fDumpFile = 0;
-    int fMiter = 0;
-    int nStatesMax = 1000000000;
-    extern int Gia_ManCollectReachable( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fDumpFile, int fVerbose );
-    extern int Gia_ManArePerform( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fVerbose );
-
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Smcdvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nStatesMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nStatesMax < 0 )
-                goto usage;
-            break;
-        case 'm':
-            fMiter ^= 1;
-            break;
-        case 'c':
-            fUseCubes ^= 1;
-            break;
-        case 'd':
-            fDumpFile ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Era(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Era(): The network is combinational.\n" );
-        return 1;
-    }
-    if ( !fUseCubes && Gia_ManPiNum(pAbc->pGia) > 12 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Era(): The number of PIs (%d) should be no more than 12 when cubes are not used.\n", Gia_ManPiNum(pAbc->pGia) );
-        return 1;
-    }
-    if ( fUseCubes && !fDumpFile )
-        pAbc->Status = Gia_ManArePerform( pAbc->pGia, nStatesMax, fMiter, fVerbose );
-    else
-        pAbc->Status = Gia_ManCollectReachable( pAbc->pGia, nStatesMax, fMiter, fDumpFile, fVerbose );
-    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &era [-S num] [-mcdvh]\n" );
-    Abc_Print( -2, "\t          explicit reachability analysis for small sequential AIGs\n" );
-    Abc_Print( -2, "\t-S num  : the max number of states (num > 0) [default = %d]\n", nStatesMax );
-    Abc_Print( -2, "\t-m      : stop when the miter output is 1 [default = %s]\n", fMiter? "yes": "no" );
-    Abc_Print( -2, "\t-c      : use state cubes instead of state minterms [default = %s]\n", fUseCubes? "yes": "no" );
-    Abc_Print( -2, "\t-d      : toggle dumping STG into a file [default = %s]\n", fDumpFile? "yes": "no" );
-    Abc_Print( -2, "\t-v      : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h      : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    Dch_Pars_t Pars, * pPars = &Pars;
-    int c;
-    // set defaults
-    Dch_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptfvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'W':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nWords = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nWords < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBTLimit < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nSatVarMax < 0 )
-                goto usage;
-            break;
-        case 's':
-            pPars->fSynthesis ^= 1;
-            break;
-        case 'p':
-            pPars->fPower ^= 1;
-            break;
-        case 't':
-            pPars->fSimulateTfo ^= 1;
-            break;
-        case 'f':
-            pPars->fLightSynth ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Dch(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManPerformDch( pAbc->pGia, pPars );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &dch [-WCS num] [-sptfvh]\n" );
-    Abc_Print( -2, "\t         computes structural choices using a new approach\n" );
-    Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
-    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
-    Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
-    Abc_Print( -2, "\t-s     : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
-    Abc_Print( -2, "\t-p     : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
-    Abc_Print( -2, "\t-t     : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
-    Abc_Print( -2, "\t-f     : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Rpm( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, nCutMax   = 16;
-    int fUseOldAlgo  =  0;
-    int fVerbose     =  0;
-    int fVeryVerbose =  0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Cavwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nCutMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nCutMax < 0 )
-                goto usage;
-            break;
-        case 'a':
-            fUseOldAlgo ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Rpm(): There is no AIG.\n" );
-        return 0;
-    }
-    if ( fUseOldAlgo )
-        pTemp = Abs_RpmPerformOld( pAbc->pGia, fVerbose );
-    else
-        pTemp = Abs_RpmPerform( pAbc->pGia, nCutMax, fVerbose, fVeryVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &rpm [-C num] [-avwh]\n" );
-    Abc_Print( -2, "\t         performs structural reparametrization\n" );
-    Abc_Print( -2, "\t-C num : max cut size for testing range equivalence [default = %d]\n", nCutMax );
-    Abc_Print( -2, "\t-a     : toggle using old algorithm [default = %s]\n", fUseOldAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing more verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9BackReach( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int nTimeMax, int fVerbose );
-
-    Gia_Man_t * pTemp = NULL;
-    int c, fVerbose = 0;
-    int nFrameMax = 1000000;
-    int nConfMax  = 1000000;
-    int nTimeMax  =      10;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "FCTvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrameMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrameMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nConfMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nConfMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nTimeMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nTimeMax < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9BackReach(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManPoNum(pAbc->pGia) != 1 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9BackReach(): The number of POs is different from 1.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManCofTest( pAbc->pGia, nFrameMax, nConfMax, nTimeMax, fVerbose );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &back_reach [-FCT <num>] [-vh]\n" );
-    Abc_Print( -2, "\t         performs backward reachability by circuit cofactoring\n" );
-    Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", nFrameMax );
-    Abc_Print( -2, "\t-C num : the conflict limit at a node during induction [default = %d]\n", nConfMax );
-    Abc_Print( -2, "\t-T num : the timeout for property directed reachability [default = %d]\n", nTimeMax );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Posplit( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Aig_Man_t * Aig_ManSplit( Aig_Man_t * p, int nVars, int fVerbose );
-    Aig_Man_t * pMan, * pAux;
-    Gia_Man_t * pTemp = NULL;
-    int c, nVars = 5, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nVars = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nVars < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Posplit(): There is no AIG.\n" );
-        return 1;
-    }
-    pMan = Gia_ManToAigSimple( pAbc->pGia );
-    pMan = Aig_ManSplit( pAux = pMan, nVars, fVerbose );
-    Aig_ManStop( pAux );
-    if ( pMan != NULL )
-    {
-        pTemp = Gia_ManFromAigSimple( pMan );
-        Aig_ManStop( pMan );
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    }
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &posplit [-N num] [-vh]\n" );
-    Abc_Print( -2, "\t         cofactors the property output w.r.t. a support subset\n" );
-    Abc_Print( -2, "\t         (the OR of new PO functions is equal to the original property)\n" );
-    Abc_Print( -2, "\t-N num : the number of random cofactoring variables [default = %d]\n", nVars );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9ReachM( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Gia_ParLlb_t Pars, * pPars = &Pars;
-    char * pLogFileName = NULL;
-    int c;
-    extern int Llb_ManModelCheckGia( Gia_Man_t * pGia, Gia_ParLlb_t * pPars );
-
-    // set defaults
-    Llb_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "TBFCHSLripcsyzvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBddMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBddMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nIterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIterMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nClusterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nClusterMax < 0 )
-                goto usage;
-            break;
-        case 'H':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nHintDepth = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nHintDepth < 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->HintFirst = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->HintFirst < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'r':
-            pPars->fReorder ^= 1;
-            break;
-        case 'i':
-            pPars->fIndConstr ^= 1;
-            break;
-        case 'p':
-            pPars->fUsePivots ^= 1;
-            break;
-        case 'c':
-            pPars->fCluster ^= 1;
-            break;
-        case 's':
-            pPars->fSchedule ^= 1;
-            break;
-        case 'y':
-            pPars->fSkipOutCheck ^= 1;
-            break;
-        case 'z':
-            pPars->fSkipReach ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachM(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachM(): The current AIG has no latches.\n" );
-        return 0;
-    }
-    if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachM(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
-        return 0;
-    }
-    pAbc->Status  = Llb_ManModelCheckGia( pAbc->pGia, pPars );
-    pAbc->nFrames = pPars->iFrame;
-    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachm" );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &reachm [-TBFCHS num] [-L file] [-ripcsyzvwh]\n" );
-    Abc_Print( -2, "\t         model checking via BDD-based reachability (dependence-matrix-based)\n" );
-    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", pPars->nBddMax );
-    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
-    Abc_Print( -2, "\t-C num : max number of variables in a cluster [default = %d]\n", pPars->nClusterMax );
-    Abc_Print( -2, "\t-H num : max number of hints to use [default = %d]\n", pPars->nHintDepth );
-    Abc_Print( -2, "\t-S num : the number of the starting hint [default = %d]\n", pPars->HintFirst );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-r     : enable dynamic BDD variable reordering [default = %s]\n", pPars->fReorder? "yes": "no" );
-    Abc_Print( -2, "\t-i     : enable extraction of inductive constraints [default = %s]\n", pPars->fIndConstr? "yes": "no" );
-    Abc_Print( -2, "\t-p     : enable partitions for internal cut-points [default = %s]\n", pPars->fUsePivots? "yes": "no" );
-    Abc_Print( -2, "\t-c     : enable clustering of partitions [default = %s]\n", pPars->fCluster? "yes": "no" );
-    Abc_Print( -2, "\t-s     : enable scheduling of clusters [default = %s]\n", pPars->fSchedule? "yes": "no" );
-    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
-    Abc_Print( -2, "\t-z     : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : prints dependency matrix [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9ReachP( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Gia_ParLlb_t Pars, * pPars = &Pars;
-    Aig_Man_t * pMan;
-    char * pLogFileName = NULL;
-    int c;
-    extern int Llb_ManReachMinCut( Aig_Man_t * pAig, Gia_ParLlb_t * pPars );
-
-    // set defaults
-    Llb_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "NBFTLrbyzdvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'N':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nPartValue = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nPartValue < 0 )
-                goto usage;
-            break;
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBddMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBddMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nIterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIterMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'r':
-            pPars->fReorder ^= 1;
-            break;
-        case 'b':
-            pPars->fBackward ^= 1;
-            break;
-        case 'y':
-            pPars->fSkipOutCheck ^= 1;
-            break;
-        case 'z':
-            pPars->fSkipReach ^= 1;
-            break;
-        case 'd':
-            pPars->fDumpReached ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachP(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachP(): The current AIG has no latches.\n" );
-        return 0;
-    }
-    if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachP(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
-        return 0;
-    }
-    pMan          = Gia_ManToAigSimple( pAbc->pGia );
-    pAbc->Status  = Llb_ManReachMinCut( pMan, pPars );
-    pAbc->nFrames = pPars->iFrame;
-    Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachp" );
-    Aig_ManStop( pMan );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &reachp [-NFT num] [-L file] [-rbyzdvwh]\n" );
-    Abc_Print( -2, "\t         model checking via BDD-based reachability (partitioning-based)\n" );
-    Abc_Print( -2, "\t-N num : partitioning value (MinVol=nANDs/N/2; MaxVol=nANDs/N) [default = %d]\n", pPars->nPartValue );
-//    Abc_Print( -2, "\t-B num : the BDD node increase when hints kick in [default = %d]\n", pPars->nBddMax );
-    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
-    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-r     : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
-    Abc_Print( -2, "\t-b     : perform backward reachability analysis [default = %s]\n", pPars->fBackward? "yes": "no" );
-    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
-    Abc_Print( -2, "\t-z     : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
-    Abc_Print( -2, "\t-d     : dump BDD of reached states into file \"reached.blif\" [default = %s]\n", pPars->fDumpReached? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9ReachN( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Gia_ParLlb_t Pars, * pPars = &Pars;
-    Aig_Man_t * pMan;
-    char * pLogFileName = NULL;
-    int c;
-    extern int Llb_NonlinCoreReach( Aig_Man_t * pAig, Gia_ParLlb_t * pPars );
-
-    // set defaults
-    Llb_ManSetDefaultParams( pPars );
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "BFTLryzvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBddMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBddMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nIterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIterMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'r':
-            pPars->fReorder ^= 1;
-            break;
-        case 'y':
-            pPars->fSkipOutCheck ^= 1;
-            break;
-        case 'z':
-            pPars->fSkipReach ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachN(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachN(): The current AIG has no latches.\n" );
-        return 0;
-    }
-    if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachN(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
-        return 0;
-    }
-    pMan          = Gia_ManToAigSimple( pAbc->pGia );
-    pAbc->Status  = Llb_NonlinCoreReach( pMan, pPars );
-    pAbc->nFrames = pPars->iFrame;
-    Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachn" );
-    Aig_ManStop( pMan );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &reachn [-BFT num] [-L file] [-ryzvh]\n" );
-    Abc_Print( -2, "\t         model checking via BDD-based reachability (non-linear-QS-based)\n" );
-    Abc_Print( -2, "\t-B num : the BDD node increase when hints kick in [default = %d]\n", pPars->nBddMax );
-    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
-    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-r     : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
-    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
-    Abc_Print( -2, "\t-z     : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-//    Abc_Print( -2, "\t-w     : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9ReachY( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
-    Gia_ParLlb_t Pars, * pPars = &Pars;
-    Aig_Man_t * pMan;
-    char * pLogFileName = NULL;
-    int c;
-
-    // set defaults
-    Llb_ManSetDefaultParams( pPars );
-    pPars->fCluster = 0;
-    pPars->fReorder = 0;
-    pPars->nBddMax     = 100;
-    pPars->nClusterMax = 500;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "BCFTLbcryzvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'B':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nBddMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nBddMax < 0 )
-                goto usage;
-            break;
-        case 'C':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nClusterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nClusterMax < 0 )
-                goto usage;
-            break;
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->nIterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->nIterMax < 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeLimit < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pLogFileName = argv[globalUtilOptind];
-            globalUtilOptind++;
-            break;
-        case 'b':
-            pPars->fBackward ^= 1;
-            break;
-        case 'c':
-            pPars->fCluster ^= 1;
-            break;
-        case 'r':
-            pPars->fReorder ^= 1;
-            break;
-        case 'y':
-            pPars->fSkipOutCheck ^= 1;
-            break;
-        case 'z':
-            pPars->fSkipReach ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachN(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachN(): The current AIG has no latches.\n" );
-        return 0;
-    }
-/*
-    if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9ReachN(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
-        return 0;
-    }
-*/
-    pMan          = Gia_ManToAigSimple( pAbc->pGia );
-    pAbc->Status  = Llb_Nonlin4CoreReach( pMan, pPars );
-    pAbc->nFrames = pPars->iFrame;
-    Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
-    if ( pLogFileName )
-        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachy" );
-    Aig_ManStop( pMan );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &reachy [-BCFT num] [-L file] [-bcryzvh]\n" );
-    Abc_Print( -2, "\t         model checking via BDD-based reachability (non-linear-QS-based)\n" );
-    Abc_Print( -2, "\t-B num : the max BDD size to introduce cut points [default = %d]\n", pPars->nBddMax );
-    Abc_Print( -2, "\t-C num : the max BDD size to reparameterize/cluster [default = %d]\n", pPars->nClusterMax );
-    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
-    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
-    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
-    Abc_Print( -2, "\t-b     : enable using backward enumeration [default = %s]\n", pPars->fBackward? "yes": "no" );
-    Abc_Print( -2, "\t-c     : enable reparametrization clustering [default = %s]\n", pPars->fCluster? "yes": "no" );
-    Abc_Print( -2, "\t-r     : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
-    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
-    Abc_Print( -2, "\t-z     : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
-    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
-//    Abc_Print( -2, "\t-w     : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Undo( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    // set defaults
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Undo(): There is no design.\n" );
-        return 1;
-    }
-    if ( pAbc->pGia2 == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Undo(): There is no previously saved network.\n" );
-        return 1;
-    }
-    Gia_ManStop( pAbc->pGia );
-    pAbc->pGia = pAbc->pGia2;
-    pAbc->pGia2 = NULL;
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &undo [-h]\n" );
-    Abc_Print( -2, "\t        reverses the previous AIG transformation\n" );
-    Abc_Print( -2, "\t-h    : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Iso( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pAig;
-    Vec_Ptr_t * vPosEquivs;
-//    Vec_Ptr_t * vPiPerms;
-    int c, fNewAlgo = 1, fEstimate = 0, fBetterQual = 0, fDualOut = 0, fVerbose = 0, fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "neqdvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'n':
-            fNewAlgo ^= 1;
-            break;
-        case 'e':
-            fEstimate ^= 1;
-            break;
-        case 'q':
-            fBetterQual ^= 1;
-            break;
-        case 'd':
-            fDualOut ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Iso(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManPoNum(pAbc->pGia) == 1 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Iso(): The AIG has only one PO. Isomorphism detection is not performed.\n" );
-        return 1;
-    }
-    if ( fNewAlgo )
-        pAig = Gia_ManIsoReduce2( pAbc->pGia, &vPosEquivs, NULL, fEstimate, fBetterQual, fDualOut, fVerbose, fVeryVerbose );
-    else
-        pAig = Gia_ManIsoReduce( pAbc->pGia, &vPosEquivs, NULL, fEstimate, fDualOut, fVerbose, fVeryVerbose );
-//    pAig = Gia_ManIsoReduce( pAbc->pGia, &vPosEquivs, &vPiPerms, 0, fDualOut, fVerbose, fVeryVerbose );
-//    Vec_VecFree( (Vec_Vec_t *)vPiPerms );
-    if ( pAig == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Iso(): Transformation has failed.\n" );
-        return 1;
-    }
-    // update the internal storage of PO equivalences
-    Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
-    // update the AIG
-    Abc_FrameUpdateGia( pAbc, pAig );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &iso [-neqdvwh]\n" );
-    Abc_Print( -2, "\t         removes POs with isomorphic sequential COI\n" );
-    Abc_Print( -2, "\t-n     : toggle using new fast algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
-    Abc_Print( -2, "\t-e     : toggle computing lower bound on equivalence classes [default = %s]\n", fEstimate? "yes": "no" );
-    Abc_Print( -2, "\t-q     : toggle improving quality at the expense of runtime [default = %s]\n", fBetterQual? "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle treating the current AIG as a dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9CexInfo( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern void Bmc_CexTest( Gia_Man_t * p, Abc_Cex_t * pCex, int fVerbose );
-    int c, fDualOut = 0, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "dvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'd':
-            fDualOut ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9CexInfo(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( pAbc->pCex == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9CexInfo(): There is no CEX.\n" );
-        return 1;
-    }
-    Bmc_CexTest( pAbc->pGia, pAbc->pCex, fVerbose );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &cexinfo [-vh]\n" );
-    Abc_Print( -2, "\t         prints information about the current counter-example\n" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Cycle( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, nFrames = 10, fUseCex = 0, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Fcvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'F':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nFrames = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nFrames < 0 )
-                goto usage;
-            break;
-        case 'c':
-            fUseCex ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Cycle(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManDupCycled( pAbc->pGia, fUseCex ? pAbc->pCex : NULL, nFrames );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &cycle [-F num] [-cvh]\n" );
-    Abc_Print( -2, "\t         cycles sequential circuit for the given number of timeframes\n" );
-    Abc_Print( -2, "\t         to derive a new initial state (which may be on the envelope)\n" );
-    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
-    Abc_Print( -2, "\t-c     : toggle using PI values from the current CEX [default = %s]\n", fUseCex? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Cone( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    Vec_Int_t * vPos;
-    int c, iOutNum = -1, nOutRange = 1, iPartNum = -1, fUseAllCis = 0, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "ORPavh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'O':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iOutNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iOutNum < 0 )
-                goto usage;
-            break;
-        case 'R':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nOutRange = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nOutRange < 0 )
-                goto usage;
-            break;
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iPartNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iPartNum < 0 )
-                goto usage;
-            break;
-        case 'a':
-            fUseAllCis ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Cone(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( iPartNum >= 0 )
-    {
-        Vec_Int_t * vClass;
-        Vec_Vec_t * vClasses = (Vec_Vec_t *)pAbc->vPoEquivs;
-        if ( vClasses == NULL )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9Cone(): Partitions are not defined.\n" );
-            return 1;
-        }
-        if ( iPartNum >= Vec_VecSize(vClasses) )
-        {
-            Abc_Print( -1, "Abc_CommandAbc9Cone(): Partition index exceed the array size.\n" );
-            return 1;
-        }
-        vClass = Vec_VecEntryInt( vClasses, iPartNum );
-        pTemp = Gia_ManDupCones( pAbc->pGia, Vec_IntArray(vClass), Vec_IntSize(vClass), !fUseAllCis );
-        if ( pTemp )
-            Abc_FrameUpdateGia( pAbc, pTemp );
-        return 0;
-    }
-    if ( iOutNum < 0 || iOutNum + nOutRange >= Gia_ManPoNum(pAbc->pGia) )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Cone(): Range of outputs to extract is incorrect.\n" );
-        return 1;
-    }
-    vPos = Vec_IntStartRange( iOutNum, nOutRange );
-    pTemp = Gia_ManDupCones( pAbc->pGia, Vec_IntArray(vPos), nOutRange, !fUseAllCis );
-    Vec_IntFree( vPos );
-    if ( pTemp )
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &cone [-ORP num] [-avh]\n" );
-    Abc_Print( -2, "\t         extracting multi-output sequential logic cones\n" );
-    Abc_Print( -2, "\t-O num : the index of first PO to extract [default = %d]\n", iOutNum );
-    Abc_Print( -2, "\t-R num : (optional) the number of outputs to extract [default = %d]\n", nOutRange );
-    Abc_Print( -2, "\t-P num : (optional) the partition number to extract [default = %d]\n", iPartNum );
-    Abc_Print( -2, "\t-a     : toggle keeping all CIs or structral support only [default = %s]\n", fUseAllCis? "all": "structural" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Slice( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    Gia_Man_t * pTemp;
-    int c, nSuppSize = 6, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Svh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nSuppSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nSuppSize < 0 )
-                goto usage;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9Slice(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManDupSliced( pAbc->pGia, nSuppSize );
-    Abc_FrameUpdateGia( pAbc, pTemp );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &slice [-S num] [-vh]\n" );
-    Abc_Print( -2, "\t         cuts the lower part of the AIG with nodes using their support\n" );
-    Abc_Print( -2, "\t-S num : the largest support size to keep in the slide [default = %d]\n", nSuppSize );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9PoPart( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Gia_Man_t * Gia_ManFindPoPartition( Gia_Man_t * p, int SelectShift, int fOnlyCis, int fSetLargest, int fVerbose, Vec_Ptr_t ** pvPosEquivs );
-    Gia_Man_t * pTemp;
-    Vec_Ptr_t * vPosEquivs = NULL;
-    int c, SelectShift = 0, fOnlyCis = 0, fSetLargest = 0, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "Simvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            SelectShift = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( SelectShift < 0 )
-                goto usage;
-            break;
-        case 'i':
-            fOnlyCis ^= 1;
-            break;
-        case 'm':
-            fSetLargest ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9PoPart(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManFindPoPartition( pAbc->pGia, SelectShift, fOnlyCis, fSetLargest, fVerbose, &vPosEquivs );
-    if ( pTemp )
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &popart [-S num] [-imvh]\n" );
-    Abc_Print( -2, "\t         partitioning of POs into equivalence classes\n" );
-    Abc_Print( -2, "\t-S num : random seed to select the set of pivot nodes [default = %d]\n", SelectShift );
-    Abc_Print( -2, "\t       : (if the seed is 0, the nodes with max fanout counts are used)\n" );
-    Abc_Print( -2, "\t-i     : toggle allowing only CIs to be the pivots [default = %s]\n", fOnlyCis? "yes": "no" );
-    Abc_Print( -2, "\t-m     : toggle using the largest part as the current network [default = %s]\n", fSetLargest? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9PoPart2( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Gia_Man_t * Gia_ManFindPoPartition2( Gia_Man_t * p, int iStartNum, int nDelta, int nOutsMin, int nOutsMax, int fSetLargest, int fVerbose, Vec_Ptr_t ** pvPosEquivs );
-    Gia_Man_t * pTemp = NULL;
-    Vec_Ptr_t * vPosEquivs = NULL;
-    int c, iStartNum = 0, nDelta = 10, nOutsMin = 100, nOutsMax = 1000, fSetLargest = 0, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "SDLUmvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            iStartNum = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( iStartNum < 0 )
-                goto usage;
-            break;
-        case 'D':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nDelta = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nDelta < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nOutsMin = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nOutsMin < 0 )
-                goto usage;
-            break;
-        case 'U':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-U\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nOutsMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nOutsMax < 0 )
-                goto usage;
-            break;
-        case 'm':
-            fSetLargest ^= 1;
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9PoPart(): There is no AIG.\n" );
-        return 1;
-    }
-    pTemp = Gia_ManFindPoPartition2( pAbc->pGia, iStartNum, nDelta, nOutsMin, nOutsMax, fSetLargest, fVerbose, &vPosEquivs );
-    if ( pTemp )
-        Abc_FrameUpdateGia( pAbc, pTemp );
-    Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &popart2 [-SDLU num] [-mvh]\n" );
-    Abc_Print( -2, "\t         extracting multi-output sequential logic cones\n" );
-    Abc_Print( -2, "\t-S num : the index of the PO to start the cluster [default = %d]\n", iStartNum );
-    Abc_Print( -2, "\t-D num : the max increase in flop count after adding one PO [default = %d]\n", nDelta );
-    Abc_Print( -2, "\t-L num : the minimum number of POs in a cluster [default = %d]\n", nOutsMin );
-    Abc_Print( -2, "\t-U num : the maximum number of POs in a cluster [default = %d]\n", nOutsMax );
-    Abc_Print( -2, "\t-m     : toggle selecting the largest cluster [default = %s]\n", fSetLargest? "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9GroupProve( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern Vec_Int_t * Gia_ManGroupProve( Gia_Man_t * p, char * pCommLine, int nGroupSize, int fVerbose );
-    Vec_Int_t * vStatus;
-    char * pCommLine = NULL;
-    int c, nGroupSize = 1, fVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "GSvh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nGroupSize = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nGroupSize <= 0 )
-                goto usage;
-            break;
-        case 'S':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-S\" should be followed by a file name.\n" );
-                goto usage;
-            }
-            pCommLine = argv[globalUtilOptind];
-            globalUtilOptind++;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9GroupProve(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( pCommLine == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9GroupProve(): Command line is not given.\n" );
-        return 1;
-    }
-    vStatus = Gia_ManGroupProve( pAbc->pGia, pCommLine, nGroupSize, fVerbose );
-    Vec_IntFree( vStatus );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &gprove [-GS num] [-vh]\n" );
-    Abc_Print( -2, "\t         proves multi-output testcase by splitting outputs into groups\n" );
-    Abc_Print( -2, "\t         (currently, group size more than one works only for \"bmc3\" and \"pdr\")\n" );
-    Abc_Print( -2, "\t-G num : the size of one group [default = %d]\n", nGroupSize );
-    Abc_Print( -2, "\t-S str : the command line to be executed for each group [default = %s]\n", pCommLine ? pCommLine : "none" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9MultiProve( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Gia_ManMultiProve( Gia_Man_t * p, Bmc_MulPar_t * pPars );
-    Vec_Int_t * vStatuses; int c;
-    Bmc_MulPar_t Pars, * pPars = &Pars;
-    memset( pPars, 0, sizeof(Bmc_MulPar_t) );
-    pPars->TimeOutGlo =  30;
-    pPars->TimeOutLoc =   2;
-    pPars->TimeOutInc = 100;
-    pPars->TimeOutGap =   0;
-    pPars->TimePerOut =   0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "TLMGHsdvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOutGlo = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOutGlo < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOutLoc = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOutLoc <= 0 )
-                goto usage;
-            break;
-        case 'M':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOutInc = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOutInc <= 0 )
-                goto usage;
-            break;
-        case 'G':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimeOutGap <= 0 )
-                goto usage;
-            break;
-        case 'H':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            pPars->TimePerOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( pPars->TimePerOut <= 0 )
-                goto usage;
-            break;
-        case 's':
-            pPars->fUseSyn ^= 1;
-            break;
-        case 'd':
-            pPars->fDumpFinal ^= 1;
-            break;
-        case 'v':
-            pPars->fVerbose ^= 1;
-            break;
-        case 'w':
-            pPars->fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9MultiProve(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9MultiProve(): The problem is combinational.\n" );
-        return 1;
-    }
-    pAbc->Status = Gia_ManMultiProve( pAbc->pGia, pPars );
-    vStatuses = Abc_FrameDeriveStatusArray( pAbc->pGia->vSeqModelVec );
-    Abc_FrameReplacePoStatuses( pAbc, &vStatuses );        
-    Abc_FrameReplaceCexVec( pAbc, &pAbc->pGia->vSeqModelVec );
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &mprove [-TLMGH num] [-sdvwh]\n" );
-    Abc_Print( -2, "\t         proves multi-output testcase by applying several engines\n" );
-    Abc_Print( -2, "\t-T num : approximate global runtime limit in seconds [default = %d]\n",     pPars->TimeOutGlo );
-    Abc_Print( -2, "\t-L num : approximate local runtime limit in seconds [default = %d]\n",      pPars->TimeOutLoc );
-    Abc_Print( -2, "\t-M num : percentage of local runtime limit increase [default = %d]\n",      pPars->TimeOutInc );
-    Abc_Print( -2, "\t-G num : approximate gap runtime limit in seconds [default = %d]\n",        pPars->TimeOutGap );
-    Abc_Print( -2, "\t-H num : timeout per output in miliseconds [default = %d]\n",               pPars->TimePerOut );
-    Abc_Print( -2, "\t-s     : toggle using combinational synthesis [default = %s]\n",            pPars->fUseSyn?      "yes": "no" );
-    Abc_Print( -2, "\t-d     : toggle dumping invariant into a file [default = %s]\n",            pPars->fDumpFinal?   "yes": "no" );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",             pPars->fVerbose?     "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing additional verbose information [default = %s]\n",  pPars->fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-
-#ifdef ABC_USE_PTHREADS
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9SplitProve( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    extern int Cec_GiaSplitTest( Gia_Man_t * p, int nProcs, int nTimeOut, int nIterMax, int LookAhead, int fVerbose, int fVeryVerbose );
-    int c, nProcs = 1, nTimeOut = 10, nIterMax = 0, LookAhead = 1, fVerbose = 0, fVeryVerbose = 0;
-    Extra_UtilGetoptReset();
-    while ( ( c = Extra_UtilGetopt( argc, argv, "PTILvwh" ) ) != EOF )
-    {
-        switch ( c )
-        {
-        case 'P':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-P\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nProcs = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nProcs <= 0 )
-                goto usage;
-            break;
-        case 'T':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer.\n" );
-                goto usage;
-            }
-            nTimeOut = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nTimeOut <= 0 )
-                goto usage;
-            break;
-        case 'I':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            nIterMax = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( nIterMax < 0 )
-                goto usage;
-            break;
-        case 'L':
-            if ( globalUtilOptind >= argc )
-            {
-                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
-                goto usage;
-            }
-            LookAhead = atoi(argv[globalUtilOptind]);
-            globalUtilOptind++;
-            if ( LookAhead <= 0 || LookAhead > 100 )
-            {
-                Abc_Print( -1, "Look-ahead value (\"-L <num>\") should be between 1 and 100.\n", LookAhead );
-                goto usage;
-            }
-            break;
-        case 'v':
-            fVerbose ^= 1;
-            break;
-        case 'w':
-            fVeryVerbose ^= 1;
-            break;
-        case 'h':
-            goto usage;
-        default:
-            goto usage;
-        }
-    }
-    if ( pAbc->pGia == NULL )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9SplitProve(): There is no AIG.\n" );
-        return 1;
-    }
-    if ( Gia_ManRegNum(pAbc->pGia) > 0 )
-    {
-        Abc_Print( -1, "Abc_CommandAbc9SplitProve(): The problem is sequential.\n" );
-        return 1;
-    }
-    pAbc->Status = Cec_GiaSplitTest( pAbc->pGia, nProcs, nTimeOut, nIterMax, LookAhead, fVerbose, fVeryVerbose );
-    pAbc->pCex = pAbc->pGia->pCexComb;  pAbc->pGia->pCexComb = NULL;
-    return 0;
-
-usage:
-    Abc_Print( -2, "usage: &splitprove [-PTIL num] [-vwh]\n" );
-    Abc_Print( -2, "\t         proves CEC problem by case-splitting\n" );
-    Abc_Print( -2, "\t-P num : the number of concurrent processes [default = %d]\n",          nProcs );
-    Abc_Print( -2, "\t-T num : runtime limit in seconds per subproblem [default = %d]\n",     nTimeOut );
-    Abc_Print( -2, "\t-I num : the max number of iterations (0 = infinity) [default = %d]\n", nIterMax );
-    Abc_Print( -2, "\t-L num : maximum look-ahead during cofactoring [default = %d]\n",       LookAhead );
-    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",         fVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-w     : toggle printing more verbose information [default = %s]\n",    fVeryVerbose? "yes": "no" );
-    Abc_Print( -2, "\t-h     : print the command usage\n");
-    return 1;
-}
-#endif
-
-
-/**Function*************************************************************
-
-  Synopsis    []
-
-  Description []
-
-  SideEffects []
-
-  SeeAlso     []
-
-***********************************************************************/
-int Abc_CommandAbc9Bmc( Abc_Frame_t * pAbc, int argc, char ** argv )
-{
-    int c;
-    Bmc_AndPar_t Pars, * pPars = &Pars;
-    memset( pPars, 0, sizeof(Bmc_AndPar_t) );
-    pPars->nStart        =    0;  // starting timeframe
-    pPars->nFramesMax    =    0;  // maximum number of timeframes 
-    pPars->nFramesAdd    =   50;  // the number of additional frames
-    pPars->nConfLimit    =    0;  // maximum number of conflicts at a node
-    pPars->nTimeOut      =    0;  // timeout in seconds
-    pPars->fLoadCnf      =    0;  // dynamic CNF loading
-    pPars->fDumpFrames   =    0;  // dump unrolled timeframes
-    pPars->fUseSynth     =    0;  // use synthesis
-    pPars->fUseOldCnf    =    0;  // use old CNF construction
+static int Abc_CommandSparsify               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandLutpack                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandLutmin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandImfs                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandMfs                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandMfs2                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTrace                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSpeedup                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandPowerdown              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAddBuffs               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandMerge                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestDec                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestNpn                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestRPO                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandRewrite                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRefactor               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRestructure            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandResubstitute           ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRr                     ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCascade                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandExtract                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandVarMin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandLogic                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandComb                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandMiter                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDemiter                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandOrPos                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAndPos                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandZeroPo                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSwapPos                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRemovePo               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDropSat                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAddPi                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAppend                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandPutOnTop               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFrames                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDFrames                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSop                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBdd                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAig                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandReorder                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBidec                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandOrder                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandMuxes                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCubes                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSplitSop               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandExtSeqDcs              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandReach                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCone                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandNode                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTopmost                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTopAnd                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTrim                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandShortNames             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandMoveNames              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandExdcFree               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandExdcGet                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandExdcSet                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCareSet                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCut                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandEspresso               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandGen                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandGenFsm                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCover                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDouble                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandInter                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBb2Wb                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandOutdec                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandNodeDup                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestColor              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTest                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandQuaVar                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandQuaRel                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandQuaReach               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSenseInput             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandNpnLoad                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandNpnSave                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandSendAig                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSendStatus             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandIStrash                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandICut                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIRewrite               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDRewrite               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDRefactor              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDc2                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDChoice                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDch                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDrwsat                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIRewriteSeq            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIResyn                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandISat                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIFraig                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDFraig                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCSweep                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDProve                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbSec                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSimSec                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandMatch                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandHaig                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandQbf                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandFraig                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFraigTrust             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFraigStore             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFraigRestore           ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFraigClean             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFraigSweep             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFraigDress             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandRecStart3              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRecStop3               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRecPs3                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRecAdd3                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRecDump3               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRecMerge3              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandMap                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAmap                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandUnmap                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAttach                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSuperChoice            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSuperChoiceLut         ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+//static int Abc_CommandFpga                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandFpgaFast               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIf                     ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIfif                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandDsdSave                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDsdLoad                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDsdFree                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDsdPs                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDsdTune                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDsdMerge               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDsdClean               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandScut                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandInit                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandZero                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandUndc                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandOneHot                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandPipe                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSeq                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandUnseq                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandRetime                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDRetime                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFlowRetime             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCRetime                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSeqFpga                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSeqMap                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSeqSweep               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSeqSweep2              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestSeqSweep           ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestScorr              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandLcorr                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSeqCleanup             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCycle                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandXsim                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSim                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSim3                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDarPhase               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSynch                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandClockGate              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandExtWin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandInsWin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandPermute                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandUnpermute              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCubeEnum               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandCec                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDCec                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDSec                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSat                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDSat                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandPSat                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandProve                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIProve                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDebug                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBmc                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBmc2                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBmc3                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBmcInter               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIndcut                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandEnlarge                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTempor                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandInduction              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandConstr                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandUnfold                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFold                   ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandUnfold2                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandFold2                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBm                     ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBm2                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandSaucy                  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTestCex                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandPdr                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandReconcile              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCexSave                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCexLoad                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCexCut                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandCexMerge               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandCexMin                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandDualRail               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandBlockPo                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandIso                    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandTraceStart             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandTraceCheck             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandAbc9Get                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Put                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Save               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Load               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Read               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9ReadBlif           ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9ReadCBlif          ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9ReadStg            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Write              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Ps                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9PFan               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9PSig               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Status             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9MuxProfile         ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Show               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Strash             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Topand             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Add1Hot            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Cof                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Trim               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Dfs                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Sim                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Sim3               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Resim              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9SpecI              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Equiv              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Equiv2             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Equiv3             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Semi               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Times              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Frames             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Retime             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Enable             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Dc2                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Dsd                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Bidec              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Shrink             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Fx                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Balance            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9BalanceLut         ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Syn2               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Syn3               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Syn4               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Synch2             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9False              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Miter              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Miter2             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Append             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Scl                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Lcorr              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Scorr              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Choice             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Sat                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Fraig              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9CFraig             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Srm                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Srm2               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Filter             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Reduce             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9EquivMark          ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9EquivFilter        ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Cec                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Verify             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Sweep              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Force              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Embed              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Sopb               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Dsdb               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Flow               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9If                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Iff                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9If2                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Jf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Kf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Lf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Mf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Nf                 ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Unmap              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Struct             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Trace              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Speedup            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Era                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Dch                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Rpm                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9BackReach          ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Posplit            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9ReachM             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9ReachP             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9ReachN             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9ReachY             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Undo               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Iso                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9CexInfo            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Cycle              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Cone               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Slice              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9PoPart             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9GroupProve         ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9MultiProve         ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9SplitProve         ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Bmc                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9BCore              ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9ICheck             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9SatTest            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9FFTest             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Inse               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Maxi               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Bmci               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9PoXsim             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Demiter            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandAbc9PoPart2            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandAbc9CexCut             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandAbc9CexMerge           ( Abc_Frame_t * pAbc, int argc, char ** argv );
+//static int Abc_CommandAbc9CexMin             ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandAbc9AbsDerive          ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9AbsRefine          ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9GlaDerive          ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9GlaRefine          ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9GlaShrink          ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Gla                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Vta                ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Vta2Gla            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Gla2Vta            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Fla2Gla            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int Abc_CommandAbc9Gla2Fla            ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static int Abc_CommandAbc9Test               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+extern int Abc_CommandAbcLivenessToSafety    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+extern int Abc_CommandAbcLivenessToSafetySim ( Abc_Frame_t * pAbc, int argc, char ** argv );
+extern int Abc_CommandAbcLivenessToSafetyWithLTL( Abc_Frame_t * pAbc, int argc, char ** argv );
+extern int Abc_CommandCS_kLiveness           ( Abc_Frame_t * pAbc, int argc, char ** argv );
+extern int Abc_CommandNChooseK               ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+extern Aig_Man_t * Abc_NtkToDar( Abc_Ntk_t * pNtk, int fExors, int fRegisters );
+extern Abc_Ntk_t * Abc_NtkFromAigPhase( Aig_Man_t * pMan );
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_FrameReplaceCex( Abc_Frame_t * pAbc, Abc_Cex_t ** ppCex )
+{
+    // update CEX
+    ABC_FREE( pAbc->pCex );
+    pAbc->pCex = *ppCex;
+    *ppCex = NULL;
+    // remove CEX vector
+    if ( pAbc->vCexVec )
+    {
+        Vec_PtrFreeFree( pAbc->vCexVec );
+        pAbc->vCexVec = NULL;
+    }
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_FrameReplaceCexVec( Abc_Frame_t * pAbc, Vec_Ptr_t ** pvCexVec )
+{
+    // update CEX vector
+    if ( pAbc->vCexVec )
+        Vec_PtrFreeFree( pAbc->vCexVec );
+    pAbc->vCexVec = *pvCexVec;
+    *pvCexVec = NULL;
+    // remove CEX
+    ABC_FREE( pAbc->pCex );
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_FrameReplacePoEquivs( Abc_Frame_t * pAbc, Vec_Ptr_t ** pvPoEquivs )
+{
+    if ( pAbc->vPoEquivs )
+        Vec_VecFree( (Vec_Vec_t *)pAbc->vPoEquivs );
+    pAbc->vPoEquivs = *pvPoEquivs;
+    *pvPoEquivs = NULL;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_FrameReplacePoStatuses( Abc_Frame_t * pAbc, Vec_Int_t ** pvStatuses )
+{
+    if ( pAbc->vStatuses )
+        Vec_IntFree( pAbc->vStatuses );
+    pAbc->vStatuses = *pvStatuses;
+    *pvStatuses = NULL;
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Derives array of statuses from the array of CEXes.]
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Vec_Int_t * Abc_FrameDeriveStatusArray( Vec_Ptr_t * vCexes )
+{
+    Vec_Int_t * vStatuses;
+    Abc_Cex_t * pCex;
+    int i;
+    if ( vCexes == NULL )
+        return NULL;
+    vStatuses = Vec_IntAlloc( Vec_PtrSize(vCexes) );
+    Vec_IntFill( vStatuses, Vec_PtrSize(vCexes), -1 ); // assume UNDEC
+    Vec_PtrForEachEntry( Abc_Cex_t *, vCexes, pCex, i )
+        if ( pCex != NULL )
+            Vec_IntWriteEntry( vStatuses, i, 0 ); // set this output as SAT
+    return vStatuses;    
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_FrameClearDesign()
+{
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_FrameUpdateGia( Abc_Frame_t * pAbc, Gia_Man_t * pNew )
+{
+    if ( pNew == NULL )
+    {
+        Abc_Print( -1, "Abc_FrameUpdateGia(): Tranformation has failed.\n" );
+        return;
+    }
+    if ( Gia_ManPoNum(pNew) == 0 )
+        Abc_Print( 0, "The current GIA has no primary outputs. Some commands may not work correctly.\n" );
+    if ( pNew == pAbc->pGia )
+        return;
+    // transfer names
+    if (!pNew->vNamesIn && pAbc->pGia && pAbc->pGia->vNamesIn && Gia_ManCiNum(pNew) == Vec_PtrSize(pAbc->pGia->vNamesIn))
+    {
+        pNew->vNamesIn = pAbc->pGia->vNamesIn;
+        pAbc->pGia->vNamesIn = NULL;
+    }
+    if (!pNew->vNamesOut && pAbc->pGia && pAbc->pGia->vNamesOut && Gia_ManCoNum(pNew) == Vec_PtrSize(pAbc->pGia->vNamesOut))
+    {
+        pNew->vNamesOut = pAbc->pGia->vNamesOut;
+        pAbc->pGia->vNamesOut = NULL;
+    }
+    // update
+    if ( pAbc->pGia2 )
+        Gia_ManStop( pAbc->pGia2 );
+    pAbc->pGia2 = pAbc->pGia;
+    pAbc->pGia  = pNew;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Gia_Man_t * Abc_FrameGetGia( Abc_Frame_t * pAbc )
+{
+    Gia_Man_t * pGia;
+    if ( pAbc->pGia2 )
+        Gia_ManStop( pAbc->pGia2 );
+    pAbc->pGia2 = NULL;
+    pGia = pAbc->pGia;
+    pAbc->pGia = NULL;
+    return pGia;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_Init( Abc_Frame_t * pAbc )
+{
+    Cmd_CommandAdd( pAbc, "Printing",     "print_stats",   Abc_CommandPrintStats,       0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_exdc",    Abc_CommandPrintExdc,        0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_io",      Abc_CommandPrintIo,          0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_latch",   Abc_CommandPrintLatch,       0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_fanio",   Abc_CommandPrintFanio,       0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_mffc",    Abc_CommandPrintMffc,        0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_factor",  Abc_CommandPrintFactor,      0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_level",   Abc_CommandPrintLevel,       0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_supp",    Abc_CommandPrintSupport,     0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_symm",    Abc_CommandPrintSymms,       0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_unate",   Abc_CommandPrintUnate,       0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_auto",    Abc_CommandPrintAuto,        0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_kmap",    Abc_CommandPrintKMap,        0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_gates",   Abc_CommandPrintGates,       0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_sharing", Abc_CommandPrintSharing,     0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_xcut",    Abc_CommandPrintXCut,        0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_dsd",     Abc_CommandPrintDsd,         0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_cone",    Abc_CommandPrintCone,        0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_miter",   Abc_CommandPrintMiter,       0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_status",  Abc_CommandPrintStatus,      0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "print_delay",   Abc_CommandPrintDelay,       0 );
+
+    Cmd_CommandAdd( pAbc, "Printing",     "show",          Abc_CommandShow,             0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "show_bdd",      Abc_CommandShowBdd,          0 );
+    Cmd_CommandAdd( pAbc, "Printing",     "show_cut",      Abc_CommandShowCut,          0 );
+
+    Cmd_CommandAdd( pAbc, "Synthesis",    "collapse",      Abc_CommandCollapse,         1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "strash",        Abc_CommandStrash,           1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "balance",       Abc_CommandBalance,          1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "mux_struct",    Abc_CommandMuxStruct,        1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "multi",         Abc_CommandMulti,            1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "renode",        Abc_CommandRenode,           1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "cleanup",       Abc_CommandCleanup,          1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "sweep",         Abc_CommandSweep,            1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "fx",            Abc_CommandFastExtract,      1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "eliminate",     Abc_CommandEliminate,        1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "dsd",           Abc_CommandDisjoint,         1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "sparsify",      Abc_CommandSparsify,         1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "lutpack",       Abc_CommandLutpack,          1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "lutmin",        Abc_CommandLutmin,           1 );
+//    Cmd_CommandAdd( pAbc, "Synthesis",    "imfs",          Abc_CommandImfs,             1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "mfs",           Abc_CommandMfs,              1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "mfs2",          Abc_CommandMfs2,             1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "trace",         Abc_CommandTrace,            0 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "speedup",       Abc_CommandSpeedup,          1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "powerdown",     Abc_CommandPowerdown,        1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "addbuffs",      Abc_CommandAddBuffs,         1 );
+//    Cmd_CommandAdd( pAbc, "Synthesis",    "merge",         Abc_CommandMerge,            1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "testdec",       Abc_CommandTestDec,          0 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "testnpn",       Abc_CommandTestNpn,          0 );
+    Cmd_CommandAdd( pAbc, "LogiCS",       "testrpo",       Abc_CommandTestRPO,          0 );
+
+    Cmd_CommandAdd( pAbc, "Synthesis",    "rewrite",       Abc_CommandRewrite,          1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "refactor",      Abc_CommandRefactor,         1 );
+//    Cmd_CommandAdd( pAbc, "Synthesis",    "restructure",   Abc_CommandRestructure,      1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "resub",         Abc_CommandResubstitute,     1 );
+//    Cmd_CommandAdd( pAbc, "Synthesis",    "rr",            Abc_CommandRr,               1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "cascade",       Abc_CommandCascade,          1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "extract",       Abc_CommandExtract,          1 );
+    Cmd_CommandAdd( pAbc, "Synthesis",    "varmin",        Abc_CommandVarMin,           0 );
+
+    Cmd_CommandAdd( pAbc, "Various",      "logic",         Abc_CommandLogic,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "comb",          Abc_CommandComb,             1 );
+    Cmd_CommandAdd( pAbc, "Various",      "miter",         Abc_CommandMiter,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "demiter",       Abc_CommandDemiter,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "orpos",         Abc_CommandOrPos,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "andpos",        Abc_CommandAndPos,           1 );
+    Cmd_CommandAdd( pAbc, "Various",      "zeropo",        Abc_CommandZeroPo,           1 );
+    Cmd_CommandAdd( pAbc, "Various",      "swappos",       Abc_CommandSwapPos,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "removepo",      Abc_CommandRemovePo,         1 );
+    Cmd_CommandAdd( pAbc, "Various",      "dropsat",       Abc_CommandDropSat,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "addpi",         Abc_CommandAddPi,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "append",        Abc_CommandAppend,           1 );
+    Cmd_CommandAdd( pAbc, "Various",      "putontop",      Abc_CommandPutOnTop,         1 );
+    Cmd_CommandAdd( pAbc, "Various",      "frames",        Abc_CommandFrames,           1 );
+    Cmd_CommandAdd( pAbc, "Various",      "dframes",       Abc_CommandDFrames,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "sop",           Abc_CommandSop,              0 );
+    Cmd_CommandAdd( pAbc, "Various",      "bdd",           Abc_CommandBdd,              0 );
+    Cmd_CommandAdd( pAbc, "Various",      "aig",           Abc_CommandAig,              0 );
+    Cmd_CommandAdd( pAbc, "Various",      "reorder",       Abc_CommandReorder,          0 );
+    Cmd_CommandAdd( pAbc, "Various",      "bidec",         Abc_CommandBidec,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "order",         Abc_CommandOrder,            0 );
+    Cmd_CommandAdd( pAbc, "Various",      "muxes",         Abc_CommandMuxes,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "cubes",         Abc_CommandCubes,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "splitsop",      Abc_CommandSplitSop,         1 );
+    Cmd_CommandAdd( pAbc, "Various",      "ext_seq_dcs",   Abc_CommandExtSeqDcs,        0 );
+    Cmd_CommandAdd( pAbc, "Various",      "reach",         Abc_CommandReach,            0 );
+    Cmd_CommandAdd( pAbc, "Various",      "cone",          Abc_CommandCone,             1 );
+    Cmd_CommandAdd( pAbc, "Various",      "node",          Abc_CommandNode,             1 );
+    Cmd_CommandAdd( pAbc, "Various",      "topmost",       Abc_CommandTopmost,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "topand",        Abc_CommandTopAnd,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "trim",          Abc_CommandTrim,             1 );
+    Cmd_CommandAdd( pAbc, "Various",      "short_names",   Abc_CommandShortNames,       0 );
+    Cmd_CommandAdd( pAbc, "Various",      "move_names",    Abc_CommandMoveNames,        0 );
+    Cmd_CommandAdd( pAbc, "Various",      "exdc_free",     Abc_CommandExdcFree,         1 );
+    Cmd_CommandAdd( pAbc, "Various",      "exdc_get",      Abc_CommandExdcGet,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "exdc_set",      Abc_CommandExdcSet,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "care_set",      Abc_CommandCareSet,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "cut",           Abc_CommandCut,              0 );
+    Cmd_CommandAdd( pAbc, "Various",      "espresso",      Abc_CommandEspresso,         1 );
+    Cmd_CommandAdd( pAbc, "Various",      "gen",           Abc_CommandGen,              0 );
+    Cmd_CommandAdd( pAbc, "Various",      "genfsm",        Abc_CommandGenFsm,           0 );
+    Cmd_CommandAdd( pAbc, "Various",      "cover",         Abc_CommandCover,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "double",        Abc_CommandDouble,           1 );
+    Cmd_CommandAdd( pAbc, "Various",      "inter",         Abc_CommandInter,            1 );
+    Cmd_CommandAdd( pAbc, "Various",      "bb2wb",         Abc_CommandBb2Wb,            0 );
+    Cmd_CommandAdd( pAbc, "Various",      "outdec",        Abc_CommandOutdec,           1 );
+    Cmd_CommandAdd( pAbc, "Various",      "nodedup",       Abc_CommandNodeDup,          1 );
+    Cmd_CommandAdd( pAbc, "Various",      "testcolor",     Abc_CommandTestColor,        0 );
+    Cmd_CommandAdd( pAbc, "Various",      "test",          Abc_CommandTest,             0 );
+//    Cmd_CommandAdd( pAbc, "Various",      "qbf_solve",     Abc_CommandTest,               0 );
+
+    Cmd_CommandAdd( pAbc, "Various",      "qvar",          Abc_CommandQuaVar,           1 );
+    Cmd_CommandAdd( pAbc, "Various",      "qrel",          Abc_CommandQuaRel,           1 );
+    Cmd_CommandAdd( pAbc, "Various",      "qreach",        Abc_CommandQuaReach,         1 );
+    Cmd_CommandAdd( pAbc, "Various",      "senseinput",    Abc_CommandSenseInput,       1 );
+    Cmd_CommandAdd( pAbc, "Various",      "npnload",       Abc_CommandNpnLoad,          0 );
+    Cmd_CommandAdd( pAbc, "Various",      "npnsave",       Abc_CommandNpnSave,          0 );
+
+    Cmd_CommandAdd( pAbc, "Various",      "send_aig",      Abc_CommandSendAig,          0 );
+    Cmd_CommandAdd( pAbc, "Various",      "send_status",   Abc_CommandSendStatus,       0 );
+
+    Cmd_CommandAdd( pAbc, "New AIG",      "istrash",       Abc_CommandIStrash,          1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "icut",          Abc_CommandICut,             0 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "irw",           Abc_CommandIRewrite,         1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "drw",           Abc_CommandDRewrite,         1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "drf",           Abc_CommandDRefactor,        1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "dc2",           Abc_CommandDc2,              1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "dchoice",       Abc_CommandDChoice,          1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "dch",           Abc_CommandDch,              1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "drwsat",        Abc_CommandDrwsat,           1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "irws",          Abc_CommandIRewriteSeq,      1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "iresyn",        Abc_CommandIResyn,           1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "isat",          Abc_CommandISat,             1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "ifraig",        Abc_CommandIFraig,           1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "dfraig",        Abc_CommandDFraig,           1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "csweep",        Abc_CommandCSweep,           1 );
+//    Cmd_CommandAdd( pAbc, "New AIG",      "haig",          Abc_CommandHaig,             1 );
+    Cmd_CommandAdd( pAbc, "New AIG",      "qbf",           Abc_CommandQbf,              0 );
+
+    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig",         Abc_CommandFraig,            1 );
+    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_trust",   Abc_CommandFraigTrust,       1 );
+    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_store",   Abc_CommandFraigStore,       0 );
+    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_restore", Abc_CommandFraigRestore,     1 );
+    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_clean",   Abc_CommandFraigClean,       0 );
+    Cmd_CommandAdd( pAbc, "Fraiging",     "fraig_sweep",   Abc_CommandFraigSweep,       1 );
+    Cmd_CommandAdd( pAbc, "Fraiging",     "dress",         Abc_CommandFraigDress,       1 );
+
+    Cmd_CommandAdd( pAbc, "Choicing",     "rec_start3",    Abc_CommandRecStart3,        0 );
+    Cmd_CommandAdd( pAbc, "Choicing",     "rec_stop3",     Abc_CommandRecStop3,         0 );
+    Cmd_CommandAdd( pAbc, "Choicing",     "rec_ps3",       Abc_CommandRecPs3,           0 );
+    Cmd_CommandAdd( pAbc, "Choicing",     "rec_add3",      Abc_CommandRecAdd3,          0 );
+    Cmd_CommandAdd( pAbc, "Choicing",     "rec_dump3",     Abc_CommandRecDump3,         0 );
+    Cmd_CommandAdd( pAbc, "Choicing",     "rec_merge3",    Abc_CommandRecMerge3,        0 );
+
+    Cmd_CommandAdd( pAbc, "SC mapping",   "map",           Abc_CommandMap,              1 );
+    Cmd_CommandAdd( pAbc, "SC mapping",   "amap",          Abc_CommandAmap,             1 );
+    Cmd_CommandAdd( pAbc, "SC mapping",   "unmap",         Abc_CommandUnmap,            1 );
+    Cmd_CommandAdd( pAbc, "SC mapping",   "attach",        Abc_CommandAttach,           1 );
+    Cmd_CommandAdd( pAbc, "SC mapping",   "superc",        Abc_CommandSuperChoice,      1 );
+    Cmd_CommandAdd( pAbc, "SC mapping",   "supercl",       Abc_CommandSuperChoiceLut,   1 );
+
+//    Cmd_CommandAdd( pAbc, "FPGA mapping", "fpga",          Abc_CommandFpga,             1 );
+//    Cmd_CommandAdd( pAbc, "FPGA mapping", "ffpga",         Abc_CommandFpgaFast,         1 );
+    Cmd_CommandAdd( pAbc, "FPGA mapping", "if",            Abc_CommandIf,               1 );
+    Cmd_CommandAdd( pAbc, "FPGA mapping", "ifif",          Abc_CommandIfif,             1 );
+
+    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_save",      Abc_CommandDsdSave,          0 );
+    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_load",      Abc_CommandDsdLoad,          0 );
+    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_free",      Abc_CommandDsdFree,          0 );
+    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_ps",        Abc_CommandDsdPs,            0 );
+    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_tune",      Abc_CommandDsdTune,          0 );
+    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_merge",     Abc_CommandDsdMerge,         0 );
+    Cmd_CommandAdd( pAbc, "DSD manager",  "dsd_clean",     Abc_CommandDsdClean,         0 );
+
+//    Cmd_CommandAdd( pAbc, "Sequential",   "scut",          Abc_CommandScut,             0 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "init",          Abc_CommandInit,             1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "zero",          Abc_CommandZero,             1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "undc",          Abc_CommandUndc,             1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "onehot",        Abc_CommandOneHot,           1 );
+//    Cmd_CommandAdd( pAbc, "Sequential",   "pipe",          Abc_CommandPipe,             1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "retime",        Abc_CommandRetime,           1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "dretime",       Abc_CommandDRetime,          1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "fretime",       Abc_CommandFlowRetime,       1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "cretime",       Abc_CommandCRetime,          1 );
+//    Cmd_CommandAdd( pAbc, "Sequential",   "sfpga",         Abc_CommandSeqFpga,          1 );
+//    Cmd_CommandAdd( pAbc, "Sequential",   "smap",          Abc_CommandSeqMap,           1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "ssweep",        Abc_CommandSeqSweep,         1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "scorr",         Abc_CommandSeqSweep2,        1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "testssw",       Abc_CommandTestSeqSweep,     0 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "testscorr",     Abc_CommandTestScorr,        0 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "lcorr",         Abc_CommandLcorr,            1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "scleanup",      Abc_CommandSeqCleanup,       1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "cycle",         Abc_CommandCycle,            1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "xsim",          Abc_CommandXsim,             0 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "sim",           Abc_CommandSim,              0 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "sim3",          Abc_CommandSim3,             0 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "phase",         Abc_CommandDarPhase,         1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "synch",         Abc_CommandSynch,            1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "clockgate",     Abc_CommandClockGate,        1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "extwin",        Abc_CommandExtWin,           1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "inswin",        Abc_CommandInsWin,           1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "permute",       Abc_CommandPermute,          1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "unpermute",     Abc_CommandUnpermute,        1 );
+    Cmd_CommandAdd( pAbc, "Sequential",   "cubeenum",      Abc_CommandCubeEnum,         0 );
+
+    Cmd_CommandAdd( pAbc, "Verification", "cec",           Abc_CommandCec,              0 );
+    Cmd_CommandAdd( pAbc, "Verification", "dcec",          Abc_CommandDCec,             0 );
+    Cmd_CommandAdd( pAbc, "Verification", "dsec",          Abc_CommandDSec,             0 );
+    Cmd_CommandAdd( pAbc, "Verification", "dprove",        Abc_CommandDProve,           0 );
+    Cmd_CommandAdd( pAbc, "Verification", "absec",         Abc_CommandAbSec,            0 );
+    Cmd_CommandAdd( pAbc, "Verification", "simsec",        Abc_CommandSimSec,           0 );
+    Cmd_CommandAdd( pAbc, "Verification", "match",         Abc_CommandMatch,            0 );
+    Cmd_CommandAdd( pAbc, "Verification", "sat",           Abc_CommandSat,              0 );
+    Cmd_CommandAdd( pAbc, "Verification", "dsat",          Abc_CommandDSat,             0 );
+    Cmd_CommandAdd( pAbc, "Verification", "psat",          Abc_CommandPSat,             0 );
+    Cmd_CommandAdd( pAbc, "Verification", "prove",         Abc_CommandProve,            1 );
+    Cmd_CommandAdd( pAbc, "Verification", "iprove",        Abc_CommandIProve,           1 );
+    Cmd_CommandAdd( pAbc, "Verification", "debug",         Abc_CommandDebug,            0 );
+    Cmd_CommandAdd( pAbc, "Verification", "bmc",           Abc_CommandBmc,              0 );
+    Cmd_CommandAdd( pAbc, "Verification", "bmc2",          Abc_CommandBmc2,             0 );
+    Cmd_CommandAdd( pAbc, "Verification", "bmc3",          Abc_CommandBmc3,             1 );
+    Cmd_CommandAdd( pAbc, "Verification", "int",           Abc_CommandBmcInter,         1 );
+    Cmd_CommandAdd( pAbc, "Verification", "indcut",        Abc_CommandIndcut,           0 );
+    Cmd_CommandAdd( pAbc, "Verification", "enlarge",       Abc_CommandEnlarge,          1 );
+    Cmd_CommandAdd( pAbc, "Verification", "tempor",        Abc_CommandTempor,           1 );
+    Cmd_CommandAdd( pAbc, "Verification", "ind",           Abc_CommandInduction,        0 );
+    Cmd_CommandAdd( pAbc, "Verification", "constr",        Abc_CommandConstr,           0 );
+    Cmd_CommandAdd( pAbc, "Verification", "unfold",        Abc_CommandUnfold,           1 );
+    Cmd_CommandAdd( pAbc, "Verification", "fold",          Abc_CommandFold,             1 );
+    Cmd_CommandAdd( pAbc, "Verification", "unfold2",       Abc_CommandUnfold2,          1 );    // jlong 
+    Cmd_CommandAdd( pAbc, "Verification", "fold2",         Abc_CommandFold2,            1 );    // jlong 
+    Cmd_CommandAdd( pAbc, "Verification", "bm",            Abc_CommandBm,               1 );
+    Cmd_CommandAdd( pAbc, "Verification", "bm2",           Abc_CommandBm2,              1 );
+    Cmd_CommandAdd( pAbc, "Verification", "saucy3",        Abc_CommandSaucy,            1 );
+    Cmd_CommandAdd( pAbc, "Verification", "testcex",       Abc_CommandTestCex,          0 );
+    Cmd_CommandAdd( pAbc, "Verification", "pdr",           Abc_CommandPdr,              0 );
+    Cmd_CommandAdd( pAbc, "Verification", "reconcile",     Abc_CommandReconcile,        1 );
+    Cmd_CommandAdd( pAbc, "Verification", "cexsave",       Abc_CommandCexSave,          0 );
+    Cmd_CommandAdd( pAbc, "Verification", "cexload",       Abc_CommandCexLoad,          0 );
+    Cmd_CommandAdd( pAbc, "Verification", "cexcut",        Abc_CommandCexCut,           0 );
+    Cmd_CommandAdd( pAbc, "Verification", "cexmerge",      Abc_CommandCexMerge,         0 );
+//    Cmd_CommandAdd( pAbc, "Verification", "cexmin",        Abc_CommandCexMin,           0 );
+    Cmd_CommandAdd( pAbc, "Verification", "dualrail",      Abc_CommandDualRail,         1 );
+    Cmd_CommandAdd( pAbc, "Verification", "blockpo",       Abc_CommandBlockPo,          1 );
+    Cmd_CommandAdd( pAbc, "Verification", "iso",           Abc_CommandIso,              1 );
+
+    Cmd_CommandAdd( pAbc, "ABC9",         "&get",          Abc_CommandAbc9Get,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&put",          Abc_CommandAbc9Put,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&save",         Abc_CommandAbc9Save,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&load",         Abc_CommandAbc9Load,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&r",            Abc_CommandAbc9Read,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&read_blif",    Abc_CommandAbc9ReadBlif,     0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&read_cblif",   Abc_CommandAbc9ReadCBlif,    0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&read_stg",     Abc_CommandAbc9ReadStg,      0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&w",            Abc_CommandAbc9Write,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&ps",           Abc_CommandAbc9Ps,           0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&pfan",         Abc_CommandAbc9PFan,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&psig",         Abc_CommandAbc9PSig,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&status",       Abc_CommandAbc9Status,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&mux_profile",  Abc_CommandAbc9MuxProfile,   0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&show",         Abc_CommandAbc9Show,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&st",           Abc_CommandAbc9Strash,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&topand",       Abc_CommandAbc9Topand,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&add1hot",      Abc_CommandAbc9Add1Hot,      0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&cof",          Abc_CommandAbc9Cof,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&trim",         Abc_CommandAbc9Trim,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&dfs",          Abc_CommandAbc9Dfs,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&sim",          Abc_CommandAbc9Sim,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&sim3",         Abc_CommandAbc9Sim3,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&resim",        Abc_CommandAbc9Resim,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&speci",        Abc_CommandAbc9SpecI,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv",        Abc_CommandAbc9Equiv,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv2",       Abc_CommandAbc9Equiv2,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv3",       Abc_CommandAbc9Equiv3,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&semi",         Abc_CommandAbc9Semi,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&times",        Abc_CommandAbc9Times,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&frames",       Abc_CommandAbc9Frames,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&retime",       Abc_CommandAbc9Retime,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&enable",       Abc_CommandAbc9Enable,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&dc2",          Abc_CommandAbc9Dc2,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&dsd",          Abc_CommandAbc9Dsd,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&bidec",        Abc_CommandAbc9Bidec,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&shrink",       Abc_CommandAbc9Shrink,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&fx",           Abc_CommandAbc9Fx,           0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&b",            Abc_CommandAbc9Balance,      0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&blut",         Abc_CommandAbc9BalanceLut,   0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&syn2",         Abc_CommandAbc9Syn2,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&syn3",         Abc_CommandAbc9Syn3,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&syn4",         Abc_CommandAbc9Syn4,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&synch2",       Abc_CommandAbc9Synch2,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&false",        Abc_CommandAbc9False,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&miter",        Abc_CommandAbc9Miter,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&miter2",       Abc_CommandAbc9Miter2,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&append",       Abc_CommandAbc9Append,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&scl",          Abc_CommandAbc9Scl,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&lcorr",        Abc_CommandAbc9Lcorr,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&scorr",        Abc_CommandAbc9Scorr,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&choice",       Abc_CommandAbc9Choice,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&sat",          Abc_CommandAbc9Sat,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&fraig",        Abc_CommandAbc9Fraig,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&cfraig",       Abc_CommandAbc9CFraig,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&srm",          Abc_CommandAbc9Srm,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&srm2",         Abc_CommandAbc9Srm2,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&filter",       Abc_CommandAbc9Filter,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&reduce",       Abc_CommandAbc9Reduce,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv_mark",   Abc_CommandAbc9EquivMark,    0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&equiv_filter", Abc_CommandAbc9EquivFilter,  0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&cec",          Abc_CommandAbc9Cec,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&verify",       Abc_CommandAbc9Verify,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&sweep",        Abc_CommandAbc9Sweep,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&force",        Abc_CommandAbc9Force,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&embed",        Abc_CommandAbc9Embed,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&sopb",         Abc_CommandAbc9Sopb,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&dsdb",         Abc_CommandAbc9Dsdb,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&flow",         Abc_CommandAbc9Flow,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&if",           Abc_CommandAbc9If,           0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&iff",          Abc_CommandAbc9Iff,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&if2",          Abc_CommandAbc9If2,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&jf",           Abc_CommandAbc9Jf,           0 );
+#ifdef ABC_USE_PTHREADS
+    Cmd_CommandAdd( pAbc, "ABC9",         "&kf",           Abc_CommandAbc9Kf,           0 );
+#endif
+    Cmd_CommandAdd( pAbc, "ABC9",         "&lf",           Abc_CommandAbc9Lf,           0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&mf",           Abc_CommandAbc9Mf,           0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&nf",           Abc_CommandAbc9Nf,           0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&unmap",        Abc_CommandAbc9Unmap,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&struct",       Abc_CommandAbc9Struct,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&trace",        Abc_CommandAbc9Trace,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&speedup",      Abc_CommandAbc9Speedup,      0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&era",          Abc_CommandAbc9Era,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&dch",          Abc_CommandAbc9Dch,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&rpm",          Abc_CommandAbc9Rpm,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&back_reach",   Abc_CommandAbc9BackReach,    0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&posplit",      Abc_CommandAbc9Posplit,      0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&reachm",       Abc_CommandAbc9ReachM,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&reachp",       Abc_CommandAbc9ReachP,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&reachn",       Abc_CommandAbc9ReachN,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&reachy",       Abc_CommandAbc9ReachY,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&undo",         Abc_CommandAbc9Undo,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&iso",          Abc_CommandAbc9Iso,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&cexinfo",      Abc_CommandAbc9CexInfo,      0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&cycle",        Abc_CommandAbc9Cycle,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&cone",         Abc_CommandAbc9Cone,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&slice",        Abc_CommandAbc9Slice,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&popart",       Abc_CommandAbc9PoPart,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&gprove",       Abc_CommandAbc9GroupProve,   0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&mprove",       Abc_CommandAbc9MultiProve,   0 );
+#ifdef ABC_USE_PTHREADS
+    Cmd_CommandAdd( pAbc, "ABC9",         "&splitprove",   Abc_CommandAbc9SplitProve,   0 );
+#endif
+    Cmd_CommandAdd( pAbc, "ABC9",         "&bmc",          Abc_CommandAbc9Bmc,          0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&bcore",        Abc_CommandAbc9BCore,        0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&icheck",       Abc_CommandAbc9ICheck,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&sattest",      Abc_CommandAbc9SatTest,      0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&fftest",       Abc_CommandAbc9FFTest,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&inse",         Abc_CommandAbc9Inse,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&maxi",         Abc_CommandAbc9Maxi,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&bmci",         Abc_CommandAbc9Bmci,         0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&poxsim",       Abc_CommandAbc9PoXsim,       0 );
+    Cmd_CommandAdd( pAbc, "ABC9",         "&demiter",      Abc_CommandAbc9Demiter,      0 );
+//    Cmd_CommandAdd( pAbc, "ABC9",         "&popart2",      Abc_CommandAbc9PoPart2,      0 );
+//    Cmd_CommandAdd( pAbc, "ABC9",         "&cexcut",       Abc_CommandAbc9CexCut,       0 );
+//    Cmd_CommandAdd( pAbc, "ABC9",         "&cexmerge",     Abc_CommandAbc9CexMerge,     0 );
+//    Cmd_CommandAdd( pAbc, "ABC9",         "&cexmin",       Abc_CommandAbc9CexMin,       0 );
+
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&abs_derive",   Abc_CommandAbc9AbsDerive,    0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&abs_refine",   Abc_CommandAbc9AbsRefine,    0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_derive",   Abc_CommandAbc9GlaDerive,    0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_refine",   Abc_CommandAbc9GlaRefine,    0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_shrink",   Abc_CommandAbc9GlaShrink,    0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla",          Abc_CommandAbc9Gla,          0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&vta",          Abc_CommandAbc9Vta,          0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&vta_gla",      Abc_CommandAbc9Vta2Gla,      0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_vta",      Abc_CommandAbc9Gla2Vta,      0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&fla_gla",      Abc_CommandAbc9Fla2Gla,      0 );
+    Cmd_CommandAdd( pAbc, "Abstraction",  "&gla_fla",      Abc_CommandAbc9Gla2Fla,      0 );
+
+    Cmd_CommandAdd( pAbc, "Liveness",     "l2s",           Abc_CommandAbcLivenessToSafety,        0 );
+    Cmd_CommandAdd( pAbc, "Liveness",     "l2ssim",        Abc_CommandAbcLivenessToSafetySim,     0 );
+    Cmd_CommandAdd( pAbc, "Liveness",     "l3s",           Abc_CommandAbcLivenessToSafetyWithLTL, 0 );
+    Cmd_CommandAdd( pAbc, "Liveness",     "kcs",           Abc_CommandCS_kLiveness,               0 );
+    Cmd_CommandAdd( pAbc, "Liveness",     "nck",           Abc_CommandNChooseK,                   0 );
+
+    Cmd_CommandAdd( pAbc, "ABC9",         "&test",         Abc_CommandAbc9Test,         0 );
+    {
+//        extern Mf_ManTruthCount();
+//        Mf_ManTruthCount();
+    }
+
+    {
+        extern void Dar_LibStart();
+        Dar_LibStart();
+    }
+    {
+//        extern void Dau_DsdTest();
+//        Dau_DsdTest();
+//        extern void If_ManSatTest();
+//        If_ManSatTest();
+    }
+
+    if ( Sdm_ManCanRead() )
+        Sdm_ManRead();
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Abc_End( Abc_Frame_t * pAbc )
+{
+    extern Abc_Frame_t * Abc_FrameGetGlobalFrame();
+    Abc_FrameClearDesign();
+    Cnf_ManFree();
+    {
+        extern int Abc_NtkCompareAndSaveBest( Abc_Ntk_t * pNtk );
+        Abc_NtkCompareAndSaveBest( NULL );
+    }
+    {
+        extern void Dar_LibStop();
+        Dar_LibStop();
+    }
+    {
+        extern void Aig_RManQuit();
+        Aig_RManQuit();
+    }
+    {
+        extern void Npn_ManClean();
+        Npn_ManClean();
+    }
+    {
+        extern void Sdm_ManQuit();
+        Sdm_ManQuit();
+    }
+    Abc_NtkFraigStoreClean();
+    if ( Abc_FrameGetGlobalFrame()->pGia )
+        Gia_ManStop( Abc_FrameGetGlobalFrame()->pGia );
+    if ( Abc_FrameGetGlobalFrame()->pGia2 )
+        Gia_ManStop( Abc_FrameGetGlobalFrame()->pGia2 );
+    if ( Abc_FrameGetGlobalFrame()->pGiaBest )
+        Gia_ManStop( Abc_FrameGetGlobalFrame()->pGiaBest );
+    if ( Abc_NtkRecIsRunning3() )
+        Abc_NtkRecStop3();
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int fFactor;
+    int fSaveBest;
+    int fDumpResult;
+    int fUseLutLib;
+    int fPrintTime;
+    int fPrintMuxes;
+    int fPower;
+    int fGlitch;
+    int fSkipBuf;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set the defaults
+    fFactor   = 0;
+    fSaveBest = 0;
+    fDumpResult = 0;
+    fUseLutLib = 0;
+    fPrintTime = 0;
+    fPrintMuxes = 0;
+    fPower = 0;
+    fGlitch = 0;
+    fSkipBuf = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "fbdltmpgsh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'f':
+            fFactor ^= 1;
+            break;
+        case 'b':
+            fSaveBest ^= 1;
+            break;
+        case 'd':
+            fDumpResult ^= 1;
+            break;
+        case 'l':
+            fUseLutLib ^= 1;
+            break;
+        case 't':
+            fPrintTime ^= 1;
+            break;
+        case 'm':
+            fPrintMuxes ^= 1;
+            break;
+        case 'p':
+            fPower ^= 1;
+            break;
+        case 'g':
+            fGlitch ^= 1;
+            break;
+        case 's':
+            fSkipBuf ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) && fUseLutLib )
+    {
+        Abc_Print( -1, "Cannot print LUT delay for a non-logic network.\n" );
+        return 1;
+    }
+    Abc_NtkPrintStats( pNtk, fFactor, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch, fSkipBuf );
+    if ( fPrintTime )
+    {
+        pAbc->TimeTotal += pAbc->TimeCommand;
+        Abc_Print( 1, "elapse: %3.2f seconds, total: %3.2f seconds\n", pAbc->TimeCommand, pAbc->TimeTotal );
+        pAbc->TimeCommand = 0.0;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_stats [-fbdltmpgsh]\n" );
+    Abc_Print( -2, "\t        prints the network statistics\n" );
+    Abc_Print( -2, "\t-f    : toggles printing the literal count in the factored forms [default = %s]\n", fFactor? "yes": "no" );
+    Abc_Print( -2, "\t-b    : toggles saving the best logic network in \"best.blif\" [default = %s]\n", fSaveBest? "yes": "no" );
+    Abc_Print( -2, "\t-d    : toggles dumping network into file \"<input_file_name>_dump.blif\" [default = %s]\n", fDumpResult? "yes": "no" );
+    Abc_Print( -2, "\t-l    : toggles printing delay of LUT mapping using LUT library [default = %s]\n", fSaveBest? "yes": "no" );
+    Abc_Print( -2, "\t-t    : toggles printing runtime statistics [default = %s]\n", fPrintTime? "yes": "no" );
+    Abc_Print( -2, "\t-m    : toggles printing MUX statistics [default = %s]\n", fPrintMuxes? "yes": "no" );
+    Abc_Print( -2, "\t-p    : toggles printing power dissipation due to switching [default = %s]\n", fPower? "yes": "no" );
+    Abc_Print( -2, "\t-g    : toggles printing percentage of increased power due to glitching [default = %s]\n", fGlitch? "yes": "no" );
+    Abc_Print( -2, "\t-s    : toggles not counting single-output nodes as nodes [default = %s]\n", fSkipBuf? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintExdc( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkTemp;
+    double Percentage;
+    int fShort;
+    int c;
+    int fPrintDc;
+    extern double Abc_NtkSpacePercentage( Abc_Obj_t * pNode );
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set the defaults
+    fShort  = 1;
+    fPrintDc = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "sdh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fShort ^= 1;
+            break;
+        case 'd':
+            fPrintDc ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( pNtk->pExdc == NULL )
+    {
+        Abc_Print( -1, "Network has no EXDC.\n" );
+        return 1;
+    }
+
+    if ( fPrintDc )
+    {
+        if ( !Abc_NtkIsStrash(pNtk->pExdc) )
+        {
+            pNtkTemp = Abc_NtkStrash(pNtk->pExdc, 0, 0, 0);
+            Percentage = Abc_NtkSpacePercentage( Abc_ObjChild0( Abc_NtkPo(pNtkTemp, 0) ) );
+            Abc_NtkDelete( pNtkTemp );
+        }
+        else
+            Percentage = Abc_NtkSpacePercentage( Abc_ObjChild0( Abc_NtkPo(pNtk->pExdc, 0) ) );
+
+        Abc_Print( 1, "EXDC network statistics: " );
+        Abc_Print( 1, "(" );
+        if ( Percentage > 0.05 && Percentage < 99.95 )
+            Abc_Print( 1, "%.2f", Percentage );
+        else if ( Percentage > 0.000005 && Percentage < 99.999995 )
+            Abc_Print( 1, "%.6f", Percentage );
+        else
+            Abc_Print( 1, "%f", Percentage );
+        Abc_Print( 1, " %% don't-cares)\n" );
+    }
+    else
+        Abc_Print( 1, "EXDC network statistics: \n" );
+    Abc_NtkPrintStats( pNtk->pExdc, 0, 0, 0, 0, 0, 0, 0, 0 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_exdc [-dh]\n" );
+    Abc_Print( -2, "\t        prints the EXDC network statistics\n" );
+    Abc_Print( -2, "\t-d    : toggles printing don't-care percentage [default = %s]\n", fPrintDc? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintIo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Obj_t * pNode;
+    int c, fPrintFlops = 1;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "fh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'f':
+            fPrintFlops ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( argc > globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+
+    if ( argc == globalUtilOptind + 1 )
+    {
+        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+        if ( pNode == NULL )
+        {
+            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+            return 1;
+        }
+        Abc_NodePrintFanio( stdout, pNode );
+        return 0;
+    }
+    // print the nodes
+    Abc_NtkPrintIo( stdout, pNtk, fPrintFlops );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_io [-fh] <node>\n" );
+    Abc_Print( -2, "\t        prints the PIs/POs/flops or fanins/fanouts of a node\n" );
+    Abc_Print( -2, "\t-f    : toggles printing flops [default = %s]\n", fPrintFlops? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    Abc_Print( -2, "\tnode  : the node to print fanins/fanouts\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintLatch( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fPrintSccs;
+    extern void Abc_NtkPrintSccs( Abc_Ntk_t * pNtk, int fVerbose );
+
+    // set defaults
+    fPrintSccs = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fPrintSccs ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    // print the nodes
+    Abc_NtkPrintLatch( stdout, pNtk );
+    if ( fPrintSccs )
+        Abc_NtkPrintSccs( pNtk, 0 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_latch [-sh]\n" );
+    Abc_Print( -2, "\t        prints information about latches\n" );
+    Abc_Print( -2, "\t-s    : toggles printing SCCs of registers [default = %s]\n", fPrintSccs? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintFanio( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUsePis   = 0;
+    int fMffc     = 0;
+    int fVerbose  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "imvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'i':
+            fUsePis ^= 1;
+            break;
+        case 'm':
+            fMffc ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    // print the nodes
+    if ( fVerbose )
+        Abc_NtkPrintFanio( stdout, pNtk, fUsePis );
+    else
+        Abc_NtkPrintFanioNew( stdout, pNtk, fMffc );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_fanio [-imvh]\n" );
+    Abc_Print( -2, "\t        prints the statistics about fanins/fanouts of all nodes\n" );
+    Abc_Print( -2, "\t-i    : toggles considering fanouts of primary inputs only [default = %s]\n", fUsePis? "yes": "no" );
+    Abc_Print( -2, "\t-m    : toggles printing MFFC sizes instead of fanouts [default = %s]\n", fMffc? "yes": "no" );
+    Abc_Print( -2, "\t-v    : toggles verbose way of printing the stats [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintMffc( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    extern void Abc_NtkPrintMffc( FILE * pFile, Abc_Ntk_t * pNtk );
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // print the nodes
+    Abc_NtkPrintMffc( stdout, pNtk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_mffc [-h]\n" );
+    Abc_Print( -2, "\t        prints the MFFC of each node in the network\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintFactor( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Obj_t * pNode;
+    int c;
+    int fUseRealNames;
+
+    // set defaults
+    fUseRealNames = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "nh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'n':
+            fUseRealNames ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsSopLogic(pNtk) )
+    {
+        Abc_Print( -1, "Printing factored forms can be done for SOP networks.\n" );
+        return 1;
+    }
+
+    if ( argc > globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+
+    if ( argc == globalUtilOptind + 1 )
+    {
+        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+        if ( pNode == NULL )
+        {
+            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+            return 1;
+        }
+        Abc_NodePrintFactor( stdout, pNode, fUseRealNames );
+        return 0;
+    }
+    // print the nodes
+    Abc_NtkPrintFactor( stdout, pNtk, fUseRealNames );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_factor [-nh] <node>\n" );
+    Abc_Print( -2, "\t        prints the factored forms of nodes\n" );
+    Abc_Print( -2, "\t-n    : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    Abc_Print( -2, "\tnode  : (optional) one node to consider\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintLevel( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Obj_t * pNode;
+    int c;
+    int fListNodes;
+    int fProfile;
+    int fVerbose;
+
+    // set defaults
+    fListNodes = 0;
+    fProfile   = 1;
+    fVerbose   = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "npvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'n':
+            fListNodes ^= 1;
+            break;
+        case 'p':
+            fProfile ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !fProfile && !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+
+    if ( argc > globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+
+    if ( argc == globalUtilOptind + 1 )
+    {
+        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+        if ( pNode == NULL )
+        {
+            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+            return 1;
+        }
+        Abc_NodePrintLevel( stdout, pNode );
+        return 0;
+    }
+    // process all COs
+    Abc_NtkPrintLevel( stdout, pNtk, fProfile, fListNodes, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_level [-npvh] <node>\n" );
+    Abc_Print( -2, "\t        prints information about node level and cone size\n" );
+    Abc_Print( -2, "\t-n    : toggles printing nodes by levels [default = %s]\n", fListNodes? "yes": "no" );
+    Abc_Print( -2, "\t-p    : toggles printing level profile [default = %s]\n", fProfile? "yes": "no" );
+    Abc_Print( -2, "\t-v    : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    Abc_Print( -2, "\tnode  : (optional) one node to consider\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintSupport( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Vec_Ptr_t * vSuppFun;
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fStruct;
+    int fVerbose;
+    int fVeryVerbose;
+    extern Vec_Ptr_t * Sim_ComputeFunSupp( Abc_Ntk_t * pNtk, int fVerbose );
+    extern void Abc_NtkPrintStrSupports( Abc_Ntk_t * pNtk, int fMatrix );
+
+    // set defaults
+    fStruct = 1;
+    fVerbose = 0;
+    fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "svwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fStruct ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // print support information
+    if ( fStruct )
+    {
+        Abc_NtkPrintStrSupports( pNtk, fVeryVerbose );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for combinational networks (run \"comb\").\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+    vSuppFun = Sim_ComputeFunSupp( pNtk, fVerbose );
+    ABC_FREE( vSuppFun->pArray[0] );
+    Vec_PtrFree( vSuppFun );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_supp [-svwh]\n" );
+    Abc_Print( -2, "\t        prints the supports of the CO nodes\n" );
+    Abc_Print( -2, "\t-s    : toggle printing structural support only [default = %s].\n", fStruct? "yes": "no" );
+    Abc_Print( -2, "\t-v    : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w    : enable printing CI/CO dependency matrix [default = %s].\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintSymms( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseBdds;
+    int fNaive;
+    int fReorder;
+    int fVerbose;
+    extern void Abc_NtkSymmetries( Abc_Ntk_t * pNtk, int fUseBdds, int fNaive, int fReorder, int fVerbose );
+
+    // set defaults
+    fUseBdds = 0;
+    fNaive   = 0;
+    fReorder = 1;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "bnrvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'b':
+            fUseBdds ^= 1;
+            break;
+        case 'n':
+            fNaive ^= 1;
+            break;
+        case 'r':
+            fReorder ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for combinational networks (run \"comb\").\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsStrash(pNtk) )
+        Abc_NtkSymmetries( pNtk, fUseBdds, fNaive, fReorder, fVerbose );
+    else
+    {
+        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        Abc_NtkSymmetries( pNtk, fUseBdds, fNaive, fReorder, fVerbose );
+        Abc_NtkDelete( pNtk );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_symm [-bnrvh]\n" );
+    Abc_Print( -2, "\t         computes symmetries of the PO functions\n" );
+    Abc_Print( -2, "\t-b     : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
+    Abc_Print( -2, "\t-n     : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
+    Abc_Print( -2, "\t-r     : enable dynamic BDD variable reordering [default = %s].\n", fReorder? "yes": "no" );
+    Abc_Print( -2, "\t-v     : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintUnate( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseBdds;
+    int fUseNaive;
+    int fVerbose;
+    extern void Abc_NtkPrintUnate( Abc_Ntk_t * pNtk, int fUseBdds, int fUseNaive, int fVerbose );
+
+    // set defaults
+    fUseBdds  = 1;
+    fUseNaive = 0;
+    fVerbose  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "bnvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'b':
+            fUseBdds ^= 1;
+            break;
+        case 'n':
+            fUseNaive ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+    Abc_NtkPrintUnate( pNtk, fUseBdds, fUseNaive, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_unate [-bnvh]\n" );
+    Abc_Print( -2, "\t         computes unate variables of the PO functions\n" );
+    Abc_Print( -2, "\t-b     : toggle BDD-based or SAT-based computations [default = %s].\n", fUseBdds? "BDD": "SAT" );
+    Abc_Print( -2, "\t-n     : toggle naive BDD-based computation [default = %s].\n", fUseNaive? "yes": "no" );
+    Abc_Print( -2, "\t-v     : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintAuto( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int Output;
+    int fNaive;
+    int fVerbose;
+    extern void Abc_NtkAutoPrint( Abc_Ntk_t * pNtk, int Output, int fNaive, int fVerbose );
+
+    // set defaults
+    Output   = -1;
+    fNaive   = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Onvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'O':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Output = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Output < 0 )
+                goto usage;
+            break;
+        case 'n':
+            fNaive ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+
+
+    Abc_NtkAutoPrint( pNtk, Output, fNaive, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_auto [-O <num>] [-nvh]\n" );
+    Abc_Print( -2, "\t           computes autosymmetries of the PO functions\n" );
+    Abc_Print( -2, "\t-O <num> : (optional) the 0-based number of the output [default = all]\n");
+    Abc_Print( -2, "\t-n       : enable naive BDD-based computation [default = %s].\n", fNaive? "yes": "no" );
+    Abc_Print( -2, "\t-v       : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintKMap( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Obj_t * pNode;
+    int c;
+    int fUseRealNames;
+
+    extern void Abc_NodePrintKMap( Abc_Obj_t * pNode, int fUseRealNames );
+
+    // set defaults
+    fUseRealNames = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "nh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'n':
+            fUseRealNames ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( argc == globalUtilOptind + 2 )
+    {
+        Abc_NtkShow6VarFunc( argv[globalUtilOptind], argv[globalUtilOptind+1] );
+        return 0;
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Visualization of Karnaugh maps works for logic networks.\n" );
+        return 1;
+    }
+    if ( argc > globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+    if ( argc == globalUtilOptind )
+    {
+        pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
+        if ( !Abc_ObjIsNode(pNode) )
+        {
+            Abc_Print( -1, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
+            return 1;
+        }
+    }
+    else
+    {
+        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+        if ( pNode == NULL )
+        {
+            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+            return 1;
+        }
+    }
+    Abc_NtkToBdd(pNtk);
+    Abc_NodePrintKMap( pNode, fUseRealNames );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_kmap [-nh] <node>\n" );
+    Abc_Print( -2, "\t        shows the truth table of the node\n" );
+    Abc_Print( -2, "\t-n    : toggles real/dummy fanin names [default = %s]\n", fUseRealNames? "real": "dummy" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    Abc_Print( -2, "\t<node>: the node to consider (default = the driver of the first PO)\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintGates( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseLibrary;
+
+    extern void Abc_NtkPrintGates( Abc_Ntk_t * pNtk, int fUseLibrary );
+
+    // set defaults
+    fUseLibrary = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUseLibrary ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkHasAig(pNtk) )
+    {
+        Abc_Print( -1, "Printing gates does not work for AIGs and sequential AIGs.\n" );
+        return 1;
+    }
+
+    Abc_NtkPrintGates( pNtk, fUseLibrary );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_gates [-lh]\n" );
+    Abc_Print( -2, "\t        prints statistics about gates used in the network\n" );
+    Abc_Print( -2, "\t-l    : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintSharing( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseLibrary;
+
+    extern void Abc_NtkPrintSharing( Abc_Ntk_t * pNtk );
+
+    // set defaults
+    fUseLibrary = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUseLibrary ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    Abc_NtkPrintSharing( pNtk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_sharing [-h]\n" );
+    Abc_Print( -2, "\t        prints the number of shared nodes in the TFI cones of the COs\n" );
+//    Abc_Print( -2, "\t-l    : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintXCut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseLibrary;
+
+    extern int Abc_NtkCrossCut( Abc_Ntk_t * pNtk );
+
+    // set defaults
+    fUseLibrary = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUseLibrary ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    Abc_NtkCrossCut( pNtk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_xcut [-h]\n" );
+    Abc_Print( -2, "\t        prints the size of the cross cut of the current network\n" );
+//    Abc_Print( -2, "\t-l    : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintDsd( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fCofactor;
+    int nCofLevel;
+    int fProfile;
+    int fPrintDec;
+
+    extern void Kit_DsdTest( unsigned * pTruth, int nVars );
+    extern void Kit_DsdPrintCofactors( unsigned * pTruth, int nVars, int nCofLevel, int fVerbose );
+    extern void Dau_DecTrySets( word * p, int nVars, int fVerbose );
+
+    // set defaults
+    nCofLevel = 1;
+    fCofactor = 0;
+    fProfile  = 0;
+    fPrintDec = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Npcdh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCofLevel = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCofLevel < 0 )
+                goto usage;
+            break;
+        case 'p':
+            fProfile ^= 1;
+            break;
+        case 'c':
+            fCofactor ^= 1;
+            break;
+        case 'd':
+            fPrintDec ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    // get the truth table of the first output
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Currently works only for logic networks.\n" );
+        return 1;
+    }
+    Abc_NtkToAig( pNtk );
+    // convert it to truth table
+    {
+        Abc_Obj_t * pObj = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
+        Vec_Int_t * vMemory;
+        unsigned * pTruth;
+        if ( !Abc_ObjIsNode(pObj) )
+        {
+            Abc_Print( -1, "The fanin of the first PO node does not have a logic function.\n" );
+            return 1;
+        }
+        if ( Abc_ObjFaninNum(pObj) > 16 )
+        {
+            Abc_Print( -1, "Currently works only for up to 16 inputs.\n" );
+            return 1;
+        }
+        vMemory = Vec_IntAlloc(0);
+        pTruth = Hop_ManConvertAigToTruth( (Hop_Man_t *)pNtk->pManFunc, Hop_Regular((Hop_Obj_t *)pObj->pData), Abc_ObjFaninNum(pObj), vMemory, 0 );
+        if ( Hop_IsComplement((Hop_Obj_t *)pObj->pData) )
+            Extra_TruthNot( pTruth, pTruth, Abc_ObjFaninNum(pObj) );
+//        Extra_PrintBinary( stdout, pTruth, 1 << Abc_ObjFaninNum(pObj) );
+//        Abc_Print( -1, "\n" );
+        if ( fPrintDec )//&&Abc_ObjFaninNum(pObj) <= 6 )
+        {
+            word * pTruthW = (word *)pTruth;
+            if ( Abc_ObjFaninNum(pObj) < 6 )
+                pTruthW[0] = Abc_Tt6Stretch( pTruthW[0], Abc_ObjFaninNum(pObj) );
+            Dau_DecTrySets( (word *)pTruth, Abc_ObjFaninNum(pObj), 1 );
+        }
+        if ( fProfile )
+            Kit_TruthPrintProfile( pTruth, Abc_ObjFaninNum(pObj) );
+        else if ( fCofactor )
+            Kit_DsdPrintCofactors( pTruth, Abc_ObjFaninNum(pObj), nCofLevel, 1 );
+        else
+            Kit_DsdTest( pTruth, Abc_ObjFaninNum(pObj) );
+        Vec_IntFree( vMemory );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_dsd [-pcdh] [-N <num>]\n" );
+    Abc_Print( -2, "\t           print DSD formula for a single-output function with less than 16 variables\n" );
+    Abc_Print( -2, "\t-p       : toggle printing profile [default = %s]\n", fProfile? "yes": "no" );
+    Abc_Print( -2, "\t-c       : toggle recursive cofactoring [default = %s]\n", fCofactor? "yes": "no" );
+    Abc_Print( -2, "\t-d       : toggle printing decompositions [default = %s]\n", fPrintDec? "yes": "no" );
+    Abc_Print( -2, "\t-N <num> : the number of levels to cofactor [default = %d]\n", nCofLevel );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintCone( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseLibrary;
+
+    // set defaults
+    fUseLibrary = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUseLibrary ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 1;
+    }
+    Abc_NtkDarPrintCone( pNtk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_cone [-h]\n" );
+    Abc_Print( -2, "\t        prints cones of influence info for each primary output\n" );
+//    Abc_Print( -2, "\t-l    : used library gate names (if mapped) [default = %s]\n", fUseLibrary? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseLibrary;
+
+    extern void Abc_NtkPrintMiter( Abc_Ntk_t * pNtk );
+
+    // set defaults
+    fUseLibrary = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUseLibrary ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "The network is should be structurally hashed.\n" );
+        return 1;
+    }
+    Abc_NtkPrintMiter( pNtk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_miter [-h]\n" );
+    Abc_Print( -2, "\t        prints the status of the miter\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintStatus( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c, fShort = 1;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fShort ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    Abc_Print( 1,"Status = %d  Frames = %d   ", pAbc->Status, pAbc->nFrames );
+    if ( pAbc->pCex == NULL && pAbc->vCexVec == NULL )
+        Abc_Print( 1,"Cex is not defined.\n" );
+    else
+    {
+        if ( pAbc->pCex )
+            Abc_CexPrintStats( pAbc->pCex );
+        if ( pAbc->vCexVec )
+        {
+            Abc_Cex_t * pTemp;
+            int nCexes = 0;
+            int Counter = 0;
+            printf( "\n" );
+            Vec_PtrForEachEntry( Abc_Cex_t *, pAbc->vCexVec, pTemp, c )
+            {
+                if ( pTemp == (void *)(ABC_PTRINT_T)1 )
+                {
+                    Counter++;
+                    continue;
+                }
+                if ( pTemp )
+                {
+                    printf( "%4d : ", ++nCexes );
+                    Abc_CexPrintStats( pTemp );
+                }
+            }
+            if ( Counter )
+                printf( "In total, %d (out of %d) outputs are \"sat\" but CEXes are not recorded.\n", Counter, Vec_PtrSize(pAbc->vCexVec) );
+        }
+    }
+    if ( pAbc->vStatuses )
+    {
+        if ( fShort )
+        {
+            printf( "Status array contains %d SAT, %d UNSAT, and %d UNDEC entries (out of %d).", 
+                Vec_IntCountEntry(pAbc->vStatuses, 0), Vec_IntCountEntry(pAbc->vStatuses, 1), 
+                Vec_IntCountEntry(pAbc->vStatuses, -1), Vec_IntSize(pAbc->vStatuses) );
+        }
+        else
+        {
+            int i, Entry;
+            Vec_IntForEachEntry( pAbc->vStatuses, Entry, i )
+                printf( "%d=%d  ", i, Entry );
+        }
+        printf( "\n" );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_status [-sh]\n" );
+    Abc_Print( -2, "\t        prints verification status\n" );
+    Abc_Print( -2, "\t-s    : toggle using short print-out [default = %s]\n", fShort? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPrintDelay( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Obj_t * pObjIn = NULL, * pObjOut = NULL;
+    int c;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsMappedLogic(pNtk) )
+    {
+        Abc_Print( -1, "Delay trace works only for network mapped into standard cells.\n" );
+        return 1;
+    }
+    if ( argc > globalUtilOptind + 2 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+    // collect the first name (PO name)
+    if ( argc >= globalUtilOptind + 1 )
+    {
+        int Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind], ABC_OBJ_PO );
+        if ( Num < 0 )
+            Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind], ABC_OBJ_BI );
+        if ( Num >= 0 )
+            pObjOut = Abc_NtkObj( pNtk, Num );
+        if ( pObjOut == NULL )
+        {
+            Abc_Print( 1, "Cannot find combinational output \"%s\".\n", argv[globalUtilOptind] );
+            return 1;
+        }
+    }
+    // collect the second name (PI name)
+    if ( argc == globalUtilOptind + 2 )
+    {
+        int Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind+1], ABC_OBJ_PI );
+        if ( Num < 0 )
+            Num = Nm_ManFindIdByName( pNtk->pManName, argv[globalUtilOptind+1], ABC_OBJ_BO );
+        if ( Num >= 0 )
+            pObjIn = Abc_NtkObj( pNtk, Num );
+        if ( pObjIn == NULL )
+        {
+            Abc_Print( 1, "Cannot find combinational input \"%s\".\n", argv[globalUtilOptind+1] );
+            return 1;
+        }
+    }
+    Abc_NtkDelayTrace( pNtk, pObjOut, pObjIn, 1 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: print_delay [-h] <CO_name> <CI_name>\n" );
+    Abc_Print( -2, "\t            prints one critical path of the mapped network\n" );
+    Abc_Print( -2, "\t-h        : print the command usage\n");
+    Abc_Print( -2, "\t<CO_name> : (optional) the sink of the critical path (primary output or flop input)\n");
+    Abc_Print( -2, "\t<CI_name> : (optional) the source of the critical path (primary input or flop output)\n");
+    Abc_Print( -2, "\t            (if CO and/or CI are not given, uses the most critical ones)\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandShow( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fSeq;
+    int fGateNames;
+    int fUseReverse;
+    int fFlopDep;
+    extern void Abc_NtkShow( Abc_Ntk_t * pNtk, int fGateNames, int fSeq, int fUseReverse );
+    extern void Abc_NtkShowFlopDependency( Abc_Ntk_t * pNtk );
+
+    // set defaults
+    fSeq        = 0;
+    fGateNames  = 0;
+    fUseReverse = 1;
+    fFlopDep    = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "rsgfh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'r':
+            fUseReverse ^= 1;
+            break;
+        case 's':
+            fSeq ^= 1;
+            break;
+        case 'g':
+            fGateNames ^= 1;
+            break;
+        case 'f':
+            fFlopDep ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( fFlopDep )
+        Abc_NtkShowFlopDependency( pNtk );
+    else
+        Abc_NtkShow( pNtk, fGateNames, fSeq, fUseReverse );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: show [-srgfh]\n" );
+    Abc_Print( -2, "       visualizes the network structure using DOT and GSVIEW\n" );
+#ifdef WIN32
+    Abc_Print( -2, "       \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
+    Abc_Print( -2, "       (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
+#endif
+    Abc_Print( -2, "\t-s    : toggles visualization of sequential networks [default = %s].\n", fSeq? "yes": "no" );
+    Abc_Print( -2, "\t-r    : toggles ordering nodes in reverse order [default = %s].\n", fUseReverse? "yes": "no" );
+    Abc_Print( -2, "\t-g    : toggles printing gate names for mapped network [default = %s].\n", fGateNames? "yes": "no" );
+    Abc_Print( -2, "\t-f    : toggles visualizing flop dependency graph [default = %s].\n", fFlopDep? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandShowBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Obj_t * pNode;
+    int c;
+    extern void Abc_NodeShowBdd( Abc_Obj_t * pNode );
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsBddLogic(pNtk) )
+    {
+        Abc_Print( -1, "Visualizing BDDs can only be done for logic BDD networks (run \"bdd\").\n" );
+        return 1;
+    }
+
+    if ( argc > globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+    if ( argc == globalUtilOptind )
+    {
+        pNode = Abc_ObjFanin0( Abc_NtkPo(pNtk, 0) );
+        if ( !Abc_ObjIsNode(pNode) )
+        {
+            Abc_Print( -1, "The driver \"%s\" of the first PO is not an internal node.\n", Abc_ObjName(pNode) );
+            return 1;
+        }
+    }
+    else
+    {
+        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+        if ( pNode == NULL )
+        {
+            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+            return 1;
+        }
+    }
+    Abc_NodeShowBdd( pNode );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: show_bdd [-h] <node>\n" );
+    Abc_Print( -2, "       visualizes the BDD of a node using DOT and GSVIEW\n" );
+#ifdef WIN32
+    Abc_Print( -2, "       \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
+    Abc_Print( -2, "       (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
+#endif
+    Abc_Print( -2, "\t<node>: the node to consider [default = the driver of the first PO]\n");
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandShowCut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Obj_t * pNode;
+    int c;
+    int nNodeSizeMax;
+    int nConeSizeMax;
+    extern void Abc_NodeShowCut( Abc_Obj_t * pNode, int nNodeSizeMax, int nConeSizeMax );
+
+    // set defaults
+    nNodeSizeMax = 10;
+    nConeSizeMax = ABC_INFINITY;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NCh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nNodeSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nNodeSizeMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConeSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConeSizeMax < 0 )
+                goto usage;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Visualizing cuts only works for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+    if ( argc != globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+
+    pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+    if ( pNode == NULL )
+    {
+        Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+        return 1;
+    }
+    Abc_NodeShowCut( pNode, nNodeSizeMax, nConeSizeMax );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: show_cut [-N <num>] [-C <num>] [-h] <node>\n" );
+    Abc_Print( -2, "             visualizes the cut of a node using DOT and GSVIEW\n" );
+#ifdef WIN32
+    Abc_Print( -2, "             \"dot.exe\" and \"gsview32.exe\" should be set in the paths\n" );
+    Abc_Print( -2, "             (\"gsview32.exe\" may be in \"C:\\Program Files\\Ghostgum\\gsview\\\")\n" );
+#endif
+    Abc_Print( -2, "\t-N <num> : the max size of the cut to be computed [default = %d]\n", nNodeSizeMax );
+    Abc_Print( -2, "\t-C <num> : the max support of the containing cone [default = %d]\n", nConeSizeMax );
+    Abc_Print( -2, "\t<node>   : the node to consider\n");
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCollapse( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int fVerbose;
+    int fBddSizeMax;
+    int fDualRail;
+    int fReorder;
+    int c;
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    fVerbose = 0;
+    fReorder = 1;
+    fDualRail = 0;
+    fBddSizeMax = ABC_INFINITY;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Brdvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            fBddSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( fBddSizeMax < 0 )
+                goto usage;
+            break;
+        case 'd':
+            fDualRail ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'r':
+            fReorder ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( Abc_NtkIsStrash(pNtk) )
+        pNtkRes = Abc_NtkCollapse( pNtk, fBddSizeMax, fDualRail, fReorder, fVerbose );
+    else
+    {
+        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        pNtkRes = Abc_NtkCollapse( pNtk, fBddSizeMax, fDualRail, fReorder, fVerbose );
+        Abc_NtkDelete( pNtk );
+    }
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Collapsing has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: collapse [-B <num>] [-rdvh]\n" );
+    Abc_Print( -2, "\t          collapses the network by constructing global BDDs\n" );
+    Abc_Print( -2, "\t-B <num>: limit on live BDD nodes during collapsing [default = %d]\n", fBddSizeMax );
+    Abc_Print( -2, "\t-r      : toggles dynamic variable reordering [default = %s]\n", fReorder? "yes": "no" );
+    Abc_Print( -2, "\t-d      : toggles dual-rail collapsing mode [default = %s]\n", fDualRail? "yes": "no" );
+    Abc_Print( -2, "\t-v      : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h      : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    Abc_Obj_t * pObj;
+    int c;
+    int fAllNodes;
+    int fRecord;
+    int fCleanup;
+    int fComplOuts;
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fAllNodes = 0;
+    fCleanup  = 1;
+    fRecord   = 0;
+    fComplOuts= 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "acrih" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'a':
+            fAllNodes ^= 1;
+            break;
+        case 'c':
+            fCleanup ^= 1;
+            break;
+        case 'r':
+            fRecord ^= 1;
+            break;
+        case 'i':
+            fComplOuts ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkStrash( pNtk, fAllNodes, fCleanup, fRecord );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Strashing has failed.\n" );
+        return 1;
+    }
+    if ( fComplOuts )
+    Abc_NtkForEachPo( pNtkRes, pObj, c )
+        Abc_ObjXorFaninC( pObj, 0 );
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: strash [-acrih]\n" );
+    Abc_Print( -2, "\t        transforms combinational logic into an AIG\n" );
+    Abc_Print( -2, "\t-a    : toggles between using all nodes and DFS nodes [default = %s]\n", fAllNodes? "all": "DFS" );
+    Abc_Print( -2, "\t-c    : toggles cleanup to remove the dagling AIG nodes [default = %s]\n", fCleanup? "all": "DFS" );
+    Abc_Print( -2, "\t-r    : toggles using the record of AIG subgraphs [default = %s]\n", fRecord? "yes": "no" );
+    Abc_Print( -2, "\t-i    : toggles complementing the POs of the AIG [default = %s]\n", fComplOuts? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBalance( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes, * pNtkTemp;
+    int c;
+    int fDuplicate;
+    int fSelective;
+    int fUpdateLevel;
+    int fExor;
+    int fVerbose;
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    fDuplicate   = 0;
+    fSelective   = 0;
+    fUpdateLevel = 1;
+    fExor        = 0;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ldsxvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'd':
+            fDuplicate ^= 1;
+            break;
+        case 's':
+            fSelective ^= 1;
+            break;
+        case 'x':
+            fExor ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    // get the new network
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        if ( fExor )
+            pNtkRes = Abc_NtkBalanceExor( pNtk, fUpdateLevel, fVerbose );
+        else
+            pNtkRes = Abc_NtkBalance( pNtk, fDuplicate, fSelective, fUpdateLevel );
+    }
+    else
+    {
+        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        if ( pNtkTemp == NULL )
+        {
+            Abc_Print( -1, "Strashing before balancing has failed.\n" );
+            return 1;
+        }
+        if ( fExor )
+            pNtkRes = Abc_NtkBalanceExor( pNtkTemp, fUpdateLevel, fVerbose );
+        else
+            pNtkRes = Abc_NtkBalance( pNtkTemp, fDuplicate, fSelective, fUpdateLevel );
+        Abc_NtkDelete( pNtkTemp );
+    }
+
+    // check if balancing worked
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Balancing has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: balance [-ldsxvh]\n" );
+    Abc_Print( -2, "\t        transforms the current network into a well-balanced AIG\n" );
+    Abc_Print( -2, "\t-l    : toggle minimizing the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+    Abc_Print( -2, "\t-s    : toggle duplication on the critical paths [default = %s]\n", fSelective? "yes": "no" );
+    Abc_Print( -2, "\t-x    : toggle balancing multi-input EXORs [default = %s]\n", fExor? "yes": "no" );
+    Abc_Print( -2, "\t-v    : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMuxStruct( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkMuxRestructure( Abc_Ntk_t * pNtk, int fVerbose );
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    // get the new network
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Does not work for a logic network.\n" );
+        return 1;
+    }
+    // check if balancing worked
+//    pNtkRes = Abc_NtkMuxRestructure( pNtk, fVerbose );
+    pNtkRes = NULL;
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "MUX restructuring has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: mux_struct [-vh]\n" );
+    Abc_Print( -2, "\t        performs MUX restructuring of the current network\n" );
+    Abc_Print( -2, "\t-v    : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMulti( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int nThresh, nFaninMax, c;
+    int fCnf;
+    int fMulti;
+    int fSimple;
+    int fFactor;
+    extern Abc_Ntk_t * Abc_NtkMulti( Abc_Ntk_t * pNtk, int nThresh, int nFaninMax, int fCnf, int fMulti, int fSimple, int fFactor );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    nThresh   =  1;
+    nFaninMax = 20;
+    fCnf      =  0;
+    fMulti    =  1;
+    fSimple   =  0;
+    fFactor   =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "TFmcsfh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nThresh = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nThresh < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFaninMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFaninMax < 0 )
+                goto usage;
+            break;
+        case 'c':
+            fCnf ^= 1;
+            break;
+        case 'm':
+            fMulti ^= 1;
+            break;
+        case 's':
+            fSimple ^= 1;
+            break;
+        case 'f':
+            fFactor ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkMulti( pNtk, nThresh, nFaninMax, fCnf, fMulti, fSimple, fFactor );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Renoding has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: multi [-TF <num>] [-msfch]\n" );
+    Abc_Print( -2, "\t          transforms an AIG into a logic network by creating larger nodes\n" );
+    Abc_Print( -2, "\t-F <num>: the maximum fanin size after renoding [default = %d]\n", nFaninMax );
+    Abc_Print( -2, "\t-T <num>: the threshold for AIG node duplication [default = %d]\n", nThresh );
+    Abc_Print( -2, "\t          (an AIG node is the root of a new node after renoding\n" );
+    Abc_Print( -2, "\t          if this leads to duplication of no more than %d AIG nodes,\n", nThresh );
+    Abc_Print( -2, "\t          that is, if [(numFanouts(Node)-1) * size(MFFC(Node))] <= %d)\n", nThresh );
+    Abc_Print( -2, "\t-m      : creates multi-input AND graph [default = %s]\n", fMulti? "yes": "no" );
+    Abc_Print( -2, "\t-s      : creates a simple AIG (no renoding) [default = %s]\n", fSimple? "yes": "no" );
+    Abc_Print( -2, "\t-f      : creates a factor-cut network [default = %s]\n", fFactor? "yes": "no" );
+    Abc_Print( -2, "\t-c      : performs renoding to derive the CNF [default = %s]\n", fCnf? "yes": "no" );
+    Abc_Print( -2, "\t-h      : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRenode( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int nLutSize, nCutsMax, c;
+    int nFlowIters, nAreaIters;
+    int fArea;
+    int fUseBdds;
+    int fUseSops;
+    int fUseCnfs;
+    int fUseMv;
+    int fVerbose;
+    extern Abc_Ntk_t * Abc_NtkRenode( Abc_Ntk_t * pNtk, int nLutSize, int nCutsMax, int nFlowIters, int nAreaIters, int fArea, int fUseBdds, int fUseSops, int fUseCnfs, int fUseMv, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    nLutSize   =  8;
+    nCutsMax   =  4;
+    nFlowIters =  1;
+    nAreaIters =  1;
+    fArea      =  0;
+    fUseBdds   =  0;
+    fUseSops   =  0;
+    fUseCnfs   =  0;
+    fUseMv     =  0;
+    fVerbose   =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAabscivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nFlowIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFlowIters < 0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nAreaIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nAreaIters < 0 )
+                goto usage;
+            break;
+        case 'a':
+            fArea ^= 1;
+            break;
+        case 'b':
+            fUseBdds ^= 1;
+            break;
+        case 's':
+            fUseSops ^= 1;
+            break;
+        case 'c':
+            fUseCnfs ^= 1;
+            break;
+        case 'i':
+            fUseMv ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( fUseBdds + fUseSops + fUseCnfs + fUseMv > 1 )
+    {
+        Abc_Print( -1, "Cannot optimize two parameters at the same time.\n" );
+        return 1;
+    }
+
+    if ( nLutSize < 2 || nLutSize > IF_MAX_FUNC_LUTSIZE )
+    {
+        Abc_Print( -1, "Incorrect LUT size (%d).\n", nLutSize );
+        return 1;
+    }
+
+    if ( nCutsMax < 1 || nCutsMax >= (1<<12) )
+    {
+        Abc_Print( -1, "Incorrect number of cuts.\n" );
+        return 1;
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Cannot renode a network that is not an AIG (run \"strash\").\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkRenode( pNtk, nLutSize, nCutsMax, nFlowIters, nAreaIters, fArea, fUseBdds, fUseSops, fUseCnfs, fUseMv, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Renoding has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: renode [-KCFA <num>] [-sbciav]\n" );
+    Abc_Print( -2, "\t          transforms the AIG into a logic network with larger nodes\n" );
+    Abc_Print( -2, "\t          while minimizing the number of FF literals of the node SOPs\n" );
+    Abc_Print( -2, "\t-K <num>: the max cut size for renoding (2 < num < %d) [default = %d]\n", IF_MAX_FUNC_LUTSIZE+1, nLutSize );
+    Abc_Print( -2, "\t-C <num>: the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCutsMax );
+    Abc_Print( -2, "\t-F <num>: the number of area flow recovery iterations (num >= 0) [default = %d]\n", nFlowIters );
+    Abc_Print( -2, "\t-A <num>: the number of exact area recovery iterations (num >= 0) [default = %d]\n", nAreaIters );
+    Abc_Print( -2, "\t-s      : toggles minimizing SOP cubes instead of FF lits [default = %s]\n", fUseSops? "yes": "no" );
+    Abc_Print( -2, "\t-b      : toggles minimizing BDD nodes instead of FF lits [default = %s]\n", fUseBdds? "yes": "no" );
+    Abc_Print( -2, "\t-c      : toggles minimizing CNF clauses instead of FF lits [default = %s]\n", fUseCnfs? "yes": "no" );
+    Abc_Print( -2, "\t-i      : toggles minimizing MV-SOP instead of FF lits [default = %s]\n", fUseMv? "yes": "no" );
+    Abc_Print( -2, "\t-a      : toggles area-oriented mapping [default = %s]\n", fArea? "yes": "no" );
+    Abc_Print( -2, "\t-v      : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h      : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fCleanupPis;
+    int fCleanupPos;
+    int fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkDarCleanupAig( Abc_Ntk_t * pNtk, int fCleanupPis, int fCleanupPos, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    fCleanupPis = 1;
+    fCleanupPos = 1;
+    fVerbose    = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "iovh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'i':
+            fCleanupPis ^= 1;
+            break;
+        case 'o':
+            fCleanupPos ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        if ( !fCleanupPos && !fCleanupPos )
+        {
+            Abc_Print( -1, "Cleanup for PIs and POs is not enabled.\n" );
+            pNtkRes = Abc_NtkDup( pNtk );
+        }
+        else
+            pNtkRes = Abc_NtkDarCleanupAig( pNtk, fCleanupPis, fCleanupPos, fVerbose );
+    }
+    else
+    {
+        Abc_NtkCleanup( pNtk, fVerbose );
+        pNtkRes = Abc_NtkDup( pNtk );
+    }
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Cleanup has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cleanup [-iovh]\n" );
+    Abc_Print( -2, "\t        for logic networks, removes dangling combinatinal logic\n" );
+    Abc_Print( -2, "\t        for AIGs, removes PIs w/o fanout and POs driven by const-0\n" );
+    Abc_Print( -2, "\t-i    : toggles removing PIs without fanout [default = %s]\n", fCleanupPis? "yes": "no" );
+    Abc_Print( -2, "\t-o    : toggles removing POs with const-0 drivers [default = %s]\n", fCleanupPos? "yes": "no" );
+    Abc_Print( -2, "\t-v    : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fSingle = 0;
+    int fVerbose = 0;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fSingle ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "The classical (SIS-like) sweep can only be performed on a logic network.\n" );
+        return 1;
+    }
+    // modify the current network
+    if ( fSingle )
+        Abc_NtkSweepBufsInvs( pNtk, fVerbose );
+    else
+        Abc_NtkSweep( pNtk, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: sweep [-svh]\n" );
+    Abc_Print( -2, "\t        removes dangling nodes; propagates constant, buffers, inverters\n" );
+    Abc_Print( -2, "\t-s    : toggle sweeping buffers/inverters only [default = %s]\n", fSingle? "yes": "no" );
+    Abc_Print( -2, "\t-v    : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFastExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Abc_NtkFxPerform( Abc_Ntk_t * pNtk, int nNewNodesMax, int nLitCountMax, int fVerbose, int fVeryVerbose );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Fxu_Data_t Params, * p = &Params;
+    int c, fNewAlgo = 1;
+    // set the defaults
+    Abc_NtkSetDefaultFxParams( p );
+    Extra_UtilGetoptReset();
+    while ( (c = Extra_UtilGetopt(argc, argv, "SDNWMsdzcnvwh")) != EOF )
+    {
+        switch (c)
+        {
+            case 'S':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                    goto usage;
+                }
+                p->nSingleMax = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( p->nSingleMax < 0 )
+                    goto usage;
+                break;
+            case 'D':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                    goto usage;
+                }
+                p->nPairsMax = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( p->nPairsMax < 0 )
+                    goto usage;
+                break;
+            case 'N':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                    goto usage;
+                }
+                p->nNodesExt = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( p->nNodesExt < 0 )
+                    goto usage;
+                break;
+            case 'W':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                    goto usage;
+                }
+                p->WeightMin = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( p->WeightMin < 0 )
+                    goto usage;
+                break;
+            case 'M':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                    goto usage;
+                }
+                p->LitCountMax = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( p->LitCountMax < 0 )
+                    goto usage;
+                break;
+            case 's':
+                p->fOnlyS ^= 1;
+                break;
+            case 'd':
+                p->fOnlyD ^= 1;
+                break;
+            case 'z':
+                p->fUse0 ^= 1;
+                break;
+            case 'c':
+                p->fUseCompl ^= 1;
+                break;
+            case 'n':
+                fNewAlgo ^= 1;
+                break;
+            case 'v':
+                p->fVerbose ^= 1;
+                break;
+            case 'w':
+                p->fVeryVerbose ^= 1;
+                break;
+            case 'h':
+                goto usage;
+                break;
+            default:
+                goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkNodeNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "The network does not have internal nodes.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Fast extract can only be applied to a logic network (run \"renode\" or \"if\").\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsSopLogic(pNtk) )
+    {
+        Abc_Print( -1, "Fast extract can only be applied to a logic network with SOP local functions (run \"bdd; sop\").\n" );
+        return 1;
+    }
+
+    // the nodes to be merged are linked into the special linked list
+    if ( fNewAlgo )
+        Abc_NtkFxPerform( pNtk, p->nNodesExt, p->LitCountMax, p->fVerbose, p->fVeryVerbose );
+    else
+        Abc_NtkFastExtract( pNtk, p );
+    Abc_NtkFxuFreeInfo( p );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: fx [-SDNWM <num>] [-sdzcnvwh]\n");
+    Abc_Print( -2, "\t           performs unate fast extract on the current network\n");
+    Abc_Print( -2, "\t-S <num> : max number of single-cube divisors to consider [default = %d]\n", p->nSingleMax );
+    Abc_Print( -2, "\t-D <num> : max number of double-cube divisors to consider [default = %d]\n", p->nPairsMax );
+    Abc_Print( -2, "\t-N <num> : max number of divisors to extract during this run [default = %d]\n", p->nNodesExt );
+    Abc_Print( -2, "\t-W <num> : lower bound on the weight of divisors to extract [default = %d]\n", p->WeightMin );
+    Abc_Print( -2, "\t-M <num> : upper bound on literal count of divisors to extract [default = %d]\n", p->LitCountMax );
+    Abc_Print( -2, "\t-s       : use only single-cube divisors [default = %s]\n", p->fOnlyS? "yes": "no" );
+    Abc_Print( -2, "\t-d       : use only double-cube divisors [default = %s]\n", p->fOnlyD? "yes": "no" );
+    Abc_Print( -2, "\t-z       : use zero-weight divisors [default = %s]\n", p->fUse0? "yes": "no" );
+    Abc_Print( -2, "\t-c       : use complement in the binary case [default = %s]\n", p->fUseCompl? "yes": "no" );
+    Abc_Print( -2, "\t-n       : use new implementation of fast extract [default = %s]\n", fNewAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-v       : print verbose information [default = %s]\n", p->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : print additional information [default = %s]\n", p->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandEliminate( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int ElimValue;
+    int nMaxSize;
+    int nIterMax;
+    int fGreedy;
+    int fReverse;
+    int fVerbose;
+    int c;
+    extern int Abc_NtkEliminate( Abc_Ntk_t * pNtk, int nMaxSize, int fReverse, int fVerbose );
+    extern int Abc_NtkEliminate1( Abc_Ntk_t * pNtk, int ElimValue, int nMaxSize, int nIterMax, int fReverse, int fVerbose );
+
+    // set the defaults
+    ElimValue = -1;
+    nMaxSize  = 12;
+    nIterMax  =  1;
+    fGreedy   =  0;
+    fReverse  =  0;
+    fVerbose  =  0;
+    Extra_UtilGetoptReset();
+    while ( (c = Extra_UtilGetopt(argc, argv, "VNIgrvh")) != EOF )
+    {
+        switch (c)
+        {
+            case 'V':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer that is -1 or larger.\n" );
+                    goto usage;
+                }
+                ElimValue = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( ElimValue < -1 )
+                    goto usage;
+                break;
+            case 'N':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
+                    goto usage;
+                }
+                nMaxSize = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( nMaxSize <= 0 )
+                    goto usage;
+                break;
+            case 'I':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
+                    goto usage;
+                }
+                nIterMax = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( nIterMax <= 0 )
+                    goto usage;
+                break;
+            case 'g':
+                fGreedy ^= 1;
+                break;
+            case 'r':
+                fReverse ^= 1;
+                break;
+            case 'v':
+                fVerbose ^= 1;
+                break;
+            case 'h':
+                goto usage;
+                break;
+            default:
+                goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkNodeNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "The network does not have internal nodes.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network (run \"renode\" or \"if\").\n" );
+        return 1;
+    }
+
+    if ( fGreedy )
+        Abc_NtkEliminate( pNtk, nMaxSize, fReverse, fVerbose );
+    else
+        Abc_NtkEliminate1( pNtk, ElimValue, nMaxSize, nIterMax, fReverse, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: eliminate [-VNI <num>] [-grvh]\n");
+    Abc_Print( -2, "\t           traditional \"eliminate -1\", which collapses the node into its fanout\n");
+    Abc_Print( -2, "\t           if the node's variable appears in the fanout's factored form only once\n");
+    Abc_Print( -2, "\t-V <num> : the \"value\" parameter used by \"eliminate\" in SIS [default = %d]\n", ElimValue );
+    Abc_Print( -2, "\t-N <num> : the maximum node support after collapsing [default = %d]\n", nMaxSize );
+    Abc_Print( -2, "\t-I <num> : the maximum number of iterations [default = %d]\n", nIterMax );
+    Abc_Print( -2, "\t-g       : toggle using greedy eliminate (without \"value\") [default = %s]\n", fGreedy? "yes": "no" );
+    Abc_Print( -2, "\t-r       : use the reverse topological order [default = %s]\n", fReverse? "yes": "no" );
+    Abc_Print( -2, "\t-v       : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDisjoint( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes, * pNtkNew;
+    int fGlobal, fRecursive, fVerbose, fPrint, fShort, c;
+
+    extern Abc_Ntk_t * Abc_NtkDsdGlobal( Abc_Ntk_t * pNtk, int fVerbose, int fPrint, int fShort );
+    extern int         Abc_NtkDsdLocal( Abc_Ntk_t * pNtk, int fVerbose, int fRecursive );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fGlobal    = 1;
+    fRecursive = 0;
+    fVerbose   = 0;
+    fPrint     = 0;
+    fShort     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "grvpsh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+            case 'g':
+                fGlobal ^= 1;
+                break;
+            case 'r':
+                fRecursive ^= 1;
+                break;
+            case 'v':
+                fVerbose ^= 1;
+                break;
+            case 'p':
+                fPrint ^= 1;
+                break;
+            case 's':
+                fShort ^= 1;
+                break;
+            case 'h':
+                goto usage;
+                break;
+            default:
+                goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( fGlobal )
+    {
+//        Abc_Print( 0, "Performing DSD of global functions of the network.\n" );
+        // get the new network
+        if ( !Abc_NtkIsStrash(pNtk) )
+        {
+            pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
+            pNtkRes = Abc_NtkDsdGlobal( pNtkNew, fVerbose, fPrint, fShort );
+            Abc_NtkDelete( pNtkNew );
+        }
+        else
+        {
+            pNtkRes = Abc_NtkDsdGlobal( pNtk, fVerbose, fPrint, fShort );
+        }
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "Global DSD has failed.\n" );
+            return 1;
+        }
+        // replace the current network
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    }
+    else if ( fRecursive )
+    {
+        if ( !Abc_NtkIsBddLogic( pNtk ) )
+        {
+            Abc_Print( -1, "This command is only applicable to logic BDD networks.\n" );
+            return 1;
+        }
+        if ( fVerbose )
+            Abc_Print( 1, "Performing recursive DSD and MUX decomposition of local functions.\n" );
+        if ( !Abc_NtkDsdLocal( pNtk, fVerbose, fRecursive ) )
+            Abc_Print( -1, "Recursive DSD has failed.\n" );
+    }
+    else
+    {
+        if ( !Abc_NtkIsBddLogic( pNtk ) )
+        {
+            Abc_Print( -1, "This command is only applicable to logic BDD networks (run \"bdd\").\n" );
+            return 1;
+        }
+        if ( fVerbose )
+            Abc_Print( 1, "Performing simple non-recursive DSD of local functions.\n" );
+        if ( !Abc_NtkDsdLocal( pNtk, fVerbose, fRecursive ) )
+            Abc_Print( -1, "Simple DSD of local functions has failed.\n" );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsd [-grvpsh]\n" );
+    Abc_Print( -2, "\t     decomposes the network using disjoint-support decomposition\n" );
+    Abc_Print( -2, "\t-g     : toggle DSD of global and local functions [default = %s]\n", fGlobal? "global": "local" );
+    Abc_Print( -2, "\t-r     : toggle recursive DSD/MUX and simple DSD [default = %s]\n", fRecursive? "recursive DSD/MUX": "simple DSD" );
+    Abc_Print( -2, "\t-v     : prints DSD statistics and runtime [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-p     : prints DSD structure to the standard output [default = %s]\n", fPrint? "yes": "no" );
+    Abc_Print( -2, "\t-s     : use short PI names when printing DSD structure [default = %s]\n", fShort? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSparsify( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkSparsify( Abc_Ntk_t * pNtk, int nPerc, int fVerbose );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkNew;
+    int nPerc, fVerbose, c;
+    // set defaults
+    nPerc      = 10;
+    fVerbose   =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+            case 'N':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                    goto usage;
+                }
+                nPerc = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( nPerc < 1 || nPerc > 100 )
+                    goto usage;
+                break;
+            case 'v':
+                fVerbose ^= 1;
+                break;
+            case 'h':
+                goto usage;
+                break;
+            default:
+                goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsBddLogic( pNtk ) )
+    {
+        Abc_Print( -1, "This command is only applicable to logic BDD networks (run \"bdd\").\n" );
+        return 1;
+    }
+    if ( Abc_NtkCiNum(pNtk) > 16 )
+    {
+        Abc_Print( -1, "The number of primary inputs is more than 16.\n" );
+        return 1;
+    }
+    pNtkNew = Abc_NtkSparsify( pNtk, nPerc, fVerbose );
+    if ( pNtkNew == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: sparsify [-N num] [-vh]\n" );
+    Abc_Print( -2, "\t           creates incompletely-specified function\n" );
+    Abc_Print( -2, "\t-N <num> : the percentage of on-set and off-set minterms (1 <= num <= 100) [default = %d]\n", nPerc );
+    Abc_Print( -2, "\t-v       : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandLutpack( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Lpk_Par_t Pars, * pPars = &Pars;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    memset( pPars, 0, sizeof(Lpk_Par_t) );
+    pPars->nLutsMax     =  4; // (N) the maximum number of LUTs in the structure
+    pPars->nLutsOver    =  3; // (Q) the maximum number of LUTs not in the MFFC
+    pPars->nVarsShared  =  0; // (S) the maximum number of shared variables (crossbars)
+    pPars->nGrowthLevel =  0; // (L) the maximum number of increased levels
+    pPars->fSatur       =  1;
+    pPars->fZeroCost    =  0;
+    pPars->fFirst       =  0;
+    pPars->fOldAlgo     =  0;
+    pPars->fVerbose     =  0;
+    pPars->fVeryVerbose =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NQSLszfovwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nLutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutsMax < 2 || pPars->nLutsMax > 8 )
+                goto usage;
+            break;
+        case 'Q':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nLutsOver = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutsOver < 0 || pPars->nLutsOver > 8 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nVarsShared = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nVarsShared < 0 || pPars->nVarsShared > 4 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
+                goto usage;
+            break;
+        case 's':
+            pPars->fSatur ^= 1;
+            break;
+        case 'z':
+            pPars->fZeroCost ^= 1;
+            break;
+        case 'f':
+            pPars->fFirst ^= 1;
+            break;
+        case 'o':
+            pPars->fOldAlgo ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
+        return 1;
+    }
+    if ( pPars->nVarsShared < 0 || pPars->nVarsShared > 3 )
+    {
+        Abc_Print( -1, "The number of shared variables (%d) is not in the range 0 <= S <= 3.\n", pPars->nVarsShared );
+        return 1;
+    }
+
+    // modify the current network
+    if ( !Lpk_Resynthesize( pNtk, pPars ) )
+    {
+        Abc_Print( -1, "Resynthesis has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: lutpack [-NQSL <num>] [-szfovwh]\n" );
+    Abc_Print( -2, "\t           performs \"rewriting\" for LUT network;\n" );
+    Abc_Print( -2, "\t           determines LUT size as the max fanin count of a node;\n" );
+    Abc_Print( -2, "\t           if the network is not LUT-mapped, packs it into 6-LUTs\n" );
+    Abc_Print( -2, "\t           (there is another command for resynthesis after LUT mapping, \"imfs\")\n" );
+    Abc_Print( -2, "\t-N <num> : the max number of LUTs in the structure (2 <= num) [default = %d]\n", pPars->nLutsMax );
+    Abc_Print( -2, "\t-Q <num> : the max number of LUTs not in MFFC (0 <= num) [default = %d]\n", pPars->nLutsOver );
+    Abc_Print( -2, "\t-S <num> : the max number of LUT inputs shared (0 <= num <= 3) [default = %d]\n", pPars->nVarsShared );
+    Abc_Print( -2, "\t-L <num> : max level increase after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+    Abc_Print( -2, "\t-s       : toggle iteration till saturation [default = %s]\n", pPars->fSatur? "yes": "no" );
+    Abc_Print( -2, "\t-z       : toggle zero-cost replacements [default = %s]\n", pPars->fZeroCost? "yes": "no" );
+    Abc_Print( -2, "\t-f       : toggle using only first node and first cut [default = %s]\n", pPars->fFirst? "yes": "no" );
+    Abc_Print( -2, "\t-o       : toggle using old implementation [default = %s]\n", pPars->fOldAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle detailed printout of decomposed functions [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandLutmin( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int nLutSize;
+    int fVerbose;
+    extern Abc_Ntk_t * Abc_NtkLutmin( Abc_Ntk_t * pNtk, int nLutSize, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nLutSize = 4;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Kvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    // modify the current network
+    pNtkRes = Abc_NtkLutmin( pNtk, nLutSize, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "The command has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: lutmin [-K <num>] [-vh]\n" );
+    Abc_Print( -2, "\t           perform FPGA mapping while minimizing the LUT count\n" );
+    Abc_Print( -2, "\t           as described in the paper T. Sasao and A. Mishchenko:\n" );
+    Abc_Print( -2, "\t           \"On the number of LUTs to implement logic functions\".\n" );
+    Abc_Print( -2, "\t-K <num> : the LUT size to use for the mapping (2 <= num) [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+#if 0
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandImfs( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Res_Par_t Pars, * pPars = &Pars;
+    int c;
+
+    // set defaults
+    pPars->nWindow      = 62;
+    pPars->nCands       =  5;
+    pPars->nSimWords    =  4;
+    pPars->nGrowthLevel =  0;
+    pPars->fArea        =  0;
+    pPars->fVerbose     =  0;
+    pPars->fVeryVerbose =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WSCLavwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWindow = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWindow < 1 || pPars->nWindow > 99 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nSimWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nSimWords < 1 || pPars->nSimWords > 256 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nCands = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCands < 0 || pPars->nCands > ABC_INFINITY )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fArea ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    if ( !Abc_NtkResynthesize( pNtk, pPars ) )
+    {
+        Abc_Print( -1, "Resynthesis has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: imfs [-W <NM>] [-LCS <num>] [-avwh]\n" );
+    Abc_Print( -2, "\t           performs resubstitution-based resynthesis with interpolation\n" );
+    Abc_Print( -2, "\t           (there is another command for resynthesis after LUT mapping, \"lutpack\")\n" );
+    Abc_Print( -2, "\t-W <NM>  : fanin/fanout levels (NxM) of the window (00 <= NM <= 99) [default = %d%d]\n", pPars->nWindow/10, pPars->nWindow%10 );
+    Abc_Print( -2, "\t-C <num> : the max number of resub candidates (1 <= n) [default = %d]\n", pPars->nCands );
+    Abc_Print( -2, "\t-S <num> : the number of simulation words (1 <= n <= 256) [default = %d]\n", pPars->nSimWords );
+    Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+    Abc_Print( -2, "\t-a       : toggle optimization for area only [default = %s]\n", pPars->fArea? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle printout subgraph statistics [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+#endif
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMfs( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Mfs_Par_t Pars, * pPars = &Pars;
+    int c;
+    // set defaults
+    Abc_NtkMfsParsDefault( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCdraestpgvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWinTfoLevs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWinTfoLevs < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFanoutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFanoutsMax < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nDepthMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nDepthMax < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWinMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWinMax < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nGrowthLevel < 0 || pPars->nGrowthLevel > ABC_INFINITY )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'd':
+            pPars->fRrOnly ^= 1;
+            break;
+        case 'r':
+            pPars->fResub ^= 1;
+            break;
+        case 'a':
+            pPars->fArea ^= 1;
+            break;
+        case 'e':
+            pPars->fMoreEffort ^= 1;
+            break;
+        case 's':
+            pPars->fSwapEdge ^= 1;
+            break;
+        case 't':
+            pPars->fOneHotness ^= 1;
+            break;
+        case 'p':
+            pPars->fPower ^= 1;
+            break;
+        case 'g':
+            pPars->fGiaSat ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    if ( !Abc_NtkMfs( pNtk, pPars ) )
+    {
+        Abc_Print( -1, "Resynthesis has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: mfs [-WFDMLC <num>] [-draestpgvh]\n" );
+    Abc_Print( -2, "\t           performs don't-care-based optimization of logic networks\n" );
+    Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n", pPars->nWinTfoLevs );
+    Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n", pPars->nFanoutsMax );
+    Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n", pPars->nDepthMax );
+    Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n", pPars->nWinMax );
+    Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+    Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-d       : toggle performing redundancy removal [default = %s]\n", pPars->fRrOnly? "yes": "no" );
+    Abc_Print( -2, "\t-r       : toggle resubstitution and dc-minimization [default = %s]\n", pPars->fResub? "resub": "dc-min" );
+    Abc_Print( -2, "\t-a       : toggle minimizing area or area+edges [default = %s]\n", pPars->fArea? "area": "area+edges" );
+    Abc_Print( -2, "\t-e       : toggle high-effort resubstitution [default = %s]\n", pPars->fMoreEffort? "yes": "no" );
+    Abc_Print( -2, "\t-s       : toggle evaluation of edge swapping [default = %s]\n", pPars->fSwapEdge? "yes": "no" );
+    Abc_Print( -2, "\t-t       : toggle using artificial one-hotness conditions [default = %s]\n", pPars->fOneHotness? "yes": "no" );
+    Abc_Print( -2, "\t-p       : toggle power-aware optimization [default = %s]\n", pPars->fPower? "yes": "no" );
+    Abc_Print( -2, "\t-g       : toggle using new SAT solver [default = %s]\n", pPars->fGiaSat? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMfs2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Abc_NtkPerformMfs( Abc_Ntk_t * pNtk, Sfm_Par_t * pPars );
+    extern int Abc_NtkMfsAfterICheck( Abc_Ntk_t * p, int nFrames, int nFramesAdd, Vec_Int_t * vFlops, Sfm_Par_t * pPars );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Sfm_Par_t Pars, * pPars = &Pars;
+    int c, fIndDCs = 0, fUseAllFfs = 0, nFramesAdd = 0;
+    // set defaults
+    Sfm_ParSetDefault( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WFDMLCZNIdaeijvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nTfoLevMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nTfoLevMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFanoutMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFanoutMax < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nDepthMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nDepthMax < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWinSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWinSizeMax < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nGrowthLevel = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nGrowthLevel < -ABC_INFINITY || pPars->nGrowthLevel > ABC_INFINITY )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'Z':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-Z\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFirstFixed = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFirstFixed < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nNodesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nNodesMax < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFramesAdd = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFramesAdd < 0 )
+                goto usage;
+            break;
+        case 'd':
+            pPars->fRrOnly ^= 1;
+            break;
+        case 'a':
+            pPars->fArea ^= 1;
+            break;
+        case 'e':
+            pPars->fMoreEffort ^= 1;
+            break;
+        case 'i':
+            fIndDCs ^= 1;
+            break;
+        case 'j':
+            fUseAllFfs ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
+        return 1;
+    }
+    if ( fIndDCs )
+    {
+        if ( fUseAllFfs )
+        {
+            pAbc->nIndFrames = 1;
+            Vec_IntFreeP( &pAbc->vIndFlops );
+            pAbc->vIndFlops = Vec_IntAlloc( Abc_NtkLatchNum(pNtk) );
+            Vec_IntFill( pAbc->vIndFlops, Abc_NtkLatchNum(pNtk), 1 );
+        }
+        if ( pAbc->nIndFrames <= 0 )
+        {
+            Abc_Print( -1, "The number of k-inductive frames is not specified.\n" );
+            return 0;
+        }
+        if ( pAbc->vIndFlops == NULL )
+        {
+            Abc_Print( -1, "The set of k-inductive flops is not specified.\n" );
+            return 0;
+        }
+        if ( Vec_IntSize(pAbc->vIndFlops) != Abc_NtkLatchNum(pNtk) )
+        {
+            Abc_Print( -1, "The saved flop count (%d) does not match that of the current network (%d).\n", 
+                Vec_IntSize(pAbc->vIndFlops), Abc_NtkLatchNum(pNtk) );
+            return 0;
+        }
+        // modify the current network
+        if ( !Abc_NtkMfsAfterICheck( pNtk, pAbc->nIndFrames, nFramesAdd, pAbc->vIndFlops, pPars ) )
+        {
+            Abc_Print( -1, "Resynthesis has failed.\n" );
+            return 1;
+        }
+        if ( fUseAllFfs )
+        {
+            pAbc->nIndFrames = 0;
+            Vec_IntFreeP( &pAbc->vIndFlops );
+        }
+    }
+    else
+    {
+        // modify the current network
+        if ( !Abc_NtkPerformMfs( pNtk, pPars ) )
+        {
+            Abc_Print( -1, "Resynthesis has failed.\n" );
+            return 1;
+        }
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: mfs2 [-WFDMLCZNI <num>] [-daeijvwh]\n" );
+    Abc_Print( -2, "\t           performs don't-care-based optimization of logic networks\n" );
+    Abc_Print( -2, "\t-W <num> : the number of levels in the TFO cone (0 <= num) [default = %d]\n",             pPars->nTfoLevMax );
+    Abc_Print( -2, "\t-F <num> : the max number of fanouts to skip (1 <= num) [default = %d]\n",                pPars->nFanoutMax );
+    Abc_Print( -2, "\t-D <num> : the max depth nodes to try (0 = no limit) [default = %d]\n",                   pPars->nDepthMax );
+    Abc_Print( -2, "\t-M <num> : the max node count of windows to consider (0 = no limit) [default = %d]\n",    pPars->nWinSizeMax );
+    Abc_Print( -2, "\t-L <num> : the max increase in node level after resynthesis (0 <= num) [default = %d]\n", pPars->nGrowthLevel );
+    Abc_Print( -2, "\t-C <num> : the max number of conflicts in one SAT run (0 = no limit) [default = %d]\n",   pPars->nBTLimit );
+    Abc_Print( -2, "\t-Z <num> : treat the first <num> logic nodes as fixed (0 = none) [default = %d]\n",       pPars->nFirstFixed );
+    Abc_Print( -2, "\t-N <num> : the max number of nodes to try (0 = all) [default = %d]\n",                    pPars->nNodesMax );
+    Abc_Print( -2, "\t-d       : toggle performing redundancy removal [default = %s]\n",                        pPars->fRrOnly? "yes": "no" );
+    Abc_Print( -2, "\t-a       : toggle minimizing area or area+edges [default = %s]\n",                        pPars->fArea? "area": "area+edges" );
+    Abc_Print( -2, "\t-e       : toggle high-effort resubstitution [default = %s]\n",                           pPars->fMoreEffort? "yes": "no" );
+    Abc_Print( -2, "\t-i       : toggle using inductive don't-cares [default = %s]\n",                          fIndDCs? "yes": "no" );
+    Abc_Print( -2, "\t-j       : toggle using all flops when \"-i\" is enabled [default = %s]\n",               fUseAllFfs? "yes": "no" );
+    Abc_Print( -2, "\t-I       : the number of additional frames inserted [default = %d]\n",                    nFramesAdd );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n",                        pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n",                pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTrace( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseLutLib;
+    int fVerbose;
+    extern void Abc_NtkDelayTracePrint( Abc_Ntk_t * pNtk, int fUseLutLib, int fVerbose );
+
+    // set defaults
+    fUseLutLib = 0;
+    fVerbose   = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUseLutLib ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    Abc_NtkDelayTracePrint( pNtk, fUseLutLib, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: trace [-lvh]\n" );
+    Abc_Print( -2, "\t           performs delay trace of LUT-mapped network\n" );
+    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSpeedup( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fUseLutLib;
+    int Percentage;
+    int Degree;
+    int fVerbose;
+    int fVeryVerbose;
+    extern Abc_Ntk_t * Abc_NtkSpeedup( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    fUseLutLib = 0;
+    Percentage = 5;
+    Degree     = 2;
+    fVerbose   = 0;
+    fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Percentage = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Percentage < 1 || Percentage > 100 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Degree = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Degree < 1 || Degree > 5 )
+                goto usage;
+            break;
+        case 'l':
+            fUseLutLib ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    pNtkRes = Abc_NtkSpeedup( pNtk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "The command has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: speedup [-PN <num>] [-lvwh]\n" );
+    Abc_Print( -2, "\t           transforms LUT-mapped network into an AIG with choices;\n" );
+    Abc_Print( -2, "\t           the choices are added to speedup the next round of mapping\n" );
+    Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
+    Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
+    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPowerdown( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fUseLutLib;
+    int Percentage;
+    int Degree;
+    int fVerbose;
+    int fVeryVerbose;
+    extern Abc_Ntk_t * Abc_NtkPowerdown( Abc_Ntk_t * pNtk, int fUseLutLib, int Percentage, int Degree, int fVerbose, int fVeryVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fUseLutLib = 0;
+    Percentage =10;
+    Degree     = 2;
+    fVerbose   = 0;
+    fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Percentage = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Percentage < 1 || Percentage > 100 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Degree = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Degree < 1 || Degree > 5 )
+                goto usage;
+            break;
+        case 'l':
+            fUseLutLib ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    pNtkRes = Abc_NtkPowerdown( pNtk, fUseLutLib, Percentage, Degree, fVerbose, fVeryVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "The command has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: powerdown [-PN <num>] [-vwh]\n" );
+    Abc_Print( -2, "\t           transforms LUT-mapped network into an AIG with choices;\n" );
+    Abc_Print( -2, "\t           the choices are added to power down the next round of mapping\n" );
+    Abc_Print( -2, "\t-P <num> : switching propability delta defining power critical edges [default = %d%%]\n", Percentage );
+    Abc_Print( -2, "\t           (e.g. 5% means hot wires switch with probability: 0.45 <= p <= 0.50 (max)\n" );
+    Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
+//    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAddBuffs( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkAddBuffs( Abc_Ntk_t * pNtk, int fDirect, int fReverse, int nImprove, int fVerbose );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Ntk_t * pNtkRes;
+    int fDirect;
+    int fReverse;
+    int nImprove;
+    int c, fVerbose;
+
+    fDirect  = 0;
+    fReverse = 0;
+    nImprove = 1000;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Idrvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nImprove = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nImprove < 0 )
+                goto usage;
+            break;
+        case 'd':
+            fDirect ^= 1;
+            break;
+        case 'r':
+            fReverse ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to a logic network.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    pNtkRes = Abc_NtkAddBuffs( pNtk, fDirect, fReverse, nImprove, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "The command has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: addbuffs [-I num] [-drvh]\n" );
+    Abc_Print( -2, "\t           adds buffers to create balanced CI/CO paths\n" );
+    Abc_Print( -2, "\t-I <num> : the number of refinement iterations [default = %d]\n", nImprove );
+    Abc_Print( -2, "\t-d       : toggle using only CI-to-CO levelized order [default = %s]\n", fDirect? "yes": "no" );
+    Abc_Print( -2, "\t-r       : toggle using only CO-to-C1 levelized order [default = %s]\n", fReverse? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+#if 0
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Nwk_LMPars_t Pars, * pPars = &Pars;
+    Vec_Int_t * vResult;
+    int c;
+    extern Vec_Int_t * Abc_NtkLutMerge( Abc_Ntk_t * pNtk, Nwk_LMPars_t * pPars );
+    // set defaults
+    memset( pPars, 0, sizeof(Nwk_LMPars_t) );
+    pPars->nMaxLutSize    = 5;   // the max LUT size for merging (N=5)
+    pPars->nMaxSuppSize   = 5;   // the max total support size after merging (S=5)
+    pPars->nMaxDistance   = 3;   // the max number of nodes separating LUTs
+    pPars->nMaxLevelDiff  = 2;   // the max difference in levels
+    pPars->nMaxFanout     = 100; // the max number of fanouts to traverse
+    pPars->fUseDiffSupp   = 0;   // enables the use of nodes with different support
+    pPars->fUseTfiTfo     = 0;   // enables the use of TFO/TFO nodes as candidates
+    pPars->fVeryVerbose   = 0;   // enables additional verbose output
+    pPars->fVerbose       = 1;   // enables verbose output
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NSDLFscvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxLutSize < 2 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxSuppSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxSuppSize < 2 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxDistance = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxDistance < 2 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxLevelDiff = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxLevelDiff < 2 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxFanout = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxFanout < 2 )
+                goto usage;
+            break;
+        case 's':
+            pPars->fUseDiffSupp ^= 1;
+            break;
+        case 'c':
+            pPars->fUseTfiTfo ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL || !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Abc_CommandMerge(): There is no mapped network to merge LUTs.\n" );
+        return 1;
+    }
+
+    vResult = Abc_NtkLutMerge( pNtk, pPars );
+    Vec_IntFree( vResult );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: merge [-NSDLF <num>] [-scwvh]\n" );
+    Abc_Print( -2, "\t           creates pairs of topologically-related LUTs\n" );
+    Abc_Print( -2, "\t-N <num> : the max LUT size for merging (1 < num) [default = %d]\n", pPars->nMaxLutSize );
+    Abc_Print( -2, "\t-S <num> : the max total support size after merging (1 < num) [default = %d]\n", pPars->nMaxSuppSize );
+    Abc_Print( -2, "\t-D <num> : the max distance in terms of LUTs (0 < num) [default = %d]\n", pPars->nMaxDistance );
+    Abc_Print( -2, "\t-L <num> : the max difference in levels (0 <= num) [default = %d]\n", pPars->nMaxLevelDiff );
+    Abc_Print( -2, "\t-F <num> : the max number of fanouts to stop traversal (0 < num) [default = %d]\n", pPars->nMaxFanout );
+    Abc_Print( -2, "\t-s       : toggle the use of nodes without support overlap [default = %s]\n", pPars->fUseDiffSupp? "yes" : "no" );
+    Abc_Print( -2, "\t-c       : toggle the use of TFI/TFO nodes as candidates [default = %s]\n", pPars->fUseTfiTfo? "yes" : "no" );
+    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+#endif
+
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTestDec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Abc_DecTest( char * pFileName, int DecType, int nVarNum, int fVerbose );
+    char * pFileName;
+    int c;
+    int fVerbose = 0;
+    int DecType = 0;
+    int nVarNum = -1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ANvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            DecType = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( DecType < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nVarNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nVarNum < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( argc != globalUtilOptind + 1 )
+    {
+        Abc_Print( 1,"Input file is not given.\n" );
+        return 0;
+    }
+    if ( nVarNum >= 0 && nVarNum < 6 )
+    {
+        Abc_Print( 1,"The number of variables cannot be less than 6.\n" );
+        return 0;
+    }
+    // get the output file name
+    pFileName = argv[globalUtilOptind];
+    // call the testbench
+    Abc_DecTest( pFileName, DecType, nVarNum, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: testdec [-AN <num>] [-vh] <file>\n" );
+    Abc_Print( -2, "\t           testbench for Boolean decomposition algorithms\n" );
+    Abc_Print( -2, "\t-A <num> : decomposition algorithm [default = %d]\n", DecType );
+    Abc_Print( -2, "\t               0: none (reading and writing the file)\n" );
+    Abc_Print( -2, "\t               1: algebraic factoring applied to ISOP\n" );
+    Abc_Print( -2, "\t               2: bi-decomposition with cofactoring\n" );
+    Abc_Print( -2, "\t               3: disjoint-support decomposition with cofactoring\n" );
+    Abc_Print( -2, "\t               4: updated disjoint-support decomposition with cofactoring\n" );
+    Abc_Print( -2, "\t               5: enumerating decomposable variable sets\n" );
+    Abc_Print( -2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    Abc_Print( -2, "\t<file>   : a text file with truth tables in hexadecimal, listed one per line,\n");
+    Abc_Print( -2, "\t           or a binary file with an array of truth tables (in this case,\n");
+    Abc_Print( -2, "\t           -N <num> is required to determine how many functions are stored)\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTestNpn( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Abc_NpnTest( char * pFileName, int NpnType, int nVarNum, int fDumpRes, int fBinary, int fVerbose );
+    char * pFileName;
+    int c;
+    int fVerbose = 0;
+    int NpnType = 0;
+    int nVarNum = -1;
+    int fDumpRes = 0;
+    int fBinary = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ANdbvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            NpnType = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( NpnType < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nVarNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nVarNum < 0 )
+                goto usage;
+            break;
+        case 'd':
+            fDumpRes ^= 1;
+            break;
+        case 'b':
+            fBinary ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( argc != globalUtilOptind + 1 )
+    {
+        Abc_Print( 1,"Input file is not given.\n" );
+        return 0;
+    }
+    if ( nVarNum >= 0 && nVarNum < 6 )
+    {
+        Abc_Print( 1,"The number of variables cannot be less than 6.\n" );
+        return 0;
+    }
+    // get the output file name
+    pFileName = argv[globalUtilOptind];
+    // call the testbench
+    Abc_NpnTest( pFileName, NpnType, nVarNum, fDumpRes, fBinary, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: testnpn [-AN <num>] [-dbvh] <file>\n" );
+    Abc_Print( -2, "\t           testbench for computing (semi-)canonical forms\n" );
+    Abc_Print( -2, "\t           of completely-specified Boolean functions up to 16 varibles\n" );
+    Abc_Print( -2, "\t-A <num> : semi-caninical form computation algorithm [default = %d]\n", NpnType );
+    Abc_Print( -2, "\t               0: uniqifying truth tables\n" );
+    Abc_Print( -2, "\t               1: exact NPN canonical form by brute-force enumeration\n" );
+    Abc_Print( -2, "\t               2: semi-canonical form by counting 1s in cofactors\n" );
+    Abc_Print( -2, "\t               3: Jake's hybrid semi-canonical form (fast)\n" );
+    Abc_Print( -2, "\t               4: Jake's hybrid semi-canonical form (high-effort)\n" );
+    Abc_Print( -2, "\t               5: new fast hybrid semi-canonical form\n" );
+    Abc_Print( -2, "\t               6: new phase canonical form\n" );
+    Abc_Print( -2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n" );
+    Abc_Print( -2, "\t-d       : toggle dumping resulting functions into a file [default = %s]\n", fDumpRes? "yes": "no" );
+    Abc_Print( -2, "\t-b       : toggle dumping in binary format [default = %s]\n", fBinary? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    Abc_Print( -2, "\t<file>   : a text file with truth tables in hexadecimal, listed one per line,\n");
+    Abc_Print( -2, "\t           or a binary file with an array of truth tables (in this case,\n");
+    Abc_Print( -2, "\t           -N <num> is required to determine how many functions are stored)\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTestRPO(Abc_Frame_t * pAbc, int argc, char ** argv) {
+    extern int Abc_RpoTest(char * pFileName, int nVarNum, int nThreshold, int fVerbose);
+    char * pFileName;
+    int c;
+    int nVarNum = -1;
+    int fVerbose = 0;
+    int nThreshold = -1;
+    Extra_UtilGetoptReset();
+    while ((c = Extra_UtilGetopt(argc, argv, "TNvh")) != EOF) {
+        switch (c) {
+            case 'N':
+                if (globalUtilOptind >= argc) {
+                    Abc_Print(-1, "Command line switch \"-N\" should be followed by an integer.\n");
+                    goto usage;
+                }
+                nVarNum = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if (nVarNum < 0)
+                    goto usage;
+                break;
+            case 'T':
+                if (globalUtilOptind >= argc) {
+                    Abc_Print(-1, "Command line switch \"-T\" should be followed by an integer.\n");
+                    goto usage;
+                }
+                nThreshold = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if (nThreshold < 0)
+                    goto usage;
+                break;
+            case 'v':
+                fVerbose ^= 1;
+                break;
+            case 'h':
+                goto usage;
+            default:
+                goto usage;
+        }
+    }
+    if (argc != globalUtilOptind + 1) 
+    {
+        Abc_Print(1, "Input file is not given.\n");
+        goto usage;
+    }
+    // get the output file name
+    pFileName = argv[globalUtilOptind];
+    // call the testbench
+    Abc_RpoTest( pFileName, nVarNum, nThreshold, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print(-2, "usage: testrpo [-NT <num>] [-vh] <file>\n");
+    Abc_Print(-2, "\t           RPO algorithm developed and implemented by Mayler G. A. Martins,\n");
+    Abc_Print(-2, "\t           Vinicius Callegaro, Renato P. Ribas and Andre' I. Reis\n");
+    Abc_Print(-2, "\t           at Federal University of Rio Grande do Sul, Porto Alegre, Brazil\n");
+    Abc_Print(-2, "\t-N <num> : the number of support variables (binary files only) [default = unused]\n");
+    Abc_Print(-2, "\t-T <num> : the number of recursions accepted before abort [default = INFINITE]\n");
+    Abc_Print(-2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose ? "yes" : "no");
+    Abc_Print(-2, "\t-h       : print the command usage\n");
+    Abc_Print(-2, "\t<file>   : a text file with truth tables in hexadecimal, listed one per line,\n");
+    Abc_Print(-2, "\t           or a binary file with an array of truth tables (in this case,\n");
+    Abc_Print(-2, "\t           -N <num> is required to determine how many functions are stored)\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUpdateLevel;
+    int fPrecompute;
+    int fUseZeros;
+    int fVerbose;
+    int fVeryVerbose;
+    int fPlaceEnable;
+    // external functions
+    extern void Rwr_Precompute();
+
+    // set defaults
+    fUpdateLevel = 1;
+    fPrecompute  = 0;
+    fUseZeros    = 0;
+    fVerbose     = 0;
+    fVeryVerbose = 0;
+    fPlaceEnable = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lxzvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'x':
+            fPrecompute ^= 1;
+            break;
+        case 'z':
+            fUseZeros ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'p':
+            fPlaceEnable ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( fPrecompute )
+    {
+        Rwr_Precompute();
+        return 0;
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum(pNtk) )
+    {
+        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    if ( !Abc_NtkRewrite( pNtk, fUpdateLevel, fUseZeros, fVerbose, fVeryVerbose, fPlaceEnable ) )
+    {
+        Abc_Print( -1, "Rewriting has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: rewrite [-lzvwh]\n" );
+    Abc_Print( -2, "\t         performs technology-independent rewriting of the AIG\n" );
+    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printout subgraph statistics [default = %s]\n", fVeryVerbose? "yes": "no" );
+//    Abc_Print( -2, "\t-p     : toggle placement-aware rewriting [default = %s]\n", fPlaceEnable? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nNodeSizeMax;
+    int nConeSizeMax;
+    int fUpdateLevel;
+    int fUseZeros;
+    int fUseDcs;
+    int fVerbose;
+    extern int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, int fUpdateLevel, int fUseZeros, int fUseDcs, int fVerbose );
+
+    // set defaults
+    nNodeSizeMax = 10;
+    nConeSizeMax = 16;
+    fUpdateLevel =  1;
+    fUseZeros    =  0;
+    fUseDcs      =  0;
+    fVerbose     =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NClzdvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nNodeSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nNodeSizeMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConeSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConeSizeMax < 0 )
+                goto usage;
+            break;
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'z':
+            fUseZeros ^= 1;
+            break;
+        case 'd':
+            fUseDcs ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum(pNtk) )
+    {
+        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+        return 1;
+    }
+
+    if ( fUseDcs && nNodeSizeMax >= nConeSizeMax )
+    {
+        Abc_Print( -1, "For don't-care to work, containing cone should be larger than collapsed node.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    if ( !Abc_NtkRefactor( pNtk, nNodeSizeMax, nConeSizeMax, fUpdateLevel, fUseZeros, fUseDcs, fVerbose ) )
+    {
+        Abc_Print( -1, "Refactoring has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: refactor [-NC <num>] [-lzdvh]\n" );
+    Abc_Print( -2, "\t           performs technology-independent refactoring of the AIG\n" );
+    Abc_Print( -2, "\t-N <num> : the max support of the collapsed node [default = %d]\n", nNodeSizeMax );
+    Abc_Print( -2, "\t-C <num> : the max support of the containing cone [default = %d]\n", nConeSizeMax );
+    Abc_Print( -2, "\t-l       : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-z       : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
+    Abc_Print( -2, "\t-d       : toggle using don't-cares [default = %s]\n", fUseDcs? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRestructure( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nCutsMax;
+    int fUpdateLevel;
+    int fUseZeros;
+    int fVerbose;
+    extern int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutsMax, int fUpdateLevel, int fUseZeros, int fVerbose );
+
+    // set defaults
+    nCutsMax      =  5;
+    fUpdateLevel =  0;
+    fUseZeros    =  0;
+    fVerbose     =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Klzvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'z':
+            fUseZeros ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( nCutsMax < 4 || nCutsMax > CUT_SIZE_MAX )
+    {
+        Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", 4, CUT_SIZE_MAX );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum(pNtk) )
+    {
+        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    if ( !Abc_NtkRestructure( pNtk, nCutsMax, fUpdateLevel, fUseZeros, fVerbose ) )
+    {
+        Abc_Print( -1, "Refactoring has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: restructure [-K <num>] [-lzvh]\n" );
+    Abc_Print( -2, "\t           performs technology-independent restructuring of the AIG\n" );
+    Abc_Print( -2, "\t-K <num> : the max cut size (%d <= num <= %d) [default = %d]\n",   CUT_SIZE_MIN, CUT_SIZE_MAX, nCutsMax );
+    Abc_Print( -2, "\t-l       : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-z       : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandResubstitute( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int RS_CUT_MIN =  4;
+    int RS_CUT_MAX = 16;
+    int c;
+    int nCutsMax;
+    int nNodesMax;
+    int nLevelsOdc;
+    int fUpdateLevel;
+    int fUseZeros;
+    int fVerbose;
+    int fVeryVerbose;
+    extern int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutsMax, int nNodesMax, int nLevelsOdc, int fUpdateLevel, int fVerbose, int fVeryVerbose );
+
+    // set defaults
+    nCutsMax     =  8;
+    nNodesMax    =  1;
+    nLevelsOdc   =  0;
+    fUpdateLevel =  1;
+    fUseZeros    =  0;
+    fVerbose     =  0;
+    fVeryVerbose =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KNFlzvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nNodesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nNodesMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLevelsOdc = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLevelsOdc < 0 )
+                goto usage;
+            break;
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'z':
+            fUseZeros ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( nCutsMax < RS_CUT_MIN || nCutsMax > RS_CUT_MAX )
+    {
+        Abc_Print( -1, "Can only compute cuts for %d <= K <= %d.\n", RS_CUT_MIN, RS_CUT_MAX );
+        return 1;
+    }
+    if ( nNodesMax < 0 || nNodesMax > 3 )
+    {
+        Abc_Print( -1, "Can only resubstitute at most 3 nodes.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum(pNtk) )
+    {
+        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    if ( !Abc_NtkResubstitute( pNtk, nCutsMax, nNodesMax, nLevelsOdc, fUpdateLevel, fVerbose, fVeryVerbose ) )
+    {
+        Abc_Print( -1, "Refactoring has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: resub [-KN <num>] [-lzvwh]\n" );
+    Abc_Print( -2, "\t           performs technology-independent restructuring of the AIG\n" );
+    Abc_Print( -2, "\t-K <num> : the max cut size (%d <= num <= %d) [default = %d]\n", RS_CUT_MIN, RS_CUT_MAX, nCutsMax );
+    Abc_Print( -2, "\t-N <num> : the max number of nodes to add (0 <= num <= 3) [default = %d]\n", nNodesMax );
+    Abc_Print( -2, "\t-F <num> : the number of fanout levels for ODC computation [default = %d]\n", nLevelsOdc );
+    Abc_Print( -2, "\t-l       : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-z       : toggle using zero-cost replacements [default = %s]\n", fUseZeros? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle verbose printout of ODC computation [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c, Window;
+    int nFaninLevels;
+    int nFanoutLevels;
+    int fUseFanouts;
+    int fVerbose;
+    extern int Abc_NtkRR( Abc_Ntk_t * pNtk, int nFaninLevels, int nFanoutLevels, int fUseFanouts, int fVerbose );
+
+    // set defaults
+    nFaninLevels  = 3;
+    nFanoutLevels = 3;
+    fUseFanouts   = 0;
+    fVerbose      = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Wfvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Window = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Window < 0 )
+                goto usage;
+            nFaninLevels  = Window / 10;
+            nFanoutLevels = Window % 10;
+            break;
+        case 'f':
+            fUseFanouts ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command can only be applied to an AIG (run \"strash\").\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum(pNtk) )
+    {
+        Abc_Print( -1, "AIG resynthesis cannot be applied to AIGs with choice nodes.\n" );
+        return 1;
+    }
+
+    // modify the current network
+    if ( !Abc_NtkRR( pNtk, nFaninLevels, nFanoutLevels, fUseFanouts, fVerbose ) )
+    {
+        Abc_Print( -1, "Redundancy removal has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: rr [-W NM] [-fvh]\n" );
+    Abc_Print( -2, "\t         removes combinational redundancies in the current network\n" );
+    Abc_Print( -2, "\t-W NM  : window size: TFI (N) and TFO (M) logic levels [default = %d%d]\n", nFaninLevels, nFanoutLevels );
+    Abc_Print( -2, "\t-f     : toggle RR w.r.t. fanouts [default = %s]\n", fUseFanouts? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCascade( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, nLutSize;
+    int fCheck;
+    int fVerbose;
+    extern Abc_Ntk_t * Abc_NtkCascade( Abc_Ntk_t * pNtk, int nLutSize, int fCheck, int fVerbose );
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    nLutSize = 12;
+    fCheck   = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Kcvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+        case 'c':
+            fCheck ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( Abc_NtkIsStrash(pNtk) )
+        pNtkRes = Abc_NtkCascade( pNtk, nLutSize, fCheck, fVerbose );
+    else
+    {
+        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        pNtkRes = Abc_NtkCascade( pNtk, nLutSize, fCheck, fVerbose );
+        Abc_NtkDelete( pNtk );
+    }
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Cascade synthesis has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cascade [-K <num>] [-cvh]\n" );
+    Abc_Print( -2, "\t           performs LUT cascade synthesis for the current network\n" );
+    Abc_Print( -2, "\t-K <num> : the number of LUT inputs [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-c       : check equivalence after synthesis [default = %s]\n", fCheck? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    Abc_Print( -2, "\t           \n");
+    Abc_Print( -2, "  A lookup-table cascade is a programmable architecture developed by\n");
+    Abc_Print( -2, "  Professor Tsutomu Sasao (sasao@cse.kyutech.ac.jp) at Kyushu Institute\n");
+    Abc_Print( -2, "  of Technology. This work received Takeda Techno-Entrepreneurship Award:\n");
+    Abc_Print( -2, "  http://www.lsi-cad.com/sasao/photo/takeda.html\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandExtract( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkShareXor( Abc_Ntk_t * pNtk, int nMultiSize, int fAnd, int fVerbose );
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, nMultiSize, fAnd, fVerbose;
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    nMultiSize = 3;
+    fAnd       = 0;
+    fVerbose   = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Kavh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nMultiSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nMultiSize < 0 )
+                goto usage;
+            break;
+        case 'a':
+            fAnd ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Can only collapse a logic network or an AIG.\n" );
+        return 1;
+    }
+    // get the new network
+    pNtkRes = Abc_NtkShareXor( pNtk, nMultiSize, fAnd, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Cascade synthesis has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: extract [-K <num>] [-avh]\n" );
+    Abc_Print( -2, "\t           extracts shared logic from multi-input gates\n" );
+    Abc_Print( -2, "\t-K <num> : the minimum gate size to consider for extraction [default = %d]\n", nMultiSize );
+    Abc_Print( -2, "\t-a       : toggle multi-input XOR vs multi-input AND [default = %s]\n", fAnd? "AND": "XOR" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandVarMin( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_SuppTest( int nOnes, int nVars, int fUseSimple, int fCheck, int fVerbose );
+    extern void Abc_SuppReadMinTest( char * pFileName );
+    int nOnes      =  4;
+    int nVars      = 20;
+    int fUseSimple =  0;
+    int fCheck     =  0;
+    int fVerbose   =  0;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "MNocvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nOnes = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nOnes < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nVars = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nVars < 0 )
+                goto usage;
+            break;
+        case 'o':
+            fUseSimple ^= 1;
+            break;
+        case 'c':
+            fCheck ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    // get the file name
+    if ( argc == globalUtilOptind + 1 )
+    {
+        Abc_SuppReadMinTest( argv[globalUtilOptind] );
+        return 0;
+    }
+    Abc_SuppTest( nOnes, nVars, fUseSimple, fCheck, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: varmin [-MN <num>] [-ocvh]\n" );
+    Abc_Print( -2, "\t           performs support minimization\n" );
+    Abc_Print( -2, "\t-M <num> : the number of ones in the combination [default = %d]\n", nOnes );
+    Abc_Print( -2, "\t-N <num> : the number of variables in the problem [default = %d]\n", nVars );
+    Abc_Print( -2, "\t-o       : toggle computing reduced difference matrix [default = %s]\n", fUseSimple? "yes": "no" );
+    Abc_Print( -2, "\t-c       : toggle verifying the final result [default = %s]\n", fCheck? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandLogic( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash( pNtk ) )
+    {
+        Abc_Print( -1, "This command is only applicable to strashed networks.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkToLogic( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Converting to a logic network has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: logic [-h]\n" );
+    Abc_Print( -2, "\t        transforms an AIG into a logic network with SOPs\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandComb( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fRemoveLatches;
+    int nLatchesToAdd;
+    extern void Abc_NtkMakeSeq( Abc_Ntk_t * pNtk, int nLatchesToAdd );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fRemoveLatches = 0;
+    nLatchesToAdd = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Llh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLatchesToAdd = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLatchesToAdd < 0 )
+                goto usage;
+            break;
+        case 'l':
+            fRemoveLatches ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsComb(pNtk) && nLatchesToAdd == 0 )
+    {
+        Abc_Print( -1, "The network is already combinational.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkIsComb(pNtk) && nLatchesToAdd != 0 )
+    {
+        Abc_Print( -1, "The network is already combinational.\n" );
+        return 0;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkDup( pNtk );
+    if ( nLatchesToAdd )
+        Abc_NtkMakeSeq( pNtkRes, nLatchesToAdd );
+    else
+        Abc_NtkMakeComb( pNtkRes, fRemoveLatches );
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: comb [-L <num>] [-lh]\n" );
+    Abc_Print( -2, "\t           converts comb network into seq, and vice versa\n" );
+    Abc_Print( -2, "\t-L <num> : number of latches to add to comb network (0 = do not add) [default = %d]\n", nLatchesToAdd );
+    Abc_Print( -2, "\t-l       : toggle converting latches to PIs/POs or removing them [default = %s]\n", fRemoveLatches? "remove": "convert" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMiter( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[32];
+    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes;
+    int fDelete1, fDelete2;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c;
+    int fCheck;
+    int fComb;
+    int fImplic;
+    int fMulti;
+    int nPartSize;
+    int fTrans;
+    int fIgnoreNames;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    fComb  = 0;
+    fCheck = 1;
+    fImplic = 0;
+    fMulti = 0;
+    nPartSize = 0;
+    fTrans = 0;
+    fIgnoreNames = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Pcmitnh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nPartSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nPartSize < 0 )
+                goto usage;
+            break;
+        case 'c':
+            fComb ^= 1;
+            break;
+        case 'm':
+            fMulti ^= 1;
+            break;
+        case 'i':
+            fImplic ^= 1;
+            break;
+        case 't':
+            fTrans ^= 1;
+            break;
+        case 'n':
+            fIgnoreNames ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( fTrans )
+    {
+        if ( (Abc_NtkPoNum(pNtk) & 1) == 1 )
+        {
+            Abc_Print( -1, "Abc_CommandMiter(): The number of outputs should be even.\n" );
+            return 0;
+        }
+        // replace the current network
+        pNtkRes = Abc_NtkDupTransformMiter( pNtk );
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+        Abc_Print( 1, "The miter (current network) is transformed by XORing POs pair-wise.\n" );
+        return 0;
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+        return 1;
+
+    if ( fIgnoreNames )
+    {
+        if ( !fDelete1 )
+        {
+            pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
+            fDelete1 = 1;
+        }
+        if ( !fDelete2 )
+        {
+            pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
+            fDelete2 = 1;
+        }
+        Abc_NtkShortNames( pNtk1 );
+        Abc_NtkShortNames( pNtk2 );
+    }
+    // compute the miter
+    pNtkRes = Abc_NtkMiter( pNtk1, pNtk2, fComb, nPartSize, fImplic, fMulti );
+    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+
+    // get the new network
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Miter computation has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    if ( nPartSize == 0 )
+        strcpy( Buffer, "unused" );
+    else
+        sprintf(Buffer, "%d", nPartSize );
+    Abc_Print( -2, "usage: miter [-P <num>] [-cimtnh] <file1> <file2>\n" );
+    Abc_Print( -2, "\t           computes the miter of the two circuits\n" );
+    Abc_Print( -2, "\t-P <num> : output partition size [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-c       : toggles deriving combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
+    Abc_Print( -2, "\t-i       : toggles deriving implication miter (file1 => file2) [default = %s]\n", fImplic? "yes": "no" );
+    Abc_Print( -2, "\t-m       : toggles creating multi-output miter [default = %s]\n", fMulti? "yes": "no" );
+    Abc_Print( -2, "\t-t       : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
+    Abc_Print( -2, "\t-n       : toggle ignoring names when matching CIs/COs [default = %s]\n", fIgnoreNames? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    Abc_Print( -2, "\tfile1    : (optional) the file with the first network\n");
+    Abc_Print( -2, "\tfile2    : (optional) the file with the second network\n");
+    Abc_Print( -2, "\t           if no files are given, uses the current network and its spec\n");
+    Abc_Print( -2, "\t           if one file is given, uses the current network and the file\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDemiter( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c, fDual, fVerbose;
+    extern int Abc_NtkDarDemiter( Abc_Ntk_t * pNtk );
+    extern int Abc_NtkDarDemiterDual( Abc_Ntk_t * pNtk, int fVerbose );
+    // set defaults
+    fDual = 0;
+    fVerbose = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'd':
+            fDual ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "The network is not strashed.\n" );
+        return 1;
+    }
+
+    if ( fDual )
+    {
+        if ( (Abc_NtkPoNum(pNtk) & 1) )
+        {
+            Abc_Print( -1, "The number of POs should be even.\n" );
+            return 0;
+        }
+        if ( !Abc_NtkDarDemiterDual( pNtk, fVerbose ) )
+        {
+            Abc_Print( -1, "Demitering has failed.\n" );
+            return 1;
+        }
+        return 0;
+    }
+/*
+    if ( Abc_NtkPoNum(pNtk) != 1 )
+    {
+        Abc_Print( -1, "The network is not a single-output miter.\n" );
+        return 1;
+    }
+    if ( !Abc_NodeIsExorType(Abc_ObjFanin0(Abc_NtkPo(pNtk,0))) )
+    {
+        Abc_Print( -1, "The miter's PO is not an EXOR.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkDemiter( pNtk ) )
+    {
+        Abc_Print( -1, "Demitering has failed.\n" );
+        return 1;
+    }
+*/
+    // get the new network
+    if ( !Abc_NtkDarDemiter( pNtk ) )
+    {
+        Abc_Print( -1, "Demitering has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: demiter [-dvh]\n" );
+    Abc_Print( -2, "\t        splits sequential miter into two circuits\n" );
+    Abc_Print( -2, "\t-d    : expects a dual-output miter (without XORs) [default = %s]\n", fDual? "yes": "no" );
+    Abc_Print( -2, "\t-v    : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandOrPos( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
+    int fReverse = 0;
+    int fComb = 0;
+    int fXor = 0;
+    int c;
+    extern int Abc_NtkCombinePos( Abc_Ntk_t * pNtk, int fAnd, int fXor );
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "rxh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'r':
+            fReverse ^= 1;
+            break;
+        case 'x':
+            fXor ^= 1;
+            break;
+        case 'c':
+            fComb ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "The network is not strashed.\n" );
+        return 1;
+    }
+    // get the new network
+    if ( fReverse )
+    {
+        extern Aig_Man_t * Abc_NtkToDarBmc( Abc_Ntk_t * pNtk, Vec_Int_t ** pvMap );
+        Aig_Man_t * pMan = Abc_NtkToDarBmc( pNtk, NULL );
+        Abc_Ntk_t * pNtkRes = Abc_NtkFromAigPhase( pMan );
+        Aig_ManStop( pMan );
+        // perform expansion
+        if ( Abc_NtkPoNum(pNtk) != Abc_NtkPoNum(pNtkRes) )
+            Abc_Print( 1,"Expanded %d outputs into %d outputs using OR decomposition.\n", Abc_NtkPoNum(pNtk), Abc_NtkPoNum(pNtkRes) );
+        else
+            Abc_Print( 1,"The output(s) cannot be structurally decomposed.\n" );
+        // clear counter-example
+        if ( pAbc->pCex )
+            ABC_FREE( pAbc->pCex );
+        // replace the current network
+        ABC_FREE( pNtkRes->pName );
+        pNtkRes->pName = Extra_UtilStrsav(pNtk->pName);
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    }
+    else
+    {
+        if ( !Abc_NtkCombinePos( pNtk, 0, fXor ) )
+        {
+            Abc_Print( -1, "ORing the POs has failed.\n" );
+            return 1;
+        }
+        // update counter-example
+        if ( pAbc->pCex )
+            pAbc->pCex->iPo = 0;
+        // replace the current network
+    //    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: orpos [-rxh]\n" );
+    Abc_Print( -2, "\t        creates single-output miter by ORing the POs of the current network\n" );
+    Abc_Print( -2, "\t-r    : performs the reverse transform (OR decomposition) [default = %s]\n", fReverse? "yes": "no" );
+    Abc_Print( -2, "\t-x    : toggles combining the PO using XOR [default = %s]\n", fXor? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAndPos( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes;
+    int fComb = 0;
+    int c;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'c':
+            fComb ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "The network is not strashed.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkPoNum(pNtk) == 1 )
+    {
+        Abc_Print( -1, "The network already has one PO.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkLatchNum(pNtk) )
+    {
+        Abc_Print( -1, "The miter has latches. ORing is not performed.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( !Abc_NtkCombinePos( pNtk, 1, 0 ) )
+    {
+        Abc_Print( -1, "ANDing the POs has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: andpos [-h]\n" );
+    Abc_Print( -2, "\t        creates single-output miter by ANDing the POs of the current network\n" );
+//    Abc_Print( -2, "\t-c    : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandZeroPo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL;
+    int c, iOutput = -1;
+    int fSkipSweep = 0;
+    int fUseConst1 = 0;
+    extern void Abc_NtkDropOneOutput( Abc_Ntk_t * pNtk, int iOutput, int fSkipSweep, int fUseConst1 );
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nsoh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iOutput = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iOutput < 0 )
+                goto usage;
+            break;
+        case 's':
+            fSkipSweep ^= 1;
+            break;
+        case 'o':
+            fUseConst1 ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "The network is not strashed.\n" );
+        return 1;
+    }
+    if ( iOutput < 0 )
+    {
+        Abc_Print( -1, "The output index is not specified.\n" );
+        return 1;
+    }
+    if ( iOutput >= Abc_NtkPoNum(pNtk) )
+    {
+        Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
+        return 1;
+    }
+
+    // get the new network
+//    pNtkRes = Abc_NtkDup( pNtk );
+//    Abc_NtkDropOneOutput( pNtkRes, iOutput );
+//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    Abc_NtkDropOneOutput( pNtk, iOutput, fSkipSweep, fUseConst1 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: zeropo [-N <num>] [-soh]\n" );
+    Abc_Print( -2, "\t           replaces the PO driver by constant 0\n" );
+    Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to replace [default = %d]\n", iOutput );
+    Abc_Print( -2, "\t-s       : performs comb sweep after removimg a PO [default = %s]\n", !fSkipSweep? "yes": "no" );
+    Abc_Print( -2, "\t-o       : toggles using const 1 instead of const 0 [default = %s]\n", fUseConst1? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSwapPos( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes;
+    int c, iOutput = -1;
+    extern void Abc_NtkSwapOneOutput( Abc_Ntk_t * pNtk, int iOutput );
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iOutput = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iOutput < 0 )
+                goto usage;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "The network is not strashed.\n" );
+        return 1;
+    }
+    if ( iOutput < 0 )
+    {
+        Abc_Print( -1, "The output index is not specified.\n" );
+        return 1;
+    }
+    if ( iOutput >= Abc_NtkPoNum(pNtk) )
+    {
+        Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkDup( pNtk );
+    Abc_NtkSwapOneOutput( pNtkRes, iOutput );
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: swappos [-N <num>] [-h]\n" );
+    Abc_Print( -2, "\t           swap the 0-th PO with the <num>-th PO\n" );
+    Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to swap [default = %d]\n", iOutput );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRemovePo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);//, * pNtkRes = NULL;
+    int c, iOutput = -1;
+    int fRemoveConst0 = 1;
+    extern void Abc_NtkRemovePo( Abc_Ntk_t * pNtk, int iOutput, int fRemoveConst0 );
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nzh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iOutput = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iOutput < 0 )
+                goto usage;
+            break;
+        case 'z':
+            fRemoveConst0 ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "The network is not strashed.\n" );
+        return 1;
+    }
+    if ( iOutput < 0 )
+    {
+        Abc_Print( -1, "The output index is not specified.\n" );
+        return 1;
+    }
+    if ( iOutput >= Abc_NtkPoNum(pNtk) )
+    {
+        Abc_Print( -1, "The output index is larger than the allowed POs.\n" );
+        return 1;
+    }
+
+    // get the new network
+//    pNtkRes = Abc_NtkDup( pNtk );
+//    Abc_NtkRemovePo( pNtkRes, iOutput );
+//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    Abc_NtkRemovePo( pNtk, iOutput, fRemoveConst0 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: removepo [-N <num>] [-zh]\n" );
+    Abc_Print( -2, "\t           remove PO with number <num> if it is const0\n" );
+    Abc_Print( -2, "\t-N <num> : the zero-based index of the PO to remove [default = %d]\n", iOutput );
+    Abc_Print( -2, "\t-z       : toggle removing const1 instead of const0 [default = %s]\n", fRemoveConst0? "const0": "const1" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDropSat( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes = NULL;
+    int fNoSweep = 0;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fNoSweep ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+    if ( pAbc->vCexVec == NULL )
+    {
+        Abc_Print( -1, "CEX array is not defined. Run \"bmc3 -az\", \"sim3 -az\", or \"pdr -az\".\n" );
+        return 1;
+    }
+    if ( Vec_PtrSize(pAbc->vCexVec) != Abc_NtkPoNum(pNtk) )
+    {
+        Abc_Print( -1, "CEX array size (%d) does not match the number of outputs (%d).\n", Vec_PtrSize(pAbc->vCexVec), Abc_NtkPoNum(pNtk) );
+        return 1;
+    }
+    Abc_NtkDropSatOutputs( pNtk, pAbc->vCexVec, fVerbose );
+    if ( !fNoSweep )
+    {
+        pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "Removing SAT outputs has failed.\n" );
+            return 1;
+        }
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dropsat [-sh]\n" );
+    Abc_Print( -2, "\t         replaces satisfiable POs by constant 0 and cleans up the AIG\n" );
+    Abc_Print( -2, "\t-s     : toggles skipping sequential sweep [default = %s]\n", fNoSweep? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAddPi( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtkRes;
+    int c;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkDup( pNtk );
+    if ( Abc_NtkPiNum(pNtkRes) == 0 )
+    {
+        Abc_Obj_t * pObj = Abc_NtkCreatePi( pNtkRes );
+        Abc_ObjAssignName( pObj, "dummy_pi", NULL );
+        Abc_NtkOrderCisCos( pNtkRes );
+    }
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: addpi [-h]\n" );
+    Abc_Print( -2, "\t         if the network has no PIs, add one dummy PI\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAppend( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtk2;
+    char * FileName;
+    int fComb = 0;
+    int c;
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'c':
+            fComb ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    // get the second network
+    if ( argc != globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "The network to append is not given.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "The base network should be strashed for the appending to work.\n" );
+        return 1;
+    }
+
+    // read the second network
+    FileName = argv[globalUtilOptind];
+    pNtk2 = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
+    if ( pNtk2 == NULL )
+        return 1;
+
+    // check if the second network is combinational
+    if ( Abc_NtkLatchNum(pNtk2) )
+    {
+        Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "The second network has latches. Appending does not work for such networks.\n" );
+        return 0;
+    }
+
+    // get the new network
+    if ( !Abc_NtkAppend( pNtk, pNtk2, 1 ) )
+    {
+        Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "Appending the networks failed.\n" );
+        return 1;
+    }
+    Abc_NtkDelete( pNtk2 );
+    // sweep dangling logic
+    Abc_AigCleanup( (Abc_Aig_t *)pNtk->pManFunc );
+    // replace the current network
+//    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: append [-h] <file>\n" );
+    Abc_Print( -2, "\t         appends a combinational network on top of the current network\n" );
+//    Abc_Print( -2, "\t-c     : computes combinational miter (latches as POs) [default = %s]\n", fComb? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : file name with the second network\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPutOnTop( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkPutOnTop( Abc_Ntk_t * pNtk, Abc_Ntk_t * pNtk2 );
+
+    Abc_Ntk_t * pNtk, * pNtk2, * pNtkRes;
+    char * FileName;
+    int fComb = 0;
+    int c;
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'c':
+            fComb ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    // get the second network
+    if ( argc != globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "The network to append is not given.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "The base network should be in the logic form.\n" );
+        return 1;
+    }
+
+    // check if the second network is combinational
+    if ( Abc_NtkLatchNum(pNtk) )
+    {
+        Abc_Print( -1, "The current network has latches. This command does not work for such networks.\n" );
+        return 0;
+    }
+
+    // read the second network
+    FileName = argv[globalUtilOptind];
+    pNtk2 = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
+    if ( pNtk2 == NULL )
+        return 1;
+
+    // check if the second network is combinational
+    if ( Abc_NtkLatchNum(pNtk2) )
+    {
+        Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "The second network has latches. This command does not work for such networks.\n" );
+        return 0;
+    }
+    // compare inputs/outputs
+    if ( Abc_NtkPoNum(pNtk) != Abc_NtkPiNum(pNtk2) )
+    {
+        Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "The PO count (%d) of the first network is not equal to PI count (%d) of the second network.\n", Abc_NtkPoNum(pNtk), Abc_NtkPiNum(pNtk2) );
+        return 0;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkPutOnTop( pNtk, pNtk2 );
+    Abc_NtkDelete( pNtk2 );
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: putontop [-h] <file>\n" );
+    Abc_Print( -2, "\t         connects PIs of network in <file> to POs of current network\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : file name with the second network\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkTemp, * pNtkRes;
+    int nFrames;
+    int fInitial;
+    int fVerbose;
+    int c;
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    nFrames  = 5;
+    fInitial = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames <= 0 )
+                goto usage;
+            break;
+        case 'i':
+            fInitial ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        pNtkRes  = Abc_NtkFrames( pNtkTemp, nFrames, fInitial, fVerbose );
+        Abc_NtkDelete( pNtkTemp );
+    }
+    else
+        pNtkRes  = Abc_NtkFrames( pNtk, nFrames, fInitial, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Unrolling the network has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: frames [-F <num>] [-ivh]\n" );
+    Abc_Print( -2, "\t           unrolls the network for a number of time frames\n" );
+    Abc_Print( -2, "\t-F <num> : the number of frames to unroll [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-i       : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDFrames( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkTemp, * pNtkRes;
+    int nPrefix;
+    int nFrames;
+    int fInitial;
+    int fVerbose;
+    int c;
+
+    extern Abc_Ntk_t * Abc_NtkDarFrames( Abc_Ntk_t * pNtk, int nPrefix, int nFrames, int fInitial, int fVerbose );
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    nPrefix  = 5;
+    nFrames  = 5;
+    fInitial = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NFivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nPrefix = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nPrefix <= 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames <= 0 )
+                goto usage;
+            break;
+        case 'i':
+            fInitial ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( nPrefix > nFrames )
+    {
+        Abc_Print( -1, "Prefix (%d) cannot be more than the number of frames (%d).\n", nPrefix, nFrames );
+        return 1;
+    }
+
+    // get the new network
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        pNtkRes  = Abc_NtkDarFrames( pNtkTemp, nPrefix, nFrames, fInitial, fVerbose );
+        Abc_NtkDelete( pNtkTemp );
+    }
+    else
+        pNtkRes  = Abc_NtkDarFrames( pNtk, nPrefix, nFrames, fInitial, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Unrolling the network has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dframes [-NF <num>] [-ivh]\n" );
+    Abc_Print( -2, "\t         unrolls the network with simplification\n" );
+    Abc_Print( -2, "\t-N num : the number of frames to use as prefix [default = %d]\n", nPrefix );
+    Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-i     : toggles initializing the first frame [default = %s]\n", fInitial? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles outputting verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSop( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int fDirect;
+    int c;
+
+    // set defaults
+    fDirect = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'd':
+            fDirect ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Converting to SOP is possible only for logic networks.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkToSop(pNtk, fDirect) )
+    {
+        Abc_Print( -1, "Converting to SOP has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: sop [-dh]\n" );
+    Abc_Print( -2, "\t         converts node functions to SOP\n" );
+    Abc_Print( -2, "\t-d     : toggles using both phases or only positive [default = %s]\n", fDirect? "direct": "both" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBdd( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int fReorder = 1;
+    int c;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "rh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'r':
+            fReorder ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Converting to BDD is possible only for logic networks.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsBddLogic(pNtk) )
+    {
+        Abc_Print( -1, "The logic network is already in the BDD form.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkToBdd(pNtk) )
+    {
+        Abc_Print( -1, "Converting to BDD has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: bdd [-rh]\n" );
+    Abc_Print( -2, "\t         converts node functions to BDD\n" );
+    Abc_Print( -2, "\t-r     : toggles enabling dynamic variable reordering [default = %s]\n", fReorder? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Converting to AIG is possible only for logic networks.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsAigLogic(pNtk) )
+    {
+        Abc_Print( -1, "The logic network is already in the AIG form.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkToAig(pNtk) )
+    {
+        Abc_Print( -1, "Converting to AIG has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: aig [-h]\n" );
+    Abc_Print( -2, "\t         converts node functions to AIG\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandReorder( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fVerbose;
+    extern void Abc_NtkBddReorder( Abc_Ntk_t * pNtk, int fVerbose );
+
+    // set defaults
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( !Abc_NtkIsBddLogic(pNtk) )
+    {
+        Abc_Print( -1, "Variable reordering is possible when node functions are BDDs (run \"bdd\").\n" );
+        return 1;
+    }
+    Abc_NtkBddReorder( pNtk, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: reorder [-vh]\n" );
+    Abc_Print( -2, "\t         reorders local functions of the nodes using sifting\n" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBidec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fVerbose;
+    extern void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose );
+
+    // set defaults
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( !Abc_NtkIsAigLogic(pNtk) )
+    {
+        Abc_Print( -1, "Bi-decomposition only works when node functions are AIGs (run \"aig\").\n" );
+        return 1;
+    }
+    Abc_NtkBidecResyn( pNtk, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: bidec [-vh]\n" );
+    Abc_Print( -2, "\t         applies bi-decomposition to local functions of the nodes\n" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandOrder( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * pFile;
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    char * pFileName;
+    int c;
+    int fReverse;
+    int fVerbose;
+    extern void Abc_NtkImplementCiOrder( Abc_Ntk_t * pNtk, char * pFileName, int fReverse, int fVerbose );
+    extern void Abc_NtkFindCiOrder( Abc_Ntk_t * pNtk, int fReverse, int fVerbose );
+
+    // set defaults
+    fReverse = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'r':
+            fReverse ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+//    if ( Abc_NtkLatchNum(pNtk) > 0 )
+//    {
+//        Abc_Print( -1, "Currently this procedure does not work for sequential networks.\n" );
+//        return 1;
+//    }
+
+    // if the var order file is given, implement this order
+    pFileName = NULL;
+    if ( argc == globalUtilOptind + 1 )
+    {
+        pFileName = argv[globalUtilOptind];
+        pFile = fopen( pFileName, "r" );
+        if ( pFile == NULL )
+        {
+            Abc_Print( -1, "Cannot open file \"%s\" with the BDD variable order.\n", pFileName );
+            return 1;
+        }
+        fclose( pFile );
+    }
+    if ( pFileName )
+        Abc_NtkImplementCiOrder( pNtk, pFileName, fReverse, fVerbose );
+    else
+        Abc_NtkFindCiOrder( pNtk, fReverse, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: order [-rvh] <file>\n" );
+    Abc_Print( -2, "\t         computes a good static CI variable order\n" );
+    Abc_Print( -2, "\t-r     : toggle reverse ordering [default = %s]\n", fReverse? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : (optional) file with the given variable order\n" );
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMuxes( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsBddLogic(pNtk) )
+    {
+        Abc_Print( -1, "Only a BDD logic network can be converted to MUXes.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkBddToMuxes( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Converting to MUXes has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: muxes [-h]\n" );
+    Abc_Print( -2, "\t        converts the current network into a network derived by\n" );
+    Abc_Print( -2, "\t        replacing all nodes by DAGs isomorphic to the local BDDs\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCubes( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkSopToCubes( Abc_Ntk_t * pNtk );
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsSopLogic(pNtk) )
+    {
+        Abc_Print( -1, "Only a SOP logic network can be transformed into cubes.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkSopToCubes( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Converting to cubes has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cubes [-h]\n" );
+    Abc_Print( -2, "\t        converts the current network into a network derived by creating\n" );
+    Abc_Print( -2, "\t        a separate node for each product and sum in the local SOPs\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSplitSop( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkSplitSop( Abc_Ntk_t * pNtk, int nCubesMax, int fVerbose );
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, fVerbose = 0, nCubesMax = 100;
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCubesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCubesMax < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsSopLogic(pNtk) )
+    {
+        Abc_Print( -1, "Only a SOP logic network can be transformed into cubes.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkSplitSop( pNtk, nCubesMax, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Converting to cubes has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: splitsop [-N num] [-vh]\n" );
+    Abc_Print( -2, "\t         splits nodes whose SOP size is larger than the given one\n" );
+    Abc_Print( -2, "\t-N num : the maximum number of cubes after splitting [default = %d]\n", nCubesMax );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandExtSeqDcs( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fVerbose;
+    extern int Abc_NtkExtractSequentialDcs( Abc_Ntk_t * pNet, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "The current network has no latches.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Extracting sequential don't-cares works only for AIGs (run \"strash\").\n" );
+        return 0;
+    }
+    if ( !Abc_NtkExtractSequentialDcs( pNtk, fVerbose ) )
+    {
+        Abc_Print( -1, "Extracting sequential don't-cares has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: ext_seq_dcs [-vh]\n" );
+    Abc_Print( -2, "\t         create EXDC network using unreachable states\n" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandReach( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Saig_ParBbr_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    char * pLogFileName = NULL;
+
+    extern int Abc_NtkDarReach( Abc_Ntk_t * pNtk, Saig_ParBbr_t * pPars );
+
+    // set defaults
+    Bbr_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "TBFLproyvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBddMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBddMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nIterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIterMax < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'p':
+            pPars->fPartition ^= 1;
+            break;
+        case 'r':
+            pPars->fReorder ^= 1;
+            break;
+        case 'o':
+            pPars->fReorderImage ^= 1;
+            break;
+        case 'y':
+            pPars->fSkipOutCheck ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "The current network has no latches.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Reachability analysis works only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+    pAbc->Status  = Abc_NtkDarReach( pNtk, pPars );
+    pAbc->nFrames = pPars->iFrame;
+    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "reach" );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: reach [-TBF num] [-L file] [-proyvh]\n" );
+    Abc_Print( -2, "\t         verifies sequential miter using BDD-based reachability\n" );
+    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", pPars->nBddMax );
+    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-p     : enable partitioned image computation [default = %s]\n", pPars->fPartition? "yes": "no" );
+    Abc_Print( -2, "\t-r     : enable dynamic BDD variable reordering [default = %s]\n", pPars->fReorder? "yes": "no" );
+    Abc_Print( -2, "\t-o     : toggles BDD variable reordering during image computation [default = %s]\n", pPars->fReorderImage? "yes": "no" );
+    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCone( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    Abc_Obj_t * pNode, * pNodeCo;
+    int c;
+    int fUseAllCis;
+    int fUseMffc;
+    int fSeq;
+    int Output;
+    int nRange;
+
+    extern Abc_Ntk_t * Abc_NtkMakeOnePo( Abc_Ntk_t * pNtk, int Output, int nRange );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fUseAllCis = 0;
+    fUseMffc = 0;
+    fSeq = 0;
+    Output = -1;
+    nRange = -1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ORmash" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'O':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Output = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Output < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nRange = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nRange < 0 )
+                goto usage;
+            break;
+        case 'm':
+            fUseMffc ^= 1;
+            break;
+        case 'a':
+            fUseAllCis ^= 1;
+            break;
+        case 's':
+            fSeq ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently can only be applied to the logic network or an AIG.\n" );
+        return 1;
+    }
+
+    if ( argc > globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+
+    pNodeCo = NULL;
+    if ( argc == globalUtilOptind + 1 )
+    {
+        pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+        if ( pNode == NULL )
+        {
+            Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+            return 1;
+        }
+        if ( fUseMffc )
+            pNtkRes = Abc_NtkCreateMffc( pNtk, pNode, argv[globalUtilOptind] );
+        else
+            pNtkRes = Abc_NtkCreateCone( pNtk, pNode, argv[globalUtilOptind], fUseAllCis );
+    }
+    else
+    {
+        if ( Output == -1 )
+        {
+            Abc_Print( -1, "The node is not specified.\n" );
+            return 1;
+        }
+        if ( Output >= Abc_NtkCoNum(pNtk) )
+        {
+            Abc_Print( -1, "The 0-based output number (%d) is larger than the number of outputs (%d).\n", Output, Abc_NtkCoNum(pNtk) );
+            return 1;
+        }
+        pNodeCo = Abc_NtkCo( pNtk, Output );
+        if ( fSeq )
+            pNtkRes = Abc_NtkMakeOnePo( pNtk, Output, nRange );
+        else if ( fUseMffc )
+            pNtkRes = Abc_NtkCreateMffc( pNtk, Abc_ObjFanin0(pNodeCo), Abc_ObjName(pNodeCo) );
+        else
+            pNtkRes = Abc_NtkCreateCone( pNtk, Abc_ObjFanin0(pNodeCo), Abc_ObjName(pNodeCo), fUseAllCis );
+    }
+    if ( pNodeCo && Abc_ObjFaninC0(pNodeCo) && !fSeq )
+    {
+        Abc_NtkPo(pNtkRes, 0)->fCompl0  ^= 1;
+//        Abc_Print( -1, "The extracted cone represents the complement function of the CO.\n" );
+    }
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Writing the logic cone of one node has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cone [-OR num] [-amsh] <name>\n" );
+    Abc_Print( -2, "\t         replaces the current network by one logic cone\n" );
+    Abc_Print( -2, "\t-a     : toggle keeping all CIs or structral support only [default = %s]\n", fUseAllCis? "all": "structural" );
+    Abc_Print( -2, "\t-m     : toggle keeping only MFFC or complete TFI cone [default = %s]\n", fUseMffc? "MFFC": "TFI cone" );
+    Abc_Print( -2, "\t-s     : toggle comb or sequential cone (works with \"-O num\") [default = %s]\n", fSeq? "seq": "comb" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t-O num : (optional) the 0-based number of the CO to extract\n");
+    Abc_Print( -2, "\t-R num : (optional) the number of outputs to extract\n");
+    Abc_Print( -2, "\tname   : (optional) the name of the node to extract\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandNode( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    Abc_Obj_t * pNode;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+       case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Currently can only be applied to a logic network.\n" );
+        return 1;
+    }
+
+    if ( argc != globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Wrong number of auguments.\n" );
+        goto usage;
+    }
+
+    pNode = Abc_NtkFindNode( pNtk, argv[globalUtilOptind] );
+    if ( pNode == NULL )
+    {
+        Abc_Print( -1, "Cannot find node \"%s\".\n", argv[globalUtilOptind] );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkCreateFromNode( pNtk, pNode );
+//    pNtkRes = Abc_NtkDeriveFromBdd( pNtk->pManFunc, pNode->pData, NULL, NULL );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Splitting one node has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: node [-h] <name>\n" );
+    Abc_Print( -2, "\t         replaces the current network by the network composed of one node\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tname   : the node name\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTopmost( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, nLevels;
+    extern Abc_Ntk_t * Abc_NtkTopmost( Abc_Ntk_t * pNtk, int nLevels );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nLevels = 10;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLevels = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLevels < 0 )
+                goto usage;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+
+    if ( Abc_NtkLatchNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Currently can only works for combinational circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkPoNum(pNtk) != 1 )
+    {
+        Abc_Print( -1, "Currently expects a single-output miter.\n" );
+        return 0;
+    }
+
+    pNtkRes = Abc_NtkTopmost( pNtk, nLevels );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "The command has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: topmost [-N num] [-h]\n" );
+    Abc_Print( -2, "\t         replaces the current network by several of its topmost levels\n" );
+    Abc_Print( -2, "\t-N num : max number of levels [default = %d]\n", nLevels );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tname   : the node name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTopAnd( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkTopAnd( Abc_Ntk_t * pNtk );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+
+    if ( Abc_NtkLatchNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Currently can only works for combinational circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkPoNum(pNtk) != 1 )
+    {
+        Abc_Print( -1, "Currently expects a single-output miter.\n" );
+        return 0;
+    }
+    if ( Abc_ObjFaninC0(Abc_NtkPo(pNtk, 0)) )
+    {
+        Abc_Print( -1, "The PO driver is complemented. AND-decomposition is impossible.\n" );
+        return 0;
+    }
+    if ( !Abc_ObjIsNode(Abc_ObjChild0(Abc_NtkPo(pNtk, 0))) )
+    {
+        Abc_Print( -1, "The PO driver is not a node. AND-decomposition is impossible.\n" );
+        return 0;
+    }
+    pNtkRes = Abc_NtkTopAnd( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "The command has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: topand [-h]\n" );
+    Abc_Print( -2, "\t         performs AND-decomposition of single-output combinational miter\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tname   : the node name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTrim( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    Gia_Man_t * pGia, * pNew;
+    Aig_Man_t * pAig;
+    int c;
+    pNtk = Abc_FrameReadNtk(pAbc);
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Trimming works only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+    // convert to GIA
+    pAig = Abc_NtkToDar( pNtk, 0, 1 );
+    pGia = Gia_ManFromAigSimple( pAig );
+    Aig_ManStop( pAig );
+    // perform trimming
+    pNew = Gia_ManDupTrimmed( pGia, 1, 1, 0, -1 );
+    Gia_ManStop( pGia );
+    // convert back
+    pAig = Gia_ManToAigSimple( pNew );
+    Gia_ManStop( pNew );
+    pNtkRes = Abc_NtkFromAigPhase( pAig );
+    Aig_ManStop( pAig );
+    // duplicate the name and the spec
+    ABC_FREE( pNtkRes->pName );
+    ABC_FREE( pNtkRes->pSpec );
+    pNtkRes->pName = Extra_UtilStrsav(pNtk->pName);
+    pNtkRes->pSpec = Extra_UtilStrsav(pNtk->pSpec);
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: trim [-h]\n" );
+    Abc_Print( -2, "\t         removes POs fed by constants and PIs w/o fanout\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandShortNames( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    Abc_NtkShortNames( pNtk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: short_names [-h]\n" );
+    Abc_Print( -2, "\t         replaces PI/PO/latch names by short char strings\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMoveNames( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+	extern void Abc_NtkMoveNames( Abc_Ntk_t * pNtk, Abc_Ntk_t * pOld );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+	Abc_Ntk_t * pNtk2;
+	char * FileName;
+    int c;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    // get the second network
+    if ( argc != globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "The network to take names from is not given.\n" );
+        return 1;
+    }
+
+    // read the second network
+    FileName = argv[globalUtilOptind];
+    pNtk2 = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
+    if ( pNtk2 == NULL )
+        return 1;
+
+    // compare inputs/outputs
+    if ( Abc_NtkPiNum(pNtk) != Abc_NtkPiNum(pNtk2) )
+    {
+        Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "The PI count (%d) of the first network is not equal to PI count (%d) of the second network.\n", Abc_NtkPiNum(pNtk), Abc_NtkPiNum(pNtk2) );
+        return 0;
+    }
+    // compare inputs/outputs
+    if ( Abc_NtkPoNum(pNtk) != Abc_NtkPoNum(pNtk2) )
+    {
+        Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "The PO count (%d) of the first network is not equal to PO count (%d) of the second network.\n", Abc_NtkPoNum(pNtk), Abc_NtkPoNum(pNtk2) );
+        return 0;
+    }
+    // compare inputs/outputs
+    if ( Abc_NtkLatchNum(pNtk) != Abc_NtkLatchNum(pNtk2) )
+    {
+        Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "The flop count (%d) of the first network is not equal to flop count (%d) of the second network.\n", Abc_NtkLatchNum(pNtk), Abc_NtkLatchNum(pNtk2) );
+        return 0;
+    }
+    Abc_NtkMoveNames( pNtk, pNtk2 );
+    Abc_NtkDelete( pNtk2 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: move_names [-h] <file>\n" );
+    Abc_Print( -2, "\t         moves PI/PO/latch names from the other network\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : file with network that has required names\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandExdcFree( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( pNtk->pExdc == NULL )
+    {
+        Abc_Print( -1, "The network has no EXDC.\n" );
+        return 1;
+    }
+
+    Abc_NtkDelete( pNtk->pExdc );
+    pNtk->pExdc = NULL;
+
+    // replace the current network
+    pNtkRes = Abc_NtkDup( pNtk );
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: exdc_free [-h]\n" );
+    Abc_Print( -2, "\t         frees the EXDC network of the current network\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandExdcGet( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( pNtk->pExdc == NULL )
+    {
+        Abc_Print( -1, "The network has no EXDC.\n" );
+        return 1;
+    }
+
+    // replace the current network
+    pNtkRes = Abc_NtkDup( pNtk->pExdc );
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: exdc_get [-h]\n" );
+    Abc_Print( -2, "\t         replaces the current network by the EXDC of the current network\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandExdcSet( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * pFile;
+    Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
+    char * FileName;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( argc != globalUtilOptind + 1 )
+    {
+        goto usage;
+    }
+
+    // get the input file name
+    FileName = argv[globalUtilOptind];
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".mv", ".blif", ".pla", ".eqn", ".bench" )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+
+    // set the new network
+    pNtkNew = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
+    if ( pNtkNew == NULL )
+    {
+        Abc_Print( -1, "Reading network from file has failed.\n" );
+        return 1;
+    }
+
+    // replace the EXDC
+    if ( pNtk->pExdc )
+    {
+        Abc_NtkDelete( pNtk->pExdc );
+        pNtk->pExdc = NULL;
+    }
+    pNtkRes = Abc_NtkDup( pNtk );
+    pNtkRes->pExdc = pNtkNew;
+
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: exdc_set [-h] <file>\n" );
+    Abc_Print( -2, "\t         sets the network from file as EXDC for the current network\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : file with the new EXDC network\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCareSet( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * pFile;
+    Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
+    char * FileName;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( argc != globalUtilOptind + 1 )
+    {
+        goto usage;
+    }
+
+    // get the input file name
+    FileName = argv[globalUtilOptind];
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".mv", ".blif", ".pla", ".eqn", ".bench" )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+
+    // set the new network
+    pNtkNew = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
+    if ( pNtkNew == NULL )
+    {
+        Abc_Print( -1, "Reading network from file has failed.\n" );
+        return 1;
+    }
+
+    // replace the EXDC
+    if ( pNtk->pExcare )
+    {
+        Abc_NtkDelete( (Abc_Ntk_t *)pNtk->pExcare );
+        pNtk->pExcare = NULL;
+    }
+    pNtkRes = Abc_NtkDup( pNtk );
+    pNtkRes->pExcare = pNtkNew;
+
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: care_set [-h] <file>\n" );
+    Abc_Print( -2, "\t         sets the network from file as a care for the current network\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : file with the new care network\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cut_Params_t Params, * pParams = &Params;
+    Cut_Man_t * pCutMan;
+    Cut_Oracle_t * pCutOracle = NULL;
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fOracle;
+    extern Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams );
+    extern void Abc_NtkCutsOracle( Abc_Ntk_t * pNtk, Cut_Oracle_t * pCutOracle );
+
+    // set defaults
+    fOracle = 0;
+    memset( pParams, 0, sizeof(Cut_Params_t) );
+    pParams->nVarsMax    = 5;     // the max cut size ("k" of the k-feasible cuts)
+    pParams->nKeepMax    = 1000;  // the max number of cuts kept at a node
+    pParams->fTruth      = 1;     // compute truth tables
+    pParams->fFilter     = 1;     // filter dominated cuts
+    pParams->fDrop       = 0;     // drop cuts on the fly
+    pParams->fDag        = 1;     // compute DAG cuts
+    pParams->fTree       = 0;     // compute tree cuts
+    pParams->fGlobal     = 0;     // compute global cuts
+    pParams->fLocal      = 0;     // compute local cuts
+    pParams->fFancy      = 0;     // compute something fancy
+    pParams->fRecordAig  = 1;     // compute something fancy
+    pParams->fMap        = 0;     // compute mapping delay
+    pParams->fAdjust     = 0;     // removes useless fanouts
+    pParams->fNpnSave    = 0;     // enables dumping truth tables
+    pParams->fVerbose    = 0;     // the verbosiness flag
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KMtfdxyglzamjvosh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nVarsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nVarsMax < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nKeepMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nKeepMax < 0 )
+                goto usage;
+            break;
+        case 't':
+            pParams->fTruth ^= 1;
+            break;
+        case 'f':
+            pParams->fFilter ^= 1;
+            break;
+        case 'd':
+            pParams->fDrop ^= 1;
+            break;
+        case 'x':
+            pParams->fDag ^= 1;
+            break;
+        case 'y':
+            pParams->fTree ^= 1;
+            break;
+        case 'g':
+            pParams->fGlobal ^= 1;
+            break;
+        case 'l':
+            pParams->fLocal ^= 1;
+            break;
+        case 'z':
+            pParams->fFancy ^= 1;
+            break;
+        case 'a':
+            pParams->fRecordAig ^= 1;
+            break;
+        case 'm':
+            pParams->fMap ^= 1;
+            break;
+        case 'j':
+            pParams->fAdjust ^= 1;
+            break;
+        case 'v':
+            pParams->fVerbose ^= 1;
+            break;
+        case 'o':
+            fOracle ^= 1;
+            break;
+        case 's':
+            pParams->fNpnSave ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Cut computation is available only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+    if ( pParams->nVarsMax < CUT_SIZE_MIN || pParams->nVarsMax > CUT_SIZE_MAX )
+    {
+        Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
+        return 1;
+    }
+    if ( pParams->fDag && pParams->fTree )
+    {
+        Abc_Print( -1, "Cannot compute both DAG cuts and tree cuts at the same time.\n" );
+        return 1;
+    }
+
+    if ( pParams->fNpnSave )
+    {
+        pParams->nVarsMax = 6;
+        pParams->fTruth = 1;
+    }
+
+    if ( fOracle )
+        pParams->fRecord = 1;
+    pCutMan = Abc_NtkCuts( pNtk, pParams );
+    if ( fOracle )
+        pCutOracle = Cut_OracleStart( pCutMan );
+    Cut_ManStop( pCutMan );
+    if ( fOracle )
+    {
+        assert(pCutOracle);
+        Abc_NtkCutsOracle( pNtk, pCutOracle );
+        Cut_OracleStop( pCutOracle );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cut [-K num] [-M num] [-tfdcovamjsvh]\n" );
+    Abc_Print( -2, "\t         computes k-feasible cuts for the AIG\n" );
+    Abc_Print( -2, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n",     CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
+    Abc_Print( -2, "\t-M num : max number of cuts stored at a node [default = %d]\n",        pParams->nKeepMax );
+    Abc_Print( -2, "\t-t     : toggle truth table computation [default = %s]\n",             pParams->fTruth?   "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle filtering of duplicated/dominated [default = %s]\n",   pParams->fFilter?  "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle dropping when fanouts are done [default = %s]\n",      pParams->fDrop?    "yes": "no" );
+    Abc_Print( -2, "\t-x     : toggle computing only DAG cuts [default = %s]\n",             pParams->fDag?     "yes": "no" );
+    Abc_Print( -2, "\t-y     : toggle computing only tree cuts [default = %s]\n",            pParams->fTree?    "yes": "no" );
+    Abc_Print( -2, "\t-g     : toggle computing only global cuts [default = %s]\n",          pParams->fGlobal?  "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle computing only local cuts [default = %s]\n",           pParams->fLocal?   "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle fancy computations [default = %s]\n",                  pParams->fFancy?   "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle recording cut functions [default = %s]\n",             pParams->fRecordAig?"yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle delay-oriented FPGA mapping [default = %s]\n",         pParams->fMap?     "yes": "no" );
+    Abc_Print( -2, "\t-j     : toggle removing fanouts due to XOR/MUX [default = %s]\n",     pParams->fAdjust?  "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle creating library of 6-var functions [default = %s]\n", pParams->fNpnSave?  "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",        pParams->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandScut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cut_Params_t Params, * pParams = &Params;
+    Cut_Man_t * pCutMan;
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    extern Cut_Man_t * Abc_NtkSeqCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams );
+
+    // set defaults
+    memset( pParams, 0, sizeof(Cut_Params_t) );
+    pParams->nVarsMax  = 5;     // the max cut size ("k" of the k-feasible cuts)
+    pParams->nKeepMax  = 1000;  // the max number of cuts kept at a node
+    pParams->fTruth    = 0;     // compute truth tables
+    pParams->fFilter   = 1;     // filter dominated cuts
+    pParams->fSeq      = 1;     // compute sequential cuts
+    pParams->fVerbose  = 0;     // the verbosiness flag
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KMtvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nVarsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nVarsMax < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nKeepMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nKeepMax < 0 )
+                goto usage;
+            break;
+        case 't':
+            pParams->fTruth ^= 1;
+            break;
+        case 'v':
+            pParams->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+/*
+    if ( !Abc_NtkIsSeq(pNtk) )
+    {
+        Abc_Print( -1, "Sequential cuts can be computed for sequential AIGs (run \"seq\").\n" );
+        return 1;
+    }
+*/
+    if ( pParams->nVarsMax < CUT_SIZE_MIN || pParams->nVarsMax > CUT_SIZE_MAX )
+    {
+        Abc_Print( -1, "Can only compute the cuts for %d <= K <= %d.\n", CUT_SIZE_MIN, CUT_SIZE_MAX );
+        return 1;
+    }
+
+    pCutMan = Abc_NtkSeqCuts( pNtk, pParams );
+    Cut_ManStop( pCutMan );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: scut [-K num] [-M num] [-tvh]\n" );
+    Abc_Print( -2, "\t         computes k-feasible cuts for the sequential AIG\n" );
+    Abc_Print( -2, "\t-K num : max number of leaves (%d <= num <= %d) [default = %d]\n",   CUT_SIZE_MIN, CUT_SIZE_MAX, pParams->nVarsMax );
+    Abc_Print( -2, "\t-M num : max number of cuts stored at a node [default = %d]\n",      pParams->nKeepMax );
+    Abc_Print( -2, "\t-t     : toggle truth table computation [default = %s]\n",           pParams->fTruth?   "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",      pParams->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandEspresso( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fVerbose;
+    extern void Abc_NtkEspresso( Abc_Ntk_t * pNtk, int fVerbose );
+
+    if ( argc == 2 && !strcmp(argv[1], "-h") )
+    {
+        Abc_Print( -2, "The espresso command is currently disabled.\n" );
+        return 1;
+    }
+
+    Abc_Print( -1, "This command is currently disabled.\n" );
+    return 0;
+
+    // set defaults
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "SOP minimization is possible for logic networks (run \"renode\").\n" );
+        return 1;
+    }
+//    Abc_NtkEspresso( pNtk, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: espresso [-vh]\n" );
+    Abc_Print( -2, "\t         minimizes SOPs of the local functions using Espresso\n" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandGen( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nVars;    // the number of variables
+    int nLutSize = -1; // the size of LUTs
+    int nLuts = -1;    // the number of LUTs
+    int fAdder;
+    int fSorter;
+    int fMesh;
+    int fMulti;
+    int fFpga;
+    int fOneHot;
+    int fRandom;
+    int fVerbose;
+    char * FileName;
+    char Command[1000];
+    extern void Abc_GenAdder( char * pFileName, int nVars );
+    extern void Abc_GenSorter( char * pFileName, int nVars );
+    extern void Abc_GenMesh( char * pFileName, int nVars );
+    extern void Abc_GenMulti( char * pFileName, int nVars );
+    extern void Abc_GenFpga( char * pFileName, int nLutSize, int nLuts, int nVars );
+    extern void Abc_GenOneHot( char * pFileName, int nVars );
+    extern void Abc_GenRandom( char * pFileName, int nPis );
+
+    // set defaults
+    nVars = 8;
+    fAdder = 0;
+    fSorter = 0;
+    fMesh = 0;
+    fMulti = 0;
+    fFpga = 0;
+    fOneHot = 0;
+    fRandom = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NKLasemftrvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nVars = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nVars < 0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLuts = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLuts < 0 )
+                goto usage;
+            break;
+        case 'a':
+            fAdder ^= 1;
+            break;
+        case 's':
+            fSorter ^= 1;
+            break;
+        case 'e':
+            fMesh ^= 1;
+            break;
+        case 'm':
+            fMulti ^= 1;
+            break;
+        case 'f':
+            fFpga ^= 1;
+            break;
+        case 't':
+            fOneHot ^= 1;
+            break;
+        case 'r':
+            fRandom ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( argc != globalUtilOptind + 1 )
+    {
+        goto usage;
+    }
+    if ( nVars < 1 )
+    {
+        Abc_Print( -1, "The number of variables should be a positive integer.\n" );
+        return 0;
+    }
+    // get the input file name
+    FileName = argv[globalUtilOptind];
+    if ( fAdder )
+        Abc_GenAdder( FileName, nVars );
+    else if ( fSorter )
+        Abc_GenSorter( FileName, nVars );
+    else if ( fMesh )
+        Abc_GenMesh( FileName, nVars );
+    else if ( fMulti )
+        Abc_GenMulti( FileName, nVars );
+    else if ( fFpga )
+        Abc_GenFpga( FileName, nLutSize, nLuts, nVars );
+//        Abc_GenFpga( FileName, 2, 2, 3 );
+//        Abc_GenFpga( FileName, 3, 2, 5 );
+    else if ( fOneHot )
+        Abc_GenOneHot( FileName, nVars );
+    else if ( fRandom )
+        Abc_GenRandom( FileName, nVars );
+    else
+    {
+        Abc_Print( -1, "Type of circuit is not specified.\n" );
+        return 0;
+    }
+    // read the file just produced
+    sprintf(Command, "read %s", FileName );
+    Cmd_CommandExecute( pAbc, Command );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: gen [-NKL num] [-asemftrvh] <file>\n" );
+    Abc_Print( -2, "\t         generates simple circuits\n" );
+    Abc_Print( -2, "\t-N num : the number of variables [default = %d]\n", nVars );
+    Abc_Print( -2, "\t-K num : the LUT size (to be used with switch -f) [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-L num : the LUT count (to be used with switch -f) [default = %d]\n", nLuts );
+    Abc_Print( -2, "\t-a     : generate ripple-carry adder [default = %s]\n", fAdder? "yes": "no" );
+    Abc_Print( -2, "\t-s     : generate a sorter [default = %s]\n", fSorter? "yes": "no" );
+    Abc_Print( -2, "\t-e     : generate a mesh [default = %s]\n", fMesh? "yes": "no" );
+    Abc_Print( -2, "\t-m     : generate a multiplier [default = %s]\n", fMulti? "yes": "no" );
+    Abc_Print( -2, "\t-f     : generate a LUT FPGA structure [default = %s]\n", fFpga? "yes": "no" );
+    Abc_Print( -2, "\t-t     : generate one-hotness conditions [default = %s]\n", fOneHot? "yes": "no" );
+    Abc_Print( -2, "\t-r     : generate random single-output function [default = %s]\n", fRandom? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : output file name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandGenFsm( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_GenFsm( char * pFileName, int nIns, int nOuts, int nStates, int nLines, int ProbI, int ProbO );
+    int c, nIns, nOuts, nStates, nLines, ProbI, ProbO, fVerbose;
+    char * FileName;
+    // set defaults
+    nIns     =   30;
+    nOuts    =    1;
+    nStates  =   20;
+    nLines   =  100;
+    ProbI    =   10;
+    ProbO    =  100;
+    fVerbose =    0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "IOSLPQvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nIns = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nIns < 0 )
+                goto usage;
+            break;
+        case 'O':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nOuts = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nOuts < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nStates = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nStates < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLines = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLines < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            ProbI = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( ProbI < 0 )
+                goto usage;
+            break;
+        case 'Q':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            ProbO = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( ProbO < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( argc != globalUtilOptind + 1 )
+    {
+        goto usage;
+    }
+    if ( nIns < 1 || nStates < 1 || nLines < 1 || ProbI < 1 || ProbO < 1 )
+    {
+        Abc_Print( -1, "The number of inputs. states, lines, and probablity should be positive integers.\n" );
+        goto usage;
+    }
+    // get the input file name
+    FileName = argv[globalUtilOptind];
+    Abc_GenFsm( FileName, nIns, nOuts, nStates, nLines, ProbI, ProbO );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: genfsm [-IOSLPQ num] [-vh] <file>\n" );
+    Abc_Print( -2, "\t         generates random FSM in KISS format\n" );
+    Abc_Print( -2, "\t-I num : the number of input variables [default = %d]\n", nIns );
+    Abc_Print( -2, "\t-O num : the number of output variables [default = %d]\n", nOuts );
+    Abc_Print( -2, "\t-S num : the number of state variables [default = %d]\n", nStates );
+    Abc_Print( -2, "\t-L num : the number of lines (product terms) [default = %d]\n", nLines );
+    Abc_Print( -2, "\t-P num : percentage propability of a variable present in the input cube [default = %d]\n", ProbI );
+    Abc_Print( -2, "\t-Q num : percentage propability of a variable present in the output cube [default = %d]\n", ProbO );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : output file name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCover( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fVerbose;
+    int fUseSop;
+    int fUseEsop;
+    int fUseInvs;
+    int nFaninMax;
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    fUseSop   =  1;
+    fUseEsop  =  0;
+    fVerbose  =  0;
+    fUseInvs  =  1;
+    nFaninMax =  8;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nsxivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFaninMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFaninMax < 0 )
+                goto usage;
+            break;
+        case 's':
+            fUseSop ^= 1;
+            break;
+        case 'x':
+            fUseEsop ^= 1;
+            break;
+        case 'i':
+            fUseInvs ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for strashed networks.\n" );
+        return 1;
+    }
+
+    // run the command
+    pNtkRes = Abc_NtkSopEsopCover( pNtk, nFaninMax, fUseEsop, fUseSop, fUseInvs, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cover [-N num] [-sxvh]\n" );
+    Abc_Print( -2, "\t         decomposition into a network of SOP/ESOP PLAs\n" );
+    Abc_Print( -2, "\t-N num : maximum number of inputs [default = %d]\n", nFaninMax );
+    Abc_Print( -2, "\t-s     : toggle the use of SOPs [default = %s]\n", fUseSop? "yes": "no" );
+    Abc_Print( -2, "\t-x     : toggle the use of ESOPs [default = %s]\n", fUseEsop? "yes": "no" );
+//    Abc_Print( -2, "\t-i     : toggle the use of interters [default = %s]\n", fUseInvs? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandInter( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes = NULL;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c, fDelete1, fDelete2;
+    int fRelation;
+    int fVerbose;
+    extern Abc_Ntk_t * Abc_NtkInter( Abc_Ntk_t * pNtkOn, Abc_Ntk_t * pNtkOff, int fRelation, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fRelation = 0;
+    fVerbose  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'r':
+            fRelation ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+        return 1;
+    if ( nArgcNew == 0 )
+    {
+        Abc_Obj_t * pObj;
+        int i;
+        Abc_Print( -1, "Deriving new circuit structure for the current network.\n" );
+        Abc_NtkForEachPo( pNtk2, pObj, i )
+            Abc_ObjXorFaninC( pObj, 0 );
+    }
+    if ( fRelation && Abc_NtkCoNum(pNtk1) != 1 )
+    {
+        Abc_Print( -1, "Computation of interplants as a relation only works for single-output functions.\n" );
+        Abc_Print( -1, "Use command \"cone\" to extract one output cone from the multi-output network.\n" );
+    }
+    else
+        pNtkRes = Abc_NtkInter( pNtk1, pNtk2, fRelation, fVerbose );
+    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: inter [-rvh] <onset.blif> <offset.blif>\n" );
+    Abc_Print( -2, "\t         derives interpolant of two networks representing onset and offset;\n" );
+    Abc_Print( -2, "\t-r     : toggle computing interpolant as a relation [default = %s]\n", fRelation? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t         \n" );
+    Abc_Print( -2, "\t         Comments:\n" );
+    Abc_Print( -2, "\t         \n" );
+    Abc_Print( -2, "\t         The networks given on the command line should have the same CIs/COs.\n" );
+    Abc_Print( -2, "\t         If only one network is given on the command line, this network\n" );
+    Abc_Print( -2, "\t         is assumed to be the offset, while the current network is the onset.\n" );
+    Abc_Print( -2, "\t         If no network is given on the command line, the current network is\n" );
+    Abc_Print( -2, "\t         assumed to be the onset and its complement is taken to be the offset.\n" );
+    Abc_Print( -2, "\t         The resulting interpolant is stored as the current network.\n" );
+    Abc_Print( -2, "\t         To verify that the interpolant agrees with the onset and the offset,\n" );
+    Abc_Print( -2, "\t         save it in file \"inter.blif\" and run the following:\n" );
+    Abc_Print( -2, "\t         (a) \"miter -i <onset.blif> <inter.blif>; iprove\"\n" );
+    Abc_Print( -2, "\t         (b) \"miter -i <inter.blif> <offset_inv.blif>; iprove\"\n" );
+    Abc_Print( -2, "\t         where <offset_inv.blif> is the network derived by complementing the\n" );
+    Abc_Print( -2, "\t         outputs of <offset.blif>: \"r <offset.blif>; st -i; w <offset_inv.blif>\"\n" );
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDouble( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int nFrames;
+    int fVerbose;
+    extern Abc_Ntk_t * Abc_NtkDouble( Abc_Ntk_t * pNtk );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nFrames    = 50;
+    fVerbose   =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsSopLogic(pNtk) )
+    {
+        Abc_Print( -1, "Only works for logic SOP networks.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkDouble( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: double [-vh]\n" );
+    Abc_Print( -2, "\t         puts together two parallel copies of the current network\n" );
+//    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBb2Wb( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_NtkConvertBb2Wb( char * pFileNameIn, char * pFileNameOut, int fSeq, int fVerbose );
+    int c;
+    int fSeq;
+    int fVerbose;
+    // set defaults
+    fSeq = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fSeq ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( argc != globalUtilOptind + 2 )
+    {
+        Abc_Print( -1, "Expecting two files names on the command line.\n" );
+        goto usage;
+    }
+    Abc_NtkConvertBb2Wb( argv[globalUtilOptind], argv[globalUtilOptind+1], fSeq, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: bb2wb [-svh] <file_in> <file_out>\n" );
+    Abc_Print( -2, "\t             replaces black boxes by white boxes with AND functions\n" );
+    Abc_Print( -2, "\t             (file names should have standard extensions, e.g. \"blif\")\n" );
+    Abc_Print( -2, "\t-s         : toggle using sequential white boxes [default = %s]\n", fSeq? "yes": "no" );
+    Abc_Print( -2, "\t-v         : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h         : print the command usage\n");
+    Abc_Print( -2, "\t<file_in>  : input file with design containing black boxes\n");
+    Abc_Print( -2, "\t<file_out> : output file with design containing white boxes\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandOutdec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkDarOutdec( Abc_Ntk_t * pNtk, int nLits, int fVerbose );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Ntk_t * pNtkRes;
+    int c, nLits = 1;
+    int fVerbose = 0;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Lvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLits = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLits < 1 || nLits > 2 )
+            {
+                Abc_Print( 1,"Currently, command \"outdec\" works for 1-lit and 2-lit primes only.\n" );
+                goto usage;
+            }
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for strashed networks.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkDarOutdec( pNtk, nLits, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: outdec [-Lvh]\n" );
+    Abc_Print( -2, "\t         performs prime decomposition of the first output\n" );
+    Abc_Print( -2, "\t-L num : the number of literals in the primes [default = %d]\n", nLits );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandNodeDup( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkNodeDup( Abc_Ntk_t * pNtk, int nLimit, int fVerbose );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Ntk_t * pNtkRes;
+    int c, nLimit = 30;
+    int fVerbose = 0;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for logic networks.\n" );
+        return 1;
+    }
+    if ( nLimit < 2 )
+    {
+        Abc_Print( -1, "The fanout limit should be more than 1.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkNodeDup( pNtk, nLimit, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: nodedup [-Nvh]\n" );
+    Abc_Print( -2, "\t         duplicates internal nodes with high fanout\n" );
+    Abc_Print( -2, "\t-N num : the number of fanouts to start duplication [default = %d]\n", nLimit );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTestColor( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_ColorTest();
+    Abc_ColorTest();
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int nCutMax      =  1;
+    int nLeafMax     =  4;
+    int nDivMax      =  2;
+    int nDecMax      = 20;
+    int nNumOnes     =  4;
+    int fNewAlgo     =  0;
+    int fNewOrder    =  0;
+    int fVerbose     =  0;
+    int fVeryVerbose =  0;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CKDNMaovwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutMax < 0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLeafMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLeafMax < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nDivMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nDivMax < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nDecMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nDecMax < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nNumOnes = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nNumOnes < 0 )
+                goto usage;
+            break;
+        case 'a':
+            fNewAlgo ^= 1;
+            break;
+        case 'o':
+            fNewOrder ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+/*
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for logic networks.\n" );
+        return 1;
+    }
+*/
+/*
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "Only works for sequential networks.\n" );
+        return 1;
+    }
+*/
+
+/*
+    if ( pNtk )
+    {
+        extern Abc_Ntk_t * Au_ManPerformTest( Abc_Ntk_t * p, int nCutMax, int nLeafMax, int nDivMax, int nDecMax, int fVerbose, int fVeryVerbose );
+        Abc_Ntk_t * pNtkRes = Au_ManPerformTest( pNtk, nCutMax, nLeafMax, nDivMax, nDecMax, fVerbose, fVeryVerbose );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "Command has failed.\n" );
+            return 1;
+        }
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    }
+*/
+/*
+    if ( pNtk )
+    {
+        Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
+        Saig_ManBmcTerSimTestPo( pAig );
+        Aig_ManStop( pAig );
+    }
+*/
+/*
+    if ( !Abc_NtkIsTopo(pNtk) )
+    {
+        Abc_Print( -1, "Current network is not in a topological order.\n" );
+        return 1;
+    }
+*/
+//    if ( pNtk )
+//        Abc_NtkMakeLegit( pNtk ); 
+    {
+//        extern void Ifd_ManDsdTest();
+//        Ifd_ManDsdTest();
+    }
+/*
+    {
+        extern void Abc_EnumerateCubeStates();
+        extern void Abc_EnumerateCubeStatesZdd();
+        if ( fNewAlgo )
+            Abc_EnumerateCubeStatesZdd();
+        else
+            Abc_EnumerateCubeStates();
+        return 0;
+    }
+*/
+    {
+//        extern void Abc_EnumerateFuncs( int nDecMax, int nDivMax, int fVerbose );
+//        Abc_EnumerateFuncs( nDecMax, nDivMax, fVerbose );
+    }
+/*
+    if ( fNewAlgo )
+    {
+        extern void Abc_SuppTest( int nOnes, int nVars, int fUseSimple, int fCheck, int fVerbose );
+        Abc_SuppTest( nNumOnes, nDecMax, fNewOrder, 0, fVerbose );
+    }
+    else
+    {
+        extern void Bmc_EcoMiterTest();
+        Bmc_EcoMiterTest();
+    }
+*/
+
+    {
+//        extern void Nf_ManPrepareLibraryTest();
+//        Nf_ManPrepareLibraryTest();
+//        return 0;
+    }
+/*
+    if ( pNtk )
+    {
+//        extern Abc_Ntk_t * Abc_NtkBarBufsOnOffTest( Abc_Ntk_t * pNtk );
+//        Abc_Ntk_t * pNtkRes = Abc_NtkBarBufsOnOffTest( pNtk );
+        extern Abc_Ntk_t * Abc_NtkPcmTest( Abc_Ntk_t * pNtk, int fNewAlgo, int fVerbose );
+//        extern Abc_Ntk_t * Abc_NtkPcmTestAig( Abc_Ntk_t * pNtk, int fVerbose );
+        Abc_Ntk_t * pNtkRes;
+//        if ( Abc_NtkIsLogic(pNtk) )
+            pNtkRes = Abc_NtkPcmTest( pNtk, fNewAlgo, fVerbose );
+//        else
+//            pNtkRes = Abc_NtkPcmTestAig( pNtk, fVerbose );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "Command has failed.\n" );
+            return 1;
+        }
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    }
+*/
+    return 0;
+usage:
+    Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" );
+    Abc_Print( -2, "\t         testbench for new procedures\n" );
+    Abc_Print( -2, "\t-C num : the max number of cuts [default = %d]\n", nCutMax );
+    Abc_Print( -2, "\t-K num : the max number of leaves [default = %d]\n", nLeafMax );
+    Abc_Print( -2, "\t-D num : the max number of divisors [default = %d]\n", nDivMax );
+    Abc_Print( -2, "\t-N num : the max number of node inputs [default = %d]\n", nDecMax );
+    Abc_Print( -2, "\t-M num : the max number of ones in the vector [default = %d]\n", nNumOnes );
+    Abc_Print( -2, "\t-a     : toggle using new algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-o     : toggle using new ordering [default = %s]\n", fNewOrder? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandQuaVar( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, iVar, fUniv, fVerbose, RetValue;
+    extern int Abc_NtkQuantify( Abc_Ntk_t * pNtk, int fUniv, int iVar, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    iVar = 0;
+    fUniv = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Iuvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iVar = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iVar < 0 )
+                goto usage;
+            break;
+        case 'u':
+            fUniv ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum( pNtk ) )
+    {
+        Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
+        return 1;
+    }
+
+    // get the strashed network
+    pNtkRes = Abc_NtkStrash( pNtk, 0, 1, 0 );
+    RetValue = Abc_NtkQuantify( pNtkRes, fUniv, iVar, fVerbose );
+    // clean temporary storage for the cofactors
+    Abc_NtkCleanData( pNtkRes );
+    Abc_AigCleanup( (Abc_Aig_t *)pNtkRes->pManFunc );
+    // check the result
+    if ( !RetValue )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: qvar [-I num] [-uvh]\n" );
+    Abc_Print( -2, "\t         quantifies one variable using the AIG\n" );
+    Abc_Print( -2, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
+    Abc_Print( -2, "\t-u     : toggle universal quantification [default = %s]\n", fUniv? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandQuaRel( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, iVar, fInputs, fVerbose;
+    extern Abc_Ntk_t * Abc_NtkTransRel( Abc_Ntk_t * pNtk, int fInputs, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    iVar = 0;
+    fInputs = 1;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Iqvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iVar = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iVar < 0 )
+                goto usage;
+            break;
+        case 'q':
+            fInputs ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum( pNtk ) )
+    {
+        Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for sequential circuits.\n" );
+        return 1;
+    }
+
+    // get the strashed network
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        pNtk = Abc_NtkStrash( pNtk, 0, 1, 0 );
+        pNtkRes = Abc_NtkTransRel( pNtk, fInputs, fVerbose );
+        Abc_NtkDelete( pNtk );
+    }
+    else
+        pNtkRes = Abc_NtkTransRel( pNtk, fInputs, fVerbose );
+    // check if the result is available
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: qrel [-qvh]\n" );
+    Abc_Print( -2, "\t         computes transition relation of the sequential network\n" );
+//    Abc_Print( -2, "\t-I num : the zero-based index of a variable to quantify [default = %d]\n", iVar );
+    Abc_Print( -2, "\t-q     : perform quantification of inputs [default = %s]\n", fInputs? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandQuaReach( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, nIters, fVerbose;
+    extern Abc_Ntk_t * Abc_NtkReachability( Abc_Ntk_t * pNtk, int nIters, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nIters   = 256;
+    fVerbose =   0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nIters < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum( pNtk ) )
+    {
+        Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for combinational transition relations.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+    if ( Abc_NtkPoNum(pNtk) > 1 )
+    {
+        Abc_Print( -1, "The transition relation should have one output.\n" );
+        return 1;
+    }
+    if ( Abc_NtkPiNum(pNtk) % 2 != 0 )
+    {
+        Abc_Print( -1, "The transition relation should have an even number of inputs.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkReachability( pNtk, nIters, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: qreach [-I num] [-vh]\n" );
+    Abc_Print( -2, "\t         computes unreachable states using AIG-based quantification\n" );
+    Abc_Print( -2, "\t         assumes that the current network is a transition relation\n" );
+    Abc_Print( -2, "\t         assumes that the initial state is composed of all zeros\n" );
+    Abc_Print( -2, "\t-I num : the number of image computations to perform [default = %d]\n", nIters );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSenseInput( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Vec_Int_t * vResult;
+    int c, nConfLim, fVerbose;
+
+    extern Vec_Int_t * Abc_NtkSensitivity( Abc_Ntk_t * pNtk, int nConfLim, int fVerbose );
+    // set defaults
+    nConfLim   = 1000;
+    fVerbose   =    1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Cvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLim = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLim < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkGetChoiceNum( pNtk ) )
+    {
+        Abc_Print( -1, "This command cannot be applied to an AIG with choice nodes.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for combinational transition relations.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+    if ( Abc_NtkPoNum(pNtk) < 2 )
+    {
+        Abc_Print( -1, "The network should have at least two outputs.\n" );
+        return 1;
+    }
+
+    vResult = Abc_NtkSensitivity( pNtk, nConfLim, fVerbose );
+    Vec_IntFree( vResult );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: senseinput [-C num] [-vh]\n" );
+    Abc_Print( -2, "\t         computes sensitivity of POs to PIs under constraint\n" );
+    Abc_Print( -2, "\t         constraint should be represented as the last PO\n" );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfLim );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIStrash( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes, * pNtkTemp;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkIvyStrash( Abc_Ntk_t * pNtk );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        pNtkTemp = Abc_NtkStrash( pNtk, 0, 1, 0 );
+        pNtkRes = Abc_NtkIvyStrash( pNtkTemp );
+        Abc_NtkDelete( pNtkTemp );
+    }
+    else
+        pNtkRes = Abc_NtkIvyStrash( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: istrash [-h]\n" );
+    Abc_Print( -2, "\t         perform sequential structural hashing\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandICut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c, nInputs;
+    extern void Abc_NtkIvyCuts( Abc_Ntk_t * pNtk, int nInputs );
+
+    // set defaults
+    nInputs = 5;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Kh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nInputs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nInputs < 0 )
+                goto usage;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    Abc_NtkIvyCuts( pNtk, nInputs );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: icut [-K num] [-h]\n" );
+    Abc_Print( -2, "\t         computes sequential cuts of the given size\n" );
+    Abc_Print( -2, "\t-K num : the number of cut inputs (2 <= num <= 6) [default = %d]\n", nInputs );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, fUpdateLevel, fUseZeroCost, fVerbose;
+    extern Abc_Ntk_t * Abc_NtkIvyRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeroCost, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fUpdateLevel = 1;
+    fUseZeroCost = 0;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'z':
+            fUseZeroCost ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkIvyRewrite( pNtk, fUpdateLevel, fUseZeroCost, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: irw [-lzvh]\n" );
+    Abc_Print( -2, "\t         perform combinational AIG rewriting\n" );
+    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDRewrite( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    Dar_RwrPar_t Pars, * pPars = &Pars;
+    int c;
+
+    extern Abc_Ntk_t * Abc_NtkDRewrite( Abc_Ntk_t * pNtk, Dar_RwrPar_t * pPars );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Dar_ManDefaultRwrParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CNflzrvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nSubgMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nSubgMax < 0 )
+                goto usage;
+            break;
+        case 'f':
+            pPars->fFanout ^= 1;
+            break;
+        case 'l':
+            pPars->fUpdateLevel ^= 1;
+            break;
+        case 'z':
+            pPars->fUseZeros ^= 1;
+            break;
+        case 'r':
+            pPars->fRecycle ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkDRewrite( pNtk, pPars );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: drw [-C num] [-N num] [-lfzrvwh]\n" );
+    Abc_Print( -2, "\t         performs combinational AIG rewriting\n" );
+    Abc_Print( -2, "\t-C num : the max number of cuts at a node [default = %d]\n", pPars->nCutsMax );
+    Abc_Print( -2, "\t-N num : the max number of subgraphs tried [default = %d]\n", pPars->nSubgMax );
+    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle representing fanouts [default = %s]\n", pPars->fFanout? "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle using cut recycling [default = %s]\n", pPars->fRecycle? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDRefactor( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    Dar_RefPar_t Pars, * pPars = &Pars;
+    int c;
+
+    extern Abc_Ntk_t * Abc_NtkDRefactor( Abc_Ntk_t * pNtk, Dar_RefPar_t * pPars );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Dar_ManDefaultRefParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "MKCelzvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMffcMin = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMffcMin < 0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nLeafMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLeafMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'e':
+            pPars->fExtend ^= 1;
+            break;
+        case 'l':
+            pPars->fUpdateLevel ^= 1;
+            break;
+        case 'z':
+            pPars->fUseZeros ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+    if ( pPars->nLeafMax < 4 || pPars->nLeafMax > 15 )
+    {
+        Abc_Print( -1, "This command only works for cut sizes 4 <= K <= 15.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkDRefactor( pNtk, pPars );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: drf [-M num] [-K num] [-C num] [-elzvwh]\n" );
+    Abc_Print( -2, "\t         performs combinational AIG refactoring\n" );
+    Abc_Print( -2, "\t-M num : the min MFFC size to attempt refactoring [default = %d]\n", pPars->nMffcMin );
+    Abc_Print( -2, "\t-K num : the max number of cuts leaves [default = %d]\n", pPars->nLeafMax );
+    Abc_Print( -2, "\t-C num : the max number of cuts to try at a node [default = %d]\n", pPars->nCutsMax );
+    Abc_Print( -2, "\t-e     : toggle extending tbe cut below MFFC [default = %s]\n", pPars->fExtend? "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", pPars->fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", pPars->fUseZeros? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle very verbose printout [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDc2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int fBalance, fVerbose, fUpdateLevel, fFanout, fPower, c;
+
+    extern Abc_Ntk_t * Abc_NtkDC2( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fFanout, int fPower, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fBalance     = 0;
+    fVerbose     = 0;
+    fUpdateLevel = 0;
+    fFanout      = 1;
+    fPower       = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "blfpvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'b':
+            fBalance ^= 1;
+            break;
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'f':
+            fFanout ^= 1;
+            break;
+        case 'p':
+            fPower ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkDC2( pNtk, fBalance, fUpdateLevel, fFanout, fPower, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dc2 [-blfpvh]\n" );
+    Abc_Print( -2, "\t         performs combinational AIG optimization\n" );
+    Abc_Print( -2, "\t-b     : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle representing fanouts [default = %s]\n", fFanout? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle power-aware rewriting [default = %s]\n", fPower? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int fBalance, fVerbose, fUpdateLevel, fConstruct, c;
+    int nConfMax, nLevelMax;
+
+    extern Abc_Ntk_t * Abc_NtkDChoice( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fConstruct, int nConfMax, int nLevelMax, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fBalance     = 1;
+    fUpdateLevel = 1;
+    fConstruct   = 0;
+    nConfMax     = 1000;
+    nLevelMax    = 0;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CLblcvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfMax < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLevelMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLevelMax < 0 )
+                goto usage;
+            break;
+        case 'b':
+            fBalance ^= 1;
+            break;
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'c':
+            fConstruct ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkDChoice( pNtk, fBalance, fUpdateLevel, fConstruct, nConfMax, nLevelMax, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dchoice [-C num] [-L num] [-blcvh]\n" );
+    Abc_Print( -2, "\t         performs partitioned choicing using new AIG package\n" );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
+    Abc_Print( -2, "\t-L num : the max level of nodes to consider (0 = not used) [default = %d]\n", nLevelMax );
+    Abc_Print( -2, "\t-b     : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle updating level [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle constructive computation of choices [default = %s]\n", fConstruct? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDch( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Dch_Pars_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkDch( Abc_Ntk_t * pNtk, Dch_Pars_t * pPars );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Dch_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptgcfrvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nSatVarMax < 0 )
+                goto usage;
+            break;
+        case 's':
+            pPars->fSynthesis ^= 1;
+            break;
+        case 'p':
+            pPars->fPower ^= 1;
+            break;
+        case 't':
+            pPars->fSimulateTfo ^= 1;
+            break;
+        case 'g':
+            pPars->fUseGia ^= 1;
+            break;
+        case 'c':
+            pPars->fUseCSat ^= 1;
+            break;
+        case 'f':
+            pPars->fLightSynth ^= 1;
+            break;
+        case 'r':
+            pPars->fSkipRedSupp ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkDch( pNtk, pPars );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dch [-WCS num] [-sptgcfrvh]\n" );
+    Abc_Print( -2, "\t         computes structural choices using a new approach\n" );
+    Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
+    Abc_Print( -2, "\t-s     : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
+    Abc_Print( -2, "\t-g     : toggle using GIA to prove equivalences [default = %s]\n", pPars->fUseGia? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT vs. MiniSat [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle using faster logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle skipping choices with redundant support [default = %s]\n", pPars->fSkipRedSupp? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDrwsat( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int fBalance, fVerbose, c;
+
+    extern Abc_Ntk_t * Abc_NtkDrwsat( Abc_Ntk_t * pNtk, int fBalance, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fBalance = 0;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "bvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'b':
+            fBalance ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkDrwsat( pNtk, fBalance, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: drwsat [-bvh]\n" );
+    Abc_Print( -2, "\t         performs combinational AIG optimization for SAT\n" );
+    Abc_Print( -2, "\t-b     : toggle internal balancing [default = %s]\n", fBalance? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIRewriteSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, fUpdateLevel, fUseZeroCost, fVerbose;
+    extern Abc_Ntk_t * Abc_NtkIvyRewriteSeq( Abc_Ntk_t * pNtk, int fUseZeroCost, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fUpdateLevel = 0;
+    fUseZeroCost = 0;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'z':
+            fUseZeroCost ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkIvyRewriteSeq( pNtk, fUseZeroCost, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: irws [-zvh]\n" );
+    Abc_Print( -2, "\t         perform sequential AIG rewriting\n" );
+//    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle using zero-cost replacements [default = %s]\n", fUseZeroCost? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIResyn( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, fUpdateLevel, fVerbose;
+    extern Abc_Ntk_t * Abc_NtkIvyResyn( Abc_Ntk_t * pNtk, int fUpdateLevel, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fUpdateLevel = 1;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lzvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkIvyResyn( pNtk, fUpdateLevel, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: iresyn [-lvh]\n" );
+    Abc_Print( -2, "\t         performs combinational resynthesis\n" );
+    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandISat( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, fUpdateLevel, fVerbose;
+    int nConfLimit;
+
+    extern Abc_Ntk_t * Abc_NtkIvySat( Abc_Ntk_t * pNtk, int nConfLimit, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nConfLimit   = 100000;
+    fUpdateLevel = 1;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Clzvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLimit < 0 )
+                goto usage;
+            break;
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkIvySat( pNtk, nConfLimit, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: isat [-C num] [-vh]\n" );
+    Abc_Print( -2, "\t         tries to prove the miter constant 0\n" );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
+//    Abc_Print( -2, "\t-l     : toggle preserving the number of levels [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, fProve, fVerbose, fDoSparse;
+    int nConfLimit;
+    int nPartSize;
+    int nLevelMax;
+
+    extern Abc_Ntk_t * Abc_NtkIvyFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fVerbose );
+    extern Abc_Ntk_t * Abc_NtkDarFraigPart( Abc_Ntk_t * pNtk, int nPartSize, int nConfLimit, int nLevelMax, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nPartSize    = 0;
+    nLevelMax    = 0;
+    nConfLimit   = 100;
+    fDoSparse    = 0;
+    fProve       = 0;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PCLspvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nPartSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nPartSize < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLimit < 0 )
+                goto usage;
+            break;
+         case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLevelMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLevelMax < 0 )
+                goto usage;
+            break;
+        case 's':
+            fDoSparse ^= 1;
+            break;
+        case 'p':
+            fProve ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    if ( nPartSize > 0 )
+        pNtkRes = Abc_NtkDarFraigPart( pNtk, nPartSize, nConfLimit, nLevelMax, fVerbose );
+    else
+        pNtkRes = Abc_NtkIvyFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: ifraig [-P num] [-C num] [-L num] [-spvh]\n" );
+    Abc_Print( -2, "\t         performs fraiging using a new method\n" );
+    Abc_Print( -2, "\t-P num : partition size (0 = partitioning is not used) [default = %d]\n", nPartSize );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+    Abc_Print( -2, "\t-L num : limit on node level to fraig (0 = fraig all nodes) [default = %d]\n", nLevelMax );
+    Abc_Print( -2, "\t-s     : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, nConfLimit, fDoSparse, fProve, fSpeculate, fChoicing, fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkDarFraig( Abc_Ntk_t * pNtk, int nConfLimit, int fDoSparse, int fProve, int fTransfer, int fSpeculate, int fChoicing, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nConfLimit   = 100;
+    fDoSparse    = 1;
+    fProve       = 0;
+    fSpeculate   = 0;
+    fChoicing    = 0;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Csprcvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLimit < 0 )
+                goto usage;
+            break;
+        case 's':
+            fDoSparse ^= 1;
+            break;
+        case 'p':
+            fProve ^= 1;
+            break;
+        case 'r':
+            fSpeculate ^= 1;
+            break;
+        case 'c':
+            fChoicing ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkDarFraig( pNtk, nConfLimit, fDoSparse, fProve, 0, fSpeculate, fChoicing, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dfraig [-C num] [-sprcvh]\n" );
+    Abc_Print( -2, "\t         performs fraiging using a new method\n" );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfLimit );
+    Abc_Print( -2, "\t-s     : toggle considering sparse functions [default = %s]\n", fDoSparse? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle proving the miter outputs [default = %s]\n", fProve? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle speculative reduction [default = %s]\n", fSpeculate? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle accumulation of choices [default = %s]\n", fChoicing? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, nCutsMax, nLeafMax, fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkCSweep( Abc_Ntk_t * pNtk, int nCutsMax, int nLeafMax, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nCutsMax  =  8;
+    nLeafMax  =  6;
+    fVerbose  =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CKvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLeafMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLeafMax < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( nCutsMax < 2 )
+    {
+        Abc_Print( -1, "The number of cuts cannot be less than 2.\n" );
+        return 1;
+    }
+
+    if ( nLeafMax < 3 || nLeafMax > 16 )
+    {
+        Abc_Print( -1, "The number of leaves is infeasible.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkCSweep( pNtk, nCutsMax, nLeafMax, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: csweep [-C num] [-K num] [-vh]\n" );
+    Abc_Print( -2, "\t         performs cut sweeping using a new method\n" );
+    Abc_Print( -2, "\t-C num : limit on the number of cuts (C >= 2) [default = %d]\n", nCutsMax );
+    Abc_Print( -2, "\t-K num : limit on the cut size (3 <= K <= 16) [default = %d]\n", nLeafMax );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Prove_Params_t Params, * pParams = &Params;
+    Abc_Ntk_t * pNtk, * pNtkTemp;
+    int c, RetValue, iOut = -1;
+    abctime clk;
+
+    extern int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Prove_ParamsSetDefault( pParams );
+    pParams->fUseRewriting = 1;
+    pParams->fVerbose      = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NCFGLIrfbvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nItersMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nItersMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nMiteringLimitStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nMiteringLimitStart < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nFraigingLimitStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nFraigingLimitStart < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nFraigingLimitMulti = (float)atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nFraigingLimitMulti < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nMiteringLimitLast = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nMiteringLimitLast < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nTotalInspectLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nTotalInspectLimit < 0 )
+                goto usage;
+            break;
+        case 'r':
+            pParams->fUseRewriting ^= 1;
+            break;
+        case 'f':
+            pParams->fUseFraiging ^= 1;
+            break;
+        case 'b':
+            pParams->fUseBdds ^= 1;
+            break;
+        case 'v':
+            pParams->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkLatchNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "The network has registers. Use \"dprove\".\n" );
+        return 1;
+    }
+
+    clk = Abc_Clock();
+
+    if ( Abc_NtkIsStrash(pNtk) )
+        pNtkTemp = Abc_NtkDup( pNtk );
+    else
+        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
+
+    RetValue = Abc_NtkIvyProve( &pNtkTemp, pParams );
+
+    // verify that the pattern is correct
+    if ( RetValue == 0 )
+    {
+        Abc_Obj_t * pObj;
+        int i;
+        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtkTemp->pModel );
+        Abc_NtkForEachCo( pNtk, pObj, i )
+            if ( pSimInfo[i] == 1 )
+            {
+                iOut = i;
+                break;
+            }
+        if ( i == Abc_NtkCoNum(pNtk) )
+            Abc_Print( 1, "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
+        ABC_FREE( pSimInfo );
+    }
+    pAbc->Status = RetValue;
+    if ( RetValue == -1 )
+        Abc_Print( 1, "UNDECIDED      " );
+    else if ( RetValue == 0 )
+        Abc_Print( 1, "SATISFIABLE (output = %d) ", iOut );
+    else
+        Abc_Print( 1, "UNSATISFIABLE  " );
+    //Abc_Print( -1, "\n" );
+
+    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkTemp );
+    // update counter example
+    if ( RetValue == 0 && Abc_NtkLatchNum(pNtkTemp) == 0 )
+    {
+        Abc_Cex_t * pCex = Abc_CexDeriveFromCombModel( pNtkTemp->pModel, Abc_NtkPiNum(pNtkTemp), 0, iOut );
+        Abc_FrameReplaceCex( pAbc, &pCex );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: iprove [-NCFGLI num] [-rfbvh]\n" );
+    Abc_Print( -2, "\t         performs CEC using a new method\n" );
+    Abc_Print( -2, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
+    Abc_Print( -2, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
+    Abc_Print( -2, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
+    Abc_Print( -2, "\t-G num : multiplicative coefficient for fraiging [default = %d]\n", (int)pParams->nFraigingLimitMulti );
+    Abc_Print( -2, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
+    Abc_Print( -2, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
+    Abc_Print( -2, "\t-r     : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+/*
+int Abc_CommandHaig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * stdout, * pErr;
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int nIters;
+    int nSteps;
+    int fRetimingOnly;
+    int fAddBugs;
+    int fUseCnf;
+    int fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkDarHaigRecord( Abc_Ntk_t * pNtk, int nIters, int nSteps, int fRetimingOnly, int fAddBugs, int fUseCnf, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+
+
+    // set defaults
+    nIters        = 3;
+    nSteps        = 3000;
+    fRetimingOnly = 0;
+    fAddBugs      = 0;
+    fUseCnf       = 0;
+    fVerbose      = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ISrbcvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nIters < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nSteps = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nSteps < 0 )
+                goto usage;
+            break;
+        case 'r':
+            fRetimingOnly ^= 1;
+            break;
+        case 'b':
+            fAddBugs ^= 1;
+            break;
+        case 'c':
+            fUseCnf ^= 1;
+            break;
+        case 'v':
+            fUseCnf ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for strashed networks.\n" );
+        return 1;
+    }
+
+    pNtkRes = Abc_NtkDarHaigRecord( pNtk, nIters, nSteps, fRetimingOnly, fAddBugs, fUseCnf, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: haig [-IS num] [-rbcvh]\n" );
+    Abc_Print( -2, "\t         run a few rounds of comb+seq synthesis to test HAIG recording\n" );
+    Abc_Print( -2, "\t         the current network is set to be the result of synthesis performed\n" );
+    Abc_Print( -2, "\t         (this network can be verified using command \"dsec\")\n" );
+    Abc_Print( -2, "\t         HAIG is written out into the file \"haig.blif\"\n" );
+    Abc_Print( -2, "\t         (this HAIG can be proved using \"r haig.blif; st; dprove -abc -F 16\")\n" );
+    Abc_Print( -2, "\t-I num : the number of rounds of comb+seq synthesis [default = %d]\n", nIters );
+    Abc_Print( -2, "\t-S num : the number of forward retiming moves performed [default = %d]\n", nSteps );
+    Abc_Print( -2, "\t-r     : toggle the use of retiming only [default = %s]\n", fRetimingOnly? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggle bug insertion [default = %s]\n", fAddBugs? "yes": "no" );
+    Abc_Print( -2, "\t-c     : enable CNF-based proof (no speculative reduction) [default = %s]\n", fUseCnf? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+*/
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandQbf( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nPars;
+    int nIters;
+    int fDumpCnf;
+    int fVerbose;
+
+    extern void Abc_NtkQbf( Abc_Ntk_t * pNtk, int nPars, int nIters, int fDumpCnf, int fVerbose );
+    // set defaults
+    nPars    =  -1;
+    nIters   = 500;
+    fDumpCnf =   0;
+    fVerbose =   1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PIdvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nPars = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nPars < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nIters < 0 )
+                goto usage;
+            break;
+        case 'd':
+            fDumpCnf ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "Works only for combinational networks.\n" );
+        return 1;
+    }
+    if ( Abc_NtkPoNum(pNtk) != 1 )
+    {
+        Abc_Print( -1, "The miter should have one primary output.\n" );
+        return 1;
+    }
+    if ( !(nPars > 0 && nPars < Abc_NtkPiNum(pNtk)) )
+    {
+        Abc_Print( -1, "The number of paramter variables is invalid (should be > 0 and < PI num).\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsStrash(pNtk) )
+        Abc_NtkQbf( pNtk, nPars, nIters, fDumpCnf, fVerbose );
+    else
+    {
+        pNtk = Abc_NtkStrash( pNtk, 0, 1, 0 );
+        Abc_NtkQbf( pNtk, nPars, nIters, fDumpCnf, fVerbose );
+        Abc_NtkDelete( pNtk );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: qbf [-PI num] [-dvh]\n" );
+    Abc_Print( -2, "\t         solves QBF problem EpVxM(p,x)\n" );
+    Abc_Print( -2, "\t-P num : number of parameters p (should be the first PIs) [default = %d]\n", nPars );
+    Abc_Print( -2, "\t-I num : quit after the given iteration even if unsolved [default = %d]\n", nIters );
+    Abc_Print( -2, "\t-d     : toggle dumping QDIMACS file instead of solving [default = %s]\n", fDumpCnf? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandNpnLoad( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Npn_ManLoad( char * pFileName );
+    char * pFileName;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( argc != globalUtilOptind + 1 )
+        goto usage;
+    pFileName = argv[globalUtilOptind];
+    Npn_ManLoad( pFileName );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: npnload <filename>\n" );
+    Abc_Print( -2, "\t         loads previously saved 6-input function library from file\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandNpnSave( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Npn_ManSave( char * pFileName );
+    char * pFileName;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( argc != globalUtilOptind + 1 )
+        goto usage;
+    pFileName = argv[globalUtilOptind];
+    Npn_ManSave( pFileName );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: npnsave <filename>\n" );
+    Abc_Print( -2, "\t         saves current 6-input function library into file\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSendAig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    const int BRIDGE_NETLIST = 106;
+//    const int BRIDGE_ABS_NETLIST = 107;
+
+    int c, fAndSpace = 1, fAbsNetlist = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ah" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'a':
+            fAndSpace ^= 1;
+            break;
+        case 'b':
+            fAbsNetlist ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_FrameIsBridgeMode() )
+    {
+        Abc_Print( -1, "The bridge mode is not available.\n" );
+        return 1;
+    }
+    if ( fAndSpace )
+    {
+        if ( pAbc->pGia == NULL )
+        {
+            Abc_Print( -1, "There is no AIG in the &-space.\n" );
+            return 1;
+        }
+        Gia_ManToBridgeAbsNetlist( stdout, pAbc->pGia, fAbsNetlist ? BRIDGE_ABS_NETLIST : BRIDGE_NETLIST );
+    }
+    else
+    {
+        Aig_Man_t * pAig;
+        Gia_Man_t * pGia;
+        if ( pAbc->pNtkCur == NULL )
+        {
+            Abc_Print( -1, "There is no network in the main-space.\n" );
+            return 1;
+        }
+        if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
+        {
+            Abc_Print( -1, "The main-space network is not an AIG.\n" );
+            return 1;
+        }
+        pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
+        pGia = Gia_ManFromAig( pAig );
+        Aig_ManStop( pAig );
+        Gia_ManToBridgeAbsNetlist( stdout, pGia, fAbsNetlist ? BRIDGE_ABS_NETLIST : BRIDGE_NETLIST  );
+        Gia_ManStop( pGia );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: send_aig -a\n" );
+    Abc_Print( -2, "\t         sends current AIG to the bridge\n" );
+    Abc_Print( -2, "\t-a     : toggle sending AIG from &-space [default = %s]\n", fAndSpace? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggle sending netlist tagged as \"abstraction\". [default = %s]\n", fAbsNetlist? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSendStatus( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Gia_ManToBridgeResult( FILE * pFile, int Result, Abc_Cex_t * pCex, int iPoProved );
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_FrameIsBridgeMode() )
+    {
+        Abc_Print( -1, "The bridge mode is not available.\n" );
+        return 1;
+    }
+    if ( pAbc->Status == 0 && pAbc->pCex == NULL )
+    {
+        Abc_Print( -1, "Status is \"sat\", but current CEX is not available.\n" );
+        return 1;
+    }
+    Gia_ManToBridgeResult( stdout, pAbc->Status, pAbc->pCex, 0 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: send_status\n" );
+    Abc_Print( -2, "\t         sends current status to the bridge\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[100];
+    Fraig_Params_t Params, * pParams = &Params;
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int fAllNodes;
+    int fExdc;
+    int c;
+    int fPartition = 0;
+    extern void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fExdc     = 0;
+    fAllNodes = 0;
+    memset( pParams, 0, sizeof(Fraig_Params_t) );
+    pParams->nPatsRand  = 2048; // the number of words of random simulation info
+    pParams->nPatsDyna  = 2048; // the number of words of dynamic simulation info
+    pParams->nBTLimit   =  100; // the max number of backtracks to perform
+    pParams->fFuncRed   =    1; // performs only one level hashing
+    pParams->fFeedBack  =    1; // enables solver feedback
+    pParams->fDist1Pats =    1; // enables distance-1 patterns
+    pParams->fDoSparse  =    1; // performs equiv tests for sparse functions
+    pParams->fChoicing  =    0; // enables recording structural choices
+    pParams->fTryProve  =    0; // tries to solve the final miter
+    pParams->fVerbose   =    0; // the verbosiness flag
+    pParams->fVerboseP  =    0; // the verbosiness flag
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "RDCrscptvaeh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nPatsRand = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nPatsRand < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nPatsDyna = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nPatsDyna < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nBTLimit < 0 )
+                goto usage;
+            break;
+
+        case 'r':
+            pParams->fFuncRed ^= 1;
+            break;
+        case 's':
+            pParams->fDoSparse ^= 1;
+            break;
+        case 'c':
+            pParams->fChoicing ^= 1;
+            break;
+        case 'p':
+            pParams->fTryProve ^= 1;
+            break;
+        case 'v':
+            pParams->fVerbose ^= 1;
+            break;
+        case 't':
+            fPartition ^= 1;
+            break;
+        case 'a':
+            fAllNodes ^= 1;
+            break;
+        case 'e':
+            fExdc ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) && !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Can only fraig a logic network or an AIG.\n" );
+        return 1;
+    }
+
+    // report the proof
+    pParams->fVerboseP = pParams->fTryProve;
+
+    // get the new network
+    if ( fPartition )
+    {
+        pNtkRes = Abc_NtkDup( pNtk );
+        if ( Abc_NtkIsStrash(pNtk) )
+            Abc_NtkFraigPartitionedTime( pNtk, &Params );
+        else
+        {
+            pNtk = Abc_NtkStrash( pNtk, fAllNodes, !fAllNodes, 0 );
+            Abc_NtkFraigPartitionedTime( pNtk, &Params );
+            Abc_NtkDelete( pNtk );
+        }
+    }
+    else
+    {
+        if ( Abc_NtkIsStrash(pNtk) )
+            pNtkRes = Abc_NtkFraig( pNtk, &Params, fAllNodes, fExdc );
+        else
+        {
+            pNtk = Abc_NtkStrash( pNtk, fAllNodes, !fAllNodes, 0 );
+            pNtkRes = Abc_NtkFraig( pNtk, &Params, fAllNodes, fExdc );
+            Abc_NtkDelete( pNtk );
+        }
+    }
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Fraiging has failed.\n" );
+        return 1;
+    }
+
+    if ( pParams->fTryProve ) // report the result
+        Abc_NtkMiterReport( pNtkRes );
+
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    sprintf(Buffer, "%d", pParams->nBTLimit );
+    Abc_Print( -2, "usage: fraig [-R num] [-D num] [-C num] [-rscpvtah]\n" );
+    Abc_Print( -2, "\t         transforms a logic network into a functionally reduced AIG\n" );
+    Abc_Print( -2, "\t         (known bugs: takes an UNSAT miter and returns a SAT one)\n");
+    Abc_Print( -2, "\t         (there are newer fraiging commands, \"ifraig\" and \"dfraig\")\n" );
+    Abc_Print( -2, "\t-R num : number of random patterns (127 < num < 32769) [default = %d]\n",     pParams->nPatsRand );
+    Abc_Print( -2, "\t-D num : number of systematic patterns (127 < num < 32769) [default = %d]\n", pParams->nPatsDyna );
+    Abc_Print( -2, "\t-C num : number of backtracks for one SAT problem [default = %s]\n",    pParams->nBTLimit==-1? "infinity" : Buffer );
+    Abc_Print( -2, "\t-r     : toggle functional reduction [default = %s]\n",                 pParams->fFuncRed? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle considering sparse functions [default = %s]\n",         pParams->fDoSparse? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle accumulation of choices [default = %s]\n",              pParams->fChoicing? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle proving the miter outputs [default = %s]\n",              pParams->fTryProve? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n",                       pParams->fVerbose?  "yes": "no" );
+    Abc_Print( -2, "\t-e     : toggle functional sweeping using EXDC [default = %s]\n",       fExdc? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle between all nodes and DFS nodes [default = %s]\n",      fAllNodes? "all": "dfs" );
+    Abc_Print( -2, "\t-t     : toggle using partitioned representation [default = %s]\n",     fPartition? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFraigTrust( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fDuplicate;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fDuplicate = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'd':
+            fDuplicate ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkFraigTrust( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Fraiging in the trust mode has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: fraig_trust [-h]\n" );
+    Abc_Print( -2, "\t        transforms the current network into an AIG assuming it is FRAIG with choices\n" );
+//    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFraigStore( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fDuplicate;
+
+    // set defaults
+    fDuplicate = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'd':
+            fDuplicate ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( !Abc_NtkFraigStore( pNtk ) )
+    {
+        Abc_Print( -1, "Fraig storing has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: fraig_store [-h]\n" );
+    Abc_Print( -2, "\t        saves the current network in the AIG database\n" );
+//    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFraigRestore( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fDuplicate;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fDuplicate = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'd':
+            fDuplicate ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkFraigRestore();
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Fraig restoring has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: fraig_restore [-h]\n" );
+    Abc_Print( -2, "\t        makes the current network by fraiging the AIG database\n" );
+//    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFraigClean( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fDuplicate;
+    // set defaults
+    fDuplicate = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'd':
+            fDuplicate ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    Abc_NtkFraigStoreClean();
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: fraig_clean [-h]\n" );
+    Abc_Print( -2, "\t        cleans the internal FRAIG storage\n" );
+//    Abc_Print( -2, "\t-d    : toggle duplication of logic [default = %s]\n", fDuplicate? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFraigSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseInv;
+    int fExdc;
+    int fVerbose;
+    int fVeryVerbose;
+    extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
+    // set defaults
+    fUseInv   = 1;
+    fExdc     = 0;
+    fVerbose  = 0;
+    fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ievwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'i':
+            fUseInv ^= 1;
+            break;
+        case 'e':
+            fExdc ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Cannot sweep AIGs (use \"fraig\").\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Transform the current network into a logic network.\n" );
+        return 1;
+    }
+    // modify the current network
+    if ( !Abc_NtkFraigSweep( pNtk, fUseInv, fExdc, fVerbose, fVeryVerbose ) )
+    {
+        Abc_Print( -1, "Sweeping has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: fraig_sweep [-evwh]\n" );
+    Abc_Print( -2, "\t        performs technology-dependent sweep\n" );
+    Abc_Print( -2, "\t-e    : toggle functional sweeping using EXDC [default = %s]\n", fExdc? "yes": "no" );
+    Abc_Print( -2, "\t-v    : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w    : prints equivalence class information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFraigDress( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_NtkDress( Abc_Ntk_t * pNtk, char * pFileName, int fVerbose );
+    extern void Abc_NtkDress2( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConflictLimit, int fVerbose );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc), * pNtk2;
+    char * pFileName;
+    int c;
+    int nConfs;
+    int fVerbose;
+    // set defaults
+    nConfs   = 1000;
+    fVerbose =    0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Cvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfs < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for logic networks.\n" );
+        return 1;
+    }
+    if ( argc != globalUtilOptind && argc != globalUtilOptind + 1 )
+        goto usage;
+    if ( argc == globalUtilOptind && Abc_NtkSpec(pNtk) == NULL )
+    {
+        Abc_Print( -1, "The current network has no spec.\n" );
+        return 1;
+    }
+    // get the input file name
+    pFileName = (argc == globalUtilOptind + 1) ? argv[globalUtilOptind] : Abc_NtkSpec(pNtk);
+    // modify the current network
+//    Abc_NtkDress( pNtk, pFileName, fVerbose );
+    pNtk2 = Io_Read( pFileName, Io_ReadFileType(pFileName), 1, 0 );
+    Abc_NtkDress2( pNtk, pNtk2, nConfs, fVerbose );
+    Abc_NtkDelete( pNtk2 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dress [-C num] [-vh] <file>\n" );
+    Abc_Print( -2, "\t         transfers internal node names from file to the current network\n" );
+    Abc_Print( -2, "\t<file> : network with names (if not given, the current network spec is used)\n" );
+    Abc_Print( -2, "\t-C num : the maximum number of conflicts at each node [default = %d]\n", nConfs );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRecStart3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char * FileName, * pTemp;
+    char ** pArgvNew;
+    int c, nArgcNew;
+    FILE * pFile;
+    Gia_Man_t * pGia = NULL;
+    int nVars = 6;
+    int nCuts = 32;
+    int fFuncOnly = 0;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCfvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nVars = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nVars < 1 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCuts = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCuts < 1 )
+                goto usage;
+            break;
+        case 'f':
+            fFuncOnly ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !(nVars >= 3 && nVars <= 16) )
+    {
+        Abc_Print( -1, "The range of allowed values is 3 <= K <= 16.\n" );
+        return 0;
+    }
+    if ( Abc_NtkRecIsRunning3() )
+    {
+        Abc_Print( -1, "The AIG subgraph recording is already started.\n" );
+        return 0;
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+        Abc_Print( 1, "File name is not given on the command line. Starting a new record.\n" );
+    else
+    {
+        // get the input file name
+        FileName = pArgvNew[0];
+        // fix the wrong symbol
+        for ( pTemp = FileName; *pTemp; pTemp++ )
+            if ( *pTemp == '>' )
+                *pTemp = '\\';
+        if ( (pFile = fopen( FileName, "r" )) == NULL )
+        {
+            Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+            if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
+                Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+            Abc_Print( 1, "\n" );
+            return 1;
+        }
+        fclose( pFile );
+        pGia = Gia_AigerRead( FileName, 1, 0 );
+        if ( pGia == NULL )
+        {
+            Abc_Print( -1, "Reading AIGER has failed.\n" );
+            return 0;
+        }
+    }
+    Abc_NtkRecStart3( pGia, nVars, nCuts, fFuncOnly, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: rec_start3 [-K num] [-C num] [-fvh] <file>\n" );
+    Abc_Print( -2, "\t         starts recording AIG subgraphs (should be called for\n" );
+    Abc_Print( -2, "\t         an empty network or after reading in a previous record)\n" );
+    Abc_Print( -2, "\t-K num : the largest number of inputs [default = %d]\n", nVars );
+    Abc_Print( -2, "\t-C num : the max number of cuts used at a node (0 < num < 2^12) [default = %d]\n", nCuts );
+    Abc_Print( -2, "\t-f     : toggles recording functions without AIG subgraphs [default = %s]\n", fFuncOnly? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : AIGER file with the library\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRecStop3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_NtkRecIsRunning3() )
+    {
+        Abc_Print( -1, "This command works only after calling \"rec_start3\".\n" );
+        return 0;
+    }
+    Abc_NtkRecStop3();
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: rec_stop3 [-h]\n" );
+    Abc_Print( -2, "\t        cleans the internal storage for AIG subgraphs\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRecPs3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c, fPrintLib = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ph" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'p':
+            fPrintLib ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_NtkRecIsRunning3() )
+    {
+        Abc_Print( -1, "This command works for AIGs only after calling \"rec_start2\".\n" );
+        return 0;
+    }
+    Abc_NtkRecPs3(fPrintLib);
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: rec_ps3 [-h]\n" );
+    Abc_Print( -2, "\t        prints statistics about the recorded AIG subgraphs\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRecAdd3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fUseSOPB = 0;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "gh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'g':
+            fUseSOPB = 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works for AIGs.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkRecIsRunning3() )
+    {
+        Abc_Print( -1, "This command works for AIGs after calling \"rec_start2\".\n" );
+        return 0;
+    }
+    Abc_NtkRecAdd3( pNtk, fUseSOPB );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: rec_add3 [-h]\n" );
+    Abc_Print( -2, "\t        adds subgraphs from the current network to the set\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRecDump3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_NtkRecDumpTt3( char * pFileName, int fBinary );
+    char * FileName;
+    char ** pArgvNew;
+    int nArgcNew;
+    Gia_Man_t * pGia;
+    int fAscii = 0;
+    int fBinary = 0;
+    int c;
+
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "abh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'a':
+            fAscii ^= 1;
+            break;
+        case 'b':
+            fBinary ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_NtkRecIsRunning3() )
+    {
+        Abc_Print( -1, "The AIG subgraph recording is not started.\n" );
+        return 1;
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "File name is not given on the command line.\n" );
+        return 1;
+    }
+    // get the input file name
+    FileName = pArgvNew[0];
+    if ( fAscii )
+        Abc_NtkRecDumpTt3( FileName, 0 );
+    else if ( fBinary )
+        Abc_NtkRecDumpTt3( FileName, 1 );
+    else
+    {
+        pGia = Abc_NtkRecGetGia3();
+        if( pGia == NULL )
+        {
+            Abc_Print( 0, "Library AIG is not available.\n" );
+            return 1;
+        }
+        if( Gia_ManPoNum(pGia) == 0 )
+        {
+            Abc_Print( 0, "No structure in the library.\n" );
+            return 1;
+        }
+        Gia_AigerWrite( pGia, FileName, 0, 0 );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: rec_dump3 [-abh] <file>\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t-a     : toggles dumping TTs into an ASCII file [default = %s]\n", fAscii? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggles dumping TTs into a binary file [default = %s]\n", fBinary? "yes": "no" );
+    Abc_Print( -2, "\t<file> : AIGER file to write the library\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRecMerge3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    char * FileName, * pTemp;
+    char ** pArgvNew;
+    int nArgcNew;
+    FILE * pFile;
+    Gia_Man_t * pGia = NULL;
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_NtkRecIsRunning3() )
+    {
+        Abc_Print( -1, "This command works for AIGs only after calling \"rec_start3\".\n" );
+        return 0;
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "File name is not given on the command line.\n" );
+        return 1;
+    }
+    else
+    {
+        // get the input file name
+        FileName = pArgvNew[0];
+        // fix the wrong symbol
+        for ( pTemp = FileName; *pTemp; pTemp++ )
+            if ( *pTemp == '>' )
+                *pTemp = '\\';
+        if ( (pFile = fopen( FileName, "r" )) == NULL )
+        {
+            Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+            if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
+                Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+            Abc_Print( 1, "\n" );
+            return 1;
+        }
+        fclose( pFile );
+        pGia = Gia_AigerRead( FileName, 1, 0 );
+        if ( pGia == NULL )
+        {
+            Abc_Print( -1, "Reading AIGER has failed.\n" );
+            return 0;
+        }
+    }
+    Abc_NtkRecLibMerge3(pGia);
+    Gia_ManStop( pGia );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: rec_merge3 [-h] <file>\n" );
+    Abc_Print( -2, "\t         merge libraries\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : AIGER file with the library\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMap( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    char Buffer[100];
+    double DelayTarget;
+    double AreaMulti;
+    double DelayMulti;
+    float LogFan = 0;
+    float Slew = 0; // choose based on the library
+    float Gain = 250;
+    int nGatesMin = 4;
+    int fAreaOnly;
+    int fRecovery;
+    int fSweep;
+    int fSwitching;
+    int fVerbose;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, double AreaMulti, double DelayMulti, float LogFan, float Slew, float Gain, int nGatesMin, int fRecovery, int fSwitching, int fVerbose );
+    extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    DelayTarget =-1;
+    AreaMulti   = 0;
+    DelayMulti  = 0;
+    fAreaOnly   = 0;
+    fRecovery   = 1;
+    fSweep      = 0;
+    fSwitching  = 0;
+    fVerbose    = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "DABFSGMarspvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            DelayTarget = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            AreaMulti = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            DelayMulti = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            LogFan = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( LogFan < 0.0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            Slew = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Slew <= 0.0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            Gain = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Gain <= 0.0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nGatesMin = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nGatesMin < 0 ) 
+                goto usage;
+            break;
+        case 'a':
+            fAreaOnly ^= 1;
+            break;
+        case 'r':
+            fRecovery ^= 1;
+            break;
+        case 's':
+            fSweep ^= 1;
+            break;
+        case 'p':
+            fSwitching ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( fAreaOnly )
+        DelayTarget = ABC_INFINITY;
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Strashing before mapping has failed.\n" );
+            return 1;
+        }
+        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Balancing before mapping has failed.\n" );
+            return 1;
+        }
+        Abc_Print( 0, "The network was strashed and balanced before mapping.\n" );
+        // get the new network
+        pNtkRes = Abc_NtkMap( pNtk, DelayTarget, AreaMulti, DelayMulti, LogFan, Slew, Gain, nGatesMin, fRecovery, fSwitching, fVerbose );
+        if ( pNtkRes == NULL )
+        {
+            Abc_NtkDelete( pNtk );
+            Abc_Print( -1, "Mapping has failed.\n" );
+            return 1;
+        }
+        Abc_NtkDelete( pNtk );
+    }
+    else
+    {
+        // get the new network
+        pNtkRes = Abc_NtkMap( pNtk, DelayTarget, AreaMulti, DelayMulti, LogFan, Slew, Gain, nGatesMin, fRecovery, fSwitching, fVerbose );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "Mapping has failed.\n" );
+            return 1;
+        }
+    }
+
+    if ( fSweep )
+    {
+        Abc_NtkFraigSweep( pNtkRes, 0, 0, 0, 0 );
+        if ( Abc_NtkHasMapping(pNtkRes) )
+        {
+            pNtkRes = Abc_NtkDupDfs( pNtk = pNtkRes );
+            Abc_NtkDelete( pNtk );
+        }
+    }
+
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    if ( DelayTarget == -1 )
+        sprintf(Buffer, "not used" );
+    else
+        sprintf(Buffer, "%.3f", DelayTarget );
+    Abc_Print( -2, "usage: map [-DABFSG float] [-M num] [-arspvh]\n" );
+    Abc_Print( -2, "\t           performs standard cell mapping of the current network\n" );
+    Abc_Print( -2, "\t-D float : sets the global required times [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-A float : \"area multiplier\" to bias gate selection [default = %.2f]\n", AreaMulti );
+    Abc_Print( -2, "\t-B float : \"delay multiplier\" to bias gate selection [default = %.2f]\n", DelayMulti );
+    Abc_Print( -2, "\t-F float : the logarithmic fanout delay parameter [default = %.2f]\n", LogFan );
+    Abc_Print( -2, "\t-S float : the slew parameter used to generate the library [default = %.2f]\n", Slew );
+    Abc_Print( -2, "\t-G float : the gain parameter used to generate the library [default = %.2f]\n", Gain );
+    Abc_Print( -2, "\t-M num   : skip gate classes whose size is less than this [default = %d]\n", nGatesMin );
+    Abc_Print( -2, "\t-a       : toggles area-only mapping [default = %s]\n", fAreaOnly? "yes": "no" );
+    Abc_Print( -2, "\t-r       : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
+    Abc_Print( -2, "\t-s       : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
+    Abc_Print( -2, "\t-p       : optimizes power by minimizing switching [default = %s]\n", fSwitching? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAmap( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Amap_Par_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int fSweep;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkDarAmap( Abc_Ntk_t * pNtk, Amap_Par_t * pPars );
+    extern int Abc_NtkFraigSweep( Abc_Ntk_t * pNtk, int fUseInv, int fExdc, int fVerbose, int fVeryVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fSweep = 0;
+    Amap_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FACEQmxisvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->nIterFlow = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIterFlow < 0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->nIterArea = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIterArea < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'E':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->fEpsilon = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->fEpsilon < 0.0 || pPars->fEpsilon > 1.0 )
+                goto usage;
+            break;
+        case 'Q':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-Q\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->fADratio = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->fADratio < 0.0 )
+                goto usage;
+            break;
+        case 'm':
+            pPars->fUseMuxes ^= 1;
+            break;
+        case 'x':
+            pPars->fUseXors ^= 1;
+            break;
+        case 'i':
+            pPars->fFreeInvs ^= 1;
+            break;
+        case 's':
+            fSweep ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Strashing before mapping has failed.\n" );
+            return 1;
+        }
+        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Balancing before mapping has failed.\n" );
+            return 1;
+        }
+        Abc_Print( 0, "The network was strashed and balanced before mapping.\n" );
+        // get the new network
+        pNtkRes = Abc_NtkDarAmap( pNtk, pPars );
+        if ( pNtkRes == NULL )
+        {
+            Abc_NtkDelete( pNtk );
+            Abc_Print( -1, "Mapping has failed.\n" );
+            return 1;
+        }
+        Abc_NtkDelete( pNtk );
+    }
+    else
+    {
+        // get the new network
+        pNtkRes = Abc_NtkDarAmap( pNtk, pPars );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "Mapping has failed.\n" );
+            return 1;
+        }
+    }
+
+    if ( fSweep )
+    {
+        Abc_NtkFraigSweep( pNtkRes, 0, 0, 0, 0 );
+        if ( Abc_NtkHasMapping(pNtkRes) )
+        {
+            pNtkRes = Abc_NtkDupDfs( pNtk = pNtkRes );
+            Abc_NtkDelete( pNtk );
+        }
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: amap [-FAC <num>] [-EQ <float>] [-mxisvh]\n" );
+    Abc_Print( -2, "\t           performs standard cell mapping of the current network\n" );
+    Abc_Print( -2, "\t-F num   : the number of iterations of area flow [default = %d]\n", pPars->nIterFlow );
+    Abc_Print( -2, "\t-A num   : the number of iterations of exact area [default = %d]\n", pPars->nIterArea );
+    Abc_Print( -2, "\t-C num   : the maximum number of cuts at a node [default = %d]\n", pPars->nCutsMax );
+    Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->fEpsilon );
+    Abc_Print( -2, "\t-Q float : area/delay preference ratio [default = %.2f (area-only)] \n", pPars->fADratio );
+    Abc_Print( -2, "\t-m       : toggles using MUX matching [default = %s]\n", pPars->fUseMuxes? "yes": "no" );
+    Abc_Print( -2, "\t-x       : toggles using XOR matching [default = %s]\n", pPars->fUseXors? "yes": "no" );
+    Abc_Print( -2, "\t-i       : toggles assuming inverters are free [default = %s]\n", pPars->fFreeInvs? "yes": "no" );
+    Abc_Print( -2, "\t-s       : toggles sweep after mapping [default = %s]\n", fSweep? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandUnmap( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkHasMapping(pNtk) )
+    {
+        Abc_Print( -1, "Cannot unmap the network that is not mapped.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( !Abc_NtkMapToSop( pNtk ) )
+    {
+        Abc_Print( -1, "Unmapping has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: unmap [-h]\n" );
+    Abc_Print( -2, "\t        replaces the library gates by the logic nodes represented using SOPs\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAttach( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsSopLogic(pNtk) )
+    {
+        Abc_Print( -1, "Can only attach gates if the nodes have SOP representations.\n" );
+        return 1;
+    }
+
+    // get the new network
+    if ( !Abc_NtkAttach( pNtk ) )
+    {
+        Abc_Print( -1, "Attaching gates has failed.\n" );
+        return 1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: attach [-h]\n" );
+    Abc_Print( -2, "\t        replaces the SOP functions by the gates from the library\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSuperChoice( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkSuperChoice( Abc_Ntk_t * pNtk );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
+        return 1;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkSuperChoice( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Superchoicing has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: superc [-h]\n" );
+    Abc_Print( -2, "\t      performs superchoicing\n" );
+    Abc_Print( -2, "\t      (accumulate: \"r file.blif; rsup; b; sc; f -ac; wb file_sc.blif\")\n" );
+    Abc_Print( -2, "\t      (map without supergate library: \"r file_sc.blif; ft; map\")\n" );
+    Abc_Print( -2, "\t-h  : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSuperChoiceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int nLutSize;
+    int nCutSizeMax;
+    int fVerbose;
+    extern int Abc_NtkSuperChoiceLut( Abc_Ntk_t * pNtk, int nLutSize, int nCutSizeMax, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fVerbose = 1;
+    nLutSize = 4;
+    nCutSizeMax = 10;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KNh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nCutSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutSizeMax < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Superchoicing works only for the AIG representation (run \"strash\").\n" );
+        return 1;
+    }
+
+    // convert the network into the SOP network
+    pNtkRes = Abc_NtkToLogic( pNtk );
+
+    // get the new network
+    if ( !Abc_NtkSuperChoiceLut( pNtkRes, nLutSize, nCutSizeMax, fVerbose ) )
+    {
+        Abc_NtkDelete( pNtkRes );
+        Abc_Print( -1, "Superchoicing has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: supercl [-K num] [-N num] [-vh]\n" );
+    Abc_Print( -2, "\t        performs superchoicing for K-LUTs\n" );
+    Abc_Print( -2, "\t        (accumulate: \"r file.blif; b; scl; f -ac; wb file_sc.blif\")\n" );
+    Abc_Print( -2, "\t        (FPGA map: \"r file_sc.blif; ft; read_lut lutlibK; fpga\")\n" );
+    Abc_Print( -2, "\t-K num : the number of LUT inputs [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-N num : the max size of the cut [default = %d]\n", nCutSizeMax );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+#if 0 
+int Abc_CommandFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[100];
+    char LutSize[100];
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fRecovery;
+    int fSwitching;
+    int fLatchPaths;
+    int fVerbose;
+    int nLutSize;
+    float DelayTarget;
+
+    extern Abc_Ntk_t * Abc_NtkFpga( Abc_Ntk_t * pNtk, float DelayTarget, int fRecovery, int fSwitching, int fLatchPaths, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fRecovery   = 1;
+    fSwitching  = 0;
+    fLatchPaths = 0;
+    fVerbose    = 0;
+    DelayTarget =-1;
+    nLutSize    =-1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "aplvhDK" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'a':
+            fRecovery ^= 1;
+            break;
+        case 'p':
+            fSwitching ^= 1;
+            break;
+        case 'l':
+            fLatchPaths ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            DelayTarget = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    // create the new LUT library
+    if ( nLutSize >= 3 && nLutSize <= 10 )
+        Fpga_SetSimpleLutLib( nLutSize );
+/*
+    else
+    {
+        Abc_Print( -1, "Cannot perform FPGA mapping with LUT size %d.\n", nLutSize );
+        return 1;
+    }
+*/
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        // strash and balance the network
+        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
+            return 1;
+        }
+        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
+            return 1;
+        }
+        Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
+        // get the new network
+        pNtkRes = Abc_NtkFpga( pNtk, DelayTarget, fRecovery, fSwitching, fLatchPaths, fVerbose );
+        if ( pNtkRes == NULL )
+        {
+            Abc_NtkDelete( pNtk );
+            Abc_Print( -1, "FPGA mapping has failed.\n" );
+            return 1;
+        }
+        Abc_NtkDelete( pNtk );
+    }
+    else
+    {
+        // get the new network
+        pNtkRes = Abc_NtkFpga( pNtk, DelayTarget, fRecovery, fSwitching, fLatchPaths, fVerbose );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "FPGA mapping has failed.\n" );
+            return 1;
+        }
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    if ( DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%.2f", DelayTarget );
+    if ( nLutSize == -1 )
+        sprintf(LutSize, "library" );
+    else
+        sprintf(LutSize, "%d", nLutSize );
+    Abc_Print( -2, "usage: fpga [-D float] [-K num] [-aplvh]\n" );
+    Abc_Print( -2, "\t           performs FPGA mapping of the current network\n" );
+    Abc_Print( -2, "\t-a       : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
+    Abc_Print( -2, "\t-p       : optimizes power by minimizing switching activity [default = %s]\n", fSwitching? "yes": "no" );
+    Abc_Print( -2, "\t-l       : optimizes latch paths for delay, other paths for area [default = %s]\n", fLatchPaths? "yes": "no" );
+    Abc_Print( -2, "\t-D float : sets the required time for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-K num   : the number of LUT inputs (2 < num < 11) [default = %s]%s\n", LutSize, (nLutSize == -1 ? " (type \"print_lut\")" : "") );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFpgaFast( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[100];
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fRecovery;
+    int fVerbose;
+    int nLutSize;
+    float DelayTarget;
+
+    extern Abc_Ntk_t * Abc_NtkFpgaFast( Abc_Ntk_t * pNtk, int nLutSize, int fRecovery, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fRecovery   = 1;
+    fVerbose    = 0;
+    DelayTarget =-1;
+    nLutSize    = 5;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "avhDK" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'a':
+            fRecovery ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            DelayTarget = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        // strash and balance the network
+        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
+            return 1;
+        }
+        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
+            return 1;
+        }
+        Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
+        // get the new network
+        pNtkRes = Abc_NtkFpgaFast( pNtk, nLutSize, fRecovery, fVerbose );
+        if ( pNtkRes == NULL )
+        {
+            Abc_NtkDelete( pNtk );
+            Abc_Print( -1, "FPGA mapping has failed.\n" );
+            return 1;
+        }
+        Abc_NtkDelete( pNtk );
+    }
+    else
+    {
+        // get the new network
+        pNtkRes = Abc_NtkFpgaFast( pNtk, nLutSize, fRecovery, fVerbose );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "FPGA mapping has failed.\n" );
+            return 1;
+        }
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    if ( DelayTarget == -1 )
+        sprintf(Buffer, "not used" );
+    else
+        sprintf(Buffer, "%.2f", DelayTarget );
+    Abc_Print( -2, "usage: ffpga [-K num] [-avh]\n" );
+    Abc_Print( -2, "\t           performs fast FPGA mapping of the current network\n" );
+    Abc_Print( -2, "\t-a       : toggles area recovery [default = %s]\n", fRecovery? "yes": "no" );
+//    Abc_Print( -2, "\t-D float : sets the required time for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-K num   : the number of LUT inputs (2 < num < 32) [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+#endif
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIf( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkIf( Abc_Ntk_t * pNtk, If_Par_t * pPars );
+    char Buffer[100], LutSize[100];
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    If_Par_t Pars, * pPars = &Pars;
+    int c;
+    pNtk = Abc_FrameReadNtk(pAbc);
+    If_ManSetDefaultPars( pPars );
+    pPars->pLutLib = (If_LibLut_t *)Abc_FrameReadLibLut();
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGNDEWSTqaflepmrsdbgxyojiktncvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutSize < 0 )
+                goto usage;
+            // if the LUT size is specified, disable library
+            pPars->pLutLib = NULL;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nFlowIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFlowIters < 0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nAreaIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nAreaIters < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer no less than 3.\n" );
+                goto usage;
+            }
+            pPars->nGateSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nGateSize < 2 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer no less than 3.\n" );
+                goto usage;
+            }
+            pPars->nNonDecLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nNonDecLimit < 2 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'E':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->Epsilon < 0.0 || pPars->Epsilon > 1.0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->WireDelay = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->WireDelay < 0.0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
+                goto usage;
+            }
+            pPars->pLutStruct = argv[globalUtilOptind];
+            globalUtilOptind++;
+            if ( strlen(pPars->pLutStruct) != 2 && strlen(pPars->pLutStruct) != 3 )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
+                goto usage;
+            }
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer 0,1,or 2.\n" );
+                goto usage;
+            }
+            pPars->nStructType = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nStructType < 0 || pPars->nStructType > 2 )
+                goto usage;
+            break;
+        case 'q':
+            pPars->fPreprocess ^= 1;
+            break;
+        case 'a':
+            pPars->fArea ^= 1;
+            break;
+        case 'r':
+            pPars->fExpRed ^= 1;
+            break;
+        case 'f':
+            pPars->fFancy ^= 1;
+            break;
+        case 'l':
+            pPars->fLatchPaths ^= 1;
+            break;
+        case 'e':
+            pPars->fEdge ^= 1;
+            break;
+        case 'p':
+            pPars->fPower ^= 1;
+            break;
+        case 'm':
+            pPars->fCutMin ^= 1;
+            break;
+        case 's':
+            pPars->fDelayOptLut ^= 1;
+            break;
+        case 'd':
+            pPars->fBidec ^= 1;
+            break;
+        case 'b':
+            pPars->fUseBat ^= 1;
+            break;
+        case 'g':
+            pPars->fDelayOpt ^= 1;
+            break;
+        case 'x':
+            pPars->fDsdBalance ^= 1;
+            break;
+        case 'y':
+            pPars->fUserRecLib ^= 1;
+            break;
+        case 'o':
+            pPars->fUseBuffs ^= 1;
+            break;
+        case 'j':
+            pPars->fEnableCheck07 ^= 1;
+            break;
+        case 'i':
+            pPars->fEnableCheck08 ^= 1;
+            break;
+        case 'k':
+            pPars->fEnableCheck10 ^= 1;
+            break;
+        case 't':
+            pPars->fDoAverage ^= 1;
+            break;
+        case 'n':
+            pPars->fUseDsd ^= 1;
+            break;
+        case 'c':
+            pPars->fUseTtPerm ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( pPars->nLutSize == -1 )
+    {
+        if ( pPars->pLutLib == NULL )
+        {
+            Abc_Print( -1, "The LUT library is not given.\n" );
+            return 1;
+        }
+        pPars->nLutSize = pPars->pLutLib->LutMax;
+    }
+
+    if ( pPars->nLutSize < 2 || pPars->nLutSize > IF_MAX_LUTSIZE )
+    {
+        Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
+        return 1;
+    }
+
+    if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
+    {
+        Abc_Print( -1, "Incorrect number of cuts.\n" );
+        return 1;
+    }
+
+    // enable truth table computation if choices are selected
+    if ( (c = Abc_NtkGetChoiceNum( pNtk )) )
+    {
+//        if ( !Abc_FrameReadFlag("silentmode") )
+//            Abc_Print( 0, "Performing LUT mapping with %d choices.\n", c );
+        pPars->fExpRed = 0;
+    }
+
+    if ( pPars->fUseBat )
+    {
+        if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
+        {
+            Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
+            return 1;
+        }
+        pPars->fCutMin = 1;
+    }
+
+    if ( pPars->fEnableCheck07 + pPars->fEnableCheck08 + pPars->fEnableCheck10 + (pPars->pLutStruct != NULL) > 1 )
+    {
+        Abc_Print( -1, "Only one additional check can be performed at the same time.\n" );
+        return 1;
+    }
+    if ( pPars->fEnableCheck07 )
+    {
+        if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 )
+        {
+            Abc_Print( -1, "This feature only works for {6,7}-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = If_CutPerformCheck07;
+        pPars->fCutMin = 1;
+    }
+    if ( pPars->fEnableCheck08 )
+    {
+        if ( pPars->nLutSize < 6 || pPars->nLutSize > 8 )
+        {
+            Abc_Print( -1, "This feature only works for {6,7,8}-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = If_CutPerformCheck08;
+        pPars->fCutMin = 1;
+    }
+    if ( pPars->fEnableCheck10 )
+    {
+        if ( pPars->nLutSize < 6 || pPars->nLutSize > 10 )
+        {
+            Abc_Print( -1, "This feature only works for {6,7,8,9,10}-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = If_CutPerformCheck10;
+        pPars->fCutMin = 1;
+    }
+    if ( pPars->pLutStruct )
+    {
+        if ( pPars->fDsdBalance )
+        {
+            Abc_Print( -1, "Incompatible options (-S and -x).\n" );
+            return 1;
+        }
+        if ( pPars->nLutSize < 6 || pPars->nLutSize > 16 )
+        {
+            Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck16;
+        pPars->fCutMin = 1;
+    }
+
+    // enable truth table computation if cut minimization is selected
+    if ( pPars->fCutMin )
+    {
+        pPars->fTruth = 1;
+        pPars->fExpRed = 0;
+    }
+    // modify the subgraph recording
+    if ( pPars->fUserRecLib )
+    {
+        pPars->fTruth      =  1;
+        pPars->fCutMin     =  1;
+        pPars->fExpRed     =  0;
+        pPars->fUsePerm    =  1;
+        pPars->pLutLib     =  NULL;
+    }
+    // modify for delay optimization
+    if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fDelayOptLut )
+    {
+        pPars->fTruth      =  1;
+        pPars->fCutMin     =  1;
+        pPars->fExpRed     =  0;
+        pPars->fUseDsd     =  pPars->fDsdBalance || pPars->fDelayOptLut;
+        pPars->pLutLib     =  NULL;
+    }
+    // modify for delay optimization
+    if ( pPars->nGateSize > 0 )
+    {
+        pPars->fTruth      =  1;
+        pPars->fCutMin     =  1;
+        pPars->fExpRed     =  0;
+        pPars->fUsePerm    =  1;
+        pPars->pLutLib     =  NULL;
+        pPars->nLutSize    =  pPars->nGateSize;
+    }
+
+    if ( pPars->fUseDsd || pPars->fUseTtPerm )
+    {
+        pPars->fTruth      =  1;
+        pPars->fCutMin     =  1;
+        pPars->fExpRed     =  0;
+    }
+
+    if ( pPars->fUseDsd )
+    {
+        int LutSize = (pPars->pLutStruct && pPars->pLutStruct[2] == 0)? pPars->pLutStruct[0] - '0' : 0;
+        If_DsdMan_t * p = (If_DsdMan_t *)Abc_FrameReadManDsd();
+        if ( pPars->pLutStruct && pPars->pLutStruct[2] != 0 )
+        {
+            printf( "DSD only works for LUT structures XY.\n" );
+            return 0;
+        }
+        if ( p && pPars->nLutSize > If_DsdManVarNum(p) )
+        {
+            printf( "DSD manager has incompatible number of variables.\n" );
+            return 0;
+        }
+        if ( p && LutSize != If_DsdManLutSize(p) && !pPars->fDsdBalance )
+        {
+            printf( "DSD manager has different LUT size.\n" );
+            return 0;
+        }
+        if ( p == NULL )
+            Abc_FrameSetManDsd( If_DsdManAlloc(pPars->nLutSize, LutSize) );
+    }
+
+    if ( pPars->fUserRecLib )
+    {
+        if ( !Abc_NtkRecIsRunning3() )
+        {
+            printf( "LMS manager is not running (use \"rec_start3\").\n" );
+            return 0;
+        }
+        if ( Abc_NtkRecInputNum3() != pPars->nLutSize )
+        {
+            printf( "The number of library inputs (%d) different from the K parameters (%d).\n", Abc_NtkRecInputNum3(), pPars->nLutSize );
+            return 0;
+        }
+    }
+ 
+    // complain if truth tables are requested but the cut size is too large
+    if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
+    {
+        Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
+        return 1;
+    }
+
+    // disable cut-expansion if edge-based heuristics are selected
+//    if ( pPars->fEdge )
+//        pPars->fExpRed = 0;
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        // strash and balance the network
+        pNtk = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Strashing before FPGA mapping has failed.\n" );
+            return 1;
+        }
+        pNtk = Abc_NtkBalance( pNtkRes = pNtk, 0, 0, 1 );
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
+            return 1;
+        }
+        if ( !Abc_FrameReadFlag("silentmode") )
+            Abc_Print( 1, "The network was strashed and balanced before FPGA mapping.\n" );
+        // get the new network
+        pNtkRes = Abc_NtkIf( pNtk, pPars );
+        if ( pNtkRes == NULL )
+        {
+            Abc_NtkDelete( pNtk );
+            Abc_Print( -1, "FPGA mapping has failed.\n" );
+            return 0;
+        }
+        Abc_NtkDelete( pNtk );
+    }
+    else
+    {
+        // get the new network
+        pNtkRes = Abc_NtkIf( pNtk, pPars );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "FPGA mapping has failed.\n" );
+            return 0;
+        }
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    if ( pPars->DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%.2f", pPars->DelayTarget );
+    if ( pPars->nLutSize == -1 )
+        sprintf(LutSize, "library" );
+    else
+        sprintf(LutSize, "%d", pPars->nLutSize );
+    Abc_Print( -2, "usage: if [-KCFANGT num] [-DEW float] [-S str] [-qarlepmsdbgxyojiktncvh]\n" );
+    Abc_Print( -2, "\t           performs FPGA technology mapping of the network\n" );
+    Abc_Print( -2, "\t-K num   : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
+    Abc_Print( -2, "\t-F num   : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
+    Abc_Print( -2, "\t-A num   : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
+    Abc_Print( -2, "\t-N num   : the max size of non-decomposable nodes [default = unused]\n", pPars->nNonDecLimit );
+    Abc_Print( -2, "\t-G num   : the max AND/OR gate size for mapping (0 = unused) [default = %d]\n", pPars->nGateSize );
+    Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
+    Abc_Print( -2, "\t-W float : sets wire delay between adjects LUTs [default = %f]\n", pPars->WireDelay );
+    Abc_Print( -2, "\t-S str   : string representing the LUT structure [default = %s]\n", pPars->pLutStruct ? pPars->pLutStruct : "not used" );
+    Abc_Print( -2, "\t-T num   : the type of LUT structures [default = any]\n", pPars->nStructType );
+    Abc_Print( -2, "\t-q       : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
+    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
+    Abc_Print( -2, "\t-r       : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
+    Abc_Print( -2, "\t-l       : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
+    Abc_Print( -2, "\t-e       : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
+    Abc_Print( -2, "\t-p       : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
+    Abc_Print( -2, "\t-m       : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
+    Abc_Print( -2, "\t-s       : toggles delay-oriented mapping used with -S <NN> [default = %s]\n", pPars->fDelayOptLut? "yes": "no" );
+    Abc_Print( -2, "\t-d       : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
+    Abc_Print( -2, "\t-b       : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
+    Abc_Print( -2, "\t-g       : toggles delay optimization by SOP balancing [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
+    Abc_Print( -2, "\t-x       : toggles delay optimization by DSD balancing [default = %s]\n", pPars->fDsdBalance? "yes": "no" );
+    Abc_Print( -2, "\t-y       : toggles delay optimization with recorded library [default = %s]\n", pPars->fUserRecLib? "yes": "no" );
+    Abc_Print( -2, "\t-o       : toggles using buffers to decouple combinational outputs [default = %s]\n", pPars->fUseBuffs? "yes": "no" );
+    Abc_Print( -2, "\t-j       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck07? "yes": "no" );
+    Abc_Print( -2, "\t-i       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck08? "yes": "no" );
+    Abc_Print( -2, "\t-k       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck10? "yes": "no" );
+    Abc_Print( -2, "\t-t       : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
+    Abc_Print( -2, "\t-n       : toggles computing DSDs of the cut functions [default = %s]\n", pPars->fUseDsd? "yes": "no" );
+    Abc_Print( -2, "\t-c       : toggles computing truth tables in a new way [default = %s]\n", pPars->fUseTtPerm? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIfif( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_NtkPerformIfif( Abc_Ntk_t * pNtk, Ifif_Par_t * pPars );
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Ifif_Par_t Pars, * pPars = &Pars;
+    int c, fError;
+
+    pPars->nLutSize     =  -1;    // the LUT size
+    pPars->pLutLib      = (If_LibLut_t *)Abc_FrameReadLibLut();       // the LUT library
+    pPars->DelayWire    = (float)0.5;    // wire delay
+    pPars->nDegree      =   0;    // structure degree
+    pPars->fCascade     =   0;    // cascade
+    pPars->fVerbose     =   0;    // verbose
+    pPars->fVeryVerbose =   0;    // verbose
+
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "DNcvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayWire = atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayWire < 0.0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->nDegree = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nDegree < 0 )
+                goto usage;
+            break;
+        case 'c':
+            pPars->fCascade ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "Need mapped network.\n" );
+        return 1;
+    }
+    if ( pPars->pLutLib == NULL )
+    {
+        Abc_Print( -1, "LUT library is not given.\n" );
+        return 1;
+    }
+
+    pPars->nLutSize = Abc_NtkGetFaninMax( pNtk );
+    if ( pPars->nLutSize > pPars->pLutLib->LutMax )
+    {
+        Abc_Print( -1, "The max node size (%d) exceeds the LUT size (%d).\n", pPars->nLutSize, pPars->pLutLib->LutMax );
+        return 1;
+    }
+    if ( pPars->nLutSize < pPars->pLutLib->LutMax )
+        Abc_Print( 0, "Node size (%d) is less than LUT size (%d).\n", pPars->nLutSize, pPars->pLutLib->LutMax );
+    // check delay information
+    fError = 0;
+    for ( c = 0; c < pPars->pLutLib->LutMax; c++ )
+    {
+        pPars->pLutDelays[c] = ( pPars->pLutLib->fVarPinDelays ? pPars->pLutLib->pLutDelays[pPars->pLutLib->LutMax][c] : pPars->pLutLib->pLutDelays[pPars->pLutLib->LutMax][0] );
+        if ( pPars->DelayWire >= pPars->pLutDelays[c] )
+        {
+            fError = 1;
+            printf(" Wire delay (%.2f) exceeds pin+wire delay (%.2f) for pin %d in the LUT library.\n", pPars->DelayWire, pPars->pLutDelays[c], c );
+        }
+    }
+    if ( fError )
+        return 1;
+
+    // call the mapper
+    Abc_NtkPerformIfif( pNtk, pPars );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: ifif [-DNcvwh]\n" );
+    Abc_Print( -2, "\t           technology mapper into N-node K-LUT structures\n" );
+    Abc_Print( -2, "\t           (takes a LUT network and maps it into a delay-optimal network\n" );
+    Abc_Print( -2, "\t            of N-node K-LUT structures using the current LUT library)\n" );
+    Abc_Print( -2, "\t-D float : wire delay (should be less than the LUT delay) [default = %.2f]\n", pPars->DelayWire );
+    Abc_Print( -2, "\t-N num   : degree of the LUT structure [default = %d]\n", pPars->nDegree );
+    Abc_Print( -2, "\t-c       : toggles using LUT cascade vs LUT cluster [default = %s]\n", pPars->fCascade? "cascade": "cluster" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDsdSave( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char * FileName;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c, fSecond = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "bh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'b':
+            fSecond ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "File name is not given on the command line.\n" );
+        return 1;
+    }
+    // get the input file name
+    FileName = (nArgcNew == 1) ? pArgvNew[0] : NULL;
+	if ( fSecond )
+	{
+		if ( !Abc_FrameReadManDsd2() )
+		{
+			Abc_Print( -1, "The DSD manager is not started.\n" );
+			return 1;
+		}
+		If_DsdManSave( (If_DsdMan_t *)Abc_FrameReadManDsd2(), FileName );
+	}
+	else
+	{
+		if ( !Abc_FrameReadManDsd() )
+		{
+			Abc_Print( -1, "The DSD manager is not started.\n" );
+			return 1;
+		}
+		If_DsdManSave( (If_DsdMan_t *)Abc_FrameReadManDsd(), FileName );
+	}
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsd_save [-bh] <file>\n" );
+    Abc_Print( -2, "\t         saves DSD manager into a file\n");
+    Abc_Print( -2, "\t-b     : toggles processing second manager [default = %s]\n", fSecond? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : (optional) file name to write\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDsdLoad( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char * FileName, * pTemp;
+    char ** pArgvNew;
+    int c, nArgcNew, fSecond = 0;
+    FILE * pFile;
+    If_DsdMan_t * pDsdMan;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "bh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'b':
+            fSecond ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "File name is not given on the command line.\n" );
+        return 1;
+    }
+    // get the input file name
+    FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+	if ( fSecond )
+	{
+		Abc_FrameSetManDsd2( NULL );
+		pDsdMan = If_DsdManLoad(FileName);
+		if ( pDsdMan == NULL )
+			return 1;
+		Abc_FrameSetManDsd2( pDsdMan );
+	}
+	else
+	{
+		Abc_FrameSetManDsd( NULL );
+		pDsdMan = If_DsdManLoad(FileName);
+		if ( pDsdMan == NULL )
+			return 1;
+		Abc_FrameSetManDsd( pDsdMan );
+	}
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsd_load [-bh] <file>\n" );
+    Abc_Print( -2, "\t         loads DSD manager from file\n");
+    Abc_Print( -2, "\t-b     : toggles processing second manager [default = %s]\n", fSecond? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : file name to read\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDsdFree( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c, fSecond = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "bh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'b':
+            fSecond ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+	if ( fSecond )
+	{
+		if ( !Abc_FrameReadManDsd2() )
+		{
+			Abc_Print( 1, "The DSD manager is not started.\n" );
+			return 0;
+		}
+		Abc_FrameSetManDsd2( NULL );
+	}
+	else
+	{
+		if ( !Abc_FrameReadManDsd() )
+		{
+			Abc_Print( 1, "The DSD manager is not started.\n" );
+			return 0;
+		}
+		Abc_FrameSetManDsd( NULL );
+	}
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsd_free [-bh]\n" );
+    Abc_Print( -2, "\t         deletes DSD manager\n" );
+    Abc_Print( -2, "\t-b     : toggles processing second manager [default = %s]\n", fSecond? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDsdPs( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c, Number = 0, Support = 0, fOccurs = 0, fTtDump = 0, fSecond = 0, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NSotbvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            Number = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Number < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            Support = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Support < 0 )
+                goto usage;
+            break;
+        case 'o':
+            fOccurs ^= 1;
+            break;
+        case 't':
+            fTtDump ^= 1;
+            break;
+        case 'b':
+            fSecond ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+	if ( fSecond )
+	{
+		if ( !Abc_FrameReadManDsd2() )
+		{
+			Abc_Print( 1, "The DSD manager is not started.\n" );
+			return 0;
+		}
+		If_DsdManPrint( (If_DsdMan_t *)Abc_FrameReadManDsd2(), NULL, Number, Support, fOccurs, fTtDump, fVerbose );
+	}
+	else
+	{
+		if ( !Abc_FrameReadManDsd() )
+		{
+			Abc_Print( 1, "The DSD manager is not started.\n" );
+			return 0;
+		}
+		If_DsdManPrint( (If_DsdMan_t *)Abc_FrameReadManDsd(), NULL, Number, Support, fOccurs, fTtDump, fVerbose );
+	}
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsd_ps [-NS num] [-obvh]\n" );
+    Abc_Print( -2, "\t         prints statistics of DSD manager\n" );
+    Abc_Print( -2, "\t-N num : show structures whose ID divides by N [default = %d]\n",   Number );
+    Abc_Print( -2, "\t-S num : show structures whose support size is S [default = %d]\n", Support );
+    Abc_Print( -2, "\t-o     : toggles printing occurence distribution [default = %s]\n", fOccurs? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggles dumping truth tables [default = %s]\n",            fTtDump? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggles processing second manager [default = %s]\n",       fSecond? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n",                  fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDsdTune( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c, fVerbose = 0, fFast = 0, fAdd = 0, fSpec = 0, LutSize = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Kfasvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            LutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( LutSize < 4 || LutSize > 6 )
+                goto usage;
+            break;
+        case 'f':
+            fFast ^= 1;
+            break;
+        case 'a':
+            fAdd ^= 1;
+            break;
+        case 's':
+            fSpec ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_FrameReadManDsd() )
+    {
+        Abc_Print( 1, "The DSD manager is not started.\n" );
+        return 0;
+    }
+    If_DsdManTune( (If_DsdMan_t *)Abc_FrameReadManDsd(), LutSize, fFast, fAdd, fSpec, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsd_tune [-K num] [-fasvh]\n" );
+    Abc_Print( -2, "\t         tunes DSD manager for the given LUT size\n" );
+    Abc_Print( -2, "\t-K num : LUT size used for tuning [default = %d]\n",        LutSize );
+    Abc_Print( -2, "\t-f     : toggles using fast check [default = %s]\n",        fFast? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggles adding tuning to the current one [default = %s]\n",    fAdd? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggles using specialized check [default = %s]\n", fSpec? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n",          fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDsdMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char * FileName, * pTemp;
+    char ** pArgvNew;
+    int c, nArgcNew;
+    FILE * pFile;
+    If_DsdMan_t * pDsdMan;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_FrameReadManDsd() )
+    {
+        Abc_Print( 1, "The DSD manager is not started.\n" );
+        return 0;
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "File name is not given on the command line.\n" );
+        return 1;
+    }
+    // get the input file name
+    FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+    pDsdMan = If_DsdManLoad(FileName);
+    if ( pDsdMan == NULL )
+        return 1;
+    If_DsdManMerge( (If_DsdMan_t *)Abc_FrameReadManDsd(), pDsdMan );
+    If_DsdManFree( pDsdMan, 0 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsd_merge [-h] <file>\n" );
+    Abc_Print( -2, "\t         merges DSD manager from file with the current one\n");
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : file name to read\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDsdClean( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( !Abc_FrameReadManDsd() )
+    {
+        Abc_Print( 1, "The DSD manager is not started.\n" );
+        return 0;
+    }
+    If_DsdManClean( (If_DsdMan_t *)Abc_FrameReadManDsd(), fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsd_clean [-K num] [-vh]\n" );
+    Abc_Print( -2, "\t         cleans the occurrence counters\n" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n",          fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandInit( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Abc_Obj_t * pObj;
+    int c, i;
+    int fZeros;
+    int fOnes;
+    int fRandom;
+    int fDontCare;
+    char * pInitStr;
+    // set defaults
+    fZeros    = 0;
+    fOnes     = 0;
+    fRandom   = 0;
+    fDontCare = 0;
+    pInitStr  = NULL;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Szordh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pInitStr = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'z':
+            fZeros ^= 1;
+            break;
+        case 'o':
+            fOnes ^= 1;
+            break;
+        case 'r':
+            fRandom ^= 1;
+            break;
+        case 'd':
+            fDontCare ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The current network is combinational.\n" );
+        return 0;
+    }
+
+    if ( pInitStr != NULL )
+    {
+        if ( (int)strlen(pInitStr) != Abc_NtkLatchNum(pNtk) )
+        {
+            Abc_Print( -1, "The length of init string (%d) differs from the number of flops (%d).\n", strlen(pInitStr), Abc_NtkLatchNum(pNtk) );
+            return 1;
+        }
+        Abc_NtkForEachLatch( pNtk, pObj, i )
+            if ( pInitStr[i] == '0' )
+                Abc_LatchSetInit0( pObj );
+            else if ( pInitStr[i] == '1' )
+                Abc_LatchSetInit1( pObj );
+            else 
+                Abc_LatchSetInitDc( pObj );
+        return 0;
+    }
+
+    if ( fZeros )
+    {
+        Abc_NtkForEachLatch( pNtk, pObj, i )
+            Abc_LatchSetInit0( pObj );
+    }
+    else if ( fOnes )
+    {
+        Abc_NtkForEachLatch( pNtk, pObj, i )
+            Abc_LatchSetInit1( pObj );
+    }
+    else if ( fRandom )
+    {
+        srand( time(NULL) );
+        Abc_NtkForEachLatch( pNtk, pObj, i )
+            if ( rand() & 1 )
+                Abc_LatchSetInit1( pObj );
+            else
+                Abc_LatchSetInit0( pObj );
+    }
+    else if ( fDontCare )
+    {
+        Abc_NtkForEachLatch( pNtk, pObj, i )
+            Abc_LatchSetInitDc( pObj );
+    }
+    else
+        Abc_Print( -1, "The initial states remain unchanged.\n" );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: init [-zordh] [-S <init_string>]\n" );
+    Abc_Print( -2, "\t         resets initial states of all latches\n" );
+    Abc_Print( -2, "\t-z     : set zeros initial states [default = %s]\n", fZeros? "yes": "no" );
+    Abc_Print( -2, "\t-o     : set ones initial states [default = %s]\n", fOnes? "yes": "no" );
+    Abc_Print( -2, "\t-d     : set don't-care initial states [default = %s]\n", fDontCare? "yes": "no" );
+    Abc_Print( -2, "\t-r     : set random initial states [default = %s]\n", fRandom? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t-S str : (optional) initial state  [default = unused]\n" );
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandZero( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The current network is combinational.\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for AIGs.\n" );
+        return 0;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkRestrashZero( pNtk, 0 );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Converting to sequential AIG has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: zero [-h]\n" );
+    Abc_Print( -2, "\t        converts latches to have const-0 initial value\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandUndc( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c, fUseCex = 0;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'c':
+            fUseCex ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( fUseCex )
+    {
+        char * pInit; 
+        Abc_Cex_t * pTemp;
+        int k, nFlopsX = 0;
+        if ( pAbc->pCex == NULL )
+        {
+            Abc_Print( -1, "Current CEX is not available.\n" );
+            return 1;
+        }
+        pInit = Abc_NtkCollectLatchValuesStr( pAbc->pNtkCur );
+        // count the number of X-valued flops
+        for ( k = 0; k < Abc_NtkLatchNum(pAbc->pNtkCur); k++ )
+            nFlopsX += (int)(pInit[k] == 'x');
+        // compare this value
+        if ( Abc_NtkPiNum(pNtk) + nFlopsX != pAbc->pCex->nPis )
+        {
+            Abc_Print( -1, "The number of PIs (%d) plus X-valued flops (%d) in the original network does not match the number of PIs in the current CEX (%d).\n", 
+                Abc_NtkPiNum(pNtk), Abc_NtkLatchNum(pNtk), pAbc->pCex->nPis );
+            return 1;
+        }
+        pAbc->pCex = Abc_CexTransformUndc( pTemp = pAbc->pCex, pInit );
+        assert( pAbc->pCex->nPis == Abc_NtkPiNum(pAbc->pNtkCur) );
+        assert( pAbc->pCex->nRegs == Abc_NtkLatchNum(pAbc->pNtkCur) );
+        Abc_CexFree( pTemp );
+        ABC_FREE( pInit );
+        return 0;
+    }
+
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The current network is combinational.\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for logic networks.\n" );
+        return 0;
+    }
+
+    // get the new network
+    Abc_NtkConvertDcLatches( pNtk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: undc [-ch]\n" );
+    Abc_Print( -2, "\t        converts latches with DC init values into free PIs\n" );
+    Abc_Print( -2, "\t-c    : toggles transforming CEX after \"logic;undc;st;zero\" [default = %s]\n", fUseCex? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandOneHot( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkConvertOnehot( Abc_Ntk_t * pNtk );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The current network is combinational.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for logic networks.\n" );
+        return 0;
+    }
+    // get the new network
+    pNtkRes = Abc_NtkConvertOnehot( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Converting to one-hot encoding has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: onehot [-h]\n" );
+    Abc_Print( -2, "\t        converts natural encoding into one-hot encoding\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPipe( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nLatches;
+    extern void Abc_NtkLatchPipe( Abc_Ntk_t * pNtk, int nLatches );
+    // set defaults
+    nLatches = 5;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Lh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nLatches = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLatches < 0 )
+                goto usage;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The current network is combinational.\n" );
+        return 0;
+    }
+
+    // update the network
+    Abc_NtkLatchPipe( pNtk, nLatches );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: pipe [-L num] [-h]\n" );
+    Abc_Print( -2, "\t         inserts the given number of latches at each PI for pipelining\n" );
+    Abc_Print( -2, "\t-L num : the number of latches to insert [default = %d]\n", nLatches );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSeq( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "The network has no latches.\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Conversion to sequential AIG works only for combinational AIGs (run \"strash\").\n" );
+        return 1;
+    }
+
+    // get the new network
+//    pNtkRes = Abc_NtkAigToSeq( pNtk );
+    pNtkRes = NULL;
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Converting to sequential AIG has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: seq [-h]\n" );
+    Abc_Print( -2, "\t        converts AIG into sequential AIG\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandUnseq( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fShare;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fShare = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fShare ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+/*
+    if ( !Abc_NtkIsSeq(pNtk) )
+    {
+        Abc_Print( -1, "Conversion to combinational AIG works only for sequential AIG (run \"seq\").\n" );
+        return 1;
+    }
+*/
+    // share the latches on the fanout edges
+//    if ( fShare )
+//        Seq_NtkShareFanouts(pNtk);
+
+    // get the new network
+//    pNtkRes = Abc_NtkSeqToLogicSop( pNtk );
+    pNtkRes = NULL;
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Converting sequential AIG into an SOP logic network has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: unseq [-sh]\n" );
+    Abc_Print( -2, "\t        converts sequential AIG into an SOP logic network\n" );
+    Abc_Print( -2, "\t-s    : toggle sharing latches [default = %s]\n", fShare? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, nMaxIters;
+    int fForward;
+    int fBackward;
+    int fOneStep;
+    int fVerbose;
+    int Mode;
+    int nDelayLim;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Mode      =  5;
+    nDelayLim =  0;
+    fForward  =  0;
+    fBackward =  0;
+    fOneStep  =  0;
+    fVerbose  =  0;
+    nMaxIters = 15;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "MDfbsvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            Mode = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Mode < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nDelayLim = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nDelayLim < 0 )
+                goto usage;
+            break;
+        case 'f':
+            fForward ^= 1;
+            break;
+        case 'b':
+            fBackward ^= 1;
+            break;
+        case 's':
+            fOneStep ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( fForward && fBackward )
+    {
+        Abc_Print( -1, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkLatchNum(pNtk) )
+    {
+//        Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
+        return 0;
+    }
+
+    if ( Mode < 0 || Mode > 6 )
+    {
+        Abc_Print( -1, "The mode (%d) is incorrect. Retiming is not performed.\n", Mode );
+        return 0;
+    }
+
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        if ( Abc_NtkGetChoiceNum(pNtk) )
+        {
+            Abc_Print( -1, "Retiming with choice nodes is not implemented.\n" );
+            return 0;
+        }
+        // convert the network into an SOP network
+        pNtkRes = Abc_NtkToLogic( pNtk );
+        // perform the retiming
+        Abc_NtkRetime( pNtkRes, Mode, nDelayLim, fForward, fBackward, fOneStep, fVerbose );
+        // replace the current network
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+        return 0;
+    }
+
+    // get the network in the SOP form
+    if ( !Abc_NtkToSop(pNtk, 0) )
+    {
+        Abc_Print( -1, "Converting to SOPs has failed.\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "The network is not a logic network. Retiming is not performed.\n" );
+        return 0;
+    }
+
+    // perform the retiming
+    Abc_NtkRetime( pNtk, Mode, nDelayLim, fForward, fBackward, fOneStep, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: retime [-MD num] [-fbvh]\n" );
+    Abc_Print( -2, "\t         retimes the current network using one of the algorithms:\n" );
+    Abc_Print( -2, "\t             1: most forward retiming\n" );
+    Abc_Print( -2, "\t             2: most backward retiming\n" );
+    Abc_Print( -2, "\t             3: forward and backward min-area retiming\n" );
+    Abc_Print( -2, "\t             4: forward and backward min-delay retiming\n" );
+    Abc_Print( -2, "\t             5: mode 3 followed by mode 4\n" );
+    Abc_Print( -2, "\t             6: Pan's optimum-delay retiming using binary search\n" );
+    Abc_Print( -2, "\t-M num : the retiming algorithm to use [default = %d]\n", Mode );
+    Abc_Print( -2, "\t-D num : the minimum delay target (0=unused) [default = %d]\n", nDelayLim );
+    Abc_Print( -2, "\t-f     : enables forward-only retiming in modes 3,4,5 [default = %s]\n", fForward? "yes": "no" );
+    Abc_Print( -2, "\t-b     : enables backward-only retiming in modes 3,4,5 [default = %s]\n", fBackward? "yes": "no" );
+    Abc_Print( -2, "\t-s     : enables retiming one step only in mode 4 [default = %s]\n", fOneStep? "yes": "no" );
+    Abc_Print( -2, "\t-v     : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+//    Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
+//    Abc_Print( -2, "\t-f     : toggle forward retiming (for AIGs) [default = %s]\n", fForward? "yes": "no" );
+//    Abc_Print( -2, "\t-b     : toggle backward retiming (for AIGs) [default = %s]\n", fBackward? "yes": "no" );
+//    Abc_Print( -2, "\t-i     : toggle computation of initial state [default = %s]\n", fInitial? "yes": "no" );
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int fMinArea;
+    int fForwardOnly;
+    int fBackwardOnly;
+    int fInitial;
+    int nStepsMax;
+    int fFastAlgo;
+    int fVerbose;
+    int c, nMaxIters;
+    extern Abc_Ntk_t * Abc_NtkDarRetime( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
+    extern Abc_Ntk_t * Abc_NtkDarRetimeF( Abc_Ntk_t * pNtk, int nStepsMax, int fVerbose );
+    extern Abc_Ntk_t * Abc_NtkDarRetimeMinArea( Abc_Ntk_t * pNtk, int nMaxIters, int fForwardOnly, int fBackwardOnly, int fInitial, int fVerbose );
+    extern Abc_Ntk_t * Abc_NtkDarRetimeMostFwd( Abc_Ntk_t * pNtk, int nMaxIters, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fMinArea  = 1;
+    fForwardOnly = 0;
+    fBackwardOnly = 0;
+    fInitial = 1;
+    nStepsMax = 100000;
+    fFastAlgo = 0;
+    nMaxIters = 20;
+    fVerbose  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NSmfbiavh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nMaxIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nMaxIters < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nStepsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nStepsMax < 0 )
+                goto usage;
+            break;
+        case 'm':
+            fMinArea ^= 1;
+            break;
+        case 'f':
+            fForwardOnly ^= 1;
+            break;
+        case 'b':
+            fBackwardOnly ^= 1;
+            break;
+        case 'i':
+            fInitial ^= 1;
+            break;
+        case 'a':
+            fFastAlgo ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkLatchNum(pNtk) )
+    {
+//        Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
+        return 0;
+    }
+
+    // perform the retiming
+    if ( fMinArea )
+        pNtkRes = Abc_NtkDarRetimeMinArea( pNtk, nMaxIters, fForwardOnly, fBackwardOnly, fInitial, fVerbose );
+    else if ( fFastAlgo )
+        pNtkRes = Abc_NtkDarRetime( pNtk, nStepsMax, fVerbose );
+    else
+//        pNtkRes = Abc_NtkDarRetimeF( pNtk, nStepsMax, fVerbose );
+        pNtkRes = Abc_NtkDarRetimeMostFwd( pNtk, nMaxIters, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Retiming has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dretime [-NS num] [-mfbiavh]\n" );
+    Abc_Print( -2, "\t         new implementation of min-area (or most-forward) retiming\n" );
+    Abc_Print( -2, "\t-m     : toggle min-area retiming and most-forward retiming [default = %s]\n", fMinArea? "min-area": "most-fwd" );
+    Abc_Print( -2, "\t-f     : enables forward-only retiming [default = %s]\n", fForwardOnly? "yes": "no" );
+    Abc_Print( -2, "\t-b     : enables backward-only retiming [default = %s]\n", fBackwardOnly? "yes": "no" );
+    Abc_Print( -2, "\t-i     : enables init state computation [default = %s]\n", fInitial? "yes": "no" );
+    Abc_Print( -2, "\t-N num : the max number of one-frame iterations to perform [default = %d]\n", nMaxIters );
+    Abc_Print( -2, "\t-S num : the max number of forward retiming steps to perform [default = %d]\n", nStepsMax );
+    Abc_Print( -2, "\t-a     : enables a fast most-forward algorithm [default = %s]\n", fFastAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-v     : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFlowRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c, nMaxIters;
+    int fForward;
+    int fBackward;
+    int fVerbose;
+    int fComputeInit, fGuaranteeInit, fBlockConst;
+    int fFastButConservative;
+    int maxDelay;
+
+    if ( argc == 2 && !strcmp(argv[1], "-h") )
+    {
+        Abc_Print( -2, "The fretime command is temporarily disabled.\n" );
+        return 1;
+    }
+
+    Abc_Print( -1, "This command is temporarily disabled.\n" );
+    return 0;
+//    extern Abc_Ntk_t* Abc_FlowRetime_MinReg( Abc_Ntk_t * pNtk, int fVerbose,
+//                                             int fComputeInit, int fGuaranteeInit, int fBlockConst,
+//                                             int fForward, int fBackward, int nMaxIters,
+//                                             int maxDelay, int fFastButConservative);
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fForward  =  0;
+    fFastButConservative = 0;
+    fBackward =  0;
+    fComputeInit =  1;
+    fGuaranteeInit =  0;
+    fVerbose  =  0;
+    fBlockConst  =  0;
+    nMaxIters = 999;
+    maxDelay  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "MDfcgbkivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nMaxIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nMaxIters < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            maxDelay = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( maxDelay < 0 )
+                goto usage;
+           break;
+        case 'f':
+            fForward ^= 1;
+            break;
+        case 'c':
+            fFastButConservative ^= 1;
+            break;
+        case 'i':
+            fComputeInit ^= 1;
+            break;
+        case 'b':
+            fBackward ^= 1;
+            break;
+        case 'g':
+            fGuaranteeInit ^= 1;
+            break;
+        case 'k':
+            fBlockConst ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( fForward && fBackward )
+    {
+        Abc_Print( -1, "Only one switch \"-f\" or \"-b\" can be selected at a time.\n" );
+        return 1;
+    }
+
+    if ( fGuaranteeInit && !fComputeInit )
+    {
+      Abc_Print( -1, "Initial state guarantee (-g) requires initial state computation (-i).\n" );
+      return 1;
+    }
+
+    if ( !Abc_NtkLatchNum(pNtk) )
+    {
+//        Abc_Print( -1, "The network has no latches. Retiming is not performed.\n" );
+        return 0;
+    }
+
+    if ( Abc_NtkGetChoiceNum(pNtk) )
+      {
+        Abc_Print( -1, "Retiming with choice nodes is not implemented.\n" );
+        return 0;
+      }
+
+    // perform the retiming
+//    pNtkRes = Abc_FlowRetime_MinReg( pNtk, fVerbose, fComputeInit,
+//                                     fGuaranteeInit, fBlockConst,
+//                                     fForward, fBackward,
+//                                     nMaxIters, maxDelay, fFastButConservative );
+
+    if (pNtkRes != pNtk)
+      Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: fretime [-M num] [-D num] [-fbvih]\n" );
+    Abc_Print( -2, "\t         retimes the current network using flow-based algorithm\n" );
+    Abc_Print( -2, "\t-M num : the maximum number of iterations [default = %d]\n", nMaxIters );
+    Abc_Print( -2, "\t-D num : the maximum delay [default = none]\n" );
+    Abc_Print( -2, "\t-i     : enables init state computation [default = %s]\n", fComputeInit? "yes": "no" );
+    Abc_Print( -2, "\t-k     : blocks retiming over const nodes [default = %s]\n", fBlockConst? "yes": "no" );
+    Abc_Print( -2, "\t-g     : guarantees init state computation [default = %s]\n", fGuaranteeInit? "yes": "no" );
+    Abc_Print( -2, "\t-c     : very fast (but conserv.) delay constraints [default = %s]\n", fFastButConservative? "yes": "no" );
+    Abc_Print( -2, "\t-f     : enables forward-only retiming  [default = %s]\n", fForward? "yes": "no" );
+    Abc_Print( -2, "\t-b     : enables backward-only retiming [default = %s]\n", fBackward? "yes": "no" );
+    Abc_Print( -2, "\t-v     : enables verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fVerbose;
+    extern Abc_Ntk_t * Abc_NtkCRetime( Abc_Ntk_t * pNtk, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fVerbose    = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for logic networks.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkLatchNum(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    // modify the current network
+    pNtkRes = Abc_NtkCRetime( pNtk, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Sequential cleanup has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cretime [-vh]\n" );
+    Abc_Print( -2, "\t         performs most-forward retiming with equiv classes\n" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSeqFpga( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
+    int c, nMaxIters;
+    int fVerbose;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nMaxIters = 15;
+    fVerbose  =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nMaxIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nMaxIters < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkHasAig(pNtk) )
+    {
+/*
+        // quit if there are choice nodes
+        if ( Abc_NtkGetChoiceNum(pNtk) )
+        {
+            Abc_Print( -1, "Currently cannot map/retime networks with choice nodes.\n" );
+            return 0;
+        }
+*/
+//        if ( Abc_NtkIsStrash(pNtk) )
+//            pNtkNew = Abc_NtkAigToSeq(pNtk);
+//        else
+//            pNtkNew = Abc_NtkDup(pNtk);
+        pNtkNew = NULL;
+    }
+    else
+    {
+        // strash and balance the network
+        pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        if ( pNtkNew == NULL )
+        {
+            Abc_Print( -1, "Strashing before FPGA mapping/retiming has failed.\n" );
+            return 1;
+        }
+
+        pNtkNew = Abc_NtkBalance( pNtkRes = pNtkNew, 0, 0, 1 );
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtkNew == NULL )
+        {
+            Abc_Print( -1, "Balancing before FPGA mapping has failed.\n" );
+            return 1;
+        }
+
+        // convert into a sequential AIG
+//        pNtkNew = Abc_NtkAigToSeq( pNtkRes = pNtkNew );
+        pNtkNew = NULL;
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtkNew == NULL )
+        {
+            Abc_Print( -1, "Converting into a seq AIG before FPGA mapping/retiming has failed.\n" );
+            return 1;
+        }
+
+        Abc_Print( 1, "The network was strashed and balanced before FPGA mapping/retiming.\n" );
+    }
+
+    // get the new network
+//    pNtkRes = Seq_NtkFpgaMapRetime( pNtkNew, nMaxIters, fVerbose );
+    pNtkRes = NULL;
+    if ( pNtkRes == NULL )
+    {
+//        Abc_Print( -1, "Sequential FPGA mapping has failed.\n" );
+        Abc_NtkDelete( pNtkNew );
+        return 0;
+    }
+    Abc_NtkDelete( pNtkNew );
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: sfpga [-I num] [-vh]\n" );
+    Abc_Print( -2, "\t         performs integrated sequential FPGA mapping/retiming\n" );
+    Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSeqMap( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkNew, * pNtkRes;
+    int c, nMaxIters;
+    int fVerbose;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nMaxIters = 15;
+    fVerbose  =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Ivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nMaxIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nMaxIters < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkHasAig(pNtk) )
+    {
+/*
+        // quit if there are choice nodes
+        if ( Abc_NtkGetChoiceNum(pNtk) )
+        {
+            Abc_Print( -1, "Currently cannot map/retime networks with choice nodes.\n" );
+            return 0;
+        }
+*/
+//        if ( Abc_NtkIsStrash(pNtk) )
+//            pNtkNew = Abc_NtkAigToSeq(pNtk);
+//        else
+//            pNtkNew = Abc_NtkDup(pNtk);
+        pNtkNew = NULL;
+    }
+    else
+    {
+        // strash and balance the network
+        pNtkNew = Abc_NtkStrash( pNtk, 0, 0, 0 );
+        if ( pNtkNew == NULL )
+        {
+            Abc_Print( -1, "Strashing before SC mapping/retiming has failed.\n" );
+            return 1;
+        }
+
+        pNtkNew = Abc_NtkBalance( pNtkRes = pNtkNew, 0, 0, 1 );
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtkNew == NULL )
+        {
+            Abc_Print( -1, "Balancing before SC mapping/retiming has failed.\n" );
+            return 1;
+        }
+
+        // convert into a sequential AIG
+//        pNtkNew = Abc_NtkAigToSeq( pNtkRes = pNtkNew );
+        pNtkNew = NULL;
+        Abc_NtkDelete( pNtkRes );
+        if ( pNtkNew == NULL )
+        {
+            Abc_Print( -1, "Converting into a seq AIG before SC mapping/retiming has failed.\n" );
+            return 1;
+        }
+
+        Abc_Print( -1, "The network was strashed and balanced before SC mapping/retiming.\n" );
+    }
+
+    // get the new network
+//    pNtkRes = Seq_MapRetime( pNtkNew, nMaxIters, fVerbose );
+    pNtkRes = NULL;
+    if ( pNtkRes == NULL )
+    {
+//        Abc_Print( -1, "Sequential FPGA mapping has failed.\n" );
+        Abc_NtkDelete( pNtkNew );
+        return 0;
+    }
+    Abc_NtkDelete( pNtkNew );
+
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: smap [-I num] [-vh]\n" );
+    Abc_Print( -2, "\t         performs integrated sequential standard-cell mapping/retiming\n" );
+    Abc_Print( -2, "\t-I num : max number of iterations of l-value computation [default = %d]\n", nMaxIters );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    Fra_Ssw_t Pars, * pPars = &Pars;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkDarSeqSweep( Abc_Ntk_t * pNtk, Fra_Ssw_t * pPars );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    pPars->nPartSize  = 0;
+    pPars->nOverSize  = 0;
+    pPars->nFramesP   = 0;
+    pPars->nFramesK   = 1;
+    pPars->nMaxImps   = 5000;
+    pPars->nMaxLevs   = 0;
+    pPars->fUseImps   = 0;
+    pPars->fRewrite   = 0;
+    pPars->fFraiging  = 0;
+    pPars->fLatchCorr = 0;
+    pPars->fWriteImps = 0;
+    pPars->fUse1Hot   = 0;
+    pPars->fVerbose   = 0;
+    pPars->TimeLimit  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PQNFILirfletvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nPartSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nPartSize < 2 )
+                goto usage;
+            break;
+        case 'Q':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nOverSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nOverSize < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesP = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesP < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesK = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesK <= 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxImps = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxImps <= 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxLevs <= 0 )
+                goto usage;
+            break;
+        case 'i':
+            pPars->fUseImps ^= 1;
+            break;
+        case 'r':
+            pPars->fRewrite ^= 1;
+            break;
+        case 'f':
+            pPars->fFraiging ^= 1;
+            break;
+        case 'l':
+            pPars->fLatchCorr ^= 1;
+            break;
+        case 'e':
+            pPars->fWriteImps ^= 1;
+            break;
+        case 't':
+            pPars->fUse1Hot ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
+        return 0;
+    }
+
+    if ( pPars->nFramesK > 1 && pPars->fUse1Hot )
+    {
+        Abc_Print( -1, "Currrently can only use one-hotness for simple induction (K=1).\n" );
+        return 0;
+    }
+
+    if ( pPars->nFramesP && pPars->fUse1Hot )
+    {
+        Abc_Print( -1, "Currrently can only use one-hotness without prefix.\n" );
+        return 0;
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkDarSeqSweep( pNtk, pPars );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Sequential sweeping has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: ssweep [-PQNFL <num>] [-lrfetvh]\n" );
+    Abc_Print( -2, "\t         performs sequential sweep using K-step induction\n" );
+    Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
+    Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
+    Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
+    Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
+    Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
+//    Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
+//    Abc_Print( -2, "\t-i     : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
+    Abc_Print( -2, "\t-e     : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSeqSweep2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    Ssw_Pars_t Pars, * pPars = &Pars;
+    int nConstrs = 0;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkDarSeqSweep2( Abc_Ntk_t * pNtk, Ssw_Pars_t * pPars );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Ssw_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PQFCLSIVMNcmplkofdseqvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nPartSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nPartSize < 2 )
+                goto usage;
+            break;
+        case 'Q':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nOverSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nOverSize < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesK = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesK <= 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit <= 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxLevs <= 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesAddSim = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesAddSim < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nItersStop = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nItersStop < 0 )
+                goto usage;
+            break;
+        case 'V':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nSatVarMax2 = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nSatVarMax2 < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRecycleCalls2 = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRecycleCalls2 < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConstrs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConstrs < 0 )
+                goto usage;
+            break;
+        case 'c':
+            pPars->fConstrs ^= 1;
+            break;
+        case 'm':
+            pPars->fMergeFull ^= 1;
+            break;
+        case 'p':
+            pPars->fPolarFlip ^= 1;
+            break;
+        case 'l':
+            pPars->fLatchCorr ^= 1;
+            break;
+        case 'k':
+            pPars->fConstCorr ^= 1;
+            break;
+        case 'o':
+            pPars->fOutputCorr ^= 1;
+            break;
+        case 'f':
+            pPars->fSemiFormal ^= 1;
+            break;
+        case 'd':
+            pPars->fDynamic ^= 1;
+            break;
+        case 's':
+            pPars->fLocalSim ^= 1;
+            break;
+        case 'e':
+            pPars->fEquivDump ^= 1;
+            break;
+        case 'q':
+            pPars->fStopWhenGone ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fFlopVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
+        return 0;
+    }
+
+    if ( Abc_NtkPiNum(pNtk) == 0 )
+    {
+        Abc_Print( 0, "This command works only for designs with primary inputs.\n" );
+        return 0;
+    }
+
+    // if constraints are to be used, network should have no constraints
+    if ( nConstrs > 0 )
+    {
+        if ( Abc_NtkConstrNum(pNtk) > 0 )
+        {
+            Abc_Print( -1, "The network already has %d constraints.\n", Abc_NtkConstrNum(pNtk) );
+            return 0;
+        }
+        else
+        {
+            Abc_Print( 0, "Setting the number of constraints to be %d.\n", nConstrs );
+            pNtk->nConstrs = nConstrs;
+        }
+    }
+
+    if ( pPars->fConstrs )
+    {
+        if ( Abc_NtkConstrNum(pNtk) > 0 )
+            Abc_Print( 0, "Performing scorr with %d constraints.\n", Abc_NtkConstrNum(pNtk) );
+        else
+            Abc_Print( 0, "Performing constraint-based scorr without constraints.\n" );
+    }
+
+    // get the new network
+    pNtkRes = Abc_NtkDarSeqSweep2( pNtk, pPars );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Sequential sweeping has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: scorr [-PQFCLSIVMN <num>] [-cmplkodseqvwh]\n" );
+    Abc_Print( -2, "\t         performs sequential sweep using K-step induction\n" );
+    Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
+    Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
+    Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
+    Abc_Print( -2, "\t-C num : max number of conflicts at a node (0=inifinite) [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
+    Abc_Print( -2, "\t-N num : number of last POs treated as constraints (0=none) [default = %d]\n", pPars->fConstrs );
+    Abc_Print( -2, "\t-S num : additional simulation frames for c-examples (0=none) [default = %d]\n", pPars->nFramesAddSim );
+    Abc_Print( -2, "\t-I num : iteration number to stop and output SR-model (-1=none) [default = %d]\n", pPars->nItersStop );
+    Abc_Print( -2, "\t-V num : min var num needed to recycle the SAT solver [default = %d]\n", pPars->nSatVarMax2 );
+    Abc_Print( -2, "\t-M num : min call num needed to recycle the SAT solver [default = %d]\n", pPars->nRecycleCalls2 );
+    Abc_Print( -2, "\t-N num : set last <num> POs to be constraints (use with -c) [default = %d]\n", nConstrs );
+    Abc_Print( -2, "\t-c     : toggle using explicit constraints [default = %s]\n", pPars->fConstrs? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle full merge if constraints are present [default = %s]\n", pPars->fMergeFull? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle aligning polarity of SAT variables [default = %s]\n", pPars->fPolarFlip? "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle doing latch correspondence [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
+    Abc_Print( -2, "\t-k     : toggle doing constant correspondence [default = %s]\n", pPars->fConstCorr? "yes": "no" );
+    Abc_Print( -2, "\t-o     : toggle doing \'PO correspondence\' [default = %s]\n", pPars->fOutputCorr? "yes": "no" );
+//    Abc_Print( -2, "\t-f     : toggle filtering using iterative BMC [default = %s]\n", pPars->fSemiFormal? "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle dynamic addition of constraints [default = %s]\n", pPars->fDynamic? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle local simulation in the cone of influence [default = %s]\n", pPars->fLocalSim? "yes": "no" );
+    Abc_Print( -2, "\t-e     : toggle dumping disproved internal equivalences [default = %s]\n", pPars->fEquivDump? "yes": "no" );
+    Abc_Print( -2, "\t-q     : toggle quitting when PO is not a constant candidate [default = %s]\n", pPars->fStopWhenGone? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printout of flop equivalences [default = %s]\n", pPars->fFlopVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTestSeqSweep( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char * pFileName;
+    Fra_Ssw_t Pars, * pPars = &Pars;
+    int c;
+//    extern Abc_Ntk_t * Abc_NtkDarSeqSweep( Abc_Ntk_t * pNtk, Fra_Ssw_t * pPars );
+    extern int Fra_FraigInductionTest( char * pFileName, Fra_Ssw_t * pParams );
+
+    // set defaults
+    pPars->nPartSize  = 0;
+    pPars->nOverSize  = 0;
+    pPars->nFramesP   = 0;
+    pPars->nFramesK   = 1;
+    pPars->nMaxImps   = 5000;
+    pPars->nMaxLevs   = 0;
+    pPars->fUseImps   = 0;
+    pPars->fRewrite   = 0;
+    pPars->fFraiging  = 0;
+    pPars->fLatchCorr = 0;
+    pPars->fWriteImps = 0;
+    pPars->fUse1Hot   = 0;
+    pPars->fVerbose   = 0;
+    pPars->TimeLimit  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PQNFILirfletvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nPartSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nPartSize < 2 )
+                goto usage;
+            break;
+        case 'Q':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nOverSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nOverSize < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesP = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesP < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesK = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesK <= 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxImps = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxImps <= 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMaxLevs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMaxLevs <= 0 )
+                goto usage;
+            break;
+        case 'i':
+            pPars->fUseImps ^= 1;
+            break;
+        case 'r':
+            pPars->fRewrite ^= 1;
+            break;
+        case 'f':
+            pPars->fFraiging ^= 1;
+            break;
+        case 'l':
+            pPars->fLatchCorr ^= 1;
+            break;
+        case 'e':
+            pPars->fWriteImps ^= 1;
+            break;
+        case 't':
+            pPars->fUse1Hot ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    // get the input file name
+    if ( argc == globalUtilOptind + 1 )
+        pFileName = argv[globalUtilOptind];
+    else
+    {
+        Abc_Print( -1, "File name should be given on the command line.\n" );
+        return 1;
+    }
+    Fra_FraigInductionTest( pFileName, pPars );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: testssw [-PQNFL num] [-lrfetvh] <file>\n" );
+    Abc_Print( -2, "\t         performs sequential sweep using K-step induction\n" );
+    Abc_Print( -2, "\t         (outputs a file with a set of pairs of equivalent nodes)\n" );
+    Abc_Print( -2, "\t-P num : max partition size (0 = no partitioning) [default = %d]\n", pPars->nPartSize );
+    Abc_Print( -2, "\t-Q num : partition overlap (0 = no overlap) [default = %d]\n", pPars->nOverSize );
+    Abc_Print( -2, "\t-N num : number of time frames to use as the prefix [default = %d]\n", pPars->nFramesP );
+    Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", pPars->nFramesK );
+    Abc_Print( -2, "\t-L num : max number of levels to consider (0=all) [default = %d]\n", pPars->nMaxLevs );
+//    Abc_Print( -2, "\t-I num : max number of implications to consider [default = %d]\n", pPars->nMaxImps );
+//    Abc_Print( -2, "\t-i     : toggle using implications [default = %s]\n", pPars->fUseImps? "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle latch correspondence only [default = %s]\n", pPars->fLatchCorr? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle AIG rewriting [default = %s]\n", pPars->fRewrite? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle fraiging (combinational SAT sweeping) [default = %s]\n", pPars->fFraiging? "yes": "no" );
+    Abc_Print( -2, "\t-e     : toggle writing implications as assertions [default = %s]\n", pPars->fWriteImps? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle using one-hotness conditions [default = %s]\n", pPars->fUse1Hot? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTestScorr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkTestScorr( char * pFileNameIn, char * pFileNameOut, int nStepsMax, int nBTLimit, int fNewAlgo, int fFlopOnly, int fFfNdOnly, int fVerbose );
+
+    Abc_Ntk_t * pNtkRes;
+    int c;
+    int nConfMax;
+    int nStepsMax;
+    int fNewAlgo;
+    int fFlopOnly;
+    int fFfNdOnly;
+    int fVerbose;
+    // set defaults
+    nConfMax  = 100;
+    nStepsMax =  -1;
+    fNewAlgo  =   0;
+    fFlopOnly =   0;
+    fFfNdOnly =   0;
+    fVerbose  =   0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CSnfsvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfMax < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nStepsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nStepsMax < 0 )
+                goto usage;
+            break;
+        case 'n':
+            fNewAlgo ^= 1;
+            break;
+        case 'f':
+            fFlopOnly ^= 1;
+            break;
+        case 's':
+            fFfNdOnly ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( argc != globalUtilOptind + 2 )
+    {
+        Abc_Print( -1, "Expecting two files names on the command line.\n" );
+        goto usage;
+    }
+    if ( fFlopOnly && fFfNdOnly )
+    {
+        Abc_Print( -1, "These two options (-f and -s) are incompatible.\n" );
+        goto usage;
+    }
+    // get the new network
+    pNtkRes = Abc_NtkTestScorr( argv[globalUtilOptind], argv[globalUtilOptind+1], nStepsMax, nConfMax, fNewAlgo, fFlopOnly, fFfNdOnly, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Sequential sweeping has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: testscorr [-CS num] [-nfsvh] <file_in> <file_out>\n" );
+    Abc_Print( -2, "\t             outputs the list of sequential equivalences into a file\n" );
+    Abc_Print( -2, "\t             (if <file_in> is in BENCH, init state file should be the same directory)\n" );
+    Abc_Print( -2, "\t-C num     : limit on the number of conflicts [default = %d]\n", nConfMax );
+    Abc_Print( -2, "\t-S num     : limit on refinement iterations (-1=no limit, 0=after BMC, etc) [default = %d]\n", nStepsMax );
+    Abc_Print( -2, "\t-n         : toggle between \"scorr\" and \"&scorr\" [default = %s]\n", fNewAlgo? "&scorr": "scorr" );
+    Abc_Print( -2, "\t-f         : toggle reporting only flop/flop equivs [default = %s]\n", fFlopOnly? "yes": "no" );
+    Abc_Print( -2, "\t-s         : toggle reporting only flop/flop and flop/node equivs [default = %s]\n", fFfNdOnly? "yes": "no" );
+    Abc_Print( -2, "\t-v         : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h         : print the command usage\n");
+    Abc_Print( -2, "\t<file_in>  : input file with design for sequential equivalence computation\n");
+    Abc_Print( -2, "\t<file_out> : output file with the list of pairs of equivalent signals\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandLcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int nFramesP;
+    int nConfMax;
+    int nVarsMax;
+    int fNewAlgor;
+    int fVerbose;
+    extern Abc_Ntk_t * Abc_NtkDarLcorr( Abc_Ntk_t * pNtk, int nFramesP, int nConfMax, int fVerbose );
+    extern Abc_Ntk_t * Abc_NtkDarLcorrNew( Abc_Ntk_t * pNtk, int nVarsMax, int nConfMax, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+
+
+    // set defaults
+    nFramesP   =     0;
+    nConfMax   =  1000;
+    nVarsMax   =  1000;
+    fNewAlgor  =     1;
+    fVerbose   =     0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PCSnvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFramesP = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFramesP < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfMax < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nVarsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nVarsMax < 0 )
+                goto usage;
+            break;
+        case 'n':
+            fNewAlgor ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational (run \"fraig\" or \"fraig_sweep\").\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
+        return 0;
+    }
+
+    // get the new network
+    if ( fNewAlgor )
+        pNtkRes = Abc_NtkDarLcorrNew( pNtk, nVarsMax, nConfMax, fVerbose );
+    else
+        pNtkRes = Abc_NtkDarLcorr( pNtk, nFramesP, nConfMax, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Sequential sweeping has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: lcorr [-PCS num] [-nvh]\n" );
+    Abc_Print( -2, "\t         computes latch correspondence using 1-step induction\n" );
+    Abc_Print( -2, "\t-P num : number of time frames to use as the prefix [default = %d]\n", nFramesP );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfMax );
+    Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", nVarsMax );
+    Abc_Print( -2, "\t-n     : toggle using new algorithm [default = %s]\n", fNewAlgor? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSeqCleanup( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int c;
+    int fLatchConst  =   1;
+    int fLatchEqual  =   1;
+    int fSaveNames   =   1;
+    int fUseMvSweep  =   0;
+    int nFramesSymb  =   1;
+    int nFramesSatur = 512;
+    int fVerbose     =   0;
+    int fVeryVerbose =   0;
+    pNtk = Abc_FrameReadNtk(pAbc);
+
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "cenmFSvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'c':
+            fLatchConst ^= 1;
+            break;
+        case 'e':
+            fLatchEqual ^= 1;
+            break;
+        case 'n':
+            fSaveNames ^= 1;
+            break;
+        case 'm':
+            fUseMvSweep ^= 1;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFramesSymb = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFramesSymb < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFramesSatur = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFramesSatur < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for structrally hashed networks.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkLatchNum(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    // modify the current network
+    pNtkRes = Abc_NtkDarLatchSweep( pNtk, fLatchConst, fLatchEqual, fSaveNames, fUseMvSweep, nFramesSymb, nFramesSatur, fVerbose, fVeryVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Sequential cleanup has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: scleanup [-cenmFSvwh]\n" );
+    Abc_Print( -2, "\t         performs sequential cleanup of the current network\n" );
+    Abc_Print( -2, "\t         by removing nodes and latches that do not feed into POs\n" );
+    Abc_Print( -2, "\t-c     : sweep stuck-at latches detected by ternary simulation [default = %s]\n", fLatchConst? "yes": "no" );
+    Abc_Print( -2, "\t-e     : merge equal latches (same data inputs and init states) [default = %s]\n", fLatchEqual? "yes": "no" );
+    Abc_Print( -2, "\t-n     : toggle preserving latch names [default = %s]\n", fSaveNames? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle using hybrid ternary/symbolic simulation [default = %s]\n", fUseMvSweep? "yes": "no" );
+    Abc_Print( -2, "\t-F num : the number of first frames simulated symbolically [default = %d]\n", nFramesSymb );
+    Abc_Print( -2, "\t-S num : the number of frames when symbolic saturation begins [default = %d]\n", nFramesSatur );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle very verbose output [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCycle( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nFrames;
+    int fUseXval;
+    int fVerbose;
+    extern void Abc_NtkCycleInitState( Abc_Ntk_t * pNtk, int nFrames, int fUseXval, int fVerbose );
+    extern void Abc_NtkCycleInitStateSop( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
+    // set defaults
+    nFrames    = 100;
+    fUseXval   =   0;
+    fVerbose   =   0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fxvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'x':
+            fUseXval ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) && !Abc_NtkIsSopLogic(pNtk) )
+    {
+        Abc_Print( -1, "Only works for strashed networks or logic SOP networks.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkLatchNum(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    if ( fUseXval && !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "X-valued simulation only works for AIGs. Run \"strash\".\n" );
+        return 0;
+    }
+    if ( fUseXval )
+        Abc_NtkCycleInitState( pNtk, nFrames, 1, fVerbose );
+    else if ( Abc_NtkIsStrash(pNtk) )
+        Abc_NtkCycleInitState( pNtk, nFrames, 0, fVerbose );
+    else
+        Abc_NtkCycleInitStateSop( pNtk, nFrames, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cycle [-F num] [-xvh]\n" );
+    Abc_Print( -2, "\t         cycles sequential circuit for the given number of timeframes\n" );
+    Abc_Print( -2, "\t         to derive a new initial state (which may be on the envelope)\n" );
+    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-x     : use x-valued primary inputs [default = %s]\n", fUseXval? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandXsim( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nFrames;
+    int fXInputs;
+    int fXState;
+    int fVerbose;
+    extern void Abc_NtkXValueSimulate( Abc_Ntk_t * pNtk, int nFrames, int fXInputs, int fXState, int fVerbose );
+    // set defaults
+    nFrames    = 10;
+    fXInputs   =  0;
+    fXState    =  0;
+    fVerbose   =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fisvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'i':
+            fXInputs ^= 1;
+            break;
+        case 's':
+            fXState ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for strashed networks.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkLatchNum(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    Abc_NtkXValueSimulate( pNtk, nFrames, fXInputs, fXState, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: xsim [-F num] [-isvh]\n" );
+    Abc_Print( -2, "\t         performs X-valued simulation of the AIG\n" );
+    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-i     : toggle X-valued representation of inputs [default = %s]\n", fXInputs? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle X-valued representation of state [default = %s]\n", fXState? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSim( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int fNew;
+    int fComb;
+    int nFrames;
+    int nWords;
+    int TimeOut;
+    int fMiter;
+    int fVerbose;
+    char * pFileSim;
+    extern int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, int fNew, int fMiter, int fVerbose, char * pFileSim );
+    // set defaults
+    fNew       =  0;
+    fComb      =  0;
+    nFrames    = 32;
+    nWords     =  8;
+    TimeOut    = 30;
+    fMiter     =  1;
+    fVerbose   =  0;
+    pFileSim   = NULL;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FWTAnmvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nWords < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            TimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( TimeOut < 0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pFileSim = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'n':
+            fNew ^= 1;
+            break;
+        case 'm':
+            fMiter ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for strashed networks.\n" );
+        return 1;
+    }
+    if ( pFileSim != NULL && Abc_NtkLatchNum(pNtk) )
+    {
+        Abc_Print( -1, "Currently simulation with user-specified patterns works only for comb miters.\n" );
+        return 1;
+    }
+    ABC_FREE( pNtk->pSeqModel );
+    pAbc->Status = Abc_NtkDarSeqSim( pNtk, nFrames, nWords, TimeOut, fNew, fMiter, fVerbose, pFileSim );
+    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: sim [-FWT num] [-A file] [-nmvh]\n" );
+    Abc_Print( -2, "\t          performs random simulation of the sequential miter\n" );
+    Abc_Print( -2, "\t-F num  : the number of frames to simulate [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-W num  : the number of words to simulate [default = %d]\n", nWords );
+    Abc_Print( -2, "\t-T num  : approximate runtime limit in seconds [default = %d]\n", TimeOut );
+    Abc_Print( -2, "\t-A file : text file name with user's patterns [default = random simulation]\n" );
+    Abc_Print( -2, "\t          (patterns are listed, one per line, as sequences of 0s and 1s)\n" );
+    Abc_Print( -2, "\t-n      : toggle new vs. old implementation [default = %s]\n", fNew? "new": "old" );
+    Abc_Print( -2, "\t-m      : toggle miter vs. any circuit [default = %s]\n", fMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-v      : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h      : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSim3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Abc_NtkDarSeqSim3( Abc_Ntk_t * pNtk, Ssw_RarPars_t * pPars );
+    Ssw_RarPars_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
+    Vec_Ptr_t * vSeqModelVec; 
+    int c;
+    Ssw_RarSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTGadivzh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBinSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBinSize < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRestart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRestart < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRandSeed = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRandSeed < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOut < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOutGap < 0 )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fSolveAll ^= 1;
+            break;
+        case 'd':
+            pPars->fDropSatOuts ^= 1;
+            break;
+        case 'i':
+            pPars->fSetLastState ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'z':
+            pPars->fNotVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for strashed networks.\n" );
+        return 1;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "Only works for sequential networks.\n" );
+        return 1;
+    }
+    ABC_FREE( pNtk->pSeqModel );
+    pAbc->Status = Abc_NtkDarSeqSim3( pNtk, pPars );
+    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    vSeqModelVec = pNtk->vSeqModelVec;  pNtk->vSeqModelVec = NULL;
+    if ( pPars->fSetLastState && pAbc->pNtkCur->pData )
+    {
+        Abc_Obj_t * pObj;
+        Vec_Int_t * vInit = (Vec_Int_t *)pAbc->pNtkCur->pData;
+        pAbc->pNtkCur->pData = NULL;
+        Abc_NtkForEachLatch( pAbc->pNtkCur, pObj, c )
+            if ( Vec_IntEntry(vInit, c) )
+                Abc_LatchSetInit1( pObj );
+        Vec_IntFree( vInit );
+        pNtkRes = Abc_NtkRestrashZero( pAbc->pNtkCur, 0 );
+        if ( pNtkRes == NULL )
+        {
+            Abc_Print( -1, "Removing SAT outputs has failed.\n" );
+            return 1;
+        }
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+        pNtk = Abc_FrameReadNtk(pAbc);
+    }
+    if ( pPars->fSolveAll && pPars->fDropSatOuts )
+    {
+        if ( vSeqModelVec == NULL )
+            Abc_Print( 1,"The array of counter-examples is not available.\n" );
+        else if ( Vec_PtrSize(vSeqModelVec) != Abc_NtkPoNum(pNtk) )
+            Abc_Print( 1,"The array size does not match the number of outputs.\n" );
+        else
+        {
+            extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
+            Abc_NtkDropSatOutputs( pNtk, vSeqModelVec, pPars->fVerbose );
+            pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
+            if ( pNtkRes == NULL )
+            {
+                Abc_Print( -1, "Removing SAT outputs has failed.\n" );
+                return 1;
+            }
+            Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+        }
+    }
+    if ( vSeqModelVec )
+    {
+        Abc_FrameReplaceCexVec( pAbc, &vSeqModelVec );
+        pAbc->nFrames = -1;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: sim3 [-FWBRSNTG num] [-advzh]\n" );
+    Abc_Print( -2, "\t         performs random simulation of the sequential miter\n" );
+    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n",                         pPars->nFrames );
+    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n",                          pPars->nWords );
+    Abc_Print( -2, "\t-B num : the number of flops in one bin [default = %d]\n",                           pPars->nBinSize );
+    Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n",                          pPars->nRounds );
+    Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n",                    pPars->nRestart );
+    Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n",                    pPars->nRandSeed );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n",                     pPars->TimeOut );
+    Abc_Print( -2, "\t-G num : approximate runtime gap in seconds since the last CEX [default = %d]\n",    pPars->TimeOutGap );
+    Abc_Print( -2, "\t-a     : toggle solving all outputs (do not stop when one is SAT) [default = %s]\n", pPars->fSolveAll?    "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle dropping (replacing by 0) SAT outputs [default = %s]\n",             pPars->fDropSatOuts? "yes": "no" );
+    Abc_Print( -2, "\t-i     : toggle changing init state to a last rare state [default = %s]\n",          pPars->fVerbose?     "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",                      pPars->fVerbose?     "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle suppressing report about solved outputs [default = %s]\n",           pPars->fNotVerbose?  "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDarPhase( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int nFrames, nPref;
+    int fIgnore;
+    int fPrint;
+    int fUpdateCex;
+    int c, fVerbose;
+    extern Abc_Ntk_t * Abc_NtkPhaseAbstract( Abc_Ntk_t * pNtk, int nFrames, int nPref, int fIgnore, int fPrint, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nFrames     = 0;
+    nPref       = 0;
+    fIgnore     = 0;
+    fPrint      = 0;
+    fUpdateCex  = 0;
+    fVerbose    = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FPipcvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nPref = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nPref < 0 )
+                goto usage;
+            break;
+        case 'i':
+            fIgnore ^= 1;
+            break;
+        case 'p':
+            fPrint ^= 1;
+            break;
+        case 'c':
+            fUpdateCex ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for structrally hashed networks.\n" );
+        return 1;
+    }
+    if ( fUpdateCex )
+    {
+        Abc_Cex_t * pCexNew;
+        if ( pAbc->pCex == NULL )
+        {
+            Abc_Print( -1, "Counter-example is not available.\n" );
+            return 1;
+        }
+        if ( pAbc->pCex->nPis % Abc_NtkPiNum(pNtk) != 0 )
+        {
+            Abc_Print( -1, "PI count of the CEX is not a multiple of PI count of the current AIG.\n" );
+            return 1;
+        }
+        pCexNew = Abc_CexTransformPhase( pAbc->pCex, Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkLatchNum(pNtk) );
+        {
+            Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
+            Gia_Man_t * pGia = Gia_ManFromAig( pAig );
+            int iPo = Gia_ManSetFailedPoCex( pGia, pCexNew );
+            Gia_ManStop( pGia );
+            Aig_ManStop( pAig );
+            if ( iPo == -1 )
+            {
+                Abc_Print( -1, "The counter-example does not fail any of the outputs of the original AIG.\n" );
+                return 1;
+            }
+        }
+        Abc_FrameReplaceCex( pAbc, &pCexNew );
+        return 0;
+    }
+    if ( !Abc_NtkLatchNum(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    if ( fPrint )
+    {
+        Abc_NtkPhaseAbstract( pNtk, 0, nPref, fIgnore, 1, fVerbose );
+        return 0;
+    }
+    // modify the current network
+    pNtkRes = Abc_NtkPhaseAbstract( pNtk, nFrames, nPref, fIgnore, 0, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+//        Abc_Print( -1, "Phase abstraction has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: phase [-FP <num>] [-ipcvh]\n" );
+    Abc_Print( -2, "\t         performs sequential cleanup of the current network\n" );
+    Abc_Print( -2, "\t         by removing nodes and latches that do not feed into POs\n" );
+    Abc_Print( -2, "\t-F num : the number of frames to abstract [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-P num : the number of prefix frames to skip [default = %d]\n", nPref );
+    Abc_Print( -2, "\t-i     : toggle ignoring the initial state [default = %s]\n", fIgnore? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle printing statistics about generators [default = %s]\n", fPrint? "yes": "no" );
+    Abc_Print( -2, "\t-c     : update the current CEX derived for a new AIG after \"phase\"\n" );
+    Abc_Print( -2, "\t         to match the current AIG (the one before \"phase\") [default = %s]\n", fUpdateCex? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSynch( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtkRes, * pNtk1, * pNtk2, * pNtk;
+    char ** pArgvNew;
+    int nArgcNew;
+    int fDelete1, fDelete2;
+    int c;
+    int nWords;
+    int fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkDarSynch( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nWords, int fVerbose );
+    extern Abc_Ntk_t * Abc_NtkDarSynchOne( Abc_Ntk_t * pNtk, int nWords, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nWords   =  32;
+    fVerbose =   1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Wvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nWords <= 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew == 0 )
+    {
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Empty network.\n" );
+            return 1;
+        }
+        pNtkRes = Abc_NtkDarSynchOne( pNtk, nWords, fVerbose );
+    }
+    else
+    {
+        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+            return 1;
+        if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
+        {
+            if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+            if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+            Abc_Print( -1, "The network has no latches..\n" );
+            return 0;
+        }
+
+        // modify the current network
+        pNtkRes = Abc_NtkDarSynch( pNtk1, pNtk2, nWords, fVerbose );
+        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+    }
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Synchronization has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: synch [-W <num>] [-vh] <file1> <file2>\n" );
+    Abc_Print( -2, "\t         derives and applies synchronization sequence\n" );
+    Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", nWords );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tfile1  : (optional) the file with the first design\n");
+    Abc_Print( -2, "\tfile2  : (optional) the file with the second design\n\n");
+    Abc_Print( -2, "\t         If no designs are given on the command line,\n" );
+    Abc_Print( -2, "\t         assumes the current network has no initial state,\n" );
+    Abc_Print( -2, "\t         derives synchronization sequence and applies it.\n\n" );
+    Abc_Print( -2, "\t         If two designs are given on the command line\n" );
+    Abc_Print( -2, "\t         assumes both of them have no initial state,\n" );
+    Abc_Print( -2, "\t         derives sequences for both designs, synchorinizes\n" );
+    Abc_Print( -2, "\t         them, and creates SEC miter comparing two designs.\n\n" );
+    Abc_Print( -2, "\t         If only one design is given on the command line,\n" );
+    Abc_Print( -2, "\t         considers the second design to be the current network,\n" );
+    Abc_Print( -2, "\t         and derives SEC miter for them, as described above.\n" );
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandClockGate( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cgt_Par_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtkRes, * pNtk, * pNtkCare;
+    int c;
+
+    extern Abc_Ntk_t * Abc_NtkDarClockGate( Abc_Ntk_t * pNtk, Abc_Ntk_t * pCare, Cgt_Par_t * pPars );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Cgt_SetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "LNDCVKavwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nLevelMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLevelMax <= 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nCandMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCandMax <= 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nOdcMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nOdcMax <= 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nConfMax <= 0 )
+                goto usage;
+            break;
+        case 'V':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nVarsMin = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nVarsMin <= 0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFlopsMin = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFlopsMin <= 0 )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fAreaOnly ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( argc == globalUtilOptind + 1 )
+    {
+        pNtkCare = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
+        if ( pNtkCare == NULL )
+        {
+            Abc_Print( -1, "Reading care network has failed.\n" );
+            return 1;
+        }
+        // modify the current network
+        pNtkRes = Abc_NtkDarClockGate( pNtk, pNtkCare, pPars );
+        Abc_NtkDelete( pNtkCare );
+    }
+    else if ( argc == globalUtilOptind )
+    {
+        pNtkRes = Abc_NtkDarClockGate( pNtk, NULL, pPars );
+    }
+    else
+    {
+        Abc_Print( -1, "Wrong number of arguments.\n" );
+        return 0;
+    }
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Clock gating has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: clockgate [-LNDCVK <num>] [-avwh] <file>\n" );
+    Abc_Print( -2, "\t         sequential clock gating with observability don't-cares\n" );
+    Abc_Print( -2, "\t-L num : max level number of a clock gate [default = %d]\n", pPars->nLevelMax );
+    Abc_Print( -2, "\t-N num : max number of candidates for a flop [default = %d]\n", pPars->nCandMax );
+    Abc_Print( -2, "\t-D num : max number of ODC levels to consider [default = %d]\n", pPars->nOdcMax );
+    Abc_Print( -2, "\t-C num : max number of conflicts at a node [default = %d]\n", pPars->nConfMax );
+    Abc_Print( -2, "\t-V num : min number of vars to recycle SAT solver [default = %d]\n", pPars->nVarsMin );
+    Abc_Print( -2, "\t-K num : min number of flops to recycle SAT solver [default = %d]\n", pPars->nFlopsMin );
+    Abc_Print( -2, "\t-a     : toggle minimizing area-only [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle even more detailed output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tfile   : (optional) constraints for primary inputs and register outputs\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandExtWin( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtkRes, * pNtk;
+    int c;
+    int nObjId;
+    int nDist;
+    int fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkDarExtWin( Abc_Ntk_t * pNtk, int nObjId, int nDist, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nObjId   = -1;
+    nDist    =  5;
+    fVerbose =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NDvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nObjId = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nObjId <= 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nDist = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nDist <= 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for structrally hashed networks.\n" );
+        return 1;
+    }
+
+    if ( argc != globalUtilOptind )
+    {
+        Abc_Print( -1, "Not enough command-line arguments.\n" );
+        return 1;
+    }
+    // modify the current network
+    pNtkRes = Abc_NtkDarExtWin( pNtk, nObjId, nDist, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Extracting sequential window has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: extwin [-ND <num>] [-vh]\n" );
+    Abc_Print( -2, "\t         extracts sequential window from the AIG\n" );
+    Abc_Print( -2, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
+    Abc_Print( -2, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandInsWin( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtkRes, * pNtk, * pNtkCare;
+    int c;
+    int nObjId;
+    int nDist;
+    int fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkDarInsWin( Abc_Ntk_t * pNtk, Abc_Ntk_t * pWnd, int nObjId, int nDist, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nObjId   = -1;
+    nDist    =  5;
+    fVerbose =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NDvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nObjId = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nObjId <= 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nDist = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nDist <= 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Only works for structrally hashed networks.\n" );
+        return 1;
+    }
+
+    if ( argc != globalUtilOptind + 1 )
+    {
+        Abc_Print( -1, "Not enough command-line arguments.\n" );
+        return 1;
+    }
+    pNtkCare = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
+    if ( pNtkCare == NULL )
+    {
+        Abc_Print( -1, "Reading care network has failed.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtkCare) )
+    {
+        Abc_Ntk_t * pNtkTemp;
+        pNtkCare = Abc_NtkStrash( pNtkTemp = pNtkCare, 0, 1, 0 );
+        Abc_NtkDelete( pNtkTemp );
+    }
+    // modify the current network
+    pNtkRes = Abc_NtkDarInsWin( pNtk, pNtkCare, nObjId, nDist, fVerbose );
+    Abc_NtkDelete( pNtkCare );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Inserting sequential window has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: inswin [-ND <num>] [-vh] <file>\n" );
+    Abc_Print( -2, "\t         inserts sequential window into the AIG\n" );
+    Abc_Print( -2, "\t-N num : the ID of the object to use as the center [default = %d]\n", nObjId );
+    Abc_Print( -2, "\t-D num : the \"radius\" of the window [default = %d]\n", nDist );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tfile   : file with the AIG to be inserted\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPermute( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkRestrashRandom( Abc_Ntk_t * pNtk );
+    Abc_Ntk_t * pNtk = pAbc->pNtkCur, * pNtkRes = NULL;
+    char * pFlopPermFile = NULL;
+    int fInputs = 1;
+    int fOutputs = 1;
+    int fFlops = 1;
+    int fNodes = 1;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fiofnh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pFlopPermFile = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'i':
+            fInputs ^= 1;
+            break;
+        case 'o':
+            fOutputs ^= 1;
+            break;
+        case 'f':
+            fFlops ^= 1;
+            break;
+        case 'n':
+            fNodes ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( fNodes && !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "To permute nodes, the network should be structurally hashed.\n" );
+        return 1;
+    }
+    if ( fNodes )
+        pNtkRes = Abc_NtkRestrashRandom( pNtk );
+    else
+        pNtkRes = Abc_NtkDup( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command \"permute\" has failed.\n" );
+        return 1;
+    }
+    Abc_NtkPermute( pNtkRes, fInputs, fOutputs, fFlops, pFlopPermFile );
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: permute [-iofnh] [-F filename]\n" );
+    Abc_Print( -2, "\t                performs random permutation of inputs/outputs/flops\n" );
+    Abc_Print( -2, "\t-i            : toggle permuting primary inputs [default = %s]\n", fInputs? "yes": "no" );
+    Abc_Print( -2, "\t-o            : toggle permuting primary outputs [default = %s]\n", fOutputs? "yes": "no" );
+    Abc_Print( -2, "\t-f            : toggle permuting flip-flops [default = %s]\n", fFlops? "yes": "no" );
+    Abc_Print( -2, "\t-n            : toggle deriving new topological ordering of nodes [default = %s]\n", fNodes? "yes": "no" );
+    Abc_Print( -2, "\t-h            : print the command usage\n");
+    Abc_Print( -2, "\t-F <filename> : (optional) file with the flop permutation\n" );
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandUnpermute( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = pAbc->pNtkCur, * pNtkRes = NULL;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    pNtkRes = Abc_NtkDup( pNtk );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Command \"unpermute\" has failed.\n" );
+        return 1;
+    }
+    Abc_NtkUnpermute( pNtkRes );
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: unpermute [-h]\n" );
+    Abc_Print( -2, "\t        restores inputs/outputs/flops before the last permutation\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCubeEnum( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Abc_EnumerateCubeStates();
+    extern void Abc_EnumerateCubeStatesZdd();
+    int c, fZddAlgo = 0, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "zvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'z':
+            fZddAlgo ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+    if ( fZddAlgo )
+        Abc_EnumerateCubeStatesZdd();
+    else
+        Abc_EnumerateCubeStates();
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cubeenum [-vh]\n" );
+    Abc_Print( -2, "\t         enumerates reachable states of 2x2x2 cube\n" );
+    Abc_Print( -2, "\t         (http://en.wikipedia.org/wiki/Pocket_Cube)\n" );
+    Abc_Print( -2, "\t-z     : toggle using ZDD-based algorithm [default = %s]\n", fZddAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[16];
+    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
+    int fDelete1, fDelete2;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c;
+    int fSat;
+    int fVerbose;
+    int nSeconds;
+    int nPartSize;
+    int nConfLimit;
+    int nInsLimit;
+    int fPartition;
+    int fIgnoreNames;
+
+    extern void Abc_NtkCecSat( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int nInsLimit );
+    extern void Abc_NtkCecFraig( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose );
+    extern void Abc_NtkCecFraigPart( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int nPartSize, int fVerbose );
+    extern void Abc_NtkCecFraigPartAuto( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nSeconds, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fSat     =  0;
+    fVerbose =  0;
+    nSeconds = 20;
+    nPartSize  = 0;
+    nConfLimit = 10000;
+    nInsLimit  = 0;
+    fPartition = 0;
+    fIgnoreNames = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "TCIPpsnvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nSeconds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nSeconds < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLimit < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nInsLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nInsLimit < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nPartSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nPartSize < 0 )
+                goto usage;
+            break;
+        case 'p':
+            fPartition ^= 1;
+            break;
+        case 's':
+            fSat ^= 1;
+            break;
+        case 'n':
+            fIgnoreNames ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk && pNtk->vPhases != NULL )
+    {
+        Abc_Print( -1, "Cannot compare networks with phases defined.\n" );
+        return 1;
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+        return 1;
+
+    if ( fIgnoreNames )
+    {
+        if ( !fDelete1 )
+        {
+            pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
+            fDelete1 = 1;
+        }
+        if ( !fDelete2 )
+        {
+            pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
+            fDelete2 = 1;
+        }
+        Abc_NtkShortNames( pNtk1 );
+        Abc_NtkShortNames( pNtk2 );
+    }
+
+    // perform equivalence checking
+    if ( fPartition )
+        Abc_NtkCecFraigPartAuto( pNtk1, pNtk2, nSeconds, fVerbose );
+    else if ( nPartSize )
+        Abc_NtkCecFraigPart( pNtk1, pNtk2, nSeconds, nPartSize, fVerbose );
+    else if ( fSat )
+        Abc_NtkCecSat( pNtk1, pNtk2, nConfLimit, nInsLimit );
+    else
+        Abc_NtkCecFraig( pNtk1, pNtk2, nSeconds, fVerbose );
+
+    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+    return 0;
+
+usage:
+    if ( nPartSize == 0 )
+        strcpy( Buffer, "unused" );
+    else
+        sprintf(Buffer, "%d", nPartSize );
+    Abc_Print( -2, "usage: cec [-T num] [-C num] [-I num] [-P num] [-psnvh] <file1> <file2>\n" );
+    Abc_Print( -2, "\t         performs combinational equivalence checking\n" );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
+    Abc_Print( -2, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
+    Abc_Print( -2, "\t-P num : partition size for multi-output networks [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-p     : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle \"SAT only\" and \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
+    Abc_Print( -2, "\t-n     : toggle ignoring names when matching CIs/COs [default = %s]\n", fIgnoreNames? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
+    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
+    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
+    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDCec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
+    int fDelete1, fDelete2;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c;
+    int fSat;
+    int fVerbose;
+    int nSeconds;
+    int nConfLimit;
+    int nInsLimit;
+    int fPartition;
+    int fMiter;
+
+    extern int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose );
+    extern int Abc_NtkDarCec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int fPartition, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fSat     =  0;
+    fVerbose =  0;
+    nSeconds = 20;
+    nConfLimit = 10000;
+    nInsLimit  = 0;
+    fPartition = 0;
+    fMiter     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "TCIpmsvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nSeconds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nSeconds < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLimit < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nInsLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nInsLimit < 0 )
+                goto usage;
+            break;
+        case 'p':
+            fPartition ^= 1;
+            break;
+        case 'm':
+            fMiter ^= 1;
+            break;
+        case 's':
+            fSat ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( fMiter )
+    {
+        if ( pNtk == NULL )
+        {
+            Abc_Print( -1, "Empty network.\n" );
+            return 1;
+        }
+        if ( Abc_NtkIsStrash(pNtk) )
+        {
+            pNtk1 = pNtk;
+            fDelete1 = 0;
+        }
+        else
+        {
+            pNtk1 = Abc_NtkStrash( pNtk, 0, 1, 0 );
+            fDelete1 = 1;
+        }
+        pNtk2 = NULL;
+        fDelete2 = 0;
+    }
+    else
+    {
+        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+            return 1;
+    }
+
+    if ( (pNtk1 && Abc_NtkLatchNum(pNtk1)) || (pNtk2 && Abc_NtkLatchNum(pNtk2)) )
+    {
+        if ( pNtk1 && fDelete1 ) Abc_NtkDelete( pNtk1 );
+        if ( pNtk2 && fDelete2 ) Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "Currently this command only works for networks without latches. Run \"comb\".\n" );
+        return 1;
+    }
+
+    // perform equivalence checking
+    if ( fSat && fMiter )
+        Abc_NtkDSat( pNtk1, nConfLimit, nInsLimit, 0, 0, 0, 0, 0, 0, fVerbose );
+    else
+        Abc_NtkDarCec( pNtk1, pNtk2, nConfLimit, fPartition, fVerbose );
+
+    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dcec [-T num] [-C num] [-I num] [-mpsvh] <file1> <file2>\n" );
+    Abc_Print( -2, "\t         performs combinational equivalence checking\n" );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nSeconds );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
+    Abc_Print( -2, "\t-I num : limit on the number of clause inspections [default = %d]\n", nInsLimit );
+    Abc_Print( -2, "\t-m     : toggle working on two networks or a miter [default = %s]\n", fMiter? "miter": "two networks" );
+    Abc_Print( -2, "\t-p     : toggle automatic partitioning [default = %s]\n", fPartition? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle \"SAT only\" (miter) or \"FRAIG + SAT\" [default = %s]\n", fSat? "SAT only": "FRAIG + SAT" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
+    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
+    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
+    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDSec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Fra_Sec_t SecPar, * pSecPar = &SecPar;
+    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
+    int fDelete1, fDelete2;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c;
+    int fIgnoreNames;
+
+    extern void Fra_SecSetDefaultParams( Fra_Sec_t * p );
+    extern int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Fra_Sec_t * p );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Fra_SecSetDefaultParams( pSecPar );
+    pSecPar->TimeLimit = 0;
+    fIgnoreNames = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FTarmfnwvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nFramesMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'a':
+            pSecPar->fPhaseAbstract ^= 1;
+            break;
+        case 'r':
+            pSecPar->fRetimeFirst ^= 1;
+            break;
+        case 'm':
+            pSecPar->fRetimeRegs ^= 1;
+            break;
+        case 'f':
+            pSecPar->fFraiging ^= 1;
+            break;
+        case 'n':
+            fIgnoreNames ^= 1;
+            break;
+        case 'w':
+            pSecPar->fVeryVerbose ^= 1;
+            break;
+        case 'v':
+            pSecPar->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+        return 1;
+    if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
+    {
+        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+        Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
+        return 0;
+    }
+
+    if ( fIgnoreNames )
+    {
+        if ( !fDelete1 )
+        {
+            pNtk1 = Abc_NtkStrash( pNtk1, 0, 1, 0 );
+            fDelete1 = 1;
+        }
+        if ( !fDelete2 )
+        {
+            pNtk2 = Abc_NtkStrash( pNtk2, 0, 1, 0 );
+            fDelete2 = 1;
+        }
+        Abc_NtkShortNames( pNtk1 );
+        Abc_NtkShortNames( pNtk2 );
+    }
+
+    // perform verification
+    Abc_NtkDarSec( pNtk1, pNtk2, pSecPar );
+
+    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsec [-F num] [-T num] [-armfnwvh] <file1> <file2>\n" );
+    Abc_Print( -2, "\t         performs inductive sequential equivalence checking\n" );
+    Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
+    Abc_Print( -2, "\t-T num : the approximate runtime limit (in seconds) [default = %d]\n", pSecPar->TimeLimit );
+    Abc_Print( -2, "\t-a     : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
+    Abc_Print( -2, "\t-n     : toggle ignoring names when matching PIs/POs [default = %s]\n", fIgnoreNames? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
+    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
+    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
+    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDProve( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Fra_Sec_t SecPar, * pSecPar = &SecPar;
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    char * pLogFileName = NULL;
+    int nBmcFramesMax = 20;
+    int nBmcConfMax = 2000;
+
+    extern void Fra_SecSetDefaultParams( Fra_Sec_t * p );
+    extern int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar, int nBmcFramesMax, int nBmcConfMax );
+    // set defaults
+    Fra_SecSetDefaultParams( pSecPar );
+//    pSecPar->TimeLimit = 300;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "cbAEFCGDVBRTLarmfijkoupwvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'c':
+            pSecPar->fTryComb ^= 1;
+            break;
+        case 'b':
+            pSecPar->fTryBmc ^= 1;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nBmcFramesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nBmcFramesMax < 0 )
+                goto usage;
+            break;
+        case 'E':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-E\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nBmcConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nBmcConfMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nFramesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nFramesMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nBTLimitGlobal = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nBTLimitGlobal < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nBTLimitInter = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nBTLimitInter < 0 )
+                goto usage;
+            break;
+        case 'V':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nBddVarsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nBddVarsMax < 0 )
+                goto usage;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nBddMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nBddMax < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nBddIterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nBddIterMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pSecPar->nPdrTimeout = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pSecPar->nPdrTimeout < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'a':
+            pSecPar->fPhaseAbstract ^= 1;
+            break;
+        case 'r':
+            pSecPar->fRetimeFirst ^= 1;
+            break;
+        case 'm':
+            pSecPar->fRetimeRegs ^= 1;
+            break;
+        case 'f':
+            pSecPar->fFraiging ^= 1;
+            break;
+        case 'i':
+            pSecPar->fInduction ^= 1;
+            break;
+        case 'j':
+            pSecPar->fInterpolation ^= 1;
+            break;
+        case 'k':
+            pSecPar->fInterSeparate ^= 1;
+            break;
+        case 'o':
+            pSecPar->fReorderImage ^= 1;
+            break;
+        case 'u':
+            pSecPar->fReadUnsolved ^= 1;
+            break;
+        case 'p':
+            pSecPar->fUsePdr ^= 1;
+            break;
+        case 'w':
+            pSecPar->fVeryVerbose ^= 1;
+            break;
+        case 'v':
+            pSecPar->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
+        return 0;
+    }
+
+    // perform verification
+    pAbc->Status = Abc_NtkDarProve( pNtk, pSecPar, nBmcFramesMax, nBmcConfMax );
+    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "dprove" );
+
+    // read back the resulting unsolved reduced sequential miter
+    if ( pSecPar->fReadUnsolved && pSecPar->nSMnumber >= 0 )
+    {
+        char FileName[100];
+        sprintf(FileName, "sm%02d.aig", pSecPar->nSMnumber );
+        pNtk = Io_Read( FileName, Io_ReadFileType(FileName), 1, 0 );
+        if ( pNtk == NULL )
+            Abc_Print( -1, "Cannot read back unsolved reduced sequential miter \"%s\",\n", FileName );
+        else
+            Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dprove [-AEFCGDVBRT num] [-L file] [-cbarmfijoupvwh]\n" );
+    Abc_Print( -2, "\t         performs SEC on the sequential miter\n" );
+    Abc_Print( -2, "\t-A num : the limit on the depth of BMC [default = %d]\n", nBmcFramesMax );
+    Abc_Print( -2, "\t-E num : the conflict limit during BMC [default = %d]\n", nBmcConfMax );
+    Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pSecPar->nFramesMax );
+    Abc_Print( -2, "\t-C num : the conflict limit at a node during induction [default = %d]\n", pSecPar->nBTLimit );
+    Abc_Print( -2, "\t-G num : the global conflict limit during induction [default = %d]\n", pSecPar->nBTLimitGlobal );
+    Abc_Print( -2, "\t-D num : the conflict limit during interpolation [default = %d]\n", pSecPar->nBTLimitInter );
+    Abc_Print( -2, "\t-V num : the flop count limit for BDD-based reachablity [default = %d]\n", pSecPar->nBddVarsMax );
+    Abc_Print( -2, "\t-B num : the BDD size limit in BDD-based reachablity [default = %d]\n", pSecPar->nBddMax );
+    Abc_Print( -2, "\t-R num : the max number of reachability iterations [default = %d]\n", pSecPar->nBddIterMax );
+    Abc_Print( -2, "\t-T num : the timeout for property directed reachability [default = %d]\n", pSecPar->nPdrTimeout );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-c     : toggles using CEC before attempting SEC [default = %s]\n", pSecPar->fTryComb? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggles using BMC before attempting SEC [default = %s]\n", pSecPar->fTryBmc? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggles the use of phase abstraction [default = %s]\n", pSecPar->fPhaseAbstract? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggles forward retiming at the beginning [default = %s]\n", pSecPar->fRetimeFirst? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggles min-register retiming [default = %s]\n", pSecPar->fRetimeRegs? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggles the internal use of fraiging [default = %s]\n", pSecPar->fFraiging? "yes": "no" );
+    Abc_Print( -2, "\t-i     : toggles the use of induction [default = %s]\n", pSecPar->fInduction? "yes": "no" );
+    Abc_Print( -2, "\t-j     : toggles the use of interpolation [default = %s]\n", pSecPar->fInterpolation? "yes": "no" );
+    Abc_Print( -2, "\t-k     : toggles applying interpolation to each output [default = %s]\n", pSecPar->fInterSeparate? "yes": "no" );
+    Abc_Print( -2, "\t-o     : toggles using BDD variable reordering during image computation [default = %s]\n", pSecPar->fReorderImage? "yes": "no" );
+    Abc_Print( -2, "\t-u     : toggles reading back unsolved reduced sequential miter [default = %s]\n", pSecPar->fReadUnsolved? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggles trying property directed reachability in the end [default = %s]\n", pSecPar->fUsePdr? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", pSecPar->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggles additional verbose output [default = %s]\n", pSecPar->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\tCommand \"dprove\" can also be used for sequential synthesis (dprove -brjopu)\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbSec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
+    int fDelete1, fDelete2;
+    char ** pArgvNew;
+    int nArgcNew;
+    int fMiter, nFrames, fVerbose, c;
+
+    extern int Abc_NtkDarAbSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nFrames, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fMiter   = 1;
+    nFrames  = 2;
+    fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'm':
+            fMiter ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( fMiter )
+    {
+//        pNtk = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
+        if ( argc == globalUtilOptind + 1 )
+        {
+            Abc_Print( -1, "The miter cannot be given on the command line. Use \"read\".\n" );
+            return 0;
+        }
+        if ( !Abc_NtkIsStrash(pNtk) )
+        {
+            Abc_Print( -1, "The miter should be structurally hashed. Use \"st\"\n" );
+            return 0;
+        }
+        if ( Abc_NtkDarAbSec( pNtk, NULL, nFrames, fVerbose ) == 1 )
+            pAbc->Status = 1;
+        else
+            pAbc->Status = -1;
+    }
+    else
+    {
+        pArgvNew = argv + globalUtilOptind;
+        nArgcNew = argc - globalUtilOptind;
+        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+            return 1;
+        if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
+        {
+            if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+            if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+            Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
+            return 0;
+        }
+        // perform verification
+        if ( Abc_NtkDarAbSec( pNtk1, pNtk2, nFrames, fVerbose ) == 1 )
+            pAbc->Status = 1;
+        else
+            pAbc->Status = -1;
+        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: absec [-F num] [-mv] <file1> <file2>\n" );
+    Abc_Print( -2, "\t         performs SEC by applying CEC to several timeframes\n" );
+    Abc_Print( -2, "\t-F num : the total number of timeframes to use [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-m     : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
+    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
+    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
+    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSimSec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Ssw_Pars_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2;
+    int fDelete1, fDelete2;
+    char ** pArgvNew;
+    int nArgcNew, c;
+    int fMiter;
+
+    extern int Abc_NtkDarSimSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Ssw_Pars_t * pPars );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fMiter = 1;
+    Ssw_ManSetDefaultParams( pPars );
+    pPars->fPartSigCorr = 1;
+    pPars->fVerbose     = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FDcymvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesK = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesK < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nIsleDist = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIsleDist < 0 )
+                goto usage;
+            break;
+        case 'm':
+            fMiter ^= 1;
+            break;
+        case 'c':
+            pPars->fPartSigCorr ^= 1;
+            break;
+        case 'y':
+            pPars->fDumpSRInit ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( fMiter )
+    {
+//        Abc_Ntk_t * pNtkA, * pNtkB;
+        if ( !Abc_NtkIsStrash(pNtk) )
+        {
+            Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
+            return 0;
+        }
+        Abc_NtkDarSimSec( pNtk, NULL, pPars );
+/*
+        pNtkA = Abc_NtkDup( pNtk );
+        pNtkB = Abc_NtkDup( pNtk );
+        Abc_NtkDarSimSec( pNtkA, pNtkB, pPars );
+        Abc_NtkDelete( pNtkA );
+        Abc_NtkDelete( pNtkB );
+*/
+    }
+    else
+    {
+        pArgvNew = argv + globalUtilOptind;
+        nArgcNew = argc - globalUtilOptind;
+        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+            return 1;
+        if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
+        {
+            if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+            if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+            Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
+            return 0;
+        }
+        // perform verification
+        Abc_NtkDarSimSec( pNtk1, pNtk2, pPars );
+        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: simsec [-FD num] [-mcyv] <file1> <file2>\n" );
+    Abc_Print( -2, "\t         performs SEC using structural similarity\n" );
+    Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", pPars->nFramesK );
+    Abc_Print( -2, "\t-D num : the distance for extending islands [default = %d]\n", pPars->nIsleDist );
+    Abc_Print( -2, "\t-m     : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
+    Abc_Print( -2, "\t-c     : uses partial vs. full signal correspondence [default = %s]\n", pPars->fPartSigCorr? "partial": "full" );
+    Abc_Print( -2, "\t-y     : dumps speculatively reduced miter of the classes [default = %s]\n", pPars->fDumpSRInit? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
+    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
+    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
+    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandMatch( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtk1, * pNtk2, * pNtkRes;
+    int fDelete1, fDelete2;
+    char ** pArgvNew;
+    int nArgcNew, c;
+    int fMiter;
+    int nDist;
+    int fVerbose;
+
+    extern Abc_Ntk_t * Abc_NtkDarMatch( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nDist, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fMiter = 0;
+    nDist = 0;
+    fVerbose = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Dmvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nDist = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nDist < 0 )
+                goto usage;
+            break;
+        case 'm':
+            fMiter ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( fMiter )
+    {
+//        Abc_Ntk_t * pNtkA, * pNtkB;
+        if ( !Abc_NtkIsStrash(pNtk) )
+        {
+            Abc_Print( -1, "This command works only for structrally hashed networks. Run \"st\".\n" );
+            return 0;
+        }
+        pNtkRes = Abc_NtkDarMatch( pNtk, NULL, nDist, fVerbose );
+/*
+        pNtkA = Abc_NtkDup( pNtk );
+        pNtkB = Abc_NtkDup( pNtk );
+        Abc_NtkDarSimSec( pNtkA, pNtkB, pPars );
+        Abc_NtkDelete( pNtkA );
+        Abc_NtkDelete( pNtkB );
+*/
+    }
+    else
+    {
+        pArgvNew = argv + globalUtilOptind;
+        nArgcNew = argc - globalUtilOptind;
+        if ( !Abc_NtkPrepareTwoNtks( stdout, pNtk, pArgvNew, nArgcNew, &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+            return 1;
+        if ( Abc_NtkLatchNum(pNtk1) == 0 || Abc_NtkLatchNum(pNtk2) == 0 )
+        {
+            if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+            if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+            Abc_Print( -1, "The network has no latches. Used combinational command \"cec\".\n" );
+            return 0;
+        }
+        // perform verification
+        pNtkRes = Abc_NtkDarMatch( pNtk1, pNtk2, nDist, fVerbose );
+        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+    }
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Matching has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: match [-D num] [-mv] <file1> <file2>\n" );
+    Abc_Print( -2, "\t         detects structural similarity using simulation\n" );
+    Abc_Print( -2, "\t         replaces the current network by the miter of differences\n" );
+    Abc_Print( -2, "\t-D num : the distance for extending differences [default = %d]\n", nDist );
+    Abc_Print( -2, "\t-m     : toggles miter vs. two networks [default = %s]\n", fMiter? "miter": "two networks" );
+    Abc_Print( -2, "\t-v     : toggles verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\tfile1  : (optional) the file with the first network\n");
+    Abc_Print( -2, "\tfile2  : (optional) the file with the second network\n");
+    Abc_Print( -2, "\t         if no files are given, uses the current network and its spec\n");
+    Abc_Print( -2, "\t         if one file is given, uses the current network and the file\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSat( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int RetValue;
+    int fVerbose;
+    int nConfLimit;
+    int nInsLimit;
+    abctime clk;
+    // set defaults
+    fVerbose   = 0;
+    nConfLimit = 0;
+    nInsLimit  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CIvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLimit < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nInsLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nInsLimit < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkLatchNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
+        return 0;
+    }
+
+    clk = Abc_Clock();
+    if ( Abc_NtkIsStrash(pNtk) )
+    {
+        RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, fVerbose, NULL, NULL );
+    }
+    else
+    {
+        assert( Abc_NtkIsLogic(pNtk) );
+        Abc_NtkToBdd( pNtk );
+        RetValue = Abc_NtkMiterSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, fVerbose, NULL, NULL );
+    }
+
+    // verify that the pattern is correct
+    if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
+    {
+        //int i;
+        //Abc_Obj_t * pObj;
+        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
+        if ( pSimInfo[0] != 1 )
+            Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
+        ABC_FREE( pSimInfo );
+        /*
+        // print model
+        Abc_NtkForEachPi( pNtk, pObj, i )
+        {
+            Abc_Print( -1, "%d", (int)(pNtk->pModel[i] > 0) );
+            if ( i == 70 )
+                break;
+        }
+        Abc_Print( -1, "\n" );
+        */
+    }
+    pAbc->Status = RetValue;
+    if ( RetValue == -1 )
+        Abc_Print( 1, "UNDECIDED      " );
+    else if ( RetValue == 0 )
+        Abc_Print( 1, "SATISFIABLE    " );
+    else
+        Abc_Print( 1, "UNSATISFIABLE  " );
+    //Abc_Print( -1, "\n" );
+    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: sat [-C num] [-I num] [-vh]\n" );
+    Abc_Print( -2, "\t         solves the combinational miter using SAT solver MiniSat-1.14\n" );
+    Abc_Print( -2, "\t         derives CNF from the current network and leave it unchanged\n" );
+    Abc_Print( -2, "\t         (there is also a newer SAT solving command \"dsat\")\n" );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
+    Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int RetValue;
+    int fAlignPol;
+    int fAndOuts;
+    int fNewSolver;
+    int fVerbose;
+    int nConfLimit;
+    int nLearnedStart;
+    int nLearnedDelta;
+    int nLearnedPerce;
+    int nInsLimit;
+    abctime clk;
+
+    extern int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int nLearnedStart, int nLearnedDelta, int nLearnedPerce, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose );
+    // set defaults
+    fAlignPol  = 0;
+    fAndOuts   = 0;
+    fNewSolver = 0;
+    fVerbose   = 0;
+    nConfLimit = 0;
+    nInsLimit  = 0;
+    nLearnedStart = 0;
+    nLearnedDelta = 0;
+    nLearnedPerce = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CILDEpanvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLimit < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nInsLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nInsLimit < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLearnedStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLearnedStart < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLearnedDelta = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLearnedDelta < 0 )
+                goto usage;
+            break;
+        case 'E':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-E\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLearnedPerce = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLearnedPerce < 0 )
+                goto usage;
+            break;
+        case 'p':
+            fAlignPol ^= 1;
+            break;
+        case 'a':
+            fAndOuts ^= 1;
+            break;
+        case 'n':
+            fNewSolver ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( argc == globalUtilOptind + 1 )
+    {
+        extern int Cnf_DataSolveFromFile( char * pFileName, int nConfLimit, int fVerbose );
+        // get the input file name
+        char * pFileName = argv[globalUtilOptind];
+        FILE * pFile = fopen( pFileName, "rb" );
+        if ( pFile == NULL )
+        {
+            printf( "Cannot open file \"%s\" for writing.\n", pFileName );
+            return 0;
+        }
+        fclose( pFile );
+        Cnf_DataSolveFromFile( pFileName, nConfLimit, fVerbose );
+        return 0;
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkLatchNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
+        return 0;
+    }
+
+    if ( Abc_NtkPoNum(pNtk) != 1 )
+    {
+        Abc_Print( -1, "Currently expects a single-output miter.\n" );
+        return 0;
+    }
+
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    clk = Abc_Clock();
+    RetValue = Abc_NtkDSat( pNtk, (ABC_INT64_T)nConfLimit, (ABC_INT64_T)nInsLimit, nLearnedStart, nLearnedDelta, nLearnedPerce, fAlignPol, fAndOuts, fNewSolver, fVerbose );
+    // verify that the pattern is correct
+    if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
+    {
+        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
+        if ( pSimInfo[0] != 1 )
+            Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
+        ABC_FREE( pSimInfo );
+        pAbc->pCex = Abc_CexCreate( 0, Abc_NtkPiNum(pNtk), pNtk->pModel, 0, 0, 0 );
+    }
+    pAbc->Status = RetValue;
+    if ( RetValue == -1 )
+        Abc_Print( 1, "UNDECIDED      " );
+    else if ( RetValue == 0 )
+        Abc_Print( 1, "SATISFIABLE    " );
+    else
+        Abc_Print( 1, "UNSATISFIABLE  " );
+    //Abc_Print( -1, "\n" );
+    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dsat [-CILDE num] [-panvh]\n" );
+    Abc_Print( -2, "\t         solves the combinational miter using SAT solver MiniSat-1.14\n" );
+    Abc_Print( -2, "\t         derives CNF from the current network and leaves it unchanged\n" );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n",    nConfLimit );
+    Abc_Print( -2, "\t-I num : limit on the number of inspections [default = %d]\n", nInsLimit );
+    Abc_Print( -2, "\t-L num : starting value for learned clause removal [default = %d]\n", nLearnedStart );
+    Abc_Print( -2, "\t-D num : delta value for learned clause removal [default = %d]\n", nLearnedDelta );
+    Abc_Print( -2, "\t-E num : ratio percentage for learned clause removal [default = %d]\n", nLearnedPerce );
+    Abc_Print( -2, "\t-p     : align polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle ANDing/ORing of miter outputs [default = %s]\n", fAndOuts? "ANDing": "ORing" );
+    Abc_Print( -2, "\t-n     : toggle using new solver [default = %s]\n", fNewSolver? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int RetValue;
+    int c;
+    int nAlgo;
+    int nPartSize;
+    int nConfPart;
+    int nConfTotal;
+    int fAlignPol;
+    int fSynthesize;
+    int fVerbose;
+    abctime clk;
+
+    extern int Abc_NtkPartitionedSat( Abc_Ntk_t * pNtk, int nAlgo, int nPartSize, int nConfPart, int nConfTotal, int fAlignPol, int fSynthesize, int fVerbose );
+    // set defaults
+    nAlgo       =        0;
+    nPartSize   =    10000;
+    nConfPart   =        0;
+    nConfTotal  =  1000000;
+    fAlignPol   =        1;
+    fSynthesize =        0;
+    fVerbose    =        1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "APCpsvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nAlgo = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nAlgo < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nPartSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nPartSize < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfTotal = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfTotal < 0 )
+                goto usage;
+            break;
+        case 'p':
+            fAlignPol ^= 1;
+            break;
+        case 's':
+            fSynthesize ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkLatchNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+
+    clk = Abc_Clock();
+    RetValue = Abc_NtkPartitionedSat( pNtk, nAlgo, nPartSize, nConfPart, nConfTotal, fAlignPol, fSynthesize, fVerbose );
+    // verify that the pattern is correct
+    if ( RetValue == 0 && Abc_NtkPoNum(pNtk) == 1 )
+    {
+        //int i;
+        //Abc_Obj_t * pObj;
+        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtk->pModel );
+        if ( pSimInfo[0] != 1 )
+            Abc_Print( 1, "ERROR in Abc_NtkMiterSat(): Generated counter example is invalid.\n" );
+        ABC_FREE( pSimInfo );
+        /*
+        // print model
+        Abc_NtkForEachPi( pNtk, pObj, i )
+        {
+            Abc_Print( -1, "%d", (int)(pNtk->pModel[i] > 0) );
+            if ( i == 70 )
+                break;
+        }
+        Abc_Print( -1, "\n" );
+        */
+    }
+
+    if ( RetValue == -1 )
+        Abc_Print( 1, "UNDECIDED      " );
+    else if ( RetValue == 0 )
+        Abc_Print( 1, "SATISFIABLE    " );
+    else
+        Abc_Print( 1, "UNSATISFIABLE  " );
+    //Abc_Print( -1, "\n" );
+    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: psat [-APC num] [-psvh]\n" );
+    Abc_Print( -2, "\t         solves the combinational miter using partitioning\n" );
+    Abc_Print( -2, "\t         (derives CNF from the current network and leave it unchanged)\n" );
+    Abc_Print( -2, "\t         for multi-output miters, tries to prove that the AND of POs is always 0\n" );
+    Abc_Print( -2, "\t         (if POs should be ORed instead of ANDed, use command \"orpos\")\n" );
+    Abc_Print( -2, "\t-A num : partitioning algorithm [default = %d]\n", nAlgo );
+    Abc_Print( -2, "\t         0 : no partitioning\n" );
+    Abc_Print( -2, "\t         1 : partitioning by level\n" );
+    Abc_Print( -2, "\t         2 : DFS post-order\n" );
+    Abc_Print( -2, "\t         3 : DFS pre-order\n" );
+    Abc_Print( -2, "\t         4 : bit-slicing\n" );
+    Abc_Print( -2, "\t         partitions are ordered by level (high level first)\n" );
+    Abc_Print( -2, "\t-P num : limit on the partition size [default = %d]\n", nPartSize );
+    Abc_Print( -2, "\t-C num : limit on the number of conflicts [default = %d]\n", nConfTotal );
+    Abc_Print( -2, "\t-p     : align polarity of SAT variables [default = %s]\n", fAlignPol? "yes": "no" );
+    Abc_Print( -2, "\t-s     : apply logic synthesis to each partition [default = %s]\n", fSynthesize? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkTemp;
+    Prove_Params_t Params, * pParams = &Params;
+    int c, RetValue;
+    abctime clk;
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    Prove_ParamsSetDefault( pParams );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NCFGLIrfbvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nItersMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nItersMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nMiteringLimitStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nMiteringLimitStart < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nFraigingLimitStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nFraigingLimitStart < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nFraigingLimitMulti = (float)atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nFraigingLimitMulti < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nMiteringLimitLast = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nMiteringLimitLast < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pParams->nTotalInspectLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pParams->nTotalInspectLimit < 0 )
+                goto usage;
+            break;
+        case 'r':
+            pParams->fUseRewriting ^= 1;
+            break;
+        case 'f':
+            pParams->fUseFraiging ^= 1;
+            break;
+        case 'b':
+            pParams->fUseBdds ^= 1;
+            break;
+        case 'v':
+            pParams->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkLatchNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Currently can only solve the miter for combinational circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkCoNum(pNtk) != 1 )
+    {
+        Abc_Print( -1, "Currently can only solve the miter with one output.\n" );
+        return 0;
+    }
+    clk = Abc_Clock();
+
+    if ( Abc_NtkIsStrash(pNtk) )
+        pNtkTemp = Abc_NtkDup( pNtk );
+    else
+        pNtkTemp = Abc_NtkStrash( pNtk, 0, 0, 0 );
+
+    RetValue = Abc_NtkMiterProve( &pNtkTemp, pParams );
+
+    // verify that the pattern is correct
+    if ( RetValue == 0 )
+    {
+        int * pSimInfo = Abc_NtkVerifySimulatePattern( pNtk, pNtkTemp->pModel );
+        if ( pSimInfo[0] != 1 )
+            Abc_Print( 1, "ERROR in Abc_NtkMiterProve(): Generated counter-example is invalid.\n" );
+        ABC_FREE( pSimInfo );
+    }
+    pAbc->Status = RetValue;
+    if ( RetValue == -1 )
+        Abc_Print( 1, "UNDECIDED      " );
+    else if ( RetValue == 0 )
+        Abc_Print( 1, "SATISFIABLE    " );
+    else
+        Abc_Print( 1, "UNSATISFIABLE  " );
+    //Abc_Print( -1, "\n" );
+
+    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: prove [-NCFGLI num] [-rfbvh]\n" );
+    Abc_Print( -2, "\t         solves combinational miter by rewriting, FRAIGing, and SAT\n" );
+    Abc_Print( -2, "\t         replaces the current network by the cone modified by rewriting\n" );
+    Abc_Print( -2, "\t         (there is also newer CEC command \"iprove\")\n" );
+    Abc_Print( -2, "\t-N num : max number of iterations [default = %d]\n", pParams->nItersMax );
+    Abc_Print( -2, "\t-C num : max starting number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitStart );
+    Abc_Print( -2, "\t-F num : max starting number of conflicts in fraiging [default = %d]\n", pParams->nFraigingLimitStart );
+    Abc_Print( -2, "\t-G num : multiplicative coefficient for fraiging [default = %d]\n", (int)pParams->nFraigingLimitMulti );
+    Abc_Print( -2, "\t-L num : max last-gasp number of conflicts in mitering [default = %d]\n", pParams->nMiteringLimitLast );
+    Abc_Print( -2, "\t-I num : max number of clause inspections in all SAT calls [default = %d]\n", (int)pParams->nTotalInspectLimit );
+    Abc_Print( -2, "\t-r     : toggle the use of rewriting [default = %s]\n", pParams->fUseRewriting? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle the use of FRAIGing [default = %s]\n", pParams->fUseFraiging? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggle the use of BDDs [default = %s]\n", pParams->fUseBdds? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pParams->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDebug( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    extern void Abc_NtkAutoDebug( Abc_Ntk_t * pNtk, int (*pFuncError) (Abc_Ntk_t *) );
+    extern int Abc_NtkRetimeDebug( Abc_Ntk_t * pNtk );
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsLogic(pNtk) )
+    {
+        Abc_Print( -1, "This command is applicable to logic networks.\n" );
+        return 1;
+    }
+
+    Abc_NtkAutoDebug( pNtk, Abc_NtkRetimeDebug );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: debug [-h]\n" );
+    Abc_Print( -2, "\t        performs automated debugging of the given procedure\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBmc( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nFrames;
+    int nSizeMax;
+    int nBTLimit;
+    int nBTLimitAll;
+    int nNodeDelta;
+    int fRewrite;
+    int fNewAlgo;
+    int nCofFanLit;
+    int fVerbose;
+    int iFrames;
+    char * pLogFileName = NULL;
+
+    extern int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int fOrDecomp, int nCofFanLit, int fVerbose, int * piFrames );
+    // set defaults
+    nFrames     =       20;
+    nSizeMax    =   100000;
+    nBTLimit    =        0;
+    nBTLimitAll =        0;
+    nNodeDelta  =     1000;
+    fRewrite    =        0;
+    fNewAlgo    =        1;
+    nCofFanLit  =        0;
+    fVerbose    =        0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FNCGDLrvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nSizeMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nBTLimitAll = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nBTLimitAll < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nNodeDelta = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nNodeDelta < 0 )
+                goto usage;
+            break;
+/*
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCofFanLit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCofFanLit < 0 )
+                goto usage;
+            break;
+*/
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'r':
+            fRewrite ^= 1;
+            break;
+        case 'a':
+            fNewAlgo ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "Does not work for combinational networks.\n" );
+        return 0;
+    }
+    pAbc->Status = Abc_NtkDarBmc( pNtk, 0, nFrames, nSizeMax, nNodeDelta, 0, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, 0, nCofFanLit, fVerbose, &iFrames );
+    pAbc->nFrames = iFrames;
+    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc" );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: bmc [-FNC num] [-L file] [-rcvh]\n" );
+    Abc_Print( -2, "\t         performs bounded model checking with static unrolling\n" );
+    Abc_Print( -2, "\t-F num : the number of time frames [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-N num : the max number of nodes in the frames [default = %d]\n", nSizeMax );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
+//    Abc_Print( -2, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-r     : toggle the use of rewriting [default = %s]\n", fRewrite? "yes": "no" );
+//    Abc_Print( -2, "\t-a     : toggle SAT sweeping and SAT solving [default = %s]\n", fNewAlgo? "SAT solving": "SAT sweeping" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBmc2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    int nStart;
+    int nFrames;
+    int nSizeMax;
+    int nBTLimit;
+    int nBTLimitAll;
+    int nNodeDelta;
+    int nTimeOut;
+    int fRewrite;
+    int fNewAlgo;
+    int fOrDecomp;
+    int fVerbose;
+    int iFrames;
+    char * pLogFileName = NULL;
+
+    extern int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int nNodeDelta, int nTimeOut, int nBTLimit, int nBTLimitAll, int fRewrite, int fNewAlgo, int fOrDecomp, int nCofFanLit, int fVerbose, int * piFrames );
+
+    // set defaults
+    nStart      =        0;
+    nFrames     =        0;
+    nSizeMax    =   200000;
+    nBTLimit    =        0;
+    nBTLimitAll =        0;
+    nNodeDelta  =     2000;
+    nTimeOut    =        0;
+    fRewrite    =        0;
+    fNewAlgo    =        0;
+    fOrDecomp   =        0;
+    fVerbose    =        0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "SFNTCGDLruvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nStart < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nSizeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nSizeMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nTimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimeOut < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nBTLimitAll = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nBTLimitAll < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nNodeDelta = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nNodeDelta < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'r':
+            fRewrite ^= 1;
+            break;
+        case 'a':
+            fNewAlgo ^= 1;
+            break;
+        case 'u':
+            fOrDecomp ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "Does not work for combinational networks.\n" );
+        return 0;
+    }
+    pAbc->Status = Abc_NtkDarBmc( pNtk, nStart, nFrames, nSizeMax, nNodeDelta, nTimeOut, nBTLimit, nBTLimitAll, fRewrite, fNewAlgo, fOrDecomp, 0, fVerbose, &iFrames );
+    pAbc->nFrames = iFrames;
+    Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc2" );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: bmc2 [-SFTCGD num] [-L file] [-uvh]\n" );
+    Abc_Print( -2, "\t         performs bounded model checking with dynamic unrolling\n" );
+    Abc_Print( -2, "\t-S num : the starting time frame [default = %d]\n", nStart );
+    Abc_Print( -2, "\t-F num : the max number of time frames (0 = unused) [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", nTimeOut );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
+    Abc_Print( -2, "\t-G num : the max number of conflicts globally [default = %d]\n", nBTLimitAll );
+    Abc_Print( -2, "\t-D num : the delta in the number of nodes [default = %d]\n", nNodeDelta );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-u     : toggle performing structural OR-decomposition [default = %s]\n", fOrDecomp? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBmc3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp );
+    Saig_ParBmc_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
+    Vec_Ptr_t * vSeqModelVec = NULL;
+    Vec_Int_t * vStatuses = NULL;
+    char * pLogFileName = NULL;
+    int fOrDecomp = 0;
+    int c;
+    Saig_ParBmcSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "SFTHGCDJIPQRLWaxdruvzh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nStart < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nTimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nTimeOut < 0 )
+                goto usage;
+            break;
+        case 'H':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nTimeOutOne = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nTimeOutOne < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nTimeOutGap = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nTimeOutGap < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nConfLimit < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nConfLimitJump = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nConfLimitJump < 0 )
+                goto usage;
+            break;
+        case 'J':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-J\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesJump = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesJump < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nPisAbstract = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nPisAbstract < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nLearnedStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLearnedStart < 0 )
+                goto usage;
+            break;
+        case 'Q':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-Q\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nLearnedDelta = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLearnedDelta < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nLearnedPerce = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLearnedPerce < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pPars->pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'a':
+            pPars->fSolveAll ^= 1;
+            break;
+        case 'x':
+            pPars->fStoreCex ^= 1;
+            break;
+        case 'd':
+            pPars->fDropSatOuts ^= 1;
+            break;
+        case 'u':
+            fOrDecomp ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'z':
+            pPars->fNotVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "Does not work for combinational networks.\n" );
+        return 0;
+    }
+    if ( Abc_NtkConstrNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Constraints have to be folded (use \"fold\").\n" );
+        return 0;
+    }
+    pPars->fUseBridge = pAbc->fBridgeMode;
+    pAbc->Status = Abc_NtkDarBmc3( pNtk, pPars, fOrDecomp );
+    pAbc->nFrames = pNtk->vSeqModelVec ? -1 : pPars->iFrame;
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "bmc3" );
+    vSeqModelVec = pNtk->vSeqModelVec;  pNtk->vSeqModelVec = NULL;
+    if ( pPars->fSolveAll && pPars->fDropSatOuts )
+    {
+        if ( vSeqModelVec == NULL )
+            Abc_Print( 1,"The array of counter-examples is not available.\n" );
+        else if ( Vec_PtrSize(vSeqModelVec) != Abc_NtkPoNum(pNtk) )
+            Abc_Print( 1,"The array size does not match the number of outputs.\n" );
+        else
+        {
+            extern void Abc_NtkDropSatOutputs( Abc_Ntk_t * pNtk, Vec_Ptr_t * vCexes, int fVerbose );
+            Abc_NtkDropSatOutputs( pNtk, vSeqModelVec, pPars->fVerbose );
+            pNtkRes = Abc_NtkDarLatchSweep( pNtk, 1, 1, 1, 0, -1, -1, 0, 0 );
+            if ( pNtkRes == NULL )
+            {
+                Abc_Print( -1, "Removing SAT outputs has failed.\n" );
+                return 1;
+            }
+            Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+        }
+    }
+    vStatuses = Abc_FrameDeriveStatusArray( vSeqModelVec );
+    Abc_FrameReplacePoStatuses( pAbc, &vStatuses );        
+    if ( vSeqModelVec )
+        Abc_FrameReplaceCexVec( pAbc, &vSeqModelVec );
+    else
+        Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: bmc3 [-SFTHGCDJIPQR num] [-LW file] [-axduvzh]\n" );
+    Abc_Print( -2, "\t         performs bounded model checking with dynamic unrolling\n" );
+    Abc_Print( -2, "\t-S num : the starting time frame [default = %d]\n", pPars->nStart );
+    Abc_Print( -2, "\t-F num : the max number of time frames (0 = unused) [default = %d]\n",      pPars->nFramesMax );
+    Abc_Print( -2, "\t-T num : runtime limit, in seconds [default = %d]\n",                       pPars->nTimeOut );
+    Abc_Print( -2, "\t-H num : runtime limit per output, in miliseconds (with \"-a\") [default = %d]\n",    pPars->nTimeOutOne );
+    Abc_Print( -2, "\t-G num : runtime gap since the last CEX, in seconds [default = %d]\n",      pPars->nTimeOutGap );
+    Abc_Print( -2, "\t-C num : max conflicts at an output [default = %d]\n",                      pPars->nConfLimit );
+    Abc_Print( -2, "\t-D num : max conflicts after jumping (0 = infinity) [default = %d]\n",      pPars->nConfLimitJump );
+    Abc_Print( -2, "\t-J num : the number of timeframes to jump (0 = not used) [default = %d]\n", pPars->nFramesJump );
+    Abc_Print( -2, "\t-I num : the number of PIs to abstract [default = %d]\n",                   pPars->nPisAbstract );
+    Abc_Print( -2, "\t-P num : the max number of learned clauses to keep (0=unused) [default = %d]\n", pPars->nLearnedStart );
+    Abc_Print( -2, "\t-Q num : delta value for learned clause removal [default = %d]\n",          pPars->nLearnedDelta );
+    Abc_Print( -2, "\t-R num : percentage to keep for learned clause removal [default = %d]\n",   pPars->nLearnedPerce );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n",                               pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-W file: the log file name with per-output details [default = %s]\n",       pPars->pLogFileName ? pPars->pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-a     : solve all outputs (do not stop when one is SAT) [default = %s]\n", pPars->fSolveAll? "yes": "no" );
+    Abc_Print( -2, "\t-x     : toggle storing CEXes when solving all outputs [default = %s]\n",   pPars->fStoreCex? "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle dropping (replacing by 0) SAT outputs [default = %s]\n",    pPars->fDropSatOuts? "yes": "no" );
+    Abc_Print( -2, "\t-u     : toggle performing structural OR-decomposition [default = %s]\n",   fOrDecomp? "yes": "not" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n",                           pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle suppressing report about solved outputs [default = %s]\n",  pPars->fNotVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBmcInter( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Inter_ManParams_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    char * pLogFileName = NULL;
+
+    extern int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, Inter_ManParams_t * pPars, Abc_Ntk_t ** ppNtkRes );
+    // set defaults
+    Inter_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CFTKLIrtpomcgbqkdivh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nSecLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nSecLimit < 0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFramesK = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFramesK < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pPars->pFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'r':
+            pPars->fRewrite ^= 1;
+            break;
+        case 't':
+            pPars->fTransLoop ^= 1;
+            break;
+        case 'p':
+            pPars->fUsePudlak ^= 1;
+            break;
+        case 'o':
+            pPars->fUseOther ^= 1;
+            break;
+        case 'm':
+            pPars->fUseMiniSat ^= 1;
+            break;
+        case 'c':
+            pPars->fCheckKstep ^= 1;
+            break;
+        case 'g':
+            pPars->fUseBias ^= 1;
+            break;
+        case 'b':
+            pPars->fUseBackward ^= 1;
+            break;
+        case 'q':
+            pPars->fUseTwoFrames ^= 1;
+            break;
+        case 'k':
+            pPars->fUseSeparate ^= 1;
+            break;
+        case 'd':
+            pPars->fDropSatOuts ^= 1;
+            break;
+        case 'i':
+            pPars->fDropInvar ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -1, "Does not work for combinational networks.\n" );
+        return 0;
+    }
+    if ( Abc_NtkConstrNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Cannot run interpolation with constraints. Use \"fold\".\n" );
+        return 0;
+    }
+    if ( Abc_NtkPoNum(pNtk)-Abc_NtkConstrNum(pNtk) != 1 )
+    {
+        if ( Abc_NtkConstrNum(pNtk) > 0 )
+        {
+            Abc_Print( 1,"Cannot solve multiple-output miter with constraints.\n" );
+            return 0;
+        }
+        if ( pPars->fUseSeparate )
+        {
+            Abc_Print( 0, "Each of %d outputs will be solved separately.\n", Abc_NtkPoNum(pNtk) );
+            pAbc->Status = Abc_NtkDarBmcInter( pNtk, pPars, &pNtkRes );
+            Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+            if ( pNtkRes == NULL )
+            {
+                Abc_Print( -1, "Generating resulting network has failed.\n" );
+                return 0;
+            }
+            Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+        }
+        else
+        {
+            Abc_Ntk_t * pNtkNew = Abc_NtkDup( pNtk );
+            Abc_Print( 0, "All %d outputs will be ORed together.\n", Abc_NtkPoNum(pNtk) );
+            if ( !Abc_NtkCombinePos( pNtkNew, 0, 0 ) )
+            {
+                Abc_NtkDelete( pNtkNew );
+                Abc_Print( -1, "ORing outputs has failed.\n" );
+                return 0;
+            }
+            pAbc->Status = Abc_NtkDarBmcInter( pNtkNew, pPars, NULL );
+            if ( pAbc->Status == 0 )
+            {
+                Aig_Man_t * pMan = Abc_NtkToDar( pNtk, 0, 1 );
+                pNtkNew->pSeqModel->iPo = Saig_ManFindFailedPoCex( pMan, pNtkNew->pSeqModel );
+                Aig_ManStop( pMan );
+            }
+            Abc_FrameReplaceCex( pAbc, &pNtkNew->pSeqModel );
+            Abc_NtkDelete( pNtkNew );
+        }
+        pAbc->nFrames = -1;
+    }
+    else
+    {
+        pAbc->Status  = Abc_NtkDarBmcInter( pNtk, pPars, NULL );
+        pAbc->nFrames = pPars->iFrameMax;
+        Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    }
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "int" );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: int [-CFTK num] [-LI file] [-irtpomcgbqkdvh]\n" );
+    Abc_Print( -2, "\t         uses interpolation to prove the property\n" );
+    Abc_Print( -2, "\t-C num : the limit on conflicts for one SAT run [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-F num : the limit on number of frames to unroll [default = %d]\n", pPars->nFramesMax );
+    Abc_Print( -2, "\t-T num : the limit on runtime per output in seconds [default = %d]\n", pPars->nSecLimit );
+    Abc_Print( -2, "\t-K num : the number of steps in inductive checking [default = %d]\n", pPars->nFramesK );
+    Abc_Print( -2, "\t         (K = 1 works in all cases; K > 1 works without -t and -b)\n" );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-I file: the file name for dumping interpolant [default = \"%s\"]\n", pPars->pFileName ? pPars->pFileName : "invar.aig" );
+    Abc_Print( -2, "\t-i     : toggle dumping interpolant/invariant into a file [default = %s]\n", pPars->fDropInvar? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle rewriting of the unrolled timeframes [default = %s]\n", pPars->fRewrite? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle adding transition into the initial state [default = %s]\n", pPars->fTransLoop? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle using original Pudlak's interpolation procedure [default = %s]\n", pPars->fUsePudlak? "yes": "no" );
+    Abc_Print( -2, "\t-o     : toggle using optimized Pudlak's interpolation procedure [default = %s]\n", pPars->fUseOther? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle using MiniSat-1.14p (now, Windows-only) [default = %s]\n", pPars->fUseMiniSat? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle using inductive containment check [default = %s]\n", pPars->fCheckKstep? "yes": "no" );
+    Abc_Print( -2, "\t-g     : toggle using bias for global variables using SAT [default = %s]\n", pPars->fUseBias? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggle using backward interpolation (works with -t) [default = %s]\n", pPars->fUseBackward? "yes": "no" );
+    Abc_Print( -2, "\t-q     : toggle using property in two last timeframes [default = %s]\n", pPars->fUseTwoFrames? "yes": "no" );
+    Abc_Print( -2, "\t-k     : toggle solving each output separately [default = %s]\n", pPars->fUseSeparate? "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle dropping (replacing by 0) SAT outputs (with -k is used) [default = %s]\n", pPars->fDropSatOuts? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIndcut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int nFrames;
+    int nPref;
+    int nClauses;
+    int nLutSize;
+    int nLevels;
+    int nCutsMax;
+    int nBatches;
+    int fStepUp;
+    int fBmc;
+    int fRegs;
+    int fTarget;
+    int fVerbose;
+    int fVeryVerbose;
+    int c;
+    extern int Abc_NtkDarClau( Abc_Ntk_t * pNtk, int nFrames, int nPref, int nClauses, int nLutSize, int nLevels, int nCutsMax, int nBatches, int fStepUp, int fBmc, int fRegs, int fTarget, int fVerbose, int fVeryVerbose );
+    // set defaults
+    nFrames      =    1;
+    nPref        =    0;
+    nClauses     = 5000;
+    nLutSize     =    4;
+    nLevels      =    8;
+    nCutsMax     =   16;
+    nBatches     =    1;
+    fStepUp      =    0;
+    fBmc         =    1;
+    fRegs        =    1;
+    fTarget      =    1;
+    fVerbose     =    0;
+    fVeryVerbose =    0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FPCMLNBsbrtvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nPref = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nPref < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nClauses = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nClauses < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLevels = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLevels < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nBatches = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nBatches < 0 )
+                goto usage;
+            break;
+        case 's':
+            fStepUp ^= 1;
+            break;
+        case 'b':
+            fBmc ^= 1;
+            break;
+        case 'r':
+            fRegs ^= 1;
+            break;
+        case 't':
+            fTarget ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( nLutSize > 12 )
+    {
+        Abc_Print( -1, "The cut size should be not exceed 12.\n" );
+        return 0;
+    }
+    Abc_NtkDarClau( pNtk, nFrames, nPref, nClauses, nLutSize, nLevels, nCutsMax, nBatches, fStepUp, fBmc, fRegs, fTarget, fVerbose, fVeryVerbose );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: indcut [-FPCMLNB num] [-sbrtvh]\n" );
+    Abc_Print( -2, "\t         K-step induction strengthened with cut properties\n" );
+    Abc_Print( -2, "\t-F num : number of time frames for induction (1=simple) [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-P num : number of time frames in the prefix (0=no prefix) [default = %d]\n", nPref );
+    Abc_Print( -2, "\t-C num : the max number of clauses to use for strengthening [default = %d]\n", nClauses );
+    Abc_Print( -2, "\t-M num : the cut size (2 <= M <= 12) [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-L num : the max number of levels for cut computation [default = %d]\n", nLevels );
+    Abc_Print( -2, "\t-N num : the max number of cuts to compute at a node [default = %d]\n", nCutsMax );
+    Abc_Print( -2, "\t-B num : the max number of invariant batches to try [default = %d]\n", nBatches );
+    Abc_Print( -2, "\t-s     : toggle increment cut size in each batch [default = %s]\n", fStepUp? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggle enabling BMC check [default = %s]\n", fBmc? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle enabling register clauses [default = %s]\n", fRegs? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle proving target / computing don't-cares [default = %s]\n", fTarget? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+//    Abc_Print( -2, "\t-w     : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandEnlarge( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int nFrames;
+    int fVerbose;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkDarEnlarge( Abc_Ntk_t * pNtk, int nFrames, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nFrames      = 5;
+    fVerbose     = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 1 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+
+    // modify the current network
+    pNtkRes = Abc_NtkDarEnlarge( pNtk, nFrames, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Target enlargement has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: enlarge [-F <num>] [-vh]\n" );
+    Abc_Print( -2, "\t           performs structural K-step target enlargement\n" );
+    Abc_Print( -2, "\t-F <num> : the number of timeframes to unroll (<num> > 0) [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-v       : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTempor( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkDarTempor( Abc_Ntk_t * pNtk, int nFrames, int TimeOut, int nConfLimit, int fUseBmc, int fUseTransSigs, int fVerbose, int fVeryVerbose );
+    Abc_Ntk_t * pNtkRes, * pNtk = Abc_FrameReadNtk(pAbc);
+    int nFrames       =       0;
+    int TimeOut       =     300;
+    int nConfMax      =  100000;
+    int fUseBmc       =       1;
+    int fUseTransSigs =       0;
+    int fUpdateCex    =       0;
+    int fVerbose      =       0;
+    int fVeryVerbose  =       0;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FTCbscvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            TimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( TimeOut < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfMax < 0 )
+                goto usage;
+            break;
+        case 'b':
+            fUseBmc ^= 1;
+            break;
+        case 's':
+            fUseTransSigs ^= 1;
+            break;
+        case 'c':
+            fUpdateCex ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -2, "There is no current network.\n");
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -2, "The current network is not an AIG (run \"strash\").\n");
+        return 0;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -2, "The current network is combinational.\n");
+        return 0;
+    }
+    if ( fUpdateCex )
+    {
+        Abc_Cex_t * pCexNew;
+        if ( pAbc->pCex == NULL )
+        {
+            Abc_Print( -1, "Counter-example is not available.\n" );
+            return 1;
+        }
+        if ( pAbc->pCex->nPis % Abc_NtkPiNum(pNtk) != 0 )
+        {
+            Abc_Print( -1, "PI count of the CEX is not a multiple of PI count of the current AIG.\n" );
+            return 1;
+        }
+        pCexNew = Abc_CexTransformTempor( pAbc->pCex, Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk), Abc_NtkLatchNum(pNtk) );
+        Abc_FrameReplaceCex( pAbc, &pCexNew );
+        return 0;
+    }
+    // modify the current network
+    pNtkRes = Abc_NtkDarTempor( pNtk, nFrames, TimeOut, nConfMax, fUseBmc, fUseTransSigs, fVerbose, fVeryVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( -1, "Temporal decomposition has failed.\n" );
+        return 1;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: tempor [-FTC <num>] [-bscvwh]\n" );
+    Abc_Print( -2, "\t           performs temporal decomposition\n" );
+    Abc_Print( -2, "\t-F <num> : init logic timeframe count (0 = use leading length) [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-T <num> : runtime limit in seconds for BMC (0=unused) [default = %d]\n", TimeOut );
+    Abc_Print( -2, "\t-C <num> : max number of SAT conflicts in BMC (0=unused) [default = %d]\n", nConfMax );
+    Abc_Print( -2, "\t-b       : toggle running BMC2 on the init frames [default = %s]\n", fUseBmc? "yes": "no" );
+    Abc_Print( -2, "\t-s       : toggle using transient signals [default = %s]\n", fUseTransSigs? "yes": "no" );
+    Abc_Print( -2, "\t-c       : update the current CEX derived for a new AIG after \"tempor\"\n" );
+    Abc_Print( -2, "\t           to match the current AIG (the one before \"tempor\") [default = %s]\n", fUpdateCex? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle printing verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle printing ternary state space [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandInduction( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int nTimeOut;
+    int nFramesMax;
+    int nConfMax;
+    int fUnique;
+    int fUniqueAll;
+    int fGetCex;
+    int fVerbose;
+    int fVeryVerbose;
+    int c;
+    extern int Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nTimeOut, int nFramesMax, int nConfMax, int fUnique, int fUniqueAll, int fGetCex, int fVerbose, int fVeryVerbose );
+    // set defaults
+    nTimeOut     =     0;
+    nFramesMax   =     0;
+    nConfMax     =     0;
+    fUnique      =     0;
+    fUniqueAll   =     0;
+    fGetCex      =     0;
+    fVerbose     =     0;
+    fVeryVerbose =     0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FCTuaxvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFramesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFramesMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nTimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimeOut < 0 )
+                goto usage;
+            break;
+        case 'u':
+            fUnique ^= 1;
+            break;
+        case 'a':
+            fUniqueAll ^= 1;
+            break;
+        case 'x':
+            fGetCex ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkPoNum(pNtk) != 1 )
+    {
+        Abc_Print( -1, "Currently this command works only for single-output miter.\n" );
+        return 0;
+    }
+    if ( fUnique && fUniqueAll )
+    {
+        Abc_Print( -1, "Only one of the options, \"-u\" or \"-a\", should be selected.\n" );
+        return 0;
+    }
+
+    // modify the current network
+    pAbc->Status = Abc_NtkDarInduction( pNtk, nTimeOut, nFramesMax, nConfMax, fUnique, fUniqueAll, fGetCex, fVerbose, fVeryVerbose );
+    if ( fGetCex )
+    {
+        Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+        Abc_Print( 1,"The current CEX in ABC is set to be the CEX to induction.\n" );
+    }
+    return 0;
+usage:
+    Abc_Print( -2, "usage: ind [-FCT num] [-uaxvwh]\n" );
+    Abc_Print( -2, "\t         runs the inductive case of the K-step induction\n" );
+    Abc_Print( -2, "\t-F num : the max number of timeframes [default = %d]\n", nFramesMax );
+    Abc_Print( -2, "\t-C num : the max number of conflicts by SAT solver [default = %d]\n", nConfMax );
+    Abc_Print( -2, "\t-T num : the limit on runtime per output in seconds [default = %d]\n", nTimeOut );
+    Abc_Print( -2, "\t-u     : toggle adding uniqueness constraints on demand [default = %s]\n", fUnique? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle adding uniqueness constraints always [default = %s]\n", fUniqueAll? "yes": "no" );
+    Abc_Print( -2, "\t-x     : toggle returning CEX to induction for the top frame [default = %s]\n", fGetCex? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing additional verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandConstr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk;
+    int c;
+    int nFrames;
+    int nConfs;
+    int nProps;
+    int fRemove;
+    int fStruct;
+    int fInvert;
+    int fOldAlgo;
+    int fVerbose;
+    int nConstrs;
+    extern void Abc_NtkDarConstr( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nFrames   =      1;
+    nConfs    =   1000;
+    nProps    =   1000;
+    fRemove   =      0;
+    fStruct   =      0;
+    fInvert   =      0;
+    fOldAlgo  =      0;
+    fVerbose  =      0;
+    nConstrs  =     -1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FCPNrsiavh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfs < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nProps = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nProps < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConstrs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConstrs < 0 )
+                goto usage;
+            break;
+        case 'r':
+            fRemove ^= 1;
+            break;
+        case 's':
+            fStruct ^= 1;
+            break;
+        case 'i':
+            fInvert ^= 1;
+            break;
+        case 'a':
+            fOldAlgo ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( fRemove )
+    {
+        if ( Abc_NtkConstrNum(pNtk) == 0 )
+        {
+            Abc_Print( -1, "Constraints are not defined.\n" );
+            return 0;
+        }
+        Abc_Print( 1, "Constraints are converted to be primary outputs.\n" );
+        pNtk->nConstrs = 0;
+        return 0;
+    }
+    // consider the case of manual constraint definition
+    if ( nConstrs >= 0 )
+    {
+        if ( Abc_NtkIsComb(pNtk) )
+            Abc_Print( 0, "The network is combinational.\n" );
+        if ( Abc_NtkConstrNum(pNtk) > 0 )
+            Abc_Print( 0, "The network currently has %d constraints.\n", Abc_NtkConstrNum(pNtk) );
+        if ( nConstrs >= Abc_NtkPoNum(pNtk) )
+        {
+            Abc_Print( -1, "The number of constraints specified (%d) should be less than POs (%d).\n", nConstrs, Abc_NtkPoNum(pNtk) );
+            return 0;
+        }
+        Abc_Print( 1, "Setting the last %d POs as constraint outputs.\n", nConstrs );
+        pNtk->nConstrs = nConstrs;
+        return 0;
+    }
+    // consider the case of already defined constraints
+    if ( Abc_NtkConstrNum(pNtk) > 0 )
+    {
+        extern void Abc_NtkDarConstrProfile( Abc_Ntk_t * pNtk, int fVerbose );
+        if ( fInvert )
+        {
+            Abc_NtkInvertConstraints( pNtk );
+            if ( Abc_NtkConstrNum(pNtk) == 1 )
+                Abc_Print( 1, "The output of %d constraint is complemented.\n", Abc_NtkConstrNum(pNtk) );
+            else
+                Abc_Print( 1, "The outputs of %d constraints are complemented.\n", Abc_NtkConstrNum(pNtk) );
+        }
+        if ( fVerbose )
+            Abc_NtkDarConstrProfile( pNtk, fVerbose );
+        return 0;
+    }
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    // detect constraints using functional/structural methods
+    Abc_NtkDarConstr( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: constr [-FCPN num] [-risavh]\n" );
+    Abc_Print( -2, "\t         a toolkit for constraint manipulation\n" );
+    Abc_Print( -2, "\t         if constraints are absent, detect them functionally\n" );
+    Abc_Print( -2, "\t         if constraints are present, profiles them using random simulation\n" );
+    Abc_Print( -2, "\t-F num : the max number of timeframes to consider [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
+    Abc_Print( -2, "\t-P num : the max number of propagations in SAT solving [default = %d]\n", nProps );
+    Abc_Print( -2, "\t-N num : manually set the last <num> POs to be constraints [default = %d]\n", nConstrs );
+    Abc_Print( -2, "\t-r     : manually remove the constraints [default = %s]\n", fRemove? "yes": "no" );
+    Abc_Print( -2, "\t-i     : toggle inverting already defined constraints [default = %s]\n", fInvert? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle using structural detection methods [default = %s]\n", fStruct? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandUnfold( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int nFrames;
+    int nConfs;
+    int nProps;
+    int fStruct;
+    int fOldAlgo;
+    int fVerbose;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkDarUnfold( Abc_Ntk_t * pNtk, int nFrames, int nConfs, int nProps, int fStruct, int fOldAlgo, int fVerbose );
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    nFrames   =      1;
+    nConfs    =   1000;
+    nProps    =   1000;
+    fStruct   =      0;
+    fOldAlgo  =      0;
+    fVerbose  =      0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FCPsavh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfs < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nProps = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nProps < 0 )
+                goto usage;
+            break;
+        case 's':
+            fStruct ^= 1;
+            break;
+        case 'a':
+            fOldAlgo ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Abc_NtkIsComb(pNtk) && Abc_NtkPoNum(pNtk) > 1 )
+    {
+        Abc_Print( -1, "Combinational miter has more than one PO.\n" );
+        return 0;
+    }
+    if ( Abc_NtkIsComb(pNtk) )
+    {
+        extern Gia_Man_t * Gia_ManDupWithConstr( Gia_Man_t * p );
+        Gia_Man_t * pNew;
+        Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 0 );
+        Gia_Man_t * pGia = Gia_ManFromAigSimple( pAig );
+        Aig_ManStop( pAig );
+        pNew = Gia_ManDupWithConstr( pGia );
+        if ( pNew == NULL )
+        {
+            Abc_Print( -1, "Cannot extract constrains from the miter.\n" );
+            return 0;
+        }
+        Gia_ManStop( pGia );
+        pAig = Gia_ManToAigSimple( pNew );
+        Gia_ManStop( pNew );
+        pNtkRes = Abc_NtkFromAigPhase( pAig );
+        Aig_ManStop( pAig );
+        ABC_FREE( pNtkRes->pName );
+        pNtkRes->pName = Extra_UtilStrsav( pNtk->pName );
+        // replace the current network
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkConstrNum(pNtk) > 0 )
+    {
+        Abc_Print( -1, "Constraints are already extracted.\n" );
+        return 0;
+    }
+    if ( Abc_NtkPoNum(pNtk) > 1 && !fStruct )
+    {
+        Abc_Print( -1, "Functional constraint extraction works for single-output miters (use \"orpos\").\n" );
+        return 0;
+    }
+    // modify the current network
+    pNtkRes = Abc_NtkDarUnfold( pNtk, nFrames, nConfs, nProps, fStruct, fOldAlgo, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( 1,"Transformation has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: unfold [-FCP num] [-savh]\n" );
+    Abc_Print( -2, "\t         unfold hidden constraints as separate outputs\n" );
+    Abc_Print( -2, "\t-F num : the max number of timeframes to consider [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-C num : the max number of conflicts in SAT solving [default = %d]\n", nConfs );
+    Abc_Print( -2, "\t-P num : the max number of constraint propagations [default = %d]\n", nProps );
+    Abc_Print( -2, "\t-s     : toggle detecting structural constraints [default = %s]\n", fStruct? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle fast implication detection [default = %s]\n", !fOldAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandFold( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkRes;
+    int fCompl;
+    int fVerbose;
+    int c;
+    extern Abc_Ntk_t * Abc_NtkDarFold( Abc_Ntk_t * pNtk, int fCompl, int fVerbose );
+    pNtk = Abc_FrameReadNtk(pAbc);
+    // set defaults
+    fCompl    =   0;
+    fVerbose  =   0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "cvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'c':
+            fCompl ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "Currently only works for structurally hashed circuits.\n" );
+        return 0;
+    }
+    if ( Abc_NtkConstrNum(pNtk) == 0 )
+    {
+        Abc_Print( 0, "The network has no constraints.\n" );
+        return 0;
+    }
+    if ( Abc_NtkIsComb(pNtk) )
+        Abc_Print( 0, "The network is combinational.\n" );
+    // modify the current network
+    pNtkRes = Abc_NtkDarFold( pNtk, fCompl, fVerbose );
+    if ( pNtkRes == NULL )
+    {
+        Abc_Print( 1,"Transformation has failed.\n" );
+        return 0;
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkRes );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: fold [-cvh]\n" );
+    Abc_Print( -2, "\t         folds constraints represented as separate outputs\n" );
+    Abc_Print( -2, "\t-c     : toggle complementing constraints while folding [default = %s]\n", fCompl? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBm( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * pOut, * pErr;
+    Abc_Ntk_t *pNtk, *pNtk1, *pNtk2;
+    int fDelete1, fDelete2;
+    char ** pArgvNew;
+    int c, nArgcNew;
+    int p_equivalence = FALSE;
+    extern void bmGateWay( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int p_equivalence );
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    pOut = Abc_FrameReadOut(pAbc);
+    pErr = Abc_FrameReadErr(pAbc);
+
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Ph" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        case 'P':
+            p_equivalence = 1;
+            break;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew , &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+        return 1;
+
+    if( (unsigned)Abc_NtkPiNum(pNtk1) != (unsigned)Abc_NtkPiNum(pNtk2) || (unsigned)Abc_NtkPoNum(pNtk1) != (unsigned)Abc_NtkPoNum(pNtk2) )
+    {
+        Abc_Print( -2, "Mismatch in the number of inputs or outputs\n");
+        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+        return 1;
+    }
+
+    bmGateWay( pNtk1, pNtk2, p_equivalence );
+
+    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: bm [-P] <file1> <file2>\n" );
+    Abc_Print( -2, "\t        performs Boolean matching (P-equivalence & PP-equivalence)\n" );
+    Abc_Print( -2, "\t        for equivalent circuits, I/O matches are printed in IOmatch.txt\n" );
+    Abc_Print( -2, "\t-P    : performs P-equivalnce checking\n");
+    Abc_Print( -2, "\t        default is PP-equivalence checking (when -P is not provided)\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    Abc_Print( -2, "\tfile1 : the file with the first network\n");
+    Abc_Print( -2, "\tfile2 : the file with the second network\n");
+
+    Abc_Print( -2, "\t        \n" );
+    Abc_Print( -2, "\t        This command was contributed by Hadi Katebi from U Michigan.\n" );
+    Abc_Print( -2, "\t        The paper describing the method: H. Katebi and I. L. Markov.\n" );
+    Abc_Print( -2, "\t        \"Large-scale Boolean matching\". Proc. DATE 2010. \n" );
+    Abc_Print( -2, "\t        http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
+//    Abc_Print( -2, "\t        \n" );
+
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBm2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{   
+    FILE * pOut, * pErr;
+    Abc_Ntk_t *pNtk, *pNtk1, *pNtk2;
+    int fDelete1, fDelete2; 
+    Abc_Obj_t * pObj;
+    char ** pArgvNew;
+    int c, nArgcNew, i; 
+
+    extern void saucyGateWay( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo, FILE * gFile, int fBooleanMatching,
+                              int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree);
+
+    pNtk = Abc_FrameReadNtk(pAbc);
+    pOut = Abc_FrameReadOut(pAbc);
+    pErr = Abc_FrameReadErr(pAbc);  
+    
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;        
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+    
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( !Abc_NtkPrepareTwoNtks( pErr, pNtk, pArgvNew, nArgcNew , &pNtk1, &pNtk2, &fDelete1, &fDelete2 ) )
+        return 1;
+        
+    if( (unsigned)Abc_NtkPiNum(pNtk1) != (unsigned)Abc_NtkPiNum(pNtk2) || 
+        (unsigned)Abc_NtkPoNum(pNtk1) != (unsigned)Abc_NtkPoNum(pNtk2) )
+    {
+        Abc_Print( -2, "Mismatch in the number of inputs or outputs\n");
+        Abc_Print( -2, "*** Networks are NOT equivalent ***\n");
+        if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+        if ( fDelete2 ) Abc_NtkDelete( pNtk2 );
+        return 1;
+    }
+    
+    Abc_NtkPermute(pNtk2, 1, 1, 0, NULL );
+    Abc_NtkShortNames(pNtk2);
+
+    Abc_NtkForEachCi( pNtk1, pObj, i ) {
+        char * newName = Abc_ObjNamePrefix( pObj, "N1:" );
+        Nm_ManDeleteIdName( pNtk1->pManName, pObj->Id);
+        Abc_ObjAssignName( pObj, newName, NULL );
+    }
+    Abc_NtkForEachCo( pNtk1, pObj, i ) {
+        char * newName = Abc_ObjNamePrefix( pObj, "N1:" );
+        Nm_ManDeleteIdName( pNtk1->pManName, pObj->Id);
+        Abc_ObjAssignName( pObj, newName, NULL );
+    }
+
+    Abc_NtkForEachCi( pNtk2, pObj, i ) {
+        char * newName = Abc_ObjNamePrefix( pObj, "N2:" );
+        Nm_ManDeleteIdName( pNtk2->pManName, pObj->Id);
+        Abc_ObjAssignName( pObj, newName, NULL );
+    }
+    Abc_NtkForEachCo( pNtk2, pObj, i ) {
+        char * newName = Abc_ObjNamePrefix( pObj, "N2:" );
+        Nm_ManDeleteIdName( pNtk2->pManName, pObj->Id);
+        Abc_ObjAssignName( pObj, newName, NULL );
+    }
+
+    Abc_NtkAppend( pNtk1, pNtk2, 1 );
+    saucyGateWay( pNtk1, NULL, NULL, 1, 0, 0, 0, 0, 0);
+
+    if ( fDelete1 ) Abc_NtkDelete( pNtk1 );
+    if ( fDelete2 ) Abc_NtkDelete( pNtk2 );     
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: bm2  <file1> <file2>\n" );
+    Abc_Print( -2, "\t        performs Boolean matching (PP-equivalence)\n" );
+    Abc_Print( -2, "\t        for equivalent circuits, permutation that maps one circuit\n" );
+    Abc_Print( -2, "\t        to another is printed to standard output (PIs and POs of the\n" );
+    Abc_Print( -2, "\t        first network have prefix \"N1:\", while PIs and POs of the\n" ); 
+    Abc_Print( -2, "\t        second network have prefix \"N2:\")\n" ); 
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    Abc_Print( -2, "\tfile1 : the file with the first network\n");
+    Abc_Print( -2, "\tfile2 : the file with the second network\n");
+
+    Abc_Print( -2, "\t        \n" );
+    Abc_Print( -2, "\t        This command was contributed by Hadi Katebi from U Michigan.\n" );
+    Abc_Print( -2, "\t        The paper describing the method: H. Katebi, K. Sakallah and\n");
+    Abc_Print( -2, "\t        I. L. Markov.\n" );
+    Abc_Print( -2, "\t        \"Generalized Boolean Symmetries Through Nested Partition\n");
+    Abc_Print( -2, "\t        Refinement\". Proc. ICCAD 2013. \n" );
+    //Abc_Print( -2, "\t        http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
+//    Abc_Print( -2, "\t        \n" );
+
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandSaucy( Abc_Frame_t * pAbc, int argc, char ** argv )
+{   
+    Abc_Ntk_t *pNtk;
+    char * outputName = NULL;
+    FILE * gFile = NULL;
+    int fOutputsOneAtTime = 0;
+    int fFixOutputs = 0;
+    int fFixInputs = 0;
+    int fLookForSwaps = 0;
+    int fQuiet = 0;
+    int fPrintTree = 0;
+    int c;
+
+    extern void saucyGateWay( Abc_Ntk_t * pNtk, Abc_Obj_t * pNodePo, FILE * gFile, int fBooleanMatching,
+                              int fLookForSwaps, int fFixOutputs, int fFixInputs, int fQuiet, int fPrintTree);
+
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "OFiosqvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'O':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-O\" should be followed by an output name or the keyword all.\n" );
+                goto usage;
+            }
+            outputName = argv[globalUtilOptind];
+            if ( !strcmp(argv[globalUtilOptind], "all") )
+                fOutputsOneAtTime ^= 1;
+            globalUtilOptind++;         
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a file name.\n" );
+                goto usage;
+            }           
+            if ( (gFile = fopen( argv[globalUtilOptind], "w" )) == NULL )
+            {
+                Abc_Print( -1, "Cannot create output file \"%s\". ", argv[globalUtilOptind] );              
+                return 1;
+            }
+            globalUtilOptind++;         
+            break;
+        case 'i':
+            fFixOutputs ^= 1;
+            break;
+        case 'o':
+            fFixInputs ^= 1;
+            break;
+        case 's':
+            fLookForSwaps ^= 1;
+            break;
+        case 'q':
+            fQuiet ^= 1;
+            break;
+        case 'v':
+            fPrintTree ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }    
+    
+    pNtk = Abc_FrameReadNtk(pAbc);  
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command works only for AIGs (run \"strash\").\n" );
+        return 1;
+    }
+
+    pNtk = Abc_NtkDup( pNtk );
+    Abc_NtkOrderObjsByName( pNtk, 1 );
+
+    if (fOutputsOneAtTime) {
+        int i;
+        Abc_Obj_t * pNodePo;
+        FILE * hadi = fopen("hadi.txt", "w");
+        Abc_NtkForEachPo( pNtk, pNodePo, i ) {
+            printf("Ouput %s\n\n", Abc_ObjName(pNodePo));
+            saucyGateWay( pNtk, pNodePo, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
+            printf("----------------------------------------\n");           
+        }
+        fclose(hadi);
+    } else if (outputName != NULL) {
+        int i;
+        Abc_Obj_t * pNodePo;        
+        Abc_NtkForEachPo( pNtk, pNodePo, i ) {
+            if (!strcmp(Abc_ObjName(pNodePo), outputName)) {
+                saucyGateWay( pNtk, pNodePo, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
+                Abc_NtkDelete( pNtk );
+                return 0;
+            }   
+        }
+        Abc_Print( -1, "Output not found\n" );
+        return 1;       
+    } else
+        saucyGateWay( pNtk, NULL, gFile, 0, fLookForSwaps, fFixOutputs, fFixInputs, fQuiet, fPrintTree );
+
+    if (gFile != NULL) fclose(gFile);
+    Abc_NtkDelete( pNtk );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: saucy3 [-O <name>] [-F <file>] [-iosqvh]\n\n" );
+    Abc_Print( -2, "\t            computes functional symmetries of the netowrk\n" );
+    Abc_Print( -2, "\t            prints symmetry generators to the standard output\n" );   
+    Abc_Print( -2, "\t-O <name> : (optional) compute symmetries only for output given by name\n");
+    Abc_Print( -2, "\t            only inputs in the output cone are permuted\n");  
+    Abc_Print( -2, "\t            (special case) name=all, compute symmetries for each\n" );
+    Abc_Print( -2, "\t            output, but only one output at a time\n" );
+    Abc_Print( -2, "\t            [default = compute symmetries by permuting all I/Os]\n" );
+    Abc_Print( -2, "\t-F <file> : print symmetry generators to file [default = stdout]\n");
+    Abc_Print( -2, "\t-i        : permute just the inputs (fix the outputs) [default = no]\n");
+    Abc_Print( -2, "\t-o        : permute just the outputs (fix the inputs) [default = no]\n");
+    Abc_Print( -2, "\t-s        : only look for swaps of inputs [default = no]\n");
+    Abc_Print( -2, "\t-q        : quiet (do not print symmetry generators) [default = no]\n");
+    Abc_Print( -2, "\t-v        : verbose (print the search tree) [default = no]\n");   
+    Abc_Print( -2, "\t-h        : print the command usage\n"); 
+
+    Abc_Print( -2, "\t            \n" );
+    Abc_Print( -2, "\t            This command was contributed by Hadi Katebi from U Michigan.\n" );
+    Abc_Print( -2, "\t            The paper describing the method: H. Katebi, K. Sakallah and\n");
+    Abc_Print( -2, "\t            I. L. Markov.\n" );
+    Abc_Print( -2, "\t            \"Generalized Boolean Symmetries Through Nested Partition\n");
+    Abc_Print( -2, "\t            Refinement\". Proc. ICCAD 2013. \n" );
+    //Abc_Print( -2, "\t          http://www.eecs.umich.edu/~imarkov/pubs/conf/date10-match.pdf\n" );
+    Abc_Print( -2, "\t            Saucy webpage: http://vlsicad.eecs.umich.edu/BK/SAUCY/\n" );
+
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTestCex( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk;
+    int c;
+    int nOutputs = 0;
+    int fCheckAnd = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Oah" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'O':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nOutputs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nOutputs < 0 )
+                goto usage;
+            break;
+        case 'a':
+            fCheckAnd ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pCex == NULL )
+    {
+        Abc_Print( 1, "There is no current cex.\n");
+        return 0;
+    }
+
+    if ( !fCheckAnd )
+    {
+        // check the main AIG
+        pNtk = Abc_FrameReadNtk(pAbc);
+        if ( pNtk == NULL )
+            Abc_Print( 1, "Main AIG: There is no current network.\n");
+        else if ( !Abc_NtkIsStrash(pNtk) )
+            Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
+        else if ( Abc_NtkPiNum(pNtk) != pAbc->pCex->nPis )
+            Abc_Print( 1, "Main AIG: The number of PIs (%d) is different from cex (%d).\n", Abc_NtkPiNum(pNtk), pAbc->pCex->nPis );
+        else
+        {
+            extern int Abc_NtkVerifyCex( Abc_Ntk_t * pNtk, Abc_Cex_t * p );
+            int iPoOld = pAbc->pCex->iPo;
+            pAbc->pCex->iPo = Abc_NtkVerifyCex( pNtk, pAbc->pCex );
+            if ( pAbc->pCex->iPo == -1 )
+                Abc_Print( 1, "Main AIG: The cex does not fail any outputs.\n" );
+            else if ( iPoOld != pAbc->pCex->iPo )
+                Abc_Print( 1, "Main AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
+            else
+                Abc_Print( 1, "Main AIG: The cex is correct.\n" );
+        }
+    }
+    else
+    {
+        // check the AND AIG
+        if ( pAbc->pGia == NULL )
+            Abc_Print( 1, "And  AIG: There is no current network.\n");
+        else if ( Gia_ManPiNum(pAbc->pGia) != pAbc->pCex->nPis )
+            Abc_Print( 1, "And  AIG: The number of PIs (%d) is different from cex (%d).\n", Gia_ManPiNum(pAbc->pGia), pAbc->pCex->nPis );
+        else
+        {
+            int iPoOld = pAbc->pCex->iPo;
+            pAbc->pCex->iPo = Gia_ManFindFailedPoCex( pAbc->pGia, pAbc->pCex, nOutputs );
+            if ( pAbc->pCex->iPo == -1 )
+                Abc_Print( 1, "And  AIG: The cex does not fail any outputs.\n" );
+            else if ( iPoOld != pAbc->pCex->iPo )
+                Abc_Print( 1, "And  AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
+            else
+                Abc_Print( 1, "And  AIG: The cex is correct.\n" );
+        }
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: testcex [-O num] [-ah]\n" );
+    Abc_Print( -2, "\t         tests the current cex against the current AIG or the &-AIG\n" );
+    Abc_Print( -2, "\t-O num : the number of real POs in the PO list [default = %d]\n", nOutputs );
+    Abc_Print( -2, "\t-a     : toggle checking the current AIG or the &-AIG [default = %s]\n", fCheckAnd ? "&-AIG": "current AIG" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandPdr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars );
+    Pdr_Par_t Pars, * pPars = &Pars;
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    Pdr_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "MFCRTHGaxrmsipdgvwzh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRecycle = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRecycle < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrameMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrameMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nConfLimit < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRestLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRestLimit < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nTimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nTimeOut < 0 )
+                goto usage;
+            break;
+        case 'H':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nTimeOutOne = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nTimeOutOne < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nTimeOutGap = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nTimeOutGap < 0 )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fSolveAll ^= 1;
+            break;
+        case 'x':
+            pPars->fStoreCex ^= 1;
+            break;
+        case 'r':
+            pPars->fTwoRounds ^= 1;
+            break;
+        case 'm':
+            pPars->fMonoCnf ^= 1;
+            break;
+        case 's':
+            pPars->fShortest ^= 1;
+            break;
+        case 'i':
+            pPars->fShiftStart ^= 1;
+            break;
+        case 'p':
+            pPars->fReuseProofOblig ^= 1;
+            break;
+        case 'd':
+            pPars->fDumpInv ^= 1;
+            break;
+        case 'g':
+            pPars->fSkipGeneral ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'z':
+            pPars->fNotVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -2, "There is no current network.\n");
+        return 0;
+    }
+    if ( Abc_NtkLatchNum(pNtk) == 0 )
+    {
+        Abc_Print( -2, "The current network is combinational.\n");
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -2, "The current network is not an AIG (run \"strash\").\n");
+        return 0;
+    }
+    // run the procedure
+    pPars->fUseBridge = pAbc->fBridgeMode;
+    pAbc->Status  = Abc_NtkDarPdr( pNtk, pPars );
+    pAbc->nFrames = pNtk->vSeqModelVec ? -1 : pPars->iFrame;
+    Abc_FrameReplacePoStatuses( pAbc, &pPars->vOutMap );
+    if ( pNtk->vSeqModelVec )
+        Abc_FrameReplaceCexVec( pAbc, &pNtk->vSeqModelVec );
+    else
+        Abc_FrameReplaceCex( pAbc, &pNtk->pSeqModel );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: pdr [-MFCRTHG <num>] [-axrmsipdgvwzh]\n" );
+    Abc_Print( -2, "\t         model checking using property directed reachability (aka IC3)\n" );
+    Abc_Print( -2, "\t         pioneered by Aaron Bradley (http://ecee.colorado.edu/~bradleya/ic3/)\n" );
+    Abc_Print( -2, "\t         with improvements by Niklas Een (http://een.se/niklas/)\n" );
+    Abc_Print( -2, "\t-M num : limit on unused vars to trigger SAT solver recycling [default = %d]\n",       pPars->nRecycle );
+    Abc_Print( -2, "\t-F num : limit on timeframes explored to stop computation [default = %d]\n",           pPars->nFrameMax );
+    Abc_Print( -2, "\t-C num : limit on conflicts in one SAT call (0 = no limit) [default = %d]\n",          pPars->nConfLimit );
+    Abc_Print( -2, "\t-R num : limit on proof obligations before a restart (0 = no limit) [default = %d]\n", pPars->nRestLimit );
+    Abc_Print( -2, "\t-T num : runtime limit, in seconds (0 = no limit) [default = %d]\n",                   pPars->nTimeOut );
+    Abc_Print( -2, "\t-H num : runtime limit per output, in miliseconds (with \"-a\") [default = %d]\n",     pPars->nTimeOutOne );
+    Abc_Print( -2, "\t-G num : runtime gap since the last CEX (0 = no limit) [default = %d]\n",              pPars->nTimeOutGap );
+    Abc_Print( -2, "\t-a     : toggle solving all outputs even if one of them is SAT [default = %s]\n",      pPars->fSolveAll? "yes": "no" );
+    Abc_Print( -2, "\t-x     : toggle storing CEXes when solving all outputs [default = %s]\n",              pPars->fStoreCex? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle using more effort in generalization [default = %s]\n",                 pPars->fTwoRounds? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle using monolythic CNF computation [default = %s]\n",                    pPars->fMonoCnf? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle creating only shortest counter-examples [default = %s]\n",             pPars->fShortest? "yes": "no" );
+    Abc_Print( -2, "\t-i     : toggle clause pushing from an intermediate timeframe [default = %s]\n",       pPars->fShiftStart? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle reusing proof-obligations in the last timeframe [default = %s]\n",     pPars->fReuseProofOblig? "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle dumping invariant (valid if init state is all-0) [default = %s]\n",    pPars->fDumpInv? "yes": "no" );
+    Abc_Print( -2, "\t-g     : toggle skipping expensive generalization step [default = %s]\n",              pPars->fSkipGeneral? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing optimization summary [default = %s]\n",                       pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing detailed stats default = %s]\n",                              pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle suppressing report about solved outputs [default = %s]\n",             pPars->fNotVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandReconcile( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Cex_t * Llb4_Nonlin4NormalizeCex( Aig_Man_t * pAigOrg, Aig_Man_t * pAigRpm, Abc_Cex_t * pCexRpm );
+    Abc_Cex_t * pCex;
+    Abc_Ntk_t * pNtk1 = NULL, * pNtk2 = NULL;
+    Aig_Man_t * pAig1 = NULL, * pAig2 = NULL;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    if ( argc != globalUtilOptind + 2 && argc != globalUtilOptind )
+    {
+        Abc_Print( 1,"Does not seen to have two files names as arguments.\n" );
+        return 1;
+    }
+    if ( pAbc->pCex == NULL )
+    {
+        Abc_Print( 1,"There is no current counter-example.\n" );
+        return 1;
+    }
+
+    if ( argc == globalUtilOptind + 2 )
+    {
+        // derive networks
+        pNtk1 = Io_Read( argv[globalUtilOptind], Io_ReadFileType(argv[globalUtilOptind]), 1, 0 );
+        if ( pNtk1 == NULL )
+            return 1;
+        pNtk2 = Io_Read( argv[globalUtilOptind+1], Io_ReadFileType(argv[globalUtilOptind+1]), 1, 0 );
+        if ( pNtk2 == NULL )
+        {
+            Abc_NtkDelete( pNtk1 );
+            return 1;
+        }
+        // create counter-examples
+        pAig1 = Abc_NtkToDar( pNtk1, 0, 0 );
+        pAig2 = Abc_NtkToDar( pNtk2, 0, 0 );
+    }
+    else if ( argc == globalUtilOptind )
+    {
+        if ( pAbc->pNtkCur == NULL )
+        {
+            Abc_Print( 1, "There is no AIG in the main-space.\n");
+            return 0;
+        }
+        if ( pAbc->pGia == NULL )
+        {
+            Abc_Print( 1, "There is no AIG in the &-space.\n");
+            return 0;
+        }
+        // create counter-examples
+        pAig1 = Abc_NtkToDar( pAbc->pNtkCur, 0, 0 );
+        pAig2 = Gia_ManToAigSimple( pAbc->pGia );
+    }
+    else assert( 0 );
+    pCex = Llb4_Nonlin4NormalizeCex( pAig1, pAig2, pAbc->pCex );
+    Aig_ManStop( pAig1 );
+    Aig_ManStop( pAig2 );
+    if ( pNtk2 )  Abc_NtkDelete( pNtk2 );
+    if ( pCex == NULL )
+    {
+        Abc_Print( 1,"Counter-example computation has failed.\n" );
+        if ( pNtk1 )  Abc_NtkDelete( pNtk1 );
+        return 1;
+    }
+
+    // replace the current network
+    if ( pNtk1 )
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtk1 );
+    // update the counter-example
+    pAbc->nFrames = pCex->iFrame;
+    Abc_FrameReplaceCex( pAbc, &pCex );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: reconcile [-h] <fileOrigin> <fileReparam>\n" );
+    Abc_Print( -2, "\t        reconciles current CEX with <fileOrigin>\n" );
+    Abc_Print( -2, "\t        More specifically:\n" );
+    Abc_Print( -2, "\t        (i) assumes that <fileReparam> is an AIG derived by input\n" );
+    Abc_Print( -2, "\t        reparametrization of <fileOrigin> without seq synthesis;\n" );
+    Abc_Print( -2, "\t        (ii) assumes that current CEX is valid for <fileReparam>;\n" );
+    Abc_Print( -2, "\t        (iii) derives new CEX for <fileOrigin> and sets this CEX\n" );
+    Abc_Print( -2, "\t        and <fileOrigin> to be current CEX and current network\n" );
+    Abc_Print( -2, "\t<fileOrigin>   : file name with the original AIG\n");
+    Abc_Print( -2, "\t<fileReparam>  : file name with the reparametrized AIG\n");
+    Abc_Print( -2, "\t        (if both file names are not given on the command line,\n");
+    Abc_Print( -2, "\t        original/reparam AIG has to be in the main-space/&-space)\n");
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCexSave( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pCex == NULL )
+    {
+        Abc_Print( -1, "Current CEX is not available..\n" );
+        return 1;
+    }
+    ABC_FREE( pAbc->pCex2 );
+    pAbc->pCex2 = Abc_CexDup( pAbc->pCex, -1 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cexsave [-h]\n" );
+    Abc_Print( -2, "\t        saves the current CEX into the internal storage\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCexLoad( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pCex2 == NULL )
+    {
+        Abc_Print( -1, "Saved CEX is not available.\n" );
+        return 1;
+    }
+    ABC_FREE( pAbc->pCex );
+    pAbc->pCex = Abc_CexDup( pAbc->pCex2, -1 );
+    // update status
+    pAbc->nFrames = pAbc->pCex2->iFrame;
+    pAbc->Status = 0;
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cexload [-h]\n" );
+    Abc_Print( -2, "\t        loads the current CEX from the internal storage\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCexCut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtkNew;
+    int c, iFrStart = 0;
+    int iFrStop     = ABC_INFINITY;
+    int fCombOnly   = 0;
+    int fUseOne     = 0;
+    int fAllFrames  = 0;
+    int fVerbose    = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FGcnmvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iFrStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iFrStart < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iFrStop = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iFrStop < 0 )
+                goto usage;
+            break;
+        case 'c':
+            fCombOnly ^= 1;
+            break;
+        case 'n':
+            fUseOne ^= 1;
+            break;
+        case 'm':
+            fAllFrames ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pCex == NULL )
+    {
+        Abc_Print( 1, "There is no current cex.\n");
+        return 0;
+    }
+    if ( pAbc->pNtkCur == NULL )
+    {
+        Abc_Print( 1, "There is no AIG in the &-space.\n");
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pAbc->pNtkCur) )
+    {
+        Abc_Print( 1, "Current network is not an AIG.\n");
+        return 0;
+    }
+    if ( iFrStop == ABC_INFINITY )
+        iFrStop = pAbc->pCex->iFrame;
+
+    {
+        Aig_Man_t * pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
+        Aig_Man_t * pAigNew = Bmc_AigTargetStates( pAig, pAbc->pCex, iFrStart, iFrStop, fCombOnly, fUseOne, fAllFrames, fVerbose );
+        Aig_ManStop( pAig );
+        if ( pAigNew == NULL )
+        {
+            Abc_Print( 1, "Command has failed.\n");
+            return 0;
+        }
+        pNtkNew = Abc_NtkFromAigPhase( pAigNew );
+        pNtkNew->pName = Extra_UtilStrsav( pAbc->pNtkCur->pName );
+        Aig_ManStop( pAigNew );
+        // update the network
+        Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
+    }
+/*
+    pGiaNew = Bmc_GiaTargetStates( pAbc->pGia, pAbc->pCex, iFrStart, iFrStop, fCombOnly, fUseOne, fVerbose );
+    if ( pGiaNew == NULL )
+    {
+        Abc_Print( 1, "Command has failed.\n");
+        return 0;
+    }
+    Abc_FrameUpdateGia( pAbc, pGiaNew );
+*/
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cexcut [-FG num] [-cnmvh]\n" );
+    Abc_Print( -2, "\t         creates logic for bad states using the current CEX\n" );
+    Abc_Print( -2, "\t-F num : 0-based number of the starting frame [default = %d]\n", iFrStart );
+    Abc_Print( -2, "\t-G num : 0-based number of the ending frame [default = %d]\n",   iFrStop );
+    Abc_Print( -2, "\t-c     : toggle outputting unate combinational circuit [default = %s]\n",  fCombOnly? "yes": "no" );
+    Abc_Print( -2, "\t-n     : toggle generating only one bad state [default = %s]\n", fUseOne? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle generating bad states for all frames after G [default = %s]\n", fAllFrames? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",  fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCexMerge( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Cex_t * pCexNew;
+    int c;
+    int iFrStart = 0;
+    int iFrStop  = ABC_INFINITY;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FGvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iFrStart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iFrStart < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iFrStop = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iFrStop < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pCex == NULL )
+    {
+        Abc_Print( 1, "There is no current cex.\n");
+        return 0;
+    }
+    if ( pAbc->pCex2 == NULL )
+    {
+        Abc_Print( 1, "There is no saved cex.\n");
+        return 0;
+    }
+    if ( iFrStop - iFrStart + pAbc->pCex->iPo < pAbc->pCex->iFrame )
+    {
+        Abc_Print( 1, "Current CEX does not allow to shorten the saved CEX.\n");
+        return 0;
+    }
+    pCexNew = Abc_CexMerge( pAbc->pCex2, pAbc->pCex, iFrStart, iFrStop );
+    if ( pCexNew == NULL )
+    {
+        Abc_Print( 1, "Merging CEXes has failed.\n");
+        return 0;
+    }
+    // replace the saved CEX
+    ABC_FREE( pAbc->pCex2 );
+    pAbc->pCex2 = pCexNew;
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cexmerge [-FG num] [-vh]\n" );
+    Abc_Print( -2, "\t         merges the current CEX into the saved one\n" );
+    Abc_Print( -2, "\t         and sets the resulting CEX as the saved one\n" );
+    Abc_Print( -2, "\t-F num : 0-based number of the starting frame [default = %d]\n", iFrStart );
+    Abc_Print( -2, "\t-G num : 0-based number of the ending frame [default = %d]\n",   iFrStop );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandCexMin( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk;
+    Abc_Cex_t * vCexNew = NULL;
+    int c;
+    int nConfLimit = 1000;
+    int nRounds    =    1;
+    int fVerbose   =    0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CRvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfLimit < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nRounds < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pCex == NULL )
+    {
+        Abc_Print( 1, "There is no current cex.\n");
+        return 0;
+    }
+
+    // check the main AIG
+    pNtk = Abc_FrameReadNtk(pAbc);
+    if ( pNtk == NULL )
+        Abc_Print( 1, "Main AIG: There is no current network.\n");
+    else if ( !Abc_NtkIsStrash(pNtk) )
+        Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
+    else if ( Abc_NtkPiNum(pNtk) != pAbc->pCex->nPis )
+        Abc_Print( 1, "Main AIG: The number of PIs (%d) is different from cex (%d).\n", Abc_NtkPiNum(pNtk), pAbc->pCex->nPis );
+//      else if ( Abc_NtkLatchNum(pNtk) != pAbc->pCex->nRegs )
+//          Abc_Print( 1, "Main AIG: The number of registers (%d) is different from cex (%d).\n", Abc_NtkLatchNum(pNtk), pAbc->pCex->nRegs );
+//      else if ( Abc_NtkPoNum(pNtk) <= pAbc->pCex->iPo )
+//          Abc_Print( 1, "Main AIG: The number of POs (%d) is less than the PO index in cex (%d).\n", Abc_NtkPoNum(pNtk), pAbc->pCex->iPo );
+    else
+    {
+        Aig_Man_t * pAig = Abc_NtkToDar( pNtk, 0, 1 );
+        Gia_Man_t * pGia = Gia_ManFromAigSimple( pAig );
+//        if ( !Gia_ManVerifyCex( pGia, pAbc->pCex, 0 ) )
+        int iPoOld = pAbc->pCex->iPo;
+        pAbc->pCex->iPo = Gia_ManFindFailedPoCex( pGia, pAbc->pCex, 0 );
+        Gia_ManStop( pGia );
+        if ( pAbc->pCex->iPo == -1 )
+        {
+            pAbc->pCex->iPo = iPoOld;
+            Abc_Print( -1, "Main AIG: The cex does not fail any outputs.\n" );
+            return 0;
+        }
+        else if ( iPoOld != pAbc->pCex->iPo )
+            Abc_Print( 0, "Main AIG: The cex refined PO %d instead of PO %d.\n", pAbc->pCex->iPo, iPoOld );
+        // perform minimization
+        vCexNew = Saig_ManCexMinPerform( pAig, pAbc->pCex );
+        Aig_ManStop( pAig );
+        Abc_CexFree( vCexNew );
+//        Abc_FrameReplaceCex( pAbc, &vCexNew );
+
+//        Abc_Print( 1,"Implementation of this command is not finished.\n" );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: cexmin [-CR num] [-vh]\n" );
+    Abc_Print( -2, "\t         reduces the length of the counter-example\n" );
+    Abc_Print( -2, "\t-C num : the maximum number of conflicts [default = %d]\n", nConfLimit );
+    Abc_Print( -2, "\t-R num : the number of minimization rounds [default = %d]\n", nRounds );
+    Abc_Print( -2, "\t-v     : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandDualRail( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Vec_Int_t * Abc_NtkFindDcLatches( Abc_Ntk_t * pNtk );
+    Abc_Ntk_t * pNtk, * pNtkNew = NULL;
+    Aig_Man_t * pAig, * pAigNew;
+    Vec_Int_t * vDcFlops = NULL;
+    int c;
+    int nDualPis   = 0;
+    int fDualFfs   = 0;
+    int fDualDcFfs = 0;
+    int fMiterFfs  = 0;
+    int fComplPo   = 0;
+    int fCheckZero = 0;
+    int fCheckOne  = 0;
+    int fVerbose   = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Itxfczovh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nDualPis = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nDualPis < 0 )
+                goto usage;
+            break;
+        case 't':
+            fDualFfs ^= 1;
+            break;
+        case 'x':
+            fDualDcFfs ^= 1;
+            break;
+        case 'f':
+            fMiterFfs ^= 1;
+            break;
+        case 'c':
+            fComplPo ^= 1;
+            break;
+        case 'z':
+            fCheckZero ^= 1;
+            break;
+        case 'o':
+            fCheckOne ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    // check the main AIG
+    pNtk = Abc_FrameReadNtk(pAbc);
+    if ( pNtk == NULL )
+    {
+        Abc_Print( 1, "Main AIG: There is no current network.\n");
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
+        return 0;
+    }
+
+    if ( fDualDcFfs )
+        vDcFlops = Abc_NtkFindDcLatches( pNtk );
+
+    // transform
+    pAig = Abc_NtkToDar( pNtk, 0, 1 );
+    pAigNew = Saig_ManDupDual( pAig, vDcFlops, nDualPis, fDualFfs, fMiterFfs, fComplPo, fCheckZero, fCheckOne );
+    Aig_ManStop( pAig );
+    pNtkNew = Abc_NtkFromAigPhase( pAigNew );
+    pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
+    Aig_ManStop( pAigNew );
+    Vec_IntFreeP( &vDcFlops );
+
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: dualrail [-I num] [-txfczovh]\n" );
+    Abc_Print( -2, "\t         transforms the current AIG into a dual-rail miter\n" );
+    Abc_Print( -2, "\t         expressing the property \"at least one PO has ternary value\"\n" );
+    Abc_Print( -2, "\t         (to compute an initialization sequence, use switches \"-tfc\")\n" );
+    Abc_Print( -2, "\t-I num : the number of first PIs interpreted as ternary [default = %d]\n", nDualPis );
+    Abc_Print( -2, "\t-t     : toggle ternary flop init values for all flops [default = %s]\n", fDualFfs? "yes": "const0 init values" );
+    Abc_Print( -2, "\t-x     : toggle ternary flop init values for DC-valued flops [default = %s]\n", fDualDcFfs? "yes": "const0 init values" );
+    Abc_Print( -2, "\t-f     : toggle mitering flops instead of POs [default = %s]\n", fMiterFfs? "flops": "POs" );
+    Abc_Print( -2, "\t-c     : toggle complementing the miter output [default = %s]\n", fComplPo? "yes": "no" );
+    Abc_Print( -2, "\t-z     : toggle checking PO==0 instead of PO==X [default = %s]\n", fCheckZero? "yes": "no" );
+    Abc_Print( -2, "\t-o     : toggle checking PO==1 instead of PO==X [default = %s]\n", fCheckOne? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandBlockPo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkNew = NULL;
+    Aig_Man_t * pAig;
+    int c;
+    int nCycles = 0;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCycles = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCycles < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    // check the main AIG
+    pNtk = Abc_FrameReadNtk(pAbc);
+    if ( pNtk == NULL )
+    {
+        Abc_Print( 1, "Main AIG: There is no current network.\n");
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
+        return 0;
+    }
+    if ( nCycles == 0 )
+    {
+        Abc_Print( 1, "The number of time frame is 0. The circuit is left unchanged.\n" );
+        return 0;
+    }
+
+    // transform
+    pAig = Abc_NtkToDar( pNtk, 0, 1 );
+    Saig_ManBlockPo( pAig, nCycles );
+    pNtkNew = Abc_NtkFromAigPhase( pAig );
+    Aig_ManStop( pAig );
+    // transfer the name
+    pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
+    pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: blockpo [-F num] [-fvh]\n" );
+    Abc_Print( -2, "\t         forces the miter outputs to be \"true\" in the first F frames\n" );
+    Abc_Print( -2, "\t-F num : the number of time frames [default = %d]\n", nCycles );
+    Abc_Print( -2, "\t-v     : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandIso( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk, * pNtkNew = NULL;
+    Aig_Man_t * pAig, * pTemp;
+    Vec_Ptr_t * vPosEquivs = NULL;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            Abc_Print( -2, "Unknown switch.\n");
+            goto usage;
+        }
+    }
+
+    // check the main AIG
+    pNtk = Abc_FrameReadNtk(pAbc);
+    if ( pNtk == NULL )
+    {
+        Abc_Print( 1, "Main AIG: There is no current network.\n");
+        return 0;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( 1, "Main AIG: The current network is not an AIG.\n");
+        return 0;
+    }
+    if ( Abc_NtkPoNum(pNtk) == 1 )
+    {
+        Abc_Print( 1, "Current AIG has only one PO. Transformation is not performed.\n");
+        return 0;
+    }
+
+    // transform
+    pAig = Abc_NtkToDar( pNtk, 0, 1 );
+    pTemp = Saig_ManIsoReduce( pAig, &vPosEquivs, fVerbose );
+    pNtkNew = Abc_NtkFromAigPhase( pTemp );
+    Aig_ManStop( pTemp );
+    Aig_ManStop( pAig );
+
+    // update the internal storage of PO equivalences
+    Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
+
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtkNew );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: iso [-vh]\n" );
+    Abc_Print( -2, "\t         removes POs with isomorphic sequential COI\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTraceStart( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command is applicable to AIGs.\n" );
+        return 1;
+    }
+/*
+    Abc_HManStart();
+    if ( !Abc_HManPopulate( pNtk ) )
+    {
+        Abc_Print( -1, "Failed to start the tracing database.\n" );
+        return 1;
+    }
+*/
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: trace_start [-h]\n" );
+    Abc_Print( -2, "\t        starts verification tracing\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandTraceCheck( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pNtk == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash(pNtk) )
+    {
+        Abc_Print( -1, "This command is applicable to AIGs.\n" );
+        return 1;
+    }
+/*
+    if ( !Abc_HManIsRunning(pNtk) )
+    {
+        Abc_Print( -1, "The tracing database is not available.\n" );
+        return 1;
+    }
+
+    if ( !Abc_HManVerify( 1, pNtk->Id ) )
+        Abc_Print( -1, "Verification failed.\n" );
+    Abc_HManStop();
+*/
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: trace_check [-h]\n" );
+    Abc_Print( -2, "\t        checks the current network using verification trace\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Read( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pAig;
+    FILE * pFile;
+    char ** pArgvNew;
+    char * FileName, * pTemp;
+    int c, nArgcNew;
+    int fUseMini = 0;
+    int fVerbose = 0;
+    int fSkipStrash = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "smvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fSkipStrash ^= 1;
+            break;
+        case 'm':
+            fUseMini ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "There is no file name.\n" );
+        return 1;
+    }
+
+    // get the input file name
+    FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", ".blif", ".pla", ".eqn", ".bench" )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+
+    if ( fUseMini )
+        pAig = Gia_ManReadMiniAig( FileName );
+    else
+        pAig = Gia_AigerRead( FileName, fSkipStrash, 0 );
+    Abc_FrameUpdateGia( pAbc, pAig );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &r [-smvh] <file>\n" );
+    Abc_Print( -2, "\t         reads the current AIG from the AIGER file\n" );
+    Abc_Print( -2, "\t-s     : toggles structural hashing while reading [default = %s]\n", !fSkipStrash? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggles reading MiniAIG rather than AIGER file [default = %s]\n", fUseMini? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : the file name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9ReadBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose );
+    Gia_Man_t * pAig;
+    FILE * pFile;
+    char ** pArgvNew;
+    char * FileName, * pTemp;
+    int nArgcNew;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "There is no file name.\n" );
+        return 1;
+    }
+
+    // get the input file name
+    FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".blif", NULL, NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+
+    pAig = Abc_NtkHieCecTest( FileName, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pAig );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &read_blif [-vh] <file>\n" );
+    Abc_Print( -2, "\t         a specialized reader for hierarchical BLIF files\n" );
+    Abc_Print( -2, "\t         (for general-purpose BLIFs, please use \"read_blif\")\n" );
+    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : the file name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9ReadCBlif( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, char * pModelName, int fVerbose );
+    Gia_Man_t * pAig;
+    FILE * pFile;
+    char ** pArgvNew;
+    char * FileName, * pTemp;
+    char * pModelName = NULL;
+    int nArgcNew;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Mvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pModelName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "There is no file name.\n" );
+        return 1;
+    }
+
+    // get the input file name
+    FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".cblif", NULL, NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+
+    pAig = Abc_NtkHieCecTest2( FileName, pModelName, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pAig );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &read_cblif [-M name] [-vh] <file>\n" );
+    Abc_Print( -2, "\t         reads CBLIF file and collapse it into an AIG\n" );
+    Abc_Print( -2, "\t-M name: module name to collapse [default = <root_module>]\n" );
+    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : the file name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9ReadStg( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pAig;
+    FILE * pFile;
+    char * FileName, ** pArgvNew;
+    int c, nArgcNew;
+    int kHot = 1;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Kvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            kHot = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( kHot < 1 || kHot > 5 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "There is no file name.\n" );
+        return 1;
+    }
+
+    // get the input file name
+    FileName = pArgvNew[0];
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        return 1;
+    }
+    fclose( pFile );
+
+    pAig = Gia_ManStgRead( FileName, kHot, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pAig );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &read_stg [-K <num>] [-vh] <file>\n" );
+    Abc_Print( -2, "\t         reads STG file and generates K-hot-encoded AIG\n" );
+    Abc_Print( -2, "\t-K num : the K parameter for hotness of the encoding (1 <= K <= 5) [default = %d]\n", kHot );
+    Abc_Print( -2, "\t-v     : toggles printing state codes [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : the file name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Get( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Aig_Man_t * Abc_NtkToDarChoices( Abc_Ntk_t * pNtk );
+    extern Vec_Ptr_t * Abc_NtkCollectCiNames( Abc_Ntk_t * pNtk );
+    extern Vec_Ptr_t * Abc_NtkCollectCoNames( Abc_Ntk_t * pNtk );
+    Abc_Ntk_t * pStrash;
+    Aig_Man_t * pAig;
+    Gia_Man_t * pGia, * pTemp;
+    char * pInits;
+    int c, fMapped = 0, fNames = 0, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "mnvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'm':
+            fMapped ^= 1;
+            break;
+        case 'n':
+            fNames ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pNtkCur == NULL )
+    {
+        Abc_Print( -1, "There is no current network\n" );
+        return 1;
+    }
+    if ( !Abc_NtkIsStrash( pAbc->pNtkCur ) )
+    {
+        if ( fMapped )
+        {
+            assert( Abc_NtkIsLogic(pAbc->pNtkCur) );
+            Abc_NtkToAig( pAbc->pNtkCur );
+            pGia = Abc_NtkAigToGia( pAbc->pNtkCur );
+        }
+        else
+        {
+            // derive comb GIA
+            pStrash = Abc_NtkStrash( pAbc->pNtkCur, 0, 1, 0 );
+            pAig = Abc_NtkToDar( pStrash, 0, 0 );
+            Abc_NtkDelete( pStrash );
+            pGia = Gia_ManFromAig( pAig );
+            Aig_ManStop( pAig );
+            // perform undc/zero
+            pInits = Abc_NtkCollectLatchValuesStr( pAbc->pNtkCur );
+            pGia = Gia_ManDupZeroUndc( pTemp = pGia, pInits, fVerbose );
+            Gia_ManStop( pTemp );
+            ABC_FREE( pInits );
+        }
+    }
+    else
+    {
+        if ( Abc_NtkGetChoiceNum(pAbc->pNtkCur) )
+            pAig = Abc_NtkToDarChoices( pAbc->pNtkCur );
+        else
+            pAig = Abc_NtkToDar( pAbc->pNtkCur, 0, 1 );
+        pGia = Gia_ManFromAig( pAig );
+        Aig_ManStop( pAig );
+    }
+    // replace
+    if ( fNames )
+    {
+        pGia->vNamesIn  = Abc_NtkCollectCiNames( pAbc->pNtkCur );
+        pGia->vNamesOut = Abc_NtkCollectCoNames( pAbc->pNtkCur );
+    }
+    Abc_FrameUpdateGia( pAbc, pGia );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &get [-mnvh] <file>\n" );
+    Abc_Print( -2, "\t         converts the current network into GIA and moves it to the &-space\n" );
+    Abc_Print( -2, "\t         (if the network is a sequential logic network, normalizes the flops\n" );
+    Abc_Print( -2, "\t         to have const-0 initial values, equivalent to \"undc; st; zero\")\n" );
+    Abc_Print( -2, "\t-m     : toggles preserving the current mapping [default = %s]\n", fMapped? "yes": "no" );
+    Abc_Print( -2, "\t-n     : toggles saving CI/CO names of the AIG [default = %s]\n", fNames? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggles additional verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : the file name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Put( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Abc_NtkFromDarChoices( Abc_Ntk_t * pNtkOld, Aig_Man_t * pMan );
+    Aig_Man_t * pMan;
+    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    int c, fVerbose = 0;
+    int fStatusClear = 1;
+
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 's':
+            fStatusClear ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( Gia_ManHasMapping(pAbc->pGia) )
+    {
+        extern Abc_Ntk_t * Abc_NtkFromMappedGia( Gia_Man_t * p );
+        pNtk = Abc_NtkFromMappedGia( pAbc->pGia );
+    }
+    else if ( Gia_ManHasCellMapping(pAbc->pGia) )
+    {
+        extern Abc_Ntk_t * Abc_NtkFromCellMappedGia( Gia_Man_t * p );
+        pNtk = Abc_NtkFromCellMappedGia( pAbc->pGia );
+    }
+    else if ( Gia_ManHasDangling(pAbc->pGia) == 0 )
+    {
+        pMan = Gia_ManToAig( pAbc->pGia, 0 );
+        pNtk = Abc_NtkFromAigPhase( pMan );
+        pNtk->pName = Extra_UtilStrsav(pMan->pName);
+        Aig_ManStop( pMan );
+    }
+    else
+    {
+        Abc_Ntk_t * pNtkNoCh;
+//        Abc_Print( -1, "Transforming AIG with %d choice nodes.\n", Gia_ManEquivCountClasses(pAbc->pGia) );
+        // create network without choices
+        pMan = Gia_ManToAig( pAbc->pGia, 0 );
+        pNtkNoCh = Abc_NtkFromAigPhase( pMan );
+        pNtkNoCh->pName = Extra_UtilStrsav(pMan->pName);
+        Aig_ManStop( pMan );
+        // derive network with choices
+        pMan = Gia_ManToAig( pAbc->pGia, 1 );
+        pNtk = Abc_NtkFromDarChoices( pNtkNoCh, pMan );
+        Abc_NtkDelete( pNtkNoCh );
+        Aig_ManStop( pMan );
+    }
+    // transfer PI names to pNtk
+    if ( pAbc->pGia->vNamesIn )
+    {
+        Abc_Obj_t * pObj;
+        int i;
+        Abc_NtkForEachCi( pNtk, pObj, i ) {
+            if (i < Vec_PtrSize(pAbc->pGia->vNamesIn)) {
+                Nm_ManDeleteIdName(pNtk->pManName, pObj->Id);
+                Abc_ObjAssignName( pObj, (char *)Vec_PtrEntry(pAbc->pGia->vNamesIn, i), NULL );
+            }
+        }
+    }
+    // transfer PO names to pNtk
+    if ( pAbc->pGia->vNamesOut )
+    {
+        Abc_Obj_t * pObj;
+        int i;
+        Abc_NtkForEachCo( pNtk, pObj, i ) {
+            if (i < Vec_PtrSize(pAbc->pGia->vNamesOut)) {
+                Nm_ManDeleteIdName(pNtk->pManName, pObj->Id);
+                Abc_ObjAssignName( pObj, (char *)Vec_PtrEntry(pAbc->pGia->vNamesOut, i), NULL );
+            }
+        }
+    }
+    // replace the current network
+    Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
+    if ( fStatusClear )
+        Abc_FrameClearVerifStatus( pAbc );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &put [-svh]\n" );
+    Abc_Print( -2, "\t         transfer the current network into the old ABC\n" );
+    Abc_Print( -2, "\t-s     : toggle clearning verification status [default = %s]\n", fStatusClear? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    [Compares to versions of the design and finds the best.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Gia_ManCompareWithBest( Gia_Man_t * pBest, Gia_Man_t * p, int * pnBestLuts, int * pnBestEdges, int * pnBestLevels )
+{
+    int nCurLuts, nCurEdges, nCurLevels;
+    Gia_ManLutParams( p, &nCurLuts, &nCurEdges, &nCurLevels );
+    if ( pBest == NULL ||
+         Gia_ManPiNum(pBest) != Gia_ManPiNum(p) || 
+         Gia_ManPoNum(pBest) != Gia_ManPoNum(p) || 
+         Gia_ManRegNum(pBest) != Gia_ManRegNum(p) ||
+         strcmp(Gia_ManName(pBest), Gia_ManName(p)) ||
+        (*pnBestLevels > nCurLevels) ||
+        (*pnBestLevels == nCurLevels && *pnBestLuts > nCurLuts) ||
+        (*pnBestLevels == nCurLevels && *pnBestLuts == nCurLuts && *pnBestEdges > nCurEdges) )
+    {
+        *pnBestLuts = nCurLuts;
+        *pnBestEdges = nCurEdges;
+        *pnBestLevels = nCurLevels;
+        return 1;
+    }
+    return 0;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Save( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty network.\n" );
+        return 1;
+    }
+    if ( !Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "GIA has no mapping.\n" );
+        return 1;
+    }
+    if ( !Gia_ManCompareWithBest( pAbc->pGiaBest, pAbc->pGia, &pAbc->nBestLuts, &pAbc->nBestEdges, &pAbc->nBestLevels ) )
+        return 0;
+    // save the design as best
+    Gia_ManStopP( &pAbc->pGiaBest );
+    pAbc->pGiaBest = Gia_ManDupWithAttributes( pAbc->pGia );
+    return 0; 
+
+usage:
+    Abc_Print( -2, "usage: &save [-h]\n" );
+    Abc_Print( -2, "\t        compares and possibly saves AIG with mapping\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Load( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    // restore from best
+    if ( pAbc->pGiaBest == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Load(): There is no best design saved.\n" );
+        return 1;
+    }
+    Gia_ManStopP( &pAbc->pGia );
+    pAbc->pGia = Gia_ManDupWithAttributes( pAbc->pGiaBest );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &load [-h]\n" );
+    Abc_Print( -2, "\t        loads previously saved AIG with mapping" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Write( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char * pFileName;
+    char ** pArgvNew;
+    int c, nArgcNew;
+    int fUnique = 0;
+    int fMiniAig = 0;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "umvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'u':
+            fUnique ^= 1;
+            break;
+        case 'm':
+            fMiniAig ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "There is no file name.\n" );
+        return 1;
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Write(): There is no AIG to write.\n" );
+        return 1;
+    }
+    pFileName = argv[globalUtilOptind];
+    if ( fUnique )
+    {
+        Gia_Man_t * pGia = Gia_ManIsoCanonicize( pAbc->pGia, fVerbose );
+        Gia_AigerWriteSimple( pGia, pFileName );
+        Gia_ManStop( pGia );
+    }
+    else if ( fMiniAig )
+        Gia_ManWriteMiniAig( pAbc->pGia, pFileName );
+    else
+        Gia_AigerWrite( pAbc->pGia, pFileName, 0, 0 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &w [-umvh] <file>\n" );
+    Abc_Print( -2, "\t         writes the current AIG into the AIGER file\n" );
+    Abc_Print( -2, "\t-u     : toggle writing canonical AIG structure [default = %s]\n", fUnique? "yes" : "no" );
+    Abc_Print( -2, "\t-m     : toggle writing MiniAIG rather than AIGER [default = %s]\n", fMiniAig? "yes" : "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : the file name\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Ps( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gps_Par_t Pars, * pPars = &Pars;
+    int c, fBest = 0;
+    memset( pPars, 0, sizeof(Gps_Par_t) );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Dtpcnlmasbh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 't':
+            pPars->fTents ^= 1;
+            break;
+        case 'p':
+            pPars->fSwitch ^= 1;
+            break;
+        case 'c':
+            pPars->fCut ^= 1;
+            break;
+        case 'n':
+            pPars->fNpn ^= 1;
+            break;
+        case 'l':
+            pPars->fLutProf ^= 1;
+            break;
+        case 'm':
+            pPars->fMuxXor ^= 1;
+            break;
+        case 'a':
+            pPars->fMiter ^= 1;
+            break;
+        case 's':
+            pPars->fSkipMap ^= 1;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pPars->pDumpFile = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'b':
+            fBest ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( fBest )
+    {
+        if ( pAbc->pGiaBest == NULL )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Ps(): There is no AIG.\n" );
+            return 1;
+        }
+        Gia_ManPrintStats( pAbc->pGiaBest, pPars );
+    }
+    else
+    {
+        if ( pAbc->pGia == NULL )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Ps(): There is no AIG.\n" );
+            return 1;
+        }
+        Gia_ManPrintStats( pAbc->pGia, pPars );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &ps [-tpcnlmasbh] [-D file]\n" );
+    Abc_Print( -2, "\t          prints stats of the current AIG\n" );
+    Abc_Print( -2, "\t-t      : toggle printing BMC tents [default = %s]\n",                pPars->fTents? "yes": "no" );
+    Abc_Print( -2, "\t-p      : toggle printing switching activity [default = %s]\n",       pPars->fSwitch? "yes": "no" );
+    Abc_Print( -2, "\t-c      : toggle printing the size of frontier cut [default = %s]\n", pPars->fCut? "yes": "no" );
+    Abc_Print( -2, "\t-n      : toggle printing NPN classes of functions [default = %s]\n", pPars->fNpn? "yes": "no" );
+    Abc_Print( -2, "\t-l      : toggle printing LUT size profile [default = %s]\n",         pPars->fLutProf? "yes": "no" );
+    Abc_Print( -2, "\t-m      : toggle printing MUX/XOR statistics [default = %s]\n",       pPars->fMuxXor? "yes": "no" );
+    Abc_Print( -2, "\t-a      : toggle printing miter statistics [default = %s]\n",         pPars->fMiter? "yes": "no" );
+    Abc_Print( -2, "\t-s      : skip mapping statistics even if mapped [default = %s]\n",   pPars->fSkipMap? "yes": "no" );
+    Abc_Print( -2, "\t-b      : toggle printing saved AIG statistics [default = %s]\n",     fBest? "yes": "no" );
+    Abc_Print( -2, "\t-D file : file name to dump statistics [default = none]\n" );
+    Abc_Print( -2, "\t-h      : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9PFan( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    int nNodes = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nNodes = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nNodes < 0 )
+                goto usage;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9PFan(): There is no AIG.\n" );
+        return 1;
+    }
+    Gia_ManPrintFanio( pAbc->pGia, nNodes );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &pfan [-N num] [-h]\n" );
+    Abc_Print( -2, "\t         prints fanin/fanout statistics\n" );
+    Abc_Print( -2, "\t-N num : the number of high-fanout nodes to explore [default = %d]\n", nNodes );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9PSig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    int fSetReset = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "rh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'r':
+            fSetReset ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9PSigs(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9PSigs(): Works only for sequential circuits.\n" );
+        return 1;
+    }
+    Gia_ManDetectSeqSignals( pAbc->pGia, fSetReset, 1 );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &psig [-rh]\n" );
+    Abc_Print( -2, "\t         prints enable/set/reset statistics\n" );
+    Abc_Print( -2, "\t-r     : toggle printing set/reset signals [default = %s]\n", fSetReset? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Status( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Status(): There is no AIG.\n" );
+        return 1;
+    }
+    Gia_ManPrintMiterStatus( pAbc->pGia );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &status [-h]\n" );
+    Abc_Print( -2, "\t         prints status of the miter\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9MuxProfile( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Gia_ManMuxProfiling( Gia_Man_t * p );
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9MuxProfile(): There is no AIG.\n" );
+        return 1;
+    }
+    Gia_ManMuxProfiling( pAbc->pGia );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &mux_profile [-h]\n" );
+    Abc_Print( -2, "\t         profile MUXes appearing in the design\n" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Show( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Aig_Man_t * pMan;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Show(): There is no AIG.\n" );
+        return 1;
+    }
+    pMan = Gia_ManToAigSimple( pAbc->pGia );
+    Aig_ManShow( pMan, 0, NULL );
+    Aig_ManStop( pMan );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &show [-h]\n" );
+    Abc_Print( -2, "\t        shows the current AIG using GSView\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Strash( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, Limit = 2;
+    int fAddStrash = 0;
+    int fCollapse = 0;
+    int fAddMuxes = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Lacmh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Limit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Limit < 0 )
+                goto usage;
+            break;
+        case 'a':
+            fAddStrash ^= 1;
+            break;
+        case 'c':
+            fCollapse ^= 1;
+            break;
+        case 'm':
+            fAddMuxes ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Strash(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManHasMapping(pAbc->pGia) )
+    {
+        pTemp = (Gia_Man_t *)Dsm_ManDeriveGia( pAbc->pGia, fAddMuxes );
+//        if ( !Abc_FrameReadFlag("silentmode") )
+//            printf( "Performed delay-oriented unmapping.\n" );
+    }
+    else if ( fAddMuxes )
+    {
+        if ( pAbc->pGia->pMuxes )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Strash(): The AIG already has MUXes.\n" );
+            return 1;
+        }
+        pTemp = Gia_ManDupMuxes( pAbc->pGia, Limit );
+        if ( !Abc_FrameReadFlag("silentmode") )
+            printf( "Generated AND/XOR/MUX graph.\n" );
+    }
+    else if ( fCollapse && pAbc->pGia->pAigExtra )
+    {
+        Gia_Man_t * pNew = Gia_ManDupUnnormalize( pAbc->pGia );
+        pNew->pManTime = pAbc->pGia->pManTime;
+        pTemp = Gia_ManDupCollapse( pNew, pAbc->pGia->pAigExtra, NULL );
+        pNew->pManTime = NULL;
+        Gia_ManStop( pNew );
+        if ( !Abc_FrameReadFlag("silentmode") )
+            printf( "Collapsed AIG with boxes with logic of the boxes.\n" );
+    }
+    else if ( pAbc->pGia->pMuxes )
+    {
+        pTemp = Gia_ManDupNoMuxes( pAbc->pGia );
+        if ( !Abc_FrameReadFlag("silentmode") )
+            printf( "Generated AIG from AND/XOR/MUX graph.\n" );
+    }
+    else
+    {
+        pTemp = Gia_ManRehash( pAbc->pGia, fAddStrash );
+        if ( !Abc_FrameReadFlag("silentmode") )
+            printf( "Rehashed the current AIG.\n" );
+    }
+    Gia_ManTransferTiming( pTemp, pAbc->pGia );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &st [-L num] [-acmh]\n" );
+    Abc_Print( -2, "\t         performs structural hashing\n" );
+    Abc_Print( -2, "\t-a     : toggle additional hashing [default = %s]\n", fAddStrash? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle collapsing hierarchical AIG [default = %s]\n", fCollapse? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle converting to larger gates [default = %s]\n", fAddMuxes? "yes": "no" );
+    Abc_Print( -2, "\t-L num : create MUX when sum of refs does not exceed this limit [default = %d]\n", Limit );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Topand( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, fVerbose = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Topand(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) > 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Topand(): Can only be applied to a combinational miter.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManDupTopAnd( pAbc->pGia, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &topand [-vh]\n" );
+    Abc_Print( -2, "\t        performs AND decomposition for combinational miter\n" );
+    Abc_Print( -2, "\t-v    : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Add1Hot( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, fVerbose = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Add1Hot(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManDupOneHot( pAbc->pGia );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &add1hot [-vh]\n" );
+    Abc_Print( -2, "\t        adds 1-hotness constraints as additional primary outputs\n" );
+    Abc_Print( -2, "\t-v    : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Cof( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, fVerbose = 0;
+    int iVar = 0, nLimFan = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "VLvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'V':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iVar = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iVar < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLimFan = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLimFan < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Cof(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( nLimFan )
+    {
+        Abc_Print( -1, "Cofactoring all variables whose fanout count is higher than %d.\n", nLimFan );
+        pTemp = Gia_ManDupCofAll( pAbc->pGia, nLimFan, fVerbose );
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    }
+    else if ( iVar )
+    {
+        Abc_Print( -1, "Cofactoring one variable with object ID %d.\n", iVar );
+        pTemp = Gia_ManDupCof( pAbc->pGia, iVar );
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    }
+    else
+    {
+        Abc_Print( -1, "One of the paramters, -V <num> or -L <num>, should be set on the command line.\n" );
+        goto usage;
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &cof [-VL num] [-vh]\n" );
+    Abc_Print( -2, "\t         performs cofactoring w.r.t. variable(s)\n" );
+    Abc_Print( -2, "\t-V num : the zero-based ID of one variable to cofactor [default = %d]\n", iVar );
+    Abc_Print( -2, "\t-L num : cofactor vars with fanout count higher than this [default = %d]\n", nLimFan );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Trim( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp, * pTemp2;
+    int c;
+    int OutValue = -1;
+    int fTrimCis = 1;
+    int fTrimCos = 1;
+    int fDualOut = 0;
+    int fPoFedByPi = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Viocdh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'V':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-V\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            OutValue = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( OutValue < 0 )
+                goto usage;
+            break;
+        case 'i':
+            fTrimCis ^= 1;
+            break;
+        case 'o':
+            fTrimCos ^= 1;
+            break;
+        case 'c':
+            fPoFedByPi ^= 1;
+            break;
+        case 'd':
+            fDualOut ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Trim(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManDupTrimmed( pAbc->pGia, fTrimCis, fTrimCos, fDualOut, OutValue );
+    if ( fPoFedByPi )
+    {
+        extern Gia_Man_t * Gia_ManDupTrimmed2( Gia_Man_t * p );
+        pTemp = Gia_ManDupTrimmed2( pTemp2 = pTemp );
+        Gia_ManStop( pTemp2 );
+    }
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &trim [-V num] [-iocdh]\n" );
+    Abc_Print( -2, "\t         removes PIs without fanout and PO driven by constants\n" );
+    Abc_Print( -2, "\t-V num : the value (0 or 1) of POs to remove [default = both]\n" );
+    Abc_Print( -2, "\t-i     : toggle removing PIs [default = %s]\n", fTrimCis? "yes": "no" );
+    Abc_Print( -2, "\t-o     : toggle removing POs [default = %s]\n", fTrimCos? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle additionally removing POs fed by PIs [default = %s]\n", fPoFedByPi? "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle using dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Dfs( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c;
+    int fNormal  = 0;
+    int fReverse = 0;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "nrvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'n':
+            fNormal ^= 1;
+            break;
+        case 'r':
+            fReverse ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Dfs(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( fNormal )
+    {
+        pTemp = Gia_ManDupOrderAiger( pAbc->pGia );
+        if ( fVerbose )
+            Abc_Print( -1, "AIG objects are reordered as follows: CIs, ANDs, COs.\n" );
+    }
+    else if ( fReverse )
+    {
+        pTemp = Gia_ManDupOrderDfsReverse( pAbc->pGia );
+        if ( fVerbose )
+            Abc_Print( -1, "AIG objects are reordered in the reserve DFS order.\n" );
+    }
+    else
+    {
+        pTemp = Gia_ManDupOrderDfs( pAbc->pGia );
+        if ( fVerbose )
+            Abc_Print( -1, "AIG objects are reordered in the DFS order.\n" );
+    }
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &dfs [-nrvh]\n" );
+    Abc_Print( -2, "\t        orders objects in the DFS order\n" );
+    Abc_Print( -2, "\t-n    : toggle using normalized ordering [default = %s]\n", fNormal? "yes": "no" );
+    Abc_Print( -2, "\t-r    : toggle using reverse DFS ordering [default = %s]\n", fReverse? "yes": "no" );
+    Abc_Print( -2, "\t-v    : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Sim( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_ParSim_t Pars, * pPars = &Pars;
+    char * pFileName = NULL;
+    int c;
+    Gia_ManSimSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FWNTImvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIters < 0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->RandSeed = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->RandSeed < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            if ( pFileName == NULL )
+                goto usage;
+            break;
+        case 'm':
+            pPars->fCheckMiter ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Sim(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    if ( pFileName != NULL )
+    {
+        extern void Gia_ManSimSimulatePattern( Gia_Man_t * p, char * pFileIn, char * pFileOut );
+        char pFileNameOut[1000];
+        char * pNameGeneric = Extra_FileNameGeneric(pFileName);
+        assert( strlen(pNameGeneric) < 900 );
+        sprintf( pFileNameOut, "%s_out.%s", pNameGeneric, Extra_FileNameExtension(pFileName) );
+        ABC_FREE( pNameGeneric );
+        Gia_ManSimSimulatePattern( pAbc->pGia, pFileName, pFileNameOut );
+        return 1;
+    }
+
+    pAbc->nFrames = -1;
+    if ( Gia_ManSimSimulate( pAbc->pGia, pPars ) )
+        pAbc->Status =  0;
+    else
+        pAbc->Status = -1;
+    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+//    if ( pLogFileName )
+//        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&sim" );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &sim [-FWNT num] [-mvh] -I <file>\n" );
+    Abc_Print( -2, "\t         performs random simulation of the sequential miter\n" );
+    Abc_Print( -2, "\t         (if candidate equivalences are defined, performs refinement)\n" );
+    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nIters );
+    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
+    Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n", pPars->RandSeed );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t-I file: (optional) file with input patterns (one line per frame, as many as PIs)\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Sim3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Ssw_RarSimulateGia( Gia_Man_t * p, Ssw_RarPars_t * pPars );
+    Ssw_RarPars_t Pars, * pPars = &Pars;
+    int c;
+    Ssw_RarSetDefaultParams( pPars );
+    // parse command line
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTGgvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBinSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBinSize < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRestart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRestart < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRandSeed = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRandSeed < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOut < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOutGap < 0 )
+                goto usage;
+            break;
+        case 'g':
+            pPars->fUseFfGrouping ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Sim3(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Sim3(): This command works only for sequential AIGs.\n" );
+        return 0;
+    }
+    pAbc->Status = Ssw_RarSimulateGia( pAbc->pGia, pPars );
+    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &sim3 [-FWBRNT num] [-gvh]\n" );
+    Abc_Print( -2, "\t         performs random simulation of the sequential miter\n" );
+    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n",       pPars->nFrames );
+    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n",        pPars->nWords );
+    Abc_Print( -2, "\t-B num : the number of flops in one bin [default = %d]\n",         pPars->nBinSize );
+    Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n",        pPars->nRounds );
+    Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n",  pPars->nRestart );
+    Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n",  pPars->nRandSeed );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n",   pPars->TimeOut );
+    Abc_Print( -2, "\t-g     : toggle heuristic flop grouping [default = %s]\n",    pPars->fUseFfGrouping? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",    pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Resim( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParSim_t Pars, * pPars = &Pars;
+    int c, RetValue;
+    Cec_ManSimSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fmvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'm':
+            pPars->fCheckMiter ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Resim(): There is no AIG.\n" );
+        return 1;
+    }
+    RetValue = Cec_ManSeqResimulateCounter( pAbc->pGia, pPars, pAbc->pCex );
+    pAbc->Status  = RetValue ? 0 : -1;
+    pAbc->nFrames = pAbc->pCex->iFrame;
+//    Abc_FrameReplaceCex( pAbc, &pAbc->pCex );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &resim [-F num] [-mvh]\n" );
+    Abc_Print( -2, "\t         resimulates equivalence classes using counter-example\n" );
+    Abc_Print( -2, "\t-F num : the number of additinal frames to simulate [default = %d]\n", pPars->nFrames );
+    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9SpecI( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Gia_CommandSpecI( Gia_Man_t * pGia, int nFrames, int nBTLimit, int fUseStart, int fCheckMiter, int fVerbose );
+    int nFrames     =   100;
+    int nBTLimit    = 25000;
+    int fUseStart   =     1;
+    int fCheckMiter =     1;
+    int fVerbose    =     0;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FCfmvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'f':
+            fUseStart ^= 1;
+            break;
+        case 'm':
+            fCheckMiter ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9SpecI(): There is no AIG.\n" );
+        return 1;
+    }
+    Gia_CommandSpecI( pAbc->pGia, nFrames, nBTLimit, fUseStart, fCheckMiter, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &speci [-FC num] [-fmvh]\n" );
+    Abc_Print( -2, "\t         refines equivalence classes using speculative reduction\n" );
+    Abc_Print( -2, "\t-F num : the max number of time frames [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nBTLimit );
+    Abc_Print( -2, "\t-f     : toggle starting BMC from a later frame [default = %s]\n", fUseStart? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", fCheckMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Equiv( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParSim_t Pars, * pPars = &Pars;
+    int c;
+    Cec_ManSimSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WFRSTsmdvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nNonRefines = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nNonRefines < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 's':
+            pPars->fSeqSimulate ^= 1;
+            break;
+        case 'm':
+            pPars->fCheckMiter ^= 1;
+            break;
+        case 'd':
+            pPars->fDualOut ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Equiv(): There is no AIG.\n" );
+        return 1;
+    }
+    Cec_ManSimulation( pAbc->pGia, pPars );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &equiv [-WFRST num] [-smdvh]\n" );
+    Abc_Print( -2, "\t         computes candidate equivalence classes\n" );
+    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
+    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", pPars->nFrames );
+    Abc_Print( -2, "\t-R num : the max number of simulation rounds [default = %d]\n", pPars->nRounds );
+    Abc_Print( -2, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-s     : toggle seq vs. comb simulation [default = %s]\n", pPars->fSeqSimulate? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-d     : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Equiv2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Ssw_SignalFilterGia( Gia_Man_t * p, int nFramesMax, int nConfMax, int nRounds, int TimeLimit, int TimeLimit2, Abc_Cex_t * pCex, int fLatchOnly, int fVerbose );
+    int nFramesMax =   20;
+    int nConfMax   =  500;
+    int nRounds    =   10;
+    int TimeLimit  =    0;
+    int TimeLimit2 =    0;
+    int fUseCex    =    0;
+    int fLatchOnly =    0;
+    int fVerbose   =    0;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FCRTSxlvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFramesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFramesMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfMax < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nRounds < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            TimeLimit2 = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( TimeLimit2 < 0 )
+                goto usage;
+            break;
+        case 'x':
+            fUseCex ^= 1;
+            break;
+        case 'l':
+            fLatchOnly ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Equiv2(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( 0, "Abc_CommandAbc9Equiv2(): There is no flops. Nothing is done.\n" );
+        return 0;
+    }
+    if ( fUseCex )
+    {
+        if ( pAbc->pCex == NULL )
+        {
+            Abc_Print( 0, "Abc_CommandAbc9Equiv2(): Counter-example is not available.\n" );
+            return 0;
+        }
+        if ( pAbc->pCex->nPis != Gia_ManPiNum(pAbc->pGia) )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Equiv2(): The number of PIs differs in cex (%d) and in AIG (%d).\n",
+                pAbc->pCex->nPis, Gia_ManPiNum(pAbc->pGia) );
+            return 1;
+        }
+    }
+    Ssw_SignalFilterGia( pAbc->pGia, nFramesMax, nConfMax, nRounds, TimeLimit, TimeLimit2, fUseCex? pAbc->pCex: NULL, fLatchOnly, fVerbose );
+    pAbc->Status  = -1;
+//    pAbc->nFrames = pAbc->pCex->iFrame;
+//    Abc_FrameReplaceCex( pAbc, &pAbc->pCex );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &equiv2 [-FCRTS num] [-xlvh]\n" );
+    Abc_Print( -2, "\t         computes candidate equivalence classes\n" );
+    Abc_Print( -2, "\t-F num : the max number of frames for BMC [default = %d]\n", nFramesMax );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", nConfMax );
+    Abc_Print( -2, "\t-R num : the max number of BMC rounds [default = %d]\n", nRounds );
+    Abc_Print( -2, "\t-T num : runtime limit in seconds for all rounds [default = %d]\n", TimeLimit );
+    Abc_Print( -2, "\t-S num : runtime limit in seconds for one round [default = %d]\n", TimeLimit2 );
+    Abc_Print( -2, "\t-x     : toggle using the current cex to perform refinement [default = %s]\n", fUseCex? "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle considering only latch output equivalences [default = %s]\n", fLatchOnly? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Equiv3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Ssw_RarSignalFilterGia( Gia_Man_t * p, Ssw_RarPars_t * pPars );
+    Ssw_RarPars_t Pars, * pPars = &Pars;
+    int c;
+    Ssw_RarSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FWBRSNTmxlvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBinSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBinSize < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRestart = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRestart < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRandSeed = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRandSeed < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOut < 0 )
+                goto usage;
+            break;
+        case 'm':
+            pPars->fMiter ^= 1;
+            break;
+        case 'x':
+            pPars->fUseCex ^= 1;
+            break;
+        case 'l':
+            pPars->fLatchOnly ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Equiv3(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( 0, "Abc_CommandAbc9Equiv3(): There is no flops. Nothing is done.\n" );
+        return 0;
+    }
+    if ( pPars->fUseCex )
+    {
+        if ( pPars->fMiter )
+        {
+            Abc_Print( 0, "Abc_CommandAbc9Equiv3(): Considering the miter as a circuit because the CEX is given.\n" );
+            pPars->fMiter = 0;
+        }
+        if ( pAbc->pCex == NULL )
+        {
+            Abc_Print( 0, "Abc_CommandAbc9Equiv3(): Counter-example is not available.\n" );
+            return 0;
+        }
+        if ( pAbc->pCex->nPis != Gia_ManPiNum(pAbc->pGia) )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Equiv3(): The number of PIs differs in cex (%d) and in AIG (%d).\n",
+                pAbc->pCex->nPis, Gia_ManPiNum(pAbc->pGia) );
+            return 1;
+        }
+        pPars->pCex = pAbc->pCex;
+    }
+    pAbc->Status = Ssw_RarSignalFilterGia( pAbc->pGia, pPars );
+//    pAbc->nFrames = pAbc->pGia->pCexSeq->iFrame;
+    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &equiv3 [-FWRSNT num] [-mxlvh]\n" );
+    Abc_Print( -2, "\t         computes candidate equivalence classes\n" );
+    Abc_Print( -2, "\t-F num : the max number of frames for BMC [default = %d]\n",                   pPars->nFrames );
+    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n",                    pPars->nWords );
+    Abc_Print( -2, "\t-R num : the max number of simulation rounds [default = %d]\n",                pPars->nRounds );
+    Abc_Print( -2, "\t-S num : the number of rounds before a restart [default = %d]\n",              pPars->nRestart );
+    Abc_Print( -2, "\t-N num : random number seed (1 <= num <= 1000) [default = %d]\n",              pPars->nRandSeed );
+    Abc_Print( -2, "\t-T num : runtime limit in seconds for all rounds [default = %d]\n",            pPars->TimeOut );
+    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n",                       pPars->fMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-x     : toggle using the current CEX to perform refinement [default = %s]\n", pPars->fUseCex? "yes": "no" );
+    Abc_Print( -2, "\t-l     : toggle considering only latch output equivalences [default = %s]\n",  pPars->fLatchOnly? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",                pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Semi( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParSmf_t Pars, * pPars = &Pars;
+    int c;
+    Cec_ManSmfSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WRFSMCTmdvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nNonRefines = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nNonRefines < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nMinOutputs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nMinOutputs < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'm':
+            pPars->fCheckMiter ^= 1;
+            break;
+        case 'd':
+            pPars->fDualOut ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Resim(): There is no AIG.\n" );
+        return 1;
+    }
+    Cec_ManSeqSemiformal( pAbc->pGia, pPars );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &semi [-WRFSMCT num] [-mdvh]\n" );
+    Abc_Print( -2, "\t         performs semiformal refinement of equivalence classes\n" );
+    Abc_Print( -2, "\t-W num : the number of words to simulate [default = %d]\n", pPars->nWords );
+    Abc_Print( -2, "\t-R num : the max number of rounds to simulate [default = %d]\n", pPars->nRounds );
+    Abc_Print( -2, "\t-F num : the max number of frames to unroll [default = %d]\n", pPars->nFrames );
+    Abc_Print( -2, "\t-S num : the max number of rounds w/o refinement to stop [default = %d]\n", pPars->nNonRefines );
+    Abc_Print( -2, "\t-M num : the min number of outputs of bounded SRM [default = %d]\n", pPars->nMinOutputs );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-d     : toggle using two POs intead of XOR [default = %s]\n", pPars->fDualOut? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Times( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, nTimes = 2, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nTimes = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimes < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Times(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManDupTimes( pAbc->pGia, nTimes );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &times [-N <num>] [-vh]\n" );
+    Abc_Print( -2, "\t         creates several \"parallel\" copies of the design\n" );
+    Abc_Print( -2, "\t-N num : number of copies to create [default = %d]\n", nTimes );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Frames( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Gia_ManFrames2( Gia_Man_t * pAig, Gia_ParFra_t * pPars );
+
+    Gia_Man_t * pTemp;
+    Gia_ParFra_t Pars, * pPars = &Pars;
+    int c;
+    int nCofFanLit = 0;
+    int fNewAlgo = 0;
+    int fInitSpecial = 0;
+    Gia_ManFraSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FLsoibavh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCofFanLit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCofFanLit < 0 )
+                goto usage;
+            break;
+        case 's':
+            pPars->fDisableSt ^= 1;
+            break;
+        case 'o':
+            pPars->fOrPos ^= 1;
+            break;
+        case 'i':
+            pPars->fInit ^= 1;
+            break;
+        case 'b':
+            fInitSpecial ^= 1;
+            break;
+        case 'a':
+            fNewAlgo ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Frames(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    if ( fInitSpecial )
+        pTemp = Gia_ManFramesInitSpecial( pAbc->pGia, pPars->nFrames, pPars->fVerbose );
+    else if ( nCofFanLit )
+        pTemp = Gia_ManUnrollAndCofactor( pAbc->pGia, pPars->nFrames, nCofFanLit, pPars->fVerbose );
+    else if ( fNewAlgo )
+        pTemp = Gia_ManFrames2( pAbc->pGia, pPars );
+    else
+        pTemp = Gia_ManFrames( pAbc->pGia, pPars );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &frames [-FL <num>] [-soibavh]\n" );
+    Abc_Print( -2, "\t         unrolls the design for several timeframes\n" );
+    Abc_Print( -2, "\t-F num : the number of frames to unroll [default = %d]\n", pPars->nFrames );
+    Abc_Print( -2, "\t-L num : the limit on fanout count of resets/enables to cofactor [default = %d]\n", nCofFanLit );
+    Abc_Print( -2, "\t-s     : toggle disabling structural hashing [default = %s]\n", pPars->fDisableSt? "yes": "no" );
+    Abc_Print( -2, "\t-o     : toggle ORing corresponding POs [default = %s]\n", pPars->fOrPos? "yes": "no" );
+    Abc_Print( -2, "\t-i     : toggle initializing registers [default = %s]\n", pPars->fInit? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggle computing special AIG for BMC [default = %s]\n", fInitSpecial? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle using new algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Retime( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c;
+    int nMaxIters = 100;
+    int fVerbose  =   0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nMaxIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nMaxIters < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Retime(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    pTemp = Gia_ManRetimeForward( pAbc->pGia, nMaxIters, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &retime [-N <num>] [-vh]\n" );
+    Abc_Print( -2, "\t         performs most-forward retiming\n" );
+    Abc_Print( -2, "\t-N num : the number of incremental iterations [default = %d]\n", nMaxIters );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Enable( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c;
+    int fRemove  = 0;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "rvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'r':
+            fRemove ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Enable(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( fRemove )
+        pTemp = Gia_ManRemoveEnables( pAbc->pGia );
+    else
+        pTemp = Gia_ManDupSelf( pAbc->pGia );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &enable [-rvh]\n" );
+    Abc_Print( -2, "\t         adds or removes flop enable signals\n" );
+    Abc_Print( -2, "\t-r     : toggle adding vs. removing enables [default = %s]\n", fRemove? "remove": "add" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Dc2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, fVerbose = 0;
+    int fUpdateLevel = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Dc2(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManCompress2( pAbc->pGia, fUpdateLevel, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &dc2 [-lvh]\n" );
+    Abc_Print( -2, "\t         performs heavy rewriting of the AIG\n" );
+    Abc_Print( -2, "\t-l     : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Dsd( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Gia_ManCollapseTest( Gia_Man_t * p, int fVerbose );
+    Gia_Man_t * pTemp;
+    int c, fVerbose = 0;
+    int fUpdateLevel = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Dsd(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManCollapseTest( pAbc->pGia, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &dsd [-vh]\n" );
+    Abc_Print( -2, "\t         performs DSD-based collapsing\n" );
+//    Abc_Print( -2, "\t-l     : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Bidec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, fVerbose = 0;
+    int fUpdateLevel = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUpdateLevel ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Bidec(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( !Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Bidec(): Mapping of the AIG is not defined.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManPerformBidec( pAbc->pGia, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &bidec [-vh]\n" );
+    Abc_Print( -2, "\t         performs heavy rewriting of the AIG\n" );
+//    Abc_Print( -2, "\t-l     : toggle level update during rewriting [default = %s]\n", fUpdateLevel? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Shrink( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp = NULL;
+    int nLutSize;
+    int c,fVerbose = 0;
+    int fKeepLevel = 0;
+    int nFanoutMax = 50;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nlvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by a char string.\n" );
+                goto usage;
+            }
+            nFanoutMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFanoutMax < 0 )
+                goto usage;
+            break;
+        case 'l':
+            fKeepLevel ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Shrink(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( !Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.\n" );
+        return 1;
+    }
+    nLutSize = Gia_ManLutSizeMax( pAbc->pGia );
+    if ( nLutSize <= 4 )
+        pTemp = Gia_ManMapShrink4( pAbc->pGia, fKeepLevel, fVerbose );
+    else if ( nLutSize <= 6 )
+        pTemp = Gia_ManMapShrink6( pAbc->pGia, nFanoutMax, fKeepLevel, fVerbose );
+    else
+        Abc_Print( -1, "Abc_CommandAbc9Shrink(): Works only for 4-LUTs and 6-LUTs.\n" );
+    if ( pTemp )
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &shrink [-N num] [-lvh]\n" );
+    Abc_Print( -2, "\t         performs fast shrinking using current mapping\n" );
+    Abc_Print( -2, "\t-N num : the max fanout count to skip a divisor [default = %d]\n", nFanoutMax );
+    Abc_Print( -2, "\t-l     : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Fx( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int nNewNodesMax = 1000000;
+    int LitCountMax  =       0;
+    int fReverse     =       0;
+    int c, fVerbose  =       0;
+    int fVeryVerbose =       0;
+    // set the defaults
+    Extra_UtilGetoptReset();
+    while ( (c = Extra_UtilGetopt(argc, argv, "NMrvwh")) != EOF )
+    {
+        switch (c)
+        {
+            case 'N':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                    goto usage;
+                }
+                nNewNodesMax = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( nNewNodesMax < 0 )
+                    goto usage;
+                break;
+            case 'M':
+                if ( globalUtilOptind >= argc )
+                {
+                    Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                    goto usage;
+                }
+                LitCountMax = atoi(argv[globalUtilOptind]);
+                globalUtilOptind++;
+                if ( LitCountMax < 0 )
+                    goto usage;
+                break;
+            case 'r':
+                fReverse ^= 1;
+                break;
+            case 'v':
+                fVerbose ^= 1;
+                break;
+            case 'w':
+                fVeryVerbose ^= 1;
+                break;
+            case 'h':
+                goto usage;
+                break;
+            default:
+                goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Shrink(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( !Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Shrink(): Mapping of the AIG is not defined.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManPerformFx( pAbc->pGia, nNewNodesMax, LitCountMax, fReverse, fVerbose, fVeryVerbose );
+    if ( pTemp != NULL )
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    else
+        Abc_Print( -1, "Abc_CommandAbc9Fx(): Command has failed.\n" );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &fx [-NM <num>] [-vh]\n");
+    Abc_Print( -2, "\t           extract shared logic using the classical \"fast_extract\" algorithm\n");
+    Abc_Print( -2, "\t-N <num> : max number of divisors to extract during this run [default = %d]\n", nNewNodesMax );
+    Abc_Print( -2, "\t-M <num> : upper bound on literal count of divisors to extract [default = %d]\n", LitCountMax );
+    Abc_Print( -2, "\t-r       : reversing variable order during ISOP computation [default = %s]\n", fReverse? "yes": "no" );
+    Abc_Print( -2, "\t-v       : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Balance( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp = NULL;
+    int nNewNodesMax = ABC_INFINITY;
+    int fDelayOnly   = 0;
+    int fSimpleAnd   = 0;
+    int fKeepLevel   = 0;
+    int c, fVerbose  = 0;
+    int fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Ndalvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by a char string.\n" );
+                goto usage;
+            }
+            nNewNodesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nNewNodesMax < 0 )
+                goto usage;
+            break;
+        case 'd':
+            fDelayOnly ^= 1;
+            break;
+        case 'a':
+            fSimpleAnd ^= 1;
+            break;
+        case 'l':
+            fKeepLevel ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Balance(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( fDelayOnly )
+        pTemp = Gia_ManBalance( pAbc->pGia, fSimpleAnd, fVerbose );
+    else
+        pTemp = Gia_ManAreaBalance( pAbc->pGia, fSimpleAnd, nNewNodesMax, fVerbose, fVeryVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &b [-N num] [-davwh]\n" );
+    Abc_Print( -2, "\t         performs AIG balancing to reduce delay and area\n" );
+    Abc_Print( -2, "\t-N num : the max fanout count to skip a divisor [default = %d]\n", nNewNodesMax );
+    Abc_Print( -2, "\t-d     : toggle delay only balancing [default = %s]\n", fDelayOnly? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle using AND instead of AND/XOR/MUX [default = %s]\n", fSimpleAnd? "yes": "no" );
+//    Abc_Print( -2, "\t-l     : toggle level update during shrinking [default = %s]\n", fKeepLevel? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9BalanceLut( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Gia_ManBalanceLut( Gia_Man_t * p, int nLutSize, int nCutNum, int fVerbose );
+    extern Gia_Man_t * Gia_ManLutBalance( Gia_Man_t * p, int nLutSize, int fUseMuxes, int fRecursive, int fOptArea, int fVerbose );
+    Gia_Man_t * pTemp = NULL;
+    int fUseOld      = 0;
+    int nLutSize     = 6;
+    int nCutNum      = 8;
+    int fUseMuxes    = 1;
+    int fRecursive   = 1;
+    int fOptArea     = 1;
+    int c, fVerbose  = 0;
+    int fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCnmravwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a char string.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a char string.\n" );
+                goto usage;
+            }
+            nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutNum < 0 )
+                goto usage;
+            break;
+        case 'n':
+            fUseOld ^= 1;
+            break;
+        case 'm':
+            fUseMuxes ^= 1;
+            break;
+        case 'r':
+            fRecursive ^= 1;
+            break;
+        case 'a':
+            fOptArea ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9BalanceLut(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( fUseOld )
+        pTemp = Gia_ManBalanceLut( pAbc->pGia, nLutSize, nCutNum, fVerbose );
+    else
+        pTemp = Gia_ManLutBalance( pAbc->pGia, nLutSize, fUseMuxes, fRecursive, fOptArea, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &blut [-KC num] [-mravh]\n" );
+    Abc_Print( -2, "\t           performs AIG balancing for the given LUT size\n" );
+    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", 6, nLutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", 8, nCutNum );
+    Abc_Print( -2, "\t-m       : toggle performing MUX restructuring [default = %s]\n", fUseMuxes? "yes": "no" );
+    Abc_Print( -2, "\t-r       : toggle performing recursive restructuring [default = %s]\n", fRecursive? "yes": "no" );
+    Abc_Print( -2, "\t-a       : toggle performing area-oriented restructuring [default = %s]\n", fOptArea? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+//    Abc_Print( -2, "\t-w       : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Syn2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, fVerbose  =  0;
+    int fOldAlgo     =  0;
+    int fCoarsen     =  1;
+    int fCutMin      =  0;
+    int nRelaxRatio  = 20;
+    int fDelayMin    =  0;
+    int fVeryVerbose =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Rakmdvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+		case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			nRelaxRatio = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( nRelaxRatio < 0 ) 
+				goto usage;
+            break;
+        case 'a':
+            fOldAlgo ^= 1;
+            break;
+        case 'k':
+            fCoarsen ^= 1;
+            break;
+        case 'm':
+            fCutMin ^= 1;
+            break;
+        case 'd':
+            fDelayMin ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Syn2(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( fDelayMin )
+    {
+        If_DsdMan_t * p = (If_DsdMan_t *)Abc_FrameReadManDsd();
+        if ( p && If_DsdManVarNum(p) < 6 )
+        {
+            printf( "DSD manager has incompatible number of variables. Delay minimization is not performed.\n" );
+            fDelayMin = 0;
+        }
+    } 
+    pTemp = Gia_ManAigSyn2( pAbc->pGia, fOldAlgo, fCoarsen, fCutMin, nRelaxRatio, fDelayMin, fVerbose, fVeryVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &syn2 [-R num] [-akmdvh]\n" );
+    Abc_Print( -2, "\t           performs AIG optimization\n" );
+    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n",   nRelaxRatio );
+    Abc_Print( -2, "\t-a       : toggles using the old algorithm [default = %s]\n",         fOldAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n",    fCoarsen? "yes": "no" );
+    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n",                fCutMin? "yes": "no" );
+    Abc_Print( -2, "\t-d       : toggles additional delay optimization [default = %s]\n",   fDelayMin? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles printing verbose information [default = %s]\n",    fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggles printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Synch2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Gia_ManAigSynch2( Gia_Man_t * p, int fVerbose );
+    Gia_Man_t * pTemp;
+    int c, fVerbose  =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Synch2(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManAigSynch2( pAbc->pGia, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &synch2 [-vh]\n" );
+    Abc_Print( -2, "\t           performs synthesis and computes structural choices\n" );
+    Abc_Print( -2, "\t-v       : toggles printing additional information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Syn3( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, fVerbose = 0;
+    int fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Syn3(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManAigSyn3( pAbc->pGia, fVerbose, fVeryVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &syn3 [-lvh]\n" );
+    Abc_Print( -2, "\t         performs AIG optimization\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Syn4( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, fVerbose = 0;
+    int fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Syn4(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManAigSyn4( pAbc->pGia, fVerbose, fVeryVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &syn4 [-lvh]\n" );
+    Abc_Print( -2, "\t         performs AIG optimization\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9False( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Gia_ManCheckFalse( Gia_Man_t * p, int nSlackMax, int nTimeOut, int fVerbose, int fVeryVerbose );
+    Gia_Man_t * pTemp;
+    int nSlackMax = 0;
+    int nTimeOut = 0;
+    int c, fVerbose = 0;
+    int fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "STvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a char string.\n" );
+                goto usage;
+            }
+            nSlackMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nSlackMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by a char string.\n" );
+                goto usage;
+            }
+            nTimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimeOut < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9False(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManCheckFalse( pAbc->pGia, nSlackMax, nTimeOut, fVerbose, fVeryVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &false [-ST num] [-vwh]\n" );
+    Abc_Print( -2, "\t         detecting and elimintation false paths\n" );
+    Abc_Print( -2, "\t-S num : maximum slack to identify false paths [default = %d]\n",  nSlackMax );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n",   nTimeOut );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",    fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing additional information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Miter( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * pFile;
+    Gia_Man_t * pAux;
+    Gia_Man_t * pSecond;
+    char * FileName, * pTemp;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c;
+    int nInsDup  = 0;
+    int fDualOut = 0;
+    int fSeq     = 0;
+    int fTrans   = 0;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Idstvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by a char string.\n" );
+                goto usage;
+            }
+            nInsDup = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nInsDup < 0 )
+                goto usage;
+            break;
+        case 'd':
+            fDualOut ^= 1;
+            break;
+        case 's':
+            fSeq ^= 1;
+            break;
+        case 't':
+            fTrans ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( fTrans )
+    {
+        if ( (Gia_ManPoNum(pAbc->pGia) & 1) == 1 )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Miter(): The number of outputs should be even.\n" );
+            return 0;
+        }
+        if ( pAbc->pGia == NULL )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Miter(): There is no AIG.\n" );
+            return 1;
+        }
+        pAux = Gia_ManTransformMiter( pAbc->pGia );
+        Abc_FrameUpdateGia( pAbc, pAux );
+        Abc_Print( 1, "The miter (current AIG) is transformed by XORing POs pair-wise.\n" );
+        return 0;
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "File name is not given on the command line.\n" );
+        return 1;
+    }
+
+    // get the input file name
+    FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+    pSecond = Gia_AigerRead( FileName, 0, 0 );
+    if ( pSecond == NULL )
+    {
+        Abc_Print( -1, "Reading AIGER has failed.\n" );
+        return 0;
+    }
+    // compute the miter
+    pAux = Gia_ManMiter( pAbc->pGia, pSecond, nInsDup, fDualOut, fSeq, 0, fVerbose );
+    Gia_ManStop( pSecond );
+    Abc_FrameUpdateGia( pAbc, pAux );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &miter [-I num] [-dstvh] <file>\n" );
+    Abc_Print( -2, "\t         creates miter of two designs (current AIG vs. <file>)\n" );
+    Abc_Print( -2, "\t-I num : the number of last PIs to replicate [default = %d]\n", nInsDup );
+    Abc_Print( -2, "\t-d     : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
+    Abc_Print( -2, "\t-s     : toggle creating sequential miter [default = %s]\n", fSeq? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle XORing pair-wise POs of the miter [default = %s]\n", fTrans? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : AIGER file with the design to miter\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Miter2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * pFile;
+    Gia_Man_t * pAux;
+    char * FileName, * pTemp, * pInit;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "File name is not given on the command line.\n" );
+        return 1;
+    }
+    // get the input file name
+    FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+    // extract string
+    pInit = Extra_FileReadContents( FileName );
+    Extra_StringClean( pInit, "01xX" );
+    if ( (int)strlen(pInit) != Gia_ManCiNum(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Init string length (%d) differs from PI and flop count (%d).\n", strlen(pInit), Gia_ManCiNum(pAbc->pGia) );
+        ABC_FREE( pInit );
+        return 1;
+    }
+    // compute the miter
+    pAux = Gia_ManMiter2( pAbc->pGia, pInit, fVerbose );
+    ABC_FREE( pInit );
+    Abc_FrameUpdateGia( pAbc, pAux );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &miter2 [-vh] <file>\n" );
+    Abc_Print( -2, "\t         creates miter of two copies of the design\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : file name with flop initial values (0/1/x/X) [default = required]\n" );
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Append( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * pFile;
+    Gia_Man_t * pSecond;
+    char * FileName, * pTemp;
+    char ** pArgvNew;
+    int nArgcNew;
+    int c;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        Abc_Print( -1, "File name is not given on the command line.\n" );
+        return 1;
+    }
+
+    // get the input file name
+    FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+    pSecond = Gia_AigerRead( FileName, 0, 0 );
+    if ( pSecond == NULL )
+    {
+        Abc_Print( -1, "Reading AIGER has failed.\n" );
+        return 0;
+    }
+    // compute the miter
+    Gia_ManDupAppend( pAbc->pGia, pSecond );
+    Gia_ManStop( pSecond );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &append [-vh] <file>\n" );
+    Abc_Print( -2, "\t         appends <file> to the current AIG using new PIs and POs\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    Abc_Print( -2, "\t<file> : AIGER file with the design to miter\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Scl( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c;
+    int fConst = 1;
+    int fEquiv = 1;
+    int fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "cevh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'c':
+            fConst ^= 1;
+            break;
+        case 'e':
+            fEquiv ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Scl(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManSeqStructSweep( pAbc->pGia, fConst, fEquiv, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &scl [-cevh]\n" );
+    Abc_Print( -2, "\t         performs structural sequential cleanup\n" );
+    Abc_Print( -2, "\t-c     : toggle removing stuck-at constant registers [default = %s]\n", fConst? "yes": "no" );
+    Abc_Print( -2, "\t-e     : toggle removing equivalent-driver registers [default = %s]\n", fEquiv? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Lcorr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParCor_t Pars, * pPars = &Pars;
+    Gia_Man_t * pTemp;
+    int c;
+    Cec_ManCorSetDefaultParams( pPars );
+    pPars->fLatchCorr = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FCPrcvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nPrefix = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nPrefix < 0 )
+                goto usage;
+            break;
+        case 'r':
+            pPars->fUseRings ^= 1;
+            break;
+        case 'c':
+            pPars->fUseCSat ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Lcorr(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    pTemp = Cec_ManLSCorrespondence( pAbc->pGia, pPars );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &lcorr [-FCP num] [-rcvh]\n" );
+    Abc_Print( -2, "\t         performs latch correpondence computation\n" );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
+    Abc_Print( -2, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
+    Abc_Print( -2, "\t-r     : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Scorr( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParCor_t Pars, * pPars = &Pars;
+    Gia_Man_t * pTemp;
+    int c;
+    Cec_ManCorSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FCPkrecqwvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFrames < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nPrefix = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nPrefix < 0 )
+                goto usage;
+            break;
+        case 'k':
+            pPars->fConstCorr ^= 1;
+            break;
+        case 'r':
+            pPars->fUseRings ^= 1;
+            break;
+        case 'e':
+            pPars->fMakeChoices ^= 1;
+            break;
+        case 'c':
+            pPars->fUseCSat ^= 1;
+            break;
+        case 'q':
+            pPars->fStopWhenGone ^= 1;
+            break;
+        case 'w':
+            pPars->fVerboseFlops ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Scorr(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "The network is combinational.\n" );
+        return 0;
+    }
+    pTemp = Cec_ManLSCorrespondence( pAbc->pGia, pPars );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &scorr [-FCP num] [-krecqwvh]\n" );
+    Abc_Print( -2, "\t         performs signal correpondence computation\n" );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-F num : the number of timeframes in inductive case [default = %d]\n", pPars->nFrames );
+    Abc_Print( -2, "\t-P num : the number of timeframes in the prefix [default = %d]\n", pPars->nPrefix );
+    Abc_Print( -2, "\t-k     : toggle using constant correspondence [default = %s]\n", pPars->fConstCorr? "yes": "no" );
+    Abc_Print( -2, "\t-r     : toggle using implication rings during refinement [default = %s]\n", pPars->fUseRings? "yes": "no" );
+    Abc_Print( -2, "\t-e     : toggle using equivalences as choices [default = %s]\n", pPars->fMakeChoices? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+    Abc_Print( -2, "\t-q     : toggle quitting when PO is not a constant candidate [default = %s]\n", pPars->fStopWhenGone? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing verbose info about equivalent flops [default = %s]\n", pPars->fVerboseFlops? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Choice( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParChc_t Pars, * pPars = &Pars;
+    Gia_Man_t * pTemp;
+    int c;
+    Cec_ManChcSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Ccvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'c':
+            pPars->fUseCSat ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Choice(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Cec_ManChoiceComputation( pAbc->pGia, pPars );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &choice [-C num] [-cvh]\n" );
+    Abc_Print( -2, "\t         performs computation of structural choices\n" );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT solver [default = %s]\n", pPars->fUseCSat? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Sat( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParSat_t ParsSat, * pPars = &ParsSat;
+    Gia_Man_t * pTemp;
+    int c;
+    int fCSat = 0;
+    Cec_ManSatSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CSNnmtcvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nSatVarMax < 0 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nCallsRecycle = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCallsRecycle < 0 )
+                goto usage;
+            break;
+        case 'n':
+            pPars->fNonChrono ^= 1;
+            break;
+        case 'm':
+            pPars->fCheckMiter ^= 1;
+            break;
+        case 't':
+            pPars->fLearnCls ^= 1;
+            break;
+        case 'c':
+            fCSat ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Sat(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( fCSat )
+    {
+        Vec_Int_t * vCounters;
+        Vec_Str_t * vStatus;
+        if ( pPars->fLearnCls )
+            vCounters = Tas_ManSolveMiterNc( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
+        else if ( pPars->fNonChrono )
+            vCounters = Cbs_ManSolveMiterNc( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
+        else
+            vCounters = Cbs_ManSolveMiter( pAbc->pGia, pPars->nBTLimit, &vStatus, pPars->fVerbose );
+        Vec_IntFree( vCounters );
+        Vec_StrFree( vStatus );
+    }
+    else
+    {
+        pTemp = Cec_ManSatSolving( pAbc->pGia, pPars );
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &sat [-CSN <num>] [-nmctvh]\n" );
+    Abc_Print( -2, "\t         performs SAT solving for the combinational outputs\n" );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-S num : the min number of variables to recycle the solver [default = %d]\n", pPars->nSatVarMax );
+    Abc_Print( -2, "\t-N num : the min number of calls to recycle the solver [default = %d]\n", pPars->nCallsRecycle );
+    Abc_Print( -2, "\t-n     : toggle using non-chronological backtracking [default = %s]\n", pPars->fNonChrono? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-c     : toggle using circuit-based SAT solver [default = %s]\n", fCSat? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle using learning in curcuit-based solver [default = %s]\n", pPars->fLearnCls? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Fraig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParFra_t ParsFra, * pPars = &ParsFra;
+    Gia_Man_t * pTemp;
+    int c;
+    Cec_ManFraSetDefaultParams( pPars );
+    pPars->fSatSweeping = 1;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WRILDCrmdcwvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nItersMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nItersMax < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nLevelMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLevelMax < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nDepthMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nDepthMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'r':
+            pPars->fRewriting ^= 1;
+            break;
+        case 'm':
+            pPars->fCheckMiter ^= 1;
+            break;
+        case 'd':
+            pPars->fDualOut ^= 1;
+            break;
+        case 'c':
+            pPars->fRunCSat ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Fraig(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Cec_ManSatSweeping( pAbc->pGia, pPars );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &fraig [-WRILDC <num>] [-rmdcwvh]\n" );
+    Abc_Print( -2, "\t         performs combinational SAT sweeping\n" );
+    Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", pPars->nWords );
+    Abc_Print( -2, "\t-R num : the number of simulation rounds [default = %d]\n", pPars->nRounds );
+    Abc_Print( -2, "\t-I num : the number of sweeping iterations [default = %d]\n", pPars->nItersMax );
+    Abc_Print( -2, "\t-L num : the max number of levels of nodes to consider [default = %d]\n", pPars->nLevelMax );
+    Abc_Print( -2, "\t-D num : the max number of steps of speculative reduction [default = %d]\n", pPars->nDepthMax );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-r     : toggle the use of AIG rewriting [default = %s]\n", pPars->fRewriting? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle miter vs. any circuit [default = %s]\n", pPars->fCheckMiter? "miter": "circuit" );
+    Abc_Print( -2, "\t-d     : toggle using double output miters [default = %s]\n", pPars->fDualOut? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle using circuit-based solver [default = %s]\n", pPars->fRunCSat? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing even more verbose information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9CFraig( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c;
+    Ssc_Pars_t Pars, * pPars = &Pars;
+    Ssc_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WCacvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fAppend ^= 1;
+            break;
+        case 'c':
+            pPars->fVerify ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9CFraig(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Ssc_PerformSweepingConstr( pAbc->pGia, pPars );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &cfraig [-WC <num>] [-acvh]\n" );
+    Abc_Print( -2, "\t         performs combinational SAT sweeping under constraints\n" );
+    Abc_Print( -2, "\t         which are present in the AIG or set manually using \"constr\"\n" );
+    Abc_Print( -2, "\t         (constraints are listed as last POs and true when they are 0)\n" );
+    Abc_Print( -2, "\t-W num : the number of simulation words [default = %d]\n", pPars->nWords );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-a     : toggle appending constraints to the result [default = %s]\n", pPars->fAppend? "yes": "no" );
+    Abc_Print( -2, "\t-c     : toggle performing internal verification [default = %s]\n", pPars->fVerify? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Srm( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char * pFileNameIn = NULL;
+    char pFileName[10] = "gsrm.aig", pFileName2[10] = "gsyn.aig";
+    Gia_Man_t * pTemp, * pAux;
+    int c, fVerbose = 0;
+    int fSynthesis = 0;
+    int fSpeculate = 1;
+    int fSkipSome = 0;
+    int fDualOut = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Adrsfvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pFileNameIn = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'd':
+            fDualOut ^= 1;
+            break;
+        case 'r':
+            fSynthesis ^= 1;
+            break;
+        case 's':
+            fSpeculate ^= 1;
+            break;
+        case 'f':
+            fSkipSome ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Srm(): There is no AIG.\n" );
+        return 1;
+    }
+    sprintf(pFileName,  "gsrm%s.aig", fSpeculate? "" : "s" );
+    sprintf(pFileName2, "gsyn%s.aig", fSpeculate? "" : "s" );
+    pTemp = Gia_ManSpecReduce( pAbc->pGia, fDualOut, fSynthesis, fSpeculate, fSkipSome, fVerbose );
+    if ( pTemp )
+    {
+        if ( fSpeculate )
+        {
+            pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
+            Gia_ManStop( pAux );
+        }
+        Gia_AigerWrite( pTemp, pFileNameIn ? pFileNameIn : pFileName, 0, 0 );
+        Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
+        Gia_ManPrintStatsShort( pTemp );
+        Gia_ManStop( pTemp );
+    }
+    if ( fSynthesis )
+    {
+        pTemp = Gia_ManEquivReduce( pAbc->pGia, 1, fDualOut, 0, fVerbose );
+        if ( pTemp )
+        {
+            pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
+            Gia_ManStop( pAux );
+
+            Gia_AigerWrite( pTemp, pFileName2, 0, 0 );
+            Abc_Print( 1, "Reduced original network was written into file \"%s\".\n", pFileName2 );
+            Gia_ManPrintStatsShort( pTemp );
+            Gia_ManStop( pTemp );
+        }
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &srm [-A file] [-drsfvh]\n" );
+    Abc_Print( -2, "\t          writes speculatively reduced model into file \"%s\"\n", pFileName );
+    Abc_Print( -2, "\t-A file : file name for dumping speculative-reduced model [default = \"gsrm.aig\"]\n" );
+    Abc_Print( -2, "\t-d      : toggle creating dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
+    Abc_Print( -2, "\t-r      : toggle writing reduced network for synthesis [default = %s]\n", fSynthesis? "yes": "no" );
+    Abc_Print( -2, "\t-s      : toggle using speculation at the internal nodes [default = %s]\n", fSpeculate? "yes": "no" );
+    Abc_Print( -2, "\t-f      : toggle filtering to remove redundant equivalences [default = %s]\n", fSkipSome? "yes": "no" );
+    Abc_Print( -2, "\t-v      : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h      : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Srm2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char pFileName[10], * pFileName1, * pFileName2;
+    Gia_Man_t * pTemp, * pAux;
+    int fLatchA = 0, fLatchB = 0;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "abvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'a':
+            fLatchA ^= 1;
+            break;
+        case 'b':
+            fLatchB ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Srm2(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( pAbc->pGia->pReprs == NULL || pAbc->pGia->pNexts == NULL )
+    {
+        Abc_Print( -1, "Equivalences are not defined.\n" );
+        return 0;
+    }
+    if ( argc != globalUtilOptind + 2 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Srm2(): Expecting two file names on the command line.\n" );
+        return 1;
+    }
+    // get the input file name
+    pFileName1 = argv[globalUtilOptind];
+    pFileName2 = argv[globalUtilOptind+1];
+    // create file name
+    sprintf(pFileName,  "gsrm.aig" );
+    pTemp = Gia_ManDup( pAbc->pGia );
+    // copy equivalences
+    pTemp->pReprs = ABC_ALLOC( Gia_Rpr_t, Gia_ManObjNum(pTemp) );
+    memcpy( pTemp->pReprs, pAbc->pGia->pReprs, sizeof(Gia_Rpr_t) * Gia_ManObjNum(pTemp) );
+    pTemp->pNexts = ABC_ALLOC( int, Gia_ManObjNum(pTemp) );
+    memcpy( pTemp->pNexts, pAbc->pGia->pNexts, sizeof(int) * Gia_ManObjNum(pTemp) );
+//Gia_ManPrintStats( pTemp, 0 );
+    // filter the classes
+    if ( !Gia_ManFilterEquivsForSpeculation( pTemp, pFileName1, pFileName2, fLatchA, fLatchB ) )
+    {
+        Gia_ManStop( pTemp );
+        Abc_Print( -1, "Filtering equivalences has failed.\n" );
+        return 1;
+    }
+//Gia_ManPrintStats( pTemp, 0 );
+    pTemp = Gia_ManSpecReduce( pAux = pTemp, 0, 0, 1, 0, 0 );
+    Gia_ManStop( pAux );
+    if ( pTemp )
+    {
+        pTemp = Gia_ManSeqStructSweep( pAux = pTemp, 1, 1, 0 );
+        Gia_ManStop( pAux );
+
+        Gia_AigerWrite( pTemp, pFileName, 0, 0 );
+        Abc_Print( 1, "Speculatively reduced model was written into file \"%s\".\n", pFileName );
+        Gia_ManPrintStatsShort( pTemp );
+        Gia_ManStop( pTemp );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &srm2 [-abvh] <PartA_FileName> <PartB_FileName>\n" );
+    Abc_Print( -2, "\t         writes speculatively reduced model into file \"%s\"\n", pFileName );
+    Abc_Print( -2, "\t         only preserves equivalences across PartA and PartB\n" );
+    Abc_Print( -2, "\t-a     : toggle using latches only in PartA [default = %s]\n", fLatchA? "yes": "no" );
+    Abc_Print( -2, "\t-b     : toggle using latches only in PartB [default = %s]\n", fLatchB? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Filter( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char * pFileName1 = NULL, * pFileName2 = NULL;
+    int fFlopsOnly = 0, fFlopsWith = 0;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "fgvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'f':
+            fFlopsOnly ^= 1;
+            break;
+        case 'g':
+            fFlopsWith ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Srm2(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( pAbc->pGia->pReprs == NULL || pAbc->pGia->pNexts == NULL )
+    {
+        Abc_Print( -1, "Equivalences are not defined.\n" );
+        return 0;
+    }
+    if ( argc != globalUtilOptind && argc != globalUtilOptind + 2 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Srm2(): Expecting two file names on the command line.\n" );
+        return 1;
+    }
+    // filter using one of the choices
+    if ( fFlopsOnly ^ fFlopsWith )
+        Gia_ManFilterEquivsUsingLatches( pAbc->pGia, fFlopsOnly, fFlopsWith );
+    // get the input file name
+    if ( argc == globalUtilOptind + 2 )
+    {
+        pFileName1 = argv[globalUtilOptind];
+        pFileName2 = argv[globalUtilOptind+1];
+        if ( !Gia_ManFilterEquivsUsingParts( pAbc->pGia, pFileName1, pFileName2 ) )
+        {
+            Abc_Print( -1, "Filtering equivalences using PartA and PartB has failed.\n" );
+            return 1;
+        }
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &filter [-fgvh] <PartA_FileName> <PartB_FileName>\n" );
+    Abc_Print( -2, "\t         performs filtering of equivalence classes\n" );
+    Abc_Print( -2, "\t         (if Parts A/B are given, removes classes composed of one part)\n" );
+    Abc_Print( -2, "\t-f     : toggle removing all elements except flops [default = %s]\n", fFlopsOnly? "yes": "no" );
+    Abc_Print( -2, "\t-g     : toggle removing removing classes without flops [default = %s]\n", fFlopsWith? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Reduce( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp, * pTemp2;
+    int c, fVerbose = 0;
+    int fUseAll = 0;
+    int fDualOut = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "advh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'a':
+            fUseAll ^= 1;
+            break;
+        case 'd':
+            fDualOut ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Reduce(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( fUseAll )
+    {
+        pTemp = Gia_ManEquivReduce( pAbc->pGia, fUseAll, fDualOut, 0, fVerbose );
+        pTemp = Gia_ManSeqStructSweep( pTemp2 = pTemp, 1, 1, 0 );
+        Gia_ManStop( pTemp2 );
+    }
+    else
+        pTemp = Gia_ManEquivReduceAndRemap( pAbc->pGia, 1, fDualOut );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &reduce [-advh]\n" );
+    Abc_Print( -2, "\t         reduces the circuit using equivalence classes\n" );
+    Abc_Print( -2, "\t-a     : toggle merging all equivalences [default = %s]\n", fUseAll? "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle using dual-output merging [default = %s]\n", fDualOut? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9EquivMark( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Gia_ManEquivMark( Gia_Man_t * p, char * pFileName, int fSkipSome, int fVerbose );
+    char * pFileName;
+    int c, fVerbose = 0;
+    int fSkipSome = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "fvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'f':
+            fSkipSome ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9EquivMark(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( argc != globalUtilOptind + 1 )
+        goto usage;
+    // get the input file name
+    pFileName = argv[globalUtilOptind];
+    // mark equivalences
+    Gia_ManEquivMark( pAbc->pGia, pFileName, fSkipSome, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &equiv_mark [-fvh] <miter.aig>\n" );
+    Abc_Print( -2, "\t              marks equivalences using an external miter\n" );
+    Abc_Print( -2, "\t-f          : toggle the use of filtered equivalences [default = %s]\n", fSkipSome? "yes": "no" );
+    Abc_Print( -2, "\t-v          : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h          : print the command usage\n");
+    Abc_Print( -2, "\t<miter.aig> : file with the external miter to read\n");
+    Abc_Print( -2, "\t              \n" );
+    Abc_Print( -2, "\t              The external miter should be generated by &srm -s\n" );
+    Abc_Print( -2, "\t              and (partially) solved by any verification engine(s).\n" );
+    Abc_Print( -2, "\t              The external miter should have as many POs as\n" );
+    Abc_Print( -2, "\t              the number of POs in the current AIG plus\n" );
+    Abc_Print( -2, "\t              the number of equivalences in the current AIG.\n" );
+    Abc_Print( -2, "\t              If some POs are proved, the corresponding equivs\n" );
+    Abc_Print( -2, "\t              are marked as proved, to be reduced by &reduce.\n" );
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9EquivFilter( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Gia_ManEquivFilter( Gia_Man_t * p, Vec_Int_t * vPoIds, int fVerbose );
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9EquivFilter(): There is no AIG.\n" );
+        return 1;
+    }
+    Gia_ManEquivFilter( pAbc->pGia, pAbc->vAbcObjIds, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &equiv_filter [-vh]\n" );
+    Abc_Print( -2, "\t              filters equivalence candidates after disproving some SRM outputs\n" );
+    Abc_Print( -2, "\t              (the array of disproved outputs should be given as pAbc->vAbcObjIds)\n" );
+    Abc_Print( -2, "\t-v          : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h          : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Cec( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParCec_t ParsCec, * pPars = &ParsCec;
+    FILE * pFile;
+    Gia_Man_t * pSecond, * pMiter;
+    char * FileName, * pTemp;
+    char ** pArgvNew;
+    int c, nArgcNew, fMiter = 0;
+    int fDumpMiter = 0;
+    Cec_ManCecSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CTmdvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'm':
+            fMiter ^= 1;
+            break;
+        case 'd':
+            fDumpMiter ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( fMiter )
+    {
+        if ( Gia_ManPoNum(pAbc->pGia) & 1 )
+        {
+            Abc_Print( -1, "The dual-output miter should have an even number of outputs.\n" );
+            return 1;
+        }
+        Abc_Print( 1, "Assuming the current network is a double-output miter. (Conflict limit = %d.)\n", pPars->nBTLimit );
+        pAbc->Status = Cec_ManVerify( pAbc->pGia, pPars );
+        Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexComb );
+        return 0;
+    }
+
+    pArgvNew = argv + globalUtilOptind;
+    nArgcNew = argc - globalUtilOptind;
+    if ( nArgcNew != 1 )
+    {
+        if ( pAbc->pGia->pSpec == NULL )
+        {
+            Abc_Print( -1, "File name is not given on the command line.\n" );
+            return 1;
+        }
+        FileName = pAbc->pGia->pSpec;
+    }
+    else
+        FileName = pArgvNew[0];
+    // fix the wrong symbol
+    for ( pTemp = FileName; *pTemp; pTemp++ )
+        if ( *pTemp == '>' )
+            *pTemp = '\\';
+    if ( (pFile = fopen( FileName, "r" )) == NULL )
+    {
+        Abc_Print( -1, "Cannot open input file \"%s\". ", FileName );
+        if ( (FileName = Extra_FileGetSimilarName( FileName, ".aig", NULL, NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", FileName );
+        Abc_Print( 1, "\n" );
+        return 1;
+    }
+    fclose( pFile );
+    pSecond = Gia_AigerRead( FileName, 0, 0 );
+    if ( pSecond == NULL )
+    {
+        Abc_Print( -1, "Reading AIGER has failed.\n" );
+        return 0;
+    }
+    // compute the miter
+    pMiter = Gia_ManMiter( pAbc->pGia, pSecond, 0, 1, 0, 0, pPars->fVerbose );
+    if ( pMiter )
+    {
+        if ( fDumpMiter )
+        {
+            Abc_Print( 0, "The verification miter is written into file \"%s\".\n", "cec_miter.aig" );
+            Gia_AigerWrite( pMiter, "cec_miter.aig", 0, 0 );
+        }
+        pAbc->Status = Cec_ManVerify( pMiter, pPars );
+        Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexComb );
+        Gia_ManStop( pMiter );
+    }
+    Gia_ManStop( pSecond );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &cec [-CT num] [-mdvh]\n" );
+    Abc_Print( -2, "\t         new combinational equivalence checker\n" );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-m     : toggle miter vs. two circuits [default = %s]\n", fMiter? "miter":"two circuits");
+    Abc_Print( -2, "\t-d     : toggle dumping dual-output miter [default = %s]\n", fDumpMiter? "yes":"no");
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Verify( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Cec_ParCec_t ParsCec, * pPars = &ParsCec;
+    int c;
+    Cec_ManCecSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "CTvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    Gia_ManVerifyWithBoxes( pAbc->pGia, pPars );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &verify [-CT num] [-vh]\n" );
+    Abc_Print( -2, "\t         performs verification of combinational design\n" );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-T num : approximate runtime limit in seconds [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Sweep( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    Dch_Pars_t Pars, * pPars = &Pars;
+    int c;
+    // set defaults
+    Dch_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptfvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nSatVarMax < 0 )
+                goto usage;
+            break;
+        case 's':
+            pPars->fSynthesis ^= 1;
+            break;
+        case 'p':
+            pPars->fPower ^= 1;
+            break;
+        case 't':
+            pPars->fSimulateTfo ^= 1;
+            break;
+        case 'f':
+            pPars->fLightSynth ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Sweep(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManFraigSweep( pAbc->pGia, pPars );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &sweep [-WCS num] [-sptfvh]\n" );
+    Abc_Print( -2, "\t         computes structural choices using a new approach\n" );
+    Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
+    Abc_Print( -2, "\t-s     : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Force( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int nIters     = 20;
+    int fClustered =  1;
+    int fVerbose   =  1;
+    int c;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Icvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nIters < 0 )
+                goto usage;
+            break;
+        case 'c':
+            fClustered ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Force(): There is no AIG.\n" );
+        return 1;
+    }
+    For_ManExperiment( pAbc->pGia, nIters, fClustered, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &force [-I <num>] [-cvh]\n" );
+    Abc_Print( -2, "\t         one-dimensional placement algorithm FORCE introduced by\n" );
+    Abc_Print( -2, "\t         F. A. Aloul, I. L. Markov, and K. A. Sakallah (GLSVLSI�03).\n" );
+    Abc_Print( -2, "\t-I num : the number of refinement iterations [default = %d]\n", nIters );
+    Abc_Print( -2, "\t-c     : toggle clustered representation [default = %s]\n", fClustered? "yes":"no");
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", fVerbose? "yes":"no");
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Embed( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Emb_Par_t Pars, * pPars = &Pars;
+    int c;
+    pPars->nDims      = 30;
+    pPars->nIters     = 10;
+    pPars->nSols      =  2;
+    pPars->fRefine    =  0;
+    pPars->fCluster   =  0;
+    pPars->fDump      =  0;
+    pPars->fDumpLarge =  0;
+    pPars->fShowImage =  0;
+    pPars->fVerbose   =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "DIrcdlsvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nDims = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nDims < 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIters < 0 )
+                goto usage;
+            break;
+        case 'r':
+            pPars->fRefine ^= 1;
+            break;
+        case 'c':
+            pPars->fCluster ^= 1;
+            break;
+        case 'd':
+            pPars->fDump ^= 1;
+            break;
+        case 'l':
+            pPars->fDumpLarge ^= 1;
+            break;
+        case 's':
+            pPars->fShowImage ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Embed(): There is no AIG.\n" );
+        return 1;
+    }
+    Gia_ManSolveProblem( pAbc->pGia, pPars );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &embed [-DI <num>] [-rdlscvh]\n" );
+    Abc_Print( -2, "\t         fast placement based on high-dimensional embedding from\n" );
+    Abc_Print( -2, "\t         D. Harel and Y. Koren, \"Graph drawing by high-dimensional\n" );
+    Abc_Print( -2, "\t         embedding\", J. Graph Algs & Apps, 2004, Vol 8(2), pp. 195-217\n" );
+    Abc_Print( -2, "\t-D num : the number of dimensions for embedding [default = %d]\n", pPars->nDims );
+    Abc_Print( -2, "\t-I num : the number of refinement iterations [default = %d]\n", pPars->nIters );
+    Abc_Print( -2, "\t-r     : toggle the use of refinement [default = %s]\n", pPars->fRefine? "yes":"no");
+    Abc_Print( -2, "\t-c     : toggle clustered representation [default = %s]\n", pPars->fCluster? "yes":"no");
+    Abc_Print( -2, "\t-d     : toggle dumping placement into a Gnuplot file [default = %s]\n", pPars->fDump? "yes":"no");
+    Abc_Print( -2, "\t-l     : toggle dumping Gnuplot for large placement [default = %s]\n", pPars->fDumpLarge? "yes":"no");
+    Abc_Print( -2, "\t-s     : toggle showing image if Gnuplot is installed [default = %s]\n", pPars->fShowImage? "yes":"no");
+    Abc_Print( -2, "\t-v     : toggle verbose output [default = %s]\n", pPars->fVerbose? "yes":"no");
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Sopb( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int nLevelMax   = 0;
+    int nTimeWindow = 0;
+    int nCutNum     = 8;
+    int nRelaxRatio = 0;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "LWCRvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLevelMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLevelMax < 0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nTimeWindow = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimeWindow < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutNum < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nRelaxRatio = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nRelaxRatio < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Sopb(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( nLevelMax || nTimeWindow )
+        pTemp = Gia_ManPerformSopBalanceWin( pAbc->pGia, nLevelMax, nTimeWindow, nCutNum, nRelaxRatio, fVerbose );
+    else
+        pTemp = Gia_ManPerformSopBalance( pAbc->pGia, nCutNum, nRelaxRatio, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &sopb [-LWCR num] [-vh]\n" );
+    Abc_Print( -2, "\t         performs SOP balancing\n" );
+    Abc_Print( -2, "\t-L num : optimize paths above this level [default = %d]\n", nLevelMax );
+    Abc_Print( -2, "\t-W num : optimize paths falling into this window [default = %d]\n", nTimeWindow );
+    Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
+    Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", nRelaxRatio );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Dsdb( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int nLevelMax   = 0;
+    int nTimeWindow = 0;
+    int nLutSize    = 6;
+    int nCutNum     = 8;
+    int nRelaxRatio = 0;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "LWKCRvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLevelMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLevelMax < 0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nTimeWindow = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimeWindow < 0 )
+                goto usage;
+            break;
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+         case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutNum < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nRelaxRatio = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nRelaxRatio < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Dsdb(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( nLevelMax || nTimeWindow )
+        pTemp = Gia_ManPerformDsdBalanceWin( pAbc->pGia, nLevelMax, nTimeWindow, nLutSize, nCutNum, nRelaxRatio, fVerbose );
+    else
+        pTemp = Gia_ManPerformDsdBalance( pAbc->pGia, nLutSize, nCutNum, nRelaxRatio, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &dsdb [-LWKCR num] [-vh]\n" );
+    Abc_Print( -2, "\t         performs DSD balancing\n" );
+    Abc_Print( -2, "\t-L num : optimize paths above this level [default = %d]\n", nLevelMax );
+    Abc_Print( -2, "\t-W num : optimize paths falling into this window [default = %d]\n", nTimeWindow );
+    Abc_Print( -2, "\t-K num : the number of LUT inputs (LUT size) [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
+    Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", nRelaxRatio );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Flow( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+	extern void Gia_ManPerformFlow( int fIsMapped, int nAnds, int nLevels, int nLutSize, int nCutNum, int nRelaxRatio, int fVerbose );
+//    Gia_Man_t * pTemp;
+    int nLutSize    = 4;
+    int nCutNum     = 8;
+    int nRelaxRatio = 0;
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCRvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 0 )
+                goto usage;
+            break;
+         case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutNum < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nRelaxRatio = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nRelaxRatio < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Flow(): There is no AIG.\n" );
+        return 1;
+    }
+	Gia_ManPerformFlow( Gia_ManHasMapping(pAbc->pGia), Gia_ManAndNum(pAbc->pGia), Gia_ManLevelNum(pAbc->pGia), nLutSize, nCutNum, nRelaxRatio, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &flow [-KCR num] [-vh]\n" );
+    Abc_Print( -2, "\t         integration optimization and mapping flow\n" );
+    Abc_Print( -2, "\t-K num : the number of LUT inputs (LUT size) [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-C num : the number of cuts at a node [default = %d]\n", nCutNum );
+    Abc_Print( -2, "\t-R num : the delay relaxation ratio (num >= 0) [default = %d]\n", nRelaxRatio );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9If( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[200];
+    char LutSize[200];
+    Gia_Man_t * pNew;
+    If_Par_t Pars, * pPars = &Pars;
+    int c;
+    // set defaults
+    Gia_ManSetIfParsDefault( pPars );
+    if ( pAbc->pLibLut == NULL )
+    {
+        Abc_Print( -1, "LUT library is not given. Using default LUT library.\n" );
+        pAbc->pLibLut = If_LibLutSetSimple( 6 );
+    }
+    pPars->pLutLib = (If_LibLut_t *)pAbc->pLibLut;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFAGRDEWSTqalepmrsdbgxyojikfuztncvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutSize < 0 )
+                goto usage;
+            // if the LUT size is specified, disable library
+            pPars->pLutLib = NULL;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nCutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutsMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nFlowIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nFlowIters < 0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nAreaIters = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nAreaIters < 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by a positive integer no less than 3.\n" );
+                goto usage;
+            }
+            pPars->nGateSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nGateSize < 2 )
+                goto usage;
+            break;
+		case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nRelaxRatio < 0 ) 
+				goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayTarget = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'E':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->Epsilon = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->Epsilon < 0.0 || pPars->Epsilon > 1.0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->WireDelay = (float)atof(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->WireDelay < 0.0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
+                goto usage;
+            }
+            pPars->pLutStruct = argv[globalUtilOptind];
+            globalUtilOptind++;
+            if ( strlen(pPars->pLutStruct) != 2 && strlen(pPars->pLutStruct) != 3 )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
+                goto usage;
+            }
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer 0,1,or 2.\n" );
+                goto usage;
+            }
+            pPars->nStructType = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nStructType < 0 || pPars->nStructType > 2 )
+                goto usage;
+            break;
+        case 'q':
+            pPars->fPreprocess ^= 1;
+            break;
+        case 'a':
+            pPars->fArea ^= 1;
+            break;
+        case 'r':
+            pPars->fExpRed ^= 1;
+            break;
+        case 'l':
+            pPars->fLatchPaths ^= 1;
+            break;
+        case 'e':
+            pPars->fEdge ^= 1;
+            break;
+        case 'p':
+            pPars->fPower ^= 1;
+            break;
+        case 'm':
+            pPars->fCutMin ^= 1;
+            break;
+        case 's':
+            pPars->fDelayOptLut ^= 1;
+            break;
+        case 'd':
+            pPars->fBidec ^= 1;
+            break;
+        case 'b':
+            pPars->fUseBat ^= 1;
+            break;
+        case 'g':
+            pPars->fDelayOpt ^= 1;
+            break;
+        case 'x':
+            pPars->fDsdBalance ^= 1;
+            break;
+        case 'y':
+            pPars->fUserRecLib ^= 1;
+            break;
+        case 'o':
+            pPars->fUseBuffs ^= 1;
+            break;
+        case 'j':
+            pPars->fEnableCheck07 ^= 1;
+            break;
+        case 'i':
+            pPars->fEnableCheck08 ^= 1;
+            break;
+        case 'k':
+            pPars->fEnableCheck10 ^= 1;
+            break;
+        case 'f':
+            pPars->fEnableCheck75 ^= 1;
+            break;
+        case 'u':
+            pPars->fEnableCheck75u ^= 1;
+            break;
+        case 'z':
+            pPars->fDeriveLuts ^= 1;
+            break;
+        case 't':
+            pPars->fDoAverage ^= 1;
+            break;
+        case 'n':
+            pPars->fUseDsd ^= 1;
+            break;
+        case 'c':
+            pPars->fUseTtPerm ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty GIA network.\n" );
+        return 1;
+    }
+    if ( Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Current AIG has mapping. Run \"&st\".\n" );
+        return 1;
+    }
+
+    if ( pPars->nLutSize == -1 )
+    {
+        if ( pPars->pLutLib == NULL )
+        {
+            Abc_Print( -1, "The LUT library is not given.\n" );
+            return 1;
+        }
+        // get LUT size from the library
+        pPars->nLutSize = pPars->pLutLib->LutMax;
+        // if variable pin delay, force truth table computation
+//        if ( pPars->pLutLib->fVarPinDelays )
+//            pPars->fTruth = 1;
+    }
+
+    if ( pPars->nLutSize < 2 || pPars->nLutSize > IF_MAX_LUTSIZE )
+    {
+        Abc_Print( -1, "Incorrect LUT size (%d).\n", pPars->nLutSize );
+        return 1;
+    }
+
+    if ( pPars->nCutsMax < 1 || pPars->nCutsMax >= (1<<12) )
+    {
+        Abc_Print( -1, "Incorrect number of cuts.\n" );
+        return 1;
+    }
+
+    // enable truth table computation if choices are selected
+    if ( Gia_ManHasChoices(pAbc->pGia) )
+    {
+//        if ( !Abc_FrameReadFlag("silentmode") )
+//            Abc_Print( 0, "Performing LUT mapping with choices.\n" );
+        pPars->fExpRed = 0;
+    }
+
+    if ( pPars->fUseBat )
+    {
+        if ( pPars->nLutSize < 4 || pPars->nLutSize > 6 )
+        {
+            Abc_Print( -1, "This feature only works for {4,5,6}-LUTs.\n" );
+            return 1;
+        }
+        pPars->fCutMin = 1;
+    }
+
+    if ( pPars->fEnableCheck07 + pPars->fEnableCheck08 + pPars->fEnableCheck10 + pPars->fEnableCheck75 + pPars->fEnableCheck75u + (pPars->pLutStruct != NULL) > 1 )
+    {
+        Abc_Print( -1, "Only one additional check can be performed at the same time.\n" );
+        return 1;
+    }
+    if ( pPars->fEnableCheck07 )
+    {
+        if ( pPars->nLutSize < 6 || pPars->nLutSize > 7 )
+        {
+            Abc_Print( -1, "This feature only works for {6,7}-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = If_CutPerformCheck07;
+        pPars->fCutMin = 1;
+    }
+    if ( pPars->fEnableCheck08 )
+    {
+        if ( pPars->nLutSize < 6 || pPars->nLutSize > 8 )
+        {
+            Abc_Print( -1, "This feature only works for {6,7,8}-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = If_CutPerformCheck08;
+        pPars->fCutMin = 1;
+    }
+    if ( pPars->fEnableCheck10 )
+    {
+        if ( pPars->nLutSize < 6 || pPars->nLutSize > 10 )
+        {
+            Abc_Print( -1, "This feature only works for {6,7,8,9,10}-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = If_CutPerformCheck10;
+        pPars->fCutMin = 1;
+    }
+    if ( pPars->fEnableCheck75 || pPars->fEnableCheck75u )
+    {
+        if ( pPars->fEnableCheck75 && pPars->fEnableCheck75u )
+        {
+            Abc_Print( -1, "Switches -f and -u are not compatible.\n" );
+            return 1;
+        }
+        if ( pPars->nLutSize < 5 || pPars->nLutSize > 8 )
+        {
+            Abc_Print( -1, "This feature only works for {6,7,8}-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = If_CutPerformCheck75;
+        pPars->fCutMin = 1;
+    }
+    if ( pPars->pLutStruct )
+    {
+        if ( pPars->fDsdBalance )
+        {
+            Abc_Print( -1, "Incompatible options (-S and -x).\n" );
+            return 1;
+        }
+        if ( pPars->nLutSize < 6 || pPars->nLutSize > 16 )
+        {
+            Abc_Print( -1, "This feature only works for [6;16]-LUTs.\n" );
+            return 1;
+        }
+        pPars->pFuncCell = pPars->fDelayOptLut ? NULL : If_CutPerformCheck16;
+        pPars->fCutMin = 1;
+    }
+
+    // enable truth table computation if cut minimization is selected
+    if ( pPars->fCutMin || pPars->fDeriveLuts )
+    {
+        pPars->fTruth = 1;
+        pPars->fExpRed = 0;
+        if ( pPars->pLutStruct == NULL )
+            pPars->fDeriveLuts = 1;
+    }
+    // modify the subgraph recording
+    if ( pPars->fUserRecLib )
+    {
+        pPars->fTruth      =  1;
+        pPars->fCutMin     =  1;
+        pPars->fExpRed     =  0;
+        pPars->fUsePerm    =  1;
+        pPars->pLutLib     =  NULL;
+    }
+    // modify for delay optimization
+    if ( pPars->fDelayOpt || pPars->fDsdBalance || pPars->fDelayOptLut )
+    {
+        pPars->fTruth      =  1;
+        pPars->fCutMin     =  1;
+        pPars->fExpRed     =  0;
+        pPars->fUseDsd     =  pPars->fDsdBalance || pPars->fDelayOptLut;
+        pPars->pLutLib     =  NULL;
+    }
+    // modify for delay optimization
+    if ( pPars->nGateSize > 0 )
+    {
+        pPars->fTruth      =  1;
+        pPars->fCutMin     =  1;
+        pPars->fExpRed     =  0;
+        pPars->fUsePerm    =  1;
+        pPars->pLutLib     =  NULL;
+        pPars->nLutSize    =  pPars->nGateSize;
+    }
+
+    if ( pPars->fUseDsd || pPars->fUseTtPerm )
+    {
+        pPars->fTruth      =  1;
+        pPars->fCutMin     =  1;
+        pPars->fExpRed     =  0;
+    }
+
+    if ( pPars->fUseDsd )
+    {
+        int LutSize = (pPars->pLutStruct && pPars->pLutStruct[2] == 0)? pPars->pLutStruct[0] - '0' : 0;
+        If_DsdMan_t * p = (If_DsdMan_t *)Abc_FrameReadManDsd();
+        if ( pPars->pLutStruct && pPars->pLutStruct[2] != 0 )
+        {
+            printf( "DSD only works for LUT structures XY.\n" );
+            return 0;
+        }
+        if ( p && pPars->nLutSize > If_DsdManVarNum(p) )
+        {
+            printf( "DSD manager has incompatible number of variables.\n" );
+            return 0;
+        }
+        if ( p && LutSize != If_DsdManLutSize(p) && !pPars->fDsdBalance )
+        {
+            printf( "DSD manager has different LUT size.\n" );
+            return 0;
+        }
+        if ( p == NULL )
+            Abc_FrameSetManDsd( If_DsdManAlloc(pPars->nLutSize, LutSize) );
+    }
+
+    if ( pPars->fUserRecLib )
+    {
+        if ( !Abc_NtkRecIsRunning3() )
+        {
+            printf( "LMS manager is not running (use \"rec_start3\").\n" );
+            return 0;
+        }
+        if ( Abc_NtkRecInputNum3() != pPars->nLutSize )
+        {
+            printf( "The number of library inputs (%d) different from the K parameters (%d).\n", Abc_NtkRecInputNum3(), pPars->nLutSize );
+            return 0;
+        }
+    }
+
+    // complain if truth tables are requested but the cut size is too large
+    if ( pPars->fTruth && pPars->nLutSize > IF_MAX_FUNC_LUTSIZE )
+    {
+        Abc_Print( -1, "Truth tables cannot be computed for LUT larger than %d inputs.\n", IF_MAX_FUNC_LUTSIZE );
+        return 1;
+    }
+    if ( pAbc->pGia->pManTime && pAbc->pLibBox == NULL )
+    {
+        Abc_Print( -1, "Design has boxes but box library is not entered.\n" );
+        return 1;
+    }
+
+    // perform mapping
+    pNew = Gia_ManPerformMapping( pAbc->pGia, pPars );
+    if ( pNew == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9If(): Mapping of GIA has failed.\n" );
+        return 1;
+    }
+    Abc_FrameUpdateGia( pAbc, pNew );
+    return 0;
+
+usage:
+    if ( pPars->DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%.2f", pPars->DelayTarget );
+    if ( pPars->nLutSize == -1 )
+        sprintf(LutSize, "library" );
+    else
+        sprintf(LutSize, "%d", pPars->nLutSize );
+    Abc_Print( -2, "usage: &if [-KCFAGRT num] [-DEW float] [-S str] [-qarlepmsdbgxyojikfuztncvh]\n" );
+    Abc_Print( -2, "\t           performs FPGA technology mapping of the network\n" );
+    Abc_Print( -2, "\t-K num   : the number of LUT inputs (2 < num < %d) [default = %s]\n", IF_MAX_LUTSIZE+1, LutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nCutsMax );
+    Abc_Print( -2, "\t-F num   : the number of area flow recovery iterations (num >= 0) [default = %d]\n", pPars->nFlowIters );
+    Abc_Print( -2, "\t-A num   : the number of exact area recovery iterations (num >= 0) [default = %d]\n", pPars->nAreaIters );
+    Abc_Print( -2, "\t-G num   : the max AND/OR gate size for mapping (0 = unused) [default = %d]\n", pPars->nGateSize );
+    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
+    Abc_Print( -2, "\t-D float : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-E float : sets epsilon used for tie-breaking [default = %f]\n", pPars->Epsilon );
+    Abc_Print( -2, "\t-W float : sets wire delay between adjects LUTs [default = %f]\n", pPars->WireDelay );
+    Abc_Print( -2, "\t-S str   : string representing the LUT structure [default = %s]\n", pPars->pLutStruct ? pPars->pLutStruct : "not used" );
+    Abc_Print( -2, "\t-T num   : the type of LUT structures [default = any]\n", pPars->nStructType );
+    Abc_Print( -2, "\t-q       : toggles preprocessing using several starting points [default = %s]\n", pPars->fPreprocess? "yes": "no" );
+    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fArea? "yes": "no" );
+    Abc_Print( -2, "\t-r       : enables expansion/reduction of the best cuts [default = %s]\n", pPars->fExpRed? "yes": "no" );
+    Abc_Print( -2, "\t-l       : optimizes latch paths for delay, other paths for area [default = %s]\n", pPars->fLatchPaths? "yes": "no" );
+    Abc_Print( -2, "\t-e       : uses edge-based cut selection heuristics [default = %s]\n", pPars->fEdge? "yes": "no" );
+    Abc_Print( -2, "\t-p       : uses power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
+    Abc_Print( -2, "\t-m       : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
+    Abc_Print( -2, "\t-s       : toggles delay-oriented mapping used with -S <NN> [default = %s]\n", pPars->fDelayOptLut? "yes": "no" );
+    Abc_Print( -2, "\t-d       : toggles deriving local AIGs using bi-decomposition [default = %s]\n", pPars->fBidec? "yes": "no" );
+    Abc_Print( -2, "\t-b       : toggles the use of one special feature [default = %s]\n", pPars->fUseBat? "yes": "no" );
+    Abc_Print( -2, "\t-g       : toggles delay optimization by SOP balancing [default = %s]\n", pPars->fDelayOpt? "yes": "no" );
+    Abc_Print( -2, "\t-x       : toggles delay optimization by DSD balancing [default = %s]\n", pPars->fDsdBalance? "yes": "no" );
+    Abc_Print( -2, "\t-y       : toggles delay optimization with recorded library [default = %s]\n", pPars->fUserRecLib? "yes": "no" );
+    Abc_Print( -2, "\t-o       : toggles using buffers to decouple combinational outputs [default = %s]\n", pPars->fUseBuffs? "yes": "no" );
+    Abc_Print( -2, "\t-j       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck07? "yes": "no" );
+    Abc_Print( -2, "\t-i       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck08? "yes": "no" );
+    Abc_Print( -2, "\t-k       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck10? "yes": "no" );
+    Abc_Print( -2, "\t-f       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck75? "yes": "no" );
+    Abc_Print( -2, "\t-u       : toggles enabling additional check [default = %s]\n", pPars->fEnableCheck75u? "yes": "no" );
+    Abc_Print( -2, "\t-z       : toggles deriving LUTs when mapping into LUT structures [default = %s]\n", pPars->fDeriveLuts? "yes": "no" );
+    Abc_Print( -2, "\t-t       : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
+    Abc_Print( -2, "\t-n       : toggles computing DSDs of the cut functions [default = %s]\n", pPars->fUseDsd? "yes": "no" );
+    Abc_Print( -2, "\t-c       : toggles computing truth tables in a new way [default = %s]\n", pPars->fUseTtPerm? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Iff( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Gia_ManIffTest( Gia_Man_t * pGia, If_LibLut_t * pLib, int fVerbose );
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Iff(): There is no AIG to map.\n" );
+        return 1;
+    }
+    if ( !Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Iff(): Mapping of the AIG is not defined.\n" );
+        return 1;
+    }
+    if ( pAbc->pLibLut == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Iff(): LUT library is not defined.\n" );
+        return 1;
+    }
+    Gia_ManIffTest( pAbc->pGia, (If_LibLut_t *)pAbc->pLibLut, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &iff [-vh]\n" );
+    Abc_Print( -2, "\t           performs structural mapping into LUT structures\n" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9If2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Abc_Ntk_t * Mpm_ManCellMapping( Gia_Man_t * p, Mpm_Par_t * pPars, void * pMio );
+    extern Gia_Man_t * Mpm_ManLutMapping( Gia_Man_t * p, Mpm_Par_t * pPars );
+    char Buffer[200];
+    Abc_Ntk_t * pTemp;
+    Gia_Man_t * pNew;
+    Mpm_Par_t Pars, * pPars = &Pars;
+    int c, nLutSize = 6;
+    // set defaults
+    Mpm_ManSetParsDefault( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCDtmzrcuxvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLutSize < 2 || nLutSize > 16 )
+            {
+                Abc_Print( -1, "LUT size %d is not supported.\n", nLutSize );
+                goto usage;
+            }
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nNumCuts = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nNumCuts < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 't':
+            pPars->fUseGates ^= 1;
+            break;
+        case 'm':
+            pPars->fCutMin ^= 1;
+            break;
+        case 'z':
+            pPars->fDeriveLuts ^= 1;
+            break;
+        case 'r':
+            pPars->fOneRound ^= 1;
+            break;
+        case 'c':
+            pPars->fMap4Cnf ^= 1;
+            break;
+        case 'u':
+            pPars->fMap4Aig ^= 1;
+            break;
+        case 'x':
+            pPars->fMap4Gates ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty GIA network.\n" );
+        return 1;
+    }
+
+    if ( pPars->fMap4Cnf )
+        pPars->fUseDsd = 1;
+    if ( pPars->fCutMin )
+        pPars->fUseDsd = 1;
+//        pPars->fUseTruth = 1;
+    if ( pPars->fMap4Gates )
+    {
+        pPars->fUseDsd = 1;
+        if ( pAbc->pLibScl == NULL )
+        {
+            Abc_Print( -1, "There is no SCL library available.\n" );
+            return 1;
+        }
+        pPars->pScl = pAbc->pLibScl;
+    }
+    if ( pPars->fUseDsd || pPars->fUseTruth )
+        pPars->fDeriveLuts = 1;
+    if ( pPars->fUseDsd && nLutSize != 6 )
+    {
+        Abc_Print( -1, "Currently DSD can only be used with 6-input cuts.\n" );
+        return 1;
+    }
+    // perform mapping
+    assert( pPars->pLib == NULL );
+    if ( pPars->fMap4Gates )
+    {
+        if ( Abc_FrameReadLibGen() == NULL )
+        {
+            Abc_Print( -1, "There is no GENLIB library available.\n" );
+            return 1;
+        }
+        pPars->pLib = Mpm_LibLutSetSimple( nLutSize );
+        pTemp = Mpm_ManCellMapping( pAbc->pGia, pPars, Abc_FrameReadLibGen() );
+        Mpm_LibLutFree( pPars->pLib );
+        if ( pTemp == NULL )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9If2(): Mapping into standard cells has failed.\n" );
+            return 1;
+        }
+        Abc_FrameReplaceCurrentNetwork( pAbc, pTemp );
+    }
+    else
+    {
+        pPars->pLib = Mpm_LibLutSetSimple( nLutSize );
+        pNew = Mpm_ManLutMapping( pAbc->pGia, pPars );
+        Mpm_LibLutFree( pPars->pLib );
+        if ( pNew == NULL )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9If2(): Mapping into LUTs has failed.\n" );
+            return 1;
+        }
+        Abc_FrameUpdateGia( pAbc, pNew );
+    }
+    return 0;
+
+usage:
+    if ( pPars->DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%d", pPars->DelayTarget );
+    Abc_Print( -2, "usage: &if2 [-KCD num] [-tmzrcuxvwh]\n" );
+    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
+    Abc_Print( -2, "\t-K num   : sets the LUT size for the mapping [default = %d]\n", nLutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (0 < num < 2^12) [default = %d]\n", pPars->nNumCuts );
+    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-t       : enables using AND/XOR/MUX nodes instead of simple AIG [default = %s]\n", pPars->fUseGates? "yes": "no" );
+    Abc_Print( -2, "\t-m       : enables cut minimization by removing vacuous variables [default = %s]\n", pPars->fCutMin? "yes": "no" );
+    Abc_Print( -2, "\t-z       : toggles deriving LUTs when mapping into LUT structures [default = %s]\n", pPars->fDeriveLuts? "yes": "no" );
+    Abc_Print( -2, "\t-r       : toggles using one round of mapping [default = %s]\n", pPars->fOneRound? "yes": "no" );
+    Abc_Print( -2, "\t-c       : toggles mapping for CNF computation [default = %s]\n", pPars->fMap4Cnf? "yes": "no" );
+    Abc_Print( -2, "\t-u       : toggles mapping for AIG computation [default = %s]\n", pPars->fMap4Aig? "yes": "no" );
+    Abc_Print( -2, "\t-x       : toggles mapping for standard cells [default = %s]\n", pPars->fMap4Gates? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Jf( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[200];
+    Jf_Par_t Pars, * pPars = &Pars;
+    Gia_Man_t * pNew; int c;
+    Jf_ManSetDefaultPars( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCDWaekmdcgvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
+            {
+                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
+                goto usage;
+            }
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
+            {
+                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
+                goto usage;
+            }
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nVerbLimit < 0 )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fAreaOnly ^= 1;
+            break;
+        case 'e':
+            pPars->fOptEdge ^= 1;
+            break;
+        case 'k':
+            pPars->fCoarsen ^= 1;
+            break;
+        case 'm':
+            pPars->fCutMin ^= 1;
+            break;
+        case 'd':
+            pPars->fFuncDsd ^= 1;
+            break;
+        case 'c':
+            pPars->fGenCnf ^= 1;
+            break;
+        case 'g':
+            pPars->fPureAig ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty GIA network.\n" );
+        return 1;
+    }
+
+    if ( (pPars->fFuncDsd || pPars->fGenCnf) && pPars->nLutSize > 6 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Jf(): DSD computation works for LUT6 or less.\n" );
+        return 1;
+    }
+
+    if ( (pPars->fFuncDsd || pPars->fGenCnf) && !Sdm_ManCanRead() )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Jf(): Cannot input DSD data from file.\n" );
+        return 1;
+    }
+
+    pNew = Jf_ManPerformMapping( pAbc->pGia, pPars );
+    if ( pNew == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Jf(): Mapping into LUTs has failed.\n" );
+        return 1;
+    }
+    Abc_FrameUpdateGia( pAbc, pNew );
+    return 0;
+
+usage:
+    if ( pPars->DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%d", pPars->DelayTarget );
+    Abc_Print( -2, "usage: &jf [-KCDW num] [-akmdcgvwh]\n" );
+    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
+    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
+    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-W num   : min frequency when printing functions with \"-w\" [default = %d]\n", pPars->nVerbLimit );
+    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
+    Abc_Print( -2, "\t-e       : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
+    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
+    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
+    Abc_Print( -2, "\t-d       : toggles using DSD to represent cut functions [default = %s]\n", pPars->fFuncDsd? "yes": "no" );
+    Abc_Print( -2, "\t-c       : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
+    Abc_Print( -2, "\t-g       : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+
+#ifdef ABC_USE_PTHREADS
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Kf( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Kf_ManSetDefaultPars( Jf_Par_t * pPars );
+    extern Gia_Man_t * Kf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars );
+    char Buffer[200];
+    Jf_Par_t Pars, * pPars = &Pars;
+    Gia_Man_t * pNew; int c;
+    Kf_ManSetDefaultPars( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCPDWaekmdcgtsvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
+            {
+                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
+                goto usage;
+            }
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
+            {
+                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
+                goto usage;
+            }
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nProcNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nProcNum < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nVerbLimit < 0 )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fAreaOnly ^= 1;
+            break;
+        case 'e':
+            pPars->fOptEdge ^= 1;
+            break;
+        case 'k':
+            pPars->fCoarsen ^= 1;
+            break;
+        case 'm':
+            pPars->fCutMin ^= 1;
+            break;
+        case 'd':
+            pPars->fFuncDsd ^= 1;
+            break;
+        case 'c':
+            pPars->fGenCnf ^= 1;
+            break;
+        case 'g':
+            pPars->fPureAig ^= 1;
+            break;
+        case 't':
+            pPars->fCutHashing ^= 1;
+            break;
+        case 's':
+            pPars->fCutSimple ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty GIA network.\n" );
+        return 1;
+    }
+
+    pNew = Kf_ManPerformMapping( pAbc->pGia, pPars );
+    if ( pNew == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Kf(): Mapping into LUTs has failed.\n" );
+        return 1;
+    }
+    Abc_FrameUpdateGia( pAbc, pNew );
+    return 0;
+
+usage:
+    if ( pPars->DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%d", pPars->DelayTarget );
+    Abc_Print( -2, "usage: &kf [-KCPDW num] [-akmdcgtsvwh]\n" );
+    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
+    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
+    Abc_Print( -2, "\t-P num   : the number of cut computation processes (0 <= P <= %d) [default = %d]\n", pPars->nProcNumMax, pPars->nProcNum );
+    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-W num   : min frequency when printing functions with \"-w\" [default = %d]\n", pPars->nVerbLimit );
+    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
+    Abc_Print( -2, "\t-e       : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
+    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
+    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
+    Abc_Print( -2, "\t-d       : toggles using DSD to represent cut functions [default = %s]\n", pPars->fFuncDsd? "yes": "no" );
+    Abc_Print( -2, "\t-c       : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
+    Abc_Print( -2, "\t-g       : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
+    Abc_Print( -2, "\t-t       : toggles cut computation using hash table [default = %s]\n", pPars->fCutHashing? "yes": "no" );
+    Abc_Print( -2, "\t-s       : toggles cut computation using a simple method [default = %s]\n", pPars->fCutSimple? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+#endif
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Lf( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[200];
+    Jf_Par_t Pars, * pPars = &Pars;
+    Gia_Man_t * pNew; int c;
+    Lf_ManSetDefaultPars( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWMaekmupgtvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
+            {
+                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
+                goto usage;
+            }
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
+            {
+                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
+                goto usage;
+            }
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRoundsEla < 0 )
+                goto usage;
+            break;
+		case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nRelaxRatio < 0 ) 
+				goto usage;
+            break;
+		case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nCoarseLimit < 0 ) 
+				goto usage;
+            break;
+		case 'E':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nAreaTuner < 0 ) 
+				goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nVerbLimit < 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nLutSizeMux = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutSizeMux < 2 || pPars->nLutSizeMux > pPars->nLutSizeMax )
+            {
+                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSizeMux );
+                goto usage;
+            }
+            break;
+        case 'a':
+            pPars->fAreaOnly ^= 1;
+            break;
+        case 'e':
+            pPars->fOptEdge ^= 1;
+            break;
+        case 'k':
+            pPars->fCoarsen ^= 1;
+            break;
+        case 'm':
+            pPars->fCutMin ^= 1;
+            break;
+        case 'u':
+            pPars->fUseMux7 ^= 1;
+            break;
+        case 'p':
+            pPars->fPower ^= 1;
+            break;
+        case 'g':
+            pPars->fPureAig ^= 1;
+            break;
+        case 't':
+            pPars->fDoAverage ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty GIA network.\n" );
+        return 1;
+    }
+    if ( Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Current AIG has mapping. Run \"&st\".\n" );
+        return 1;
+    }
+    if ( pPars->nLutSizeMux && pPars->fUseMux7 )
+    {
+        Abc_Print( -1, "Flags \"-M\" and \"-u\" are incompatible.\n" );
+        return 1;
+    }
+
+    pNew = Lf_ManPerformMapping( pAbc->pGia, pPars );
+    if ( pNew == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Lf(): Mapping into LUTs has failed.\n" );
+        return 1;
+    }
+    Abc_FrameUpdateGia( pAbc, pNew );
+    return 0;
+
+usage:
+    if ( pPars->DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%d", pPars->DelayTarget );
+    Abc_Print( -2, "usage: &lf [-KCFARLEDM num] [-kmupgtvwh]\n" );
+    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
+    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
+    Abc_Print( -2, "\t-F num   : the number of area flow rounds [default = %d]\n", pPars->nRounds );
+    Abc_Print( -2, "\t-A num   : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
+    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
+    Abc_Print( -2, "\t-L num   : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
+    Abc_Print( -2, "\t-E num   : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
+    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-M num   : LUT size for the cofactoring (0 <= num <= 100) [default = %d]\n", pPars->nLutSizeMux );
+//    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
+    Abc_Print( -2, "\t-e       : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
+    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
+    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
+    Abc_Print( -2, "\t-u       : toggles using additional MUXes [default = %s]\n", pPars->fUseMux7? "yes": "no" );
+    Abc_Print( -2, "\t-p       : toggles power-aware cut selection heuristics [default = %s]\n", pPars->fPower? "yes": "no" );
+    Abc_Print( -2, "\t-g       : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
+    Abc_Print( -2, "\t-t       : toggles optimizing average rather than maximum level [default = %s]\n", pPars->fDoAverage? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Mf( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    char Buffer[200];
+    Jf_Par_t Pars, * pPars = &Pars;
+    Gia_Man_t * pNew; int c;
+    Mf_ManSetDefaultPars( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWaekmcgvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
+            {
+                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
+                goto usage;
+            }
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
+            {
+                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
+                goto usage;
+            }
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRoundsEla < 0 )
+                goto usage;
+            break;
+		case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nRelaxRatio < 0 ) 
+				goto usage;
+            break;
+		case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nCoarseLimit < 0 ) 
+				goto usage;
+            break;
+		case 'E':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nAreaTuner < 0 ) 
+				goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nVerbLimit < 0 )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fAreaOnly ^= 1;
+            break;
+        case 'e':
+            pPars->fOptEdge ^= 1;
+            break;
+        case 'k':
+            pPars->fCoarsen ^= 1;
+            break;
+        case 'm':
+            pPars->fCutMin ^= 1;
+            break;
+        case 'c':
+            pPars->fGenCnf ^= 1;
+            break;
+        case 'g':
+            pPars->fPureAig ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty GIA network.\n" );
+        return 1;
+    }
+
+    pNew = Mf_ManPerformMapping( pAbc->pGia, pPars );
+    if ( pNew == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Lf(): Mapping into LUTs has failed.\n" );
+        return 1;
+    }
+    if ( pPars->fGenCnf )
+        Cnf_DataFree( pAbc->pGia->pData ), pAbc->pGia->pData = NULL;
+    Abc_FrameUpdateGia( pAbc, pNew );
+    return 0;
+
+usage:
+    if ( pPars->DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%d", pPars->DelayTarget );
+    Abc_Print( -2, "usage: &mf [-KCFARLED num] [-akmcgvwh]\n" );
+    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
+    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
+    Abc_Print( -2, "\t-F num   : the number of area flow rounds [default = %d]\n", pPars->nRounds );
+    Abc_Print( -2, "\t-A num   : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
+    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
+    Abc_Print( -2, "\t-L num   : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
+    Abc_Print( -2, "\t-E num   : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
+    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
+    Abc_Print( -2, "\t-e       : toggles edge vs node minimization [default = %s]\n", pPars->fOptEdge? "yes": "no" );
+    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
+    Abc_Print( -2, "\t-m       : toggles cut minimization [default = %s]\n", pPars->fCutMin? "yes": "no" );
+    Abc_Print( -2, "\t-c       : toggles mapping for CNF generation [default = %s]\n", pPars->fGenCnf? "yes": "no" );
+    Abc_Print( -2, "\t-g       : toggles generating AIG without mapping [default = %s]\n", pPars->fPureAig? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Nf( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Nf_ManSetDefaultPars( Jf_Par_t * pPars );
+    extern Gia_Man_t * Nf_ManPerformMapping( Gia_Man_t * pGia, Jf_Par_t * pPars );
+    char Buffer[200];
+    Jf_Par_t Pars, * pPars = &Pars;
+    Gia_Man_t * pNew; int c;
+    Nf_ManSetDefaultPars( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "KCFARLEDWakvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'K':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-K\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nLutSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nLutSize < 2 || pPars->nLutSize > pPars->nLutSizeMax )
+            {
+                Abc_Print( -1, "LUT size %d is not supported.\n", pPars->nLutSize );
+                goto usage;
+            }
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nCutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nCutNum < 1 || pPars->nCutNum > pPars->nCutNumMax )
+            {
+                Abc_Print( -1, "This number of cuts (%d) is not supported.\n", pPars->nCutNum );
+                goto usage;
+            }
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nRounds = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRounds < 0 )
+                goto usage;
+            break;
+        case 'A':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-A\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nRoundsEla = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nRoundsEla < 0 )
+                goto usage;
+            break;
+		case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nRelaxRatio = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nRelaxRatio < 0 ) 
+				goto usage;
+            break;
+		case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-R\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nCoarseLimit = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nCoarseLimit < 0 ) 
+				goto usage;
+            break;
+		case 'E':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( 1, "Command line switch \"-E\" should be followed by a floating point number.\n" );
+                return 0;
+            }
+			pPars->nAreaTuner = atoi(argv[globalUtilOptind]);
+			globalUtilOptind++;
+			if ( pPars->nAreaTuner < 0 ) 
+				goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by a floating point number.\n" );
+                goto usage;
+            }
+            pPars->DelayTarget = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->DelayTarget <= 0.0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            pPars->nVerbLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nVerbLimit < 0 )
+                goto usage;
+            break;
+        case 'a':
+            pPars->fAreaOnly ^= 1;
+            break;
+        case 'k':
+            pPars->fCoarsen ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Empty GIA network.\n" );
+        return 1;
+    }
+    if ( Abc_FrameReadLibGen() == NULL )
+    {
+        Abc_Print( -1, "Current library is not available.\n" );
+        return 1;
+    }
+    pNew = Nf_ManPerformMapping( pAbc->pGia, pPars );
+    if ( pNew == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Nf(): Mapping into LUTs has failed.\n" );
+        return 1;
+    }
+    Abc_FrameUpdateGia( pAbc, pNew );
+    return 0;
+
+usage:
+    if ( pPars->DelayTarget == -1 )
+        sprintf(Buffer, "best possible" );
+    else
+        sprintf(Buffer, "%d", pPars->DelayTarget );
+    Abc_Print( -2, "usage: &nf [-KCFARLED num] [-akvwh]\n" );
+    Abc_Print( -2, "\t           performs technology mapping of the network\n" );
+    Abc_Print( -2, "\t-K num   : LUT size for the mapping (2 <= K <= %d) [default = %d]\n", pPars->nLutSizeMax, pPars->nLutSize );
+    Abc_Print( -2, "\t-C num   : the max number of priority cuts (1 <= C <= %d) [default = %d]\n", pPars->nCutNumMax, pPars->nCutNum );
+    Abc_Print( -2, "\t-F num   : the number of area flow rounds [default = %d]\n", pPars->nRounds );
+    Abc_Print( -2, "\t-A num   : the number of exact area rounds [default = %d]\n", pPars->nRoundsEla );
+    Abc_Print( -2, "\t-R num   : the delay relaxation ratio (num >= 0) [default = %d]\n", pPars->nRelaxRatio );
+    Abc_Print( -2, "\t-L num   : the fanout limit for coarsening XOR/MUX (num >= 2) [default = %d]\n", pPars->nCoarseLimit );
+    Abc_Print( -2, "\t-E num   : the area/edge tradeoff parameter (0 <= num <= 100) [default = %d]\n", pPars->nAreaTuner );
+    Abc_Print( -2, "\t-D num   : sets the delay constraint for the mapping [default = %s]\n", Buffer );
+    Abc_Print( -2, "\t-a       : toggles area-oriented mapping [default = %s]\n", pPars->fAreaOnly? "yes": "no" );
+    Abc_Print( -2, "\t-k       : toggles coarsening the subject graph [default = %s]\n", pPars->fCoarsen? "yes": "no" );
+    Abc_Print( -2, "\t-v       : toggles verbose output [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggles very verbose output [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : prints the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Unmap( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Gia_ManTestStruct( Gia_Man_t * p );
+    int c, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Struct(): There is no AIG to map.\n" );
+        return 1;
+    }
+	Vec_IntFreeP( &pAbc->pGia->vMapping );
+	Vec_IntFreeP( &pAbc->pGia->vPacking );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &unmap [-vh]\n" );
+    Abc_Print( -2, "\t           removes mapping from the current network\n" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Struct( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Gia_ManTestStruct( Gia_Man_t * p );
+    int c, fVerbose;
+    // set defaults
+    fVerbose   = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Struct(): There is no AIG to map.\n" );
+        return 1;
+    }
+    if ( !Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Struct(): Mapping of the AIG is not defined.\n" );
+        return 1;
+    }
+    if ( Gia_ManLutSizeMax(pAbc->pGia) >= 8 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Struct(): Can only handle nodes with less than 8 inputs.\n" );
+        return 1;
+    }
+    Gia_ManTestStruct( pAbc->pGia );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &struct [-vh]\n" );
+    Abc_Print( -2, "\t           checks decomposition structures of the current mapping\n" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Trace( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    int fUseLutLib;
+    int fVerbose;
+    // set defaults
+    fUseLutLib = 0;
+    fVerbose   = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "lvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'l':
+            fUseLutLib ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Speedup(): There is no AIG to map.\n" );
+        return 1;
+    }
+    if ( !Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Speedup(): Mapping of the AIG is not defined.\n" );
+        return 1;
+    }
+    pAbc->pGia->pLutLib = fUseLutLib ? pAbc->pLibLut : NULL;
+    Gia_ManDelayTraceLutPrint( pAbc->pGia, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &trace [-lvh]\n" );
+    Abc_Print( -2, "\t           performs delay trace of LUT-mapped network\n" );
+    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib": "unit" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Speedup( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int fUseLutLib;
+    int Percentage;
+    int Degree;
+    int fVerbose;
+    int c, fVeryVerbose;
+
+    // set defaults
+    fUseLutLib   = 0;
+    Percentage   = 5;
+    Degree       = 2;
+    fVerbose     = 0;
+    fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PNlvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Percentage = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Percentage < 1 || Percentage > 100 )
+                goto usage;
+            break;
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            Degree = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( Degree < 1 || Degree > 5 )
+                goto usage;
+            break;
+        case 'l':
+            fUseLutLib ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Speedup(): There is no AIG to map.\n" );
+        return 1;
+    }
+    if ( !Gia_ManHasMapping(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Speedup(): Mapping of the AIG is not defined.\n" );
+        return 1;
+    }
+    pAbc->pGia->pLutLib = fUseLutLib ? pAbc->pLibLut : NULL;
+    pTemp = Gia_ManSpeedup( pAbc->pGia, Percentage, Degree, fVerbose, fVeryVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &speedup [-P num] [-N num] [-lvwh]\n" );
+    Abc_Print( -2, "\t           transforms LUT-mapped network into an AIG with choices;\n" );
+    Abc_Print( -2, "\t           the choices are added to speedup the next round of mapping\n" );
+    Abc_Print( -2, "\t-P <num> : delay delta defining critical path for library model [default = %d%%]\n", Percentage );
+    Abc_Print( -2, "\t-N <num> : the max critical path degree for resynthesis (0 < num < 6) [default = %d]\n", Degree );
+    Abc_Print( -2, "\t-l       : toggle using unit- or LUT-library-delay model [default = %s]\n", fUseLutLib? "lib" : "unit" );
+    Abc_Print( -2, "\t-v       : toggle printing optimization summary [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w       : toggle printing detailed stats for each node [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h       : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Era( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    Gia_Man_t * pTemp = NULL;
+    int c, fVerbose = 0;
+    int fUseCubes = 1;
+    int fDumpFile = 0;
+    int fMiter = 0;
+    int nStatesMax = 1000000000;
+    extern int Gia_ManCollectReachable( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fDumpFile, int fVerbose );
+    extern int Gia_ManArePerform( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fVerbose );
+
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Smcdvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nStatesMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nStatesMax < 0 )
+                goto usage;
+            break;
+        case 'm':
+            fMiter ^= 1;
+            break;
+        case 'c':
+            fUseCubes ^= 1;
+            break;
+        case 'd':
+            fDumpFile ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Era(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Era(): The network is combinational.\n" );
+        return 1;
+    }
+    if ( !fUseCubes && Gia_ManPiNum(pAbc->pGia) > 12 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Era(): The number of PIs (%d) should be no more than 12 when cubes are not used.\n", Gia_ManPiNum(pAbc->pGia) );
+        return 1;
+    }
+    if ( fUseCubes && !fDumpFile )
+        pAbc->Status = Gia_ManArePerform( pAbc->pGia, nStatesMax, fMiter, fVerbose );
+    else
+        pAbc->Status = Gia_ManCollectReachable( pAbc->pGia, nStatesMax, fMiter, fDumpFile, fVerbose );
+    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &era [-S num] [-mcdvh]\n" );
+    Abc_Print( -2, "\t          explicit reachability analysis for small sequential AIGs\n" );
+    Abc_Print( -2, "\t-S num  : the max number of states (num > 0) [default = %d]\n", nStatesMax );
+    Abc_Print( -2, "\t-m      : stop when the miter output is 1 [default = %s]\n", fMiter? "yes": "no" );
+    Abc_Print( -2, "\t-c      : use state cubes instead of state minterms [default = %s]\n", fUseCubes? "yes": "no" );
+    Abc_Print( -2, "\t-d      : toggle dumping STG into a file [default = %s]\n", fDumpFile? "yes": "no" );
+    Abc_Print( -2, "\t-v      : print verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h      : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Dch( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    Dch_Pars_t Pars, * pPars = &Pars;
+    int c;
+    // set defaults
+    Dch_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "WCSsptfvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nWords = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nWords < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBTLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBTLimit < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nSatVarMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nSatVarMax < 0 )
+                goto usage;
+            break;
+        case 's':
+            pPars->fSynthesis ^= 1;
+            break;
+        case 'p':
+            pPars->fPower ^= 1;
+            break;
+        case 't':
+            pPars->fSimulateTfo ^= 1;
+            break;
+        case 'f':
+            pPars->fLightSynth ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Dch(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManPerformDch( pAbc->pGia, pPars );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &dch [-WCS num] [-sptfvh]\n" );
+    Abc_Print( -2, "\t         computes structural choices using a new approach\n" );
+    Abc_Print( -2, "\t-W num : the max number of simulation words [default = %d]\n", pPars->nWords );
+    Abc_Print( -2, "\t-C num : the max number of conflicts at a node [default = %d]\n", pPars->nBTLimit );
+    Abc_Print( -2, "\t-S num : the max number of SAT variables [default = %d]\n", pPars->nSatVarMax );
+    Abc_Print( -2, "\t-s     : toggle synthesizing three snapshots [default = %s]\n", pPars->fSynthesis? "yes": "no" );
+    Abc_Print( -2, "\t-p     : toggle power-aware rewriting [default = %s]\n", pPars->fPower? "yes": "no" );
+    Abc_Print( -2, "\t-t     : toggle simulation of the TFO classes [default = %s]\n", pPars->fSimulateTfo? "yes": "no" );
+    Abc_Print( -2, "\t-f     : toggle using lighter logic synthesis [default = %s]\n", pPars->fLightSynth? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle verbose printout [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Rpm( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, nCutMax   = 16;
+    int fUseOldAlgo  =  0;
+    int fVerbose     =  0;
+    int fVeryVerbose =  0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Cavwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nCutMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nCutMax < 0 )
+                goto usage;
+            break;
+        case 'a':
+            fUseOldAlgo ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Rpm(): There is no AIG.\n" );
+        return 0;
+    }
+    if ( fUseOldAlgo )
+        pTemp = Abs_RpmPerformOld( pAbc->pGia, fVerbose );
+    else
+        pTemp = Abs_RpmPerform( pAbc->pGia, nCutMax, fVerbose, fVeryVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &rpm [-C num] [-avwh]\n" );
+    Abc_Print( -2, "\t         performs structural reparametrization\n" );
+    Abc_Print( -2, "\t-C num : max cut size for testing range equivalence [default = %d]\n", nCutMax );
+    Abc_Print( -2, "\t-a     : toggle using old algorithm [default = %s]\n", fUseOldAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing more verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9BackReach( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int nTimeMax, int fVerbose );
+
+    Gia_Man_t * pTemp = NULL;
+    int c, fVerbose = 0;
+    int nFrameMax = 1000000;
+    int nConfMax  = 1000000;
+    int nTimeMax  =      10;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "FCTvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrameMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrameMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nConfMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nConfMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nTimeMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimeMax < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9BackReach(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManPoNum(pAbc->pGia) != 1 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9BackReach(): The number of POs is different from 1.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManCofTest( pAbc->pGia, nFrameMax, nConfMax, nTimeMax, fVerbose );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &back_reach [-FCT <num>] [-vh]\n" );
+    Abc_Print( -2, "\t         performs backward reachability by circuit cofactoring\n" );
+    Abc_Print( -2, "\t-F num : the limit on the depth of induction [default = %d]\n", nFrameMax );
+    Abc_Print( -2, "\t-C num : the conflict limit at a node during induction [default = %d]\n", nConfMax );
+    Abc_Print( -2, "\t-T num : the timeout for property directed reachability [default = %d]\n", nTimeMax );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Posplit( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Aig_Man_t * Aig_ManSplit( Aig_Man_t * p, int nVars, int fVerbose );
+    Aig_Man_t * pMan, * pAux;
+    Gia_Man_t * pTemp = NULL;
+    int c, nVars = 5, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Nvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nVars = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nVars < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Posplit(): There is no AIG.\n" );
+        return 1;
+    }
+    pMan = Gia_ManToAigSimple( pAbc->pGia );
+    pMan = Aig_ManSplit( pAux = pMan, nVars, fVerbose );
+    Aig_ManStop( pAux );
+    if ( pMan != NULL )
+    {
+        pTemp = Gia_ManFromAigSimple( pMan );
+        Aig_ManStop( pMan );
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    }
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &posplit [-N num] [-vh]\n" );
+    Abc_Print( -2, "\t         cofactors the property output w.r.t. a support subset\n" );
+    Abc_Print( -2, "\t         (the OR of new PO functions is equal to the original property)\n" );
+    Abc_Print( -2, "\t-N num : the number of random cofactoring variables [default = %d]\n", nVars );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9ReachM( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Gia_ParLlb_t Pars, * pPars = &Pars;
+    char * pLogFileName = NULL;
+    int c;
+    extern int Llb_ManModelCheckGia( Gia_Man_t * pGia, Gia_ParLlb_t * pPars );
+
+    // set defaults
+    Llb_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "TBFCHSLripcsyzvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBddMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBddMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nIterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIterMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nClusterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nClusterMax < 0 )
+                goto usage;
+            break;
+        case 'H':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nHintDepth = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nHintDepth < 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->HintFirst = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->HintFirst < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'r':
+            pPars->fReorder ^= 1;
+            break;
+        case 'i':
+            pPars->fIndConstr ^= 1;
+            break;
+        case 'p':
+            pPars->fUsePivots ^= 1;
+            break;
+        case 'c':
+            pPars->fCluster ^= 1;
+            break;
+        case 's':
+            pPars->fSchedule ^= 1;
+            break;
+        case 'y':
+            pPars->fSkipOutCheck ^= 1;
+            break;
+        case 'z':
+            pPars->fSkipReach ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachM(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachM(): The current AIG has no latches.\n" );
+        return 0;
+    }
+    if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachM(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
+        return 0;
+    }
+    pAbc->Status  = Llb_ManModelCheckGia( pAbc->pGia, pPars );
+    pAbc->nFrames = pPars->iFrame;
+    Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachm" );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &reachm [-TBFCHS num] [-L file] [-ripcsyzvwh]\n" );
+    Abc_Print( -2, "\t         model checking via BDD-based reachability (dependence-matrix-based)\n" );
+    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-B num : max number of nodes in the intermediate BDDs [default = %d]\n", pPars->nBddMax );
+    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
+    Abc_Print( -2, "\t-C num : max number of variables in a cluster [default = %d]\n", pPars->nClusterMax );
+    Abc_Print( -2, "\t-H num : max number of hints to use [default = %d]\n", pPars->nHintDepth );
+    Abc_Print( -2, "\t-S num : the number of the starting hint [default = %d]\n", pPars->HintFirst );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-r     : enable dynamic BDD variable reordering [default = %s]\n", pPars->fReorder? "yes": "no" );
+    Abc_Print( -2, "\t-i     : enable extraction of inductive constraints [default = %s]\n", pPars->fIndConstr? "yes": "no" );
+    Abc_Print( -2, "\t-p     : enable partitions for internal cut-points [default = %s]\n", pPars->fUsePivots? "yes": "no" );
+    Abc_Print( -2, "\t-c     : enable clustering of partitions [default = %s]\n", pPars->fCluster? "yes": "no" );
+    Abc_Print( -2, "\t-s     : enable scheduling of clusters [default = %s]\n", pPars->fSchedule? "yes": "no" );
+    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
+    Abc_Print( -2, "\t-z     : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : prints dependency matrix [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9ReachP( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Gia_ParLlb_t Pars, * pPars = &Pars;
+    Aig_Man_t * pMan;
+    char * pLogFileName = NULL;
+    int c;
+    extern int Llb_ManReachMinCut( Aig_Man_t * pAig, Gia_ParLlb_t * pPars );
+
+    // set defaults
+    Llb_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "NBFTLrbyzdvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'N':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-N\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nPartValue = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nPartValue < 0 )
+                goto usage;
+            break;
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBddMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBddMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nIterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIterMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'r':
+            pPars->fReorder ^= 1;
+            break;
+        case 'b':
+            pPars->fBackward ^= 1;
+            break;
+        case 'y':
+            pPars->fSkipOutCheck ^= 1;
+            break;
+        case 'z':
+            pPars->fSkipReach ^= 1;
+            break;
+        case 'd':
+            pPars->fDumpReached ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachP(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachP(): The current AIG has no latches.\n" );
+        return 0;
+    }
+    if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachP(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
+        return 0;
+    }
+    pMan          = Gia_ManToAigSimple( pAbc->pGia );
+    pAbc->Status  = Llb_ManReachMinCut( pMan, pPars );
+    pAbc->nFrames = pPars->iFrame;
+    Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachp" );
+    Aig_ManStop( pMan );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &reachp [-NFT num] [-L file] [-rbyzdvwh]\n" );
+    Abc_Print( -2, "\t         model checking via BDD-based reachability (partitioning-based)\n" );
+    Abc_Print( -2, "\t-N num : partitioning value (MinVol=nANDs/N/2; MaxVol=nANDs/N) [default = %d]\n", pPars->nPartValue );
+//    Abc_Print( -2, "\t-B num : the BDD node increase when hints kick in [default = %d]\n", pPars->nBddMax );
+    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
+    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-r     : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
+    Abc_Print( -2, "\t-b     : perform backward reachability analysis [default = %s]\n", pPars->fBackward? "yes": "no" );
+    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
+    Abc_Print( -2, "\t-z     : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
+    Abc_Print( -2, "\t-d     : dump BDD of reached states into file \"reached.blif\" [default = %s]\n", pPars->fDumpReached? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9ReachN( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Gia_ParLlb_t Pars, * pPars = &Pars;
+    Aig_Man_t * pMan;
+    char * pLogFileName = NULL;
+    int c;
+    extern int Llb_NonlinCoreReach( Aig_Man_t * pAig, Gia_ParLlb_t * pPars );
+
+    // set defaults
+    Llb_ManSetDefaultParams( pPars );
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "BFTLryzvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBddMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBddMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nIterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIterMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'r':
+            pPars->fReorder ^= 1;
+            break;
+        case 'y':
+            pPars->fSkipOutCheck ^= 1;
+            break;
+        case 'z':
+            pPars->fSkipReach ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachN(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachN(): The current AIG has no latches.\n" );
+        return 0;
+    }
+    if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachN(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
+        return 0;
+    }
+    pMan          = Gia_ManToAigSimple( pAbc->pGia );
+    pAbc->Status  = Llb_NonlinCoreReach( pMan, pPars );
+    pAbc->nFrames = pPars->iFrame;
+    Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachn" );
+    Aig_ManStop( pMan );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &reachn [-BFT num] [-L file] [-ryzvh]\n" );
+    Abc_Print( -2, "\t         model checking via BDD-based reachability (non-linear-QS-based)\n" );
+    Abc_Print( -2, "\t-B num : the BDD node increase when hints kick in [default = %d]\n", pPars->nBddMax );
+    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
+    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-r     : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
+    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
+    Abc_Print( -2, "\t-z     : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+//    Abc_Print( -2, "\t-w     : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9ReachY( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+//    Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
+    Gia_ParLlb_t Pars, * pPars = &Pars;
+    Aig_Man_t * pMan;
+    char * pLogFileName = NULL;
+    int c;
+
+    // set defaults
+    Llb_ManSetDefaultParams( pPars );
+    pPars->fCluster = 0;
+    pPars->fReorder = 0;
+    pPars->nBddMax     = 100;
+    pPars->nClusterMax = 500;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "BCFTLbcryzvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'B':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-B\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nBddMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nBddMax < 0 )
+                goto usage;
+            break;
+        case 'C':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-C\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nClusterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nClusterMax < 0 )
+                goto usage;
+            break;
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->nIterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->nIterMax < 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeLimit = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeLimit < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pLogFileName = argv[globalUtilOptind];
+            globalUtilOptind++;
+            break;
+        case 'b':
+            pPars->fBackward ^= 1;
+            break;
+        case 'c':
+            pPars->fCluster ^= 1;
+            break;
+        case 'r':
+            pPars->fReorder ^= 1;
+            break;
+        case 'y':
+            pPars->fSkipOutCheck ^= 1;
+            break;
+        case 'z':
+            pPars->fSkipReach ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachN(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachN(): The current AIG has no latches.\n" );
+        return 0;
+    }
+/*
+    if ( Gia_ManObjNum(pAbc->pGia) >= (1<<16) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9ReachN(): Currently cannot handle AIGs with more than %d objects.\n", (1<<16) );
+        return 0;
+    }
+*/
+    pMan          = Gia_ManToAigSimple( pAbc->pGia );
+    pAbc->Status  = Llb_Nonlin4CoreReach( pMan, pPars );
+    pAbc->nFrames = pPars->iFrame;
+    Abc_FrameReplaceCex( pAbc, &pMan->pSeqModel );
+    if ( pLogFileName )
+        Abc_NtkWriteLogFile( pLogFileName, pAbc->pCex, pAbc->Status, pAbc->nFrames, "&reachy" );
+    Aig_ManStop( pMan );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &reachy [-BCFT num] [-L file] [-bcryzvh]\n" );
+    Abc_Print( -2, "\t         model checking via BDD-based reachability (non-linear-QS-based)\n" );
+    Abc_Print( -2, "\t-B num : the max BDD size to introduce cut points [default = %d]\n", pPars->nBddMax );
+    Abc_Print( -2, "\t-C num : the max BDD size to reparameterize/cluster [default = %d]\n", pPars->nClusterMax );
+    Abc_Print( -2, "\t-F num : max number of reachability iterations [default = %d]\n", pPars->nIterMax );
+    Abc_Print( -2, "\t-T num : approximate time limit in seconds (0=infinite) [default = %d]\n", pPars->TimeLimit );
+    Abc_Print( -2, "\t-L file: the log file name [default = %s]\n", pLogFileName ? pLogFileName : "no logging" );
+    Abc_Print( -2, "\t-b     : enable using backward enumeration [default = %s]\n", pPars->fBackward? "yes": "no" );
+    Abc_Print( -2, "\t-c     : enable reparametrization clustering [default = %s]\n", pPars->fCluster? "yes": "no" );
+    Abc_Print( -2, "\t-r     : enable additional BDD var reordering before image [default = %s]\n", pPars->fReorder? "yes": "no" );
+    Abc_Print( -2, "\t-y     : skip checking property outputs [default = %s]\n", pPars->fSkipOutCheck? "yes": "no" );
+    Abc_Print( -2, "\t-z     : skip reachability (run preparation phase only) [default = %s]\n", pPars->fSkipReach? "yes": "no" );
+    Abc_Print( -2, "\t-v     : prints verbose information [default = %s]\n", pPars->fVerbose? "yes": "no" );
+//    Abc_Print( -2, "\t-w     : prints additional information [default = %s]\n", pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Undo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    // set defaults
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Undo(): There is no design.\n" );
+        return 1;
+    }
+    if ( pAbc->pGia2 == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Undo(): There is no previously saved network.\n" );
+        return 1;
+    }
+    Gia_ManStop( pAbc->pGia );
+    pAbc->pGia = pAbc->pGia2;
+    pAbc->pGia2 = NULL;
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &undo [-h]\n" );
+    Abc_Print( -2, "\t        reverses the previous AIG transformation\n" );
+    Abc_Print( -2, "\t-h    : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Iso( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pAig;
+    Vec_Ptr_t * vPosEquivs;
+//    Vec_Ptr_t * vPiPerms;
+    int c, fNewAlgo = 1, fEstimate = 0, fBetterQual = 0, fDualOut = 0, fVerbose = 0, fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "neqdvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'n':
+            fNewAlgo ^= 1;
+            break;
+        case 'e':
+            fEstimate ^= 1;
+            break;
+        case 'q':
+            fBetterQual ^= 1;
+            break;
+        case 'd':
+            fDualOut ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Iso(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManPoNum(pAbc->pGia) == 1 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Iso(): The AIG has only one PO. Isomorphism detection is not performed.\n" );
+        return 1;
+    }
+    if ( fNewAlgo )
+        pAig = Gia_ManIsoReduce2( pAbc->pGia, &vPosEquivs, NULL, fEstimate, fBetterQual, fDualOut, fVerbose, fVeryVerbose );
+    else
+        pAig = Gia_ManIsoReduce( pAbc->pGia, &vPosEquivs, NULL, fEstimate, fDualOut, fVerbose, fVeryVerbose );
+//    pAig = Gia_ManIsoReduce( pAbc->pGia, &vPosEquivs, &vPiPerms, 0, fDualOut, fVerbose, fVeryVerbose );
+//    Vec_VecFree( (Vec_Vec_t *)vPiPerms );
+    if ( pAig == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Iso(): Transformation has failed.\n" );
+        return 1;
+    }
+    // update the internal storage of PO equivalences
+    Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
+    // update the AIG
+    Abc_FrameUpdateGia( pAbc, pAig );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &iso [-neqdvwh]\n" );
+    Abc_Print( -2, "\t         removes POs with isomorphic sequential COI\n" );
+    Abc_Print( -2, "\t-n     : toggle using new fast algorithm [default = %s]\n", fNewAlgo? "yes": "no" );
+    Abc_Print( -2, "\t-e     : toggle computing lower bound on equivalence classes [default = %s]\n", fEstimate? "yes": "no" );
+    Abc_Print( -2, "\t-q     : toggle improving quality at the expense of runtime [default = %s]\n", fBetterQual? "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle treating the current AIG as a dual-output miter [default = %s]\n", fDualOut? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing very verbose information [default = %s]\n", fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9CexInfo( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern void Bmc_CexTest( Gia_Man_t * p, Abc_Cex_t * pCex, int fVerbose );
+    int c, fDualOut = 0, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "dvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'd':
+            fDualOut ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9CexInfo(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( pAbc->pCex == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9CexInfo(): There is no CEX.\n" );
+        return 1;
+    }
+    Bmc_CexTest( pAbc->pGia, pAbc->pCex, fVerbose );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &cexinfo [-vh]\n" );
+    Abc_Print( -2, "\t         prints information about the current counter-example\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Cycle( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, nFrames = 10, fUseCex = 0, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Fcvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'F':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-F\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nFrames = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nFrames < 0 )
+                goto usage;
+            break;
+        case 'c':
+            fUseCex ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Cycle(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManDupCycled( pAbc->pGia, fUseCex ? pAbc->pCex : NULL, nFrames );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &cycle [-F num] [-cvh]\n" );
+    Abc_Print( -2, "\t         cycles sequential circuit for the given number of timeframes\n" );
+    Abc_Print( -2, "\t         to derive a new initial state (which may be on the envelope)\n" );
+    Abc_Print( -2, "\t-F num : the number of frames to simulate [default = %d]\n", nFrames );
+    Abc_Print( -2, "\t-c     : toggle using PI values from the current CEX [default = %s]\n", fUseCex? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Cone( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    Vec_Int_t * vPos;
+    int c, iOutNum = -1, nOutRange = 1, iPartNum = -1, nLevelMax = 0, nTimeWindow = 0, fUseAllCis = 0, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "ORPLWavh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'O':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-O\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iOutNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iOutNum < 0 )
+                goto usage;
+            break;
+        case 'R':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-R\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nOutRange = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nOutRange < 0 )
+                goto usage;
+            break;
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iPartNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iPartNum < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nLevelMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nLevelMax < 0 )
+                goto usage;
+            break;
+        case 'W':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-W\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nTimeWindow = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimeWindow < 0 )
+                goto usage;
+            break;
+        case 'a':
+            fUseAllCis ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Cone(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( nLevelMax || nTimeWindow )
+    {
+        if ( nLevelMax && nTimeWindow )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Cone(): Parameters -L (max level) and -W (timing window) cannot be specified at the same time.\n" );
+            return 1;
+        }
+        else
+        {
+            pTemp = Gia_ManExtractWindow( pAbc->pGia, nLevelMax, nTimeWindow, fVerbose );
+            Abc_FrameUpdateGia( pAbc, pTemp );
+            return 0;
+        }
+    }
+    if ( iPartNum >= 0 )
+    {
+        Vec_Int_t * vClass;
+        Vec_Vec_t * vClasses = (Vec_Vec_t *)pAbc->vPoEquivs;
+        if ( vClasses == NULL )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Cone(): Partitions are not defined.\n" );
+            return 1;
+        }
+        if ( iPartNum >= Vec_VecSize(vClasses) )
+        {
+            Abc_Print( -1, "Abc_CommandAbc9Cone(): Partition index exceed the array size.\n" );
+            return 1;
+        }
+        vClass = Vec_VecEntryInt( vClasses, iPartNum );
+        pTemp = Gia_ManDupCones( pAbc->pGia, Vec_IntArray(vClass), Vec_IntSize(vClass), !fUseAllCis );
+        if ( pTemp )
+            Abc_FrameUpdateGia( pAbc, pTemp );
+        return 0;
+    }
+    if ( iOutNum < 0 || iOutNum + nOutRange >= Gia_ManPoNum(pAbc->pGia) )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Cone(): Range of outputs to extract is incorrect.\n" );
+        return 1;
+    }
+    vPos = Vec_IntStartRange( iOutNum, nOutRange );
+    pTemp = Gia_ManDupCones( pAbc->pGia, Vec_IntArray(vPos), nOutRange, !fUseAllCis );
+    Vec_IntFree( vPos );
+    if ( pTemp )
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &cone [-ORPLW num] [-avh]\n" );
+    Abc_Print( -2, "\t         extracting multi-output sequential logic cones\n" );
+    Abc_Print( -2, "\t-O num : the index of first PO to extract [default = %d]\n", iOutNum );
+    Abc_Print( -2, "\t-R num : (optional) the number of outputs to extract [default = %d]\n", nOutRange );
+    Abc_Print( -2, "\t-P num : (optional) the partition number to extract [default = %d]\n", iPartNum );
+    Abc_Print( -2, "\t-L num : (optional) extract cones with higher level [default = %d]\n", nLevelMax );
+    Abc_Print( -2, "\t-W num : (optional) extract cones falling into this window [default = %d]\n", nTimeWindow );
+    Abc_Print( -2, "\t-a     : toggle keeping all CIs or structral support only [default = %s]\n", fUseAllCis? "all": "structural" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Slice( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Gia_Man_t * pTemp;
+    int c, nSuppSize = 6, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Svh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nSuppSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nSuppSize < 0 )
+                goto usage;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9Slice(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManDupSliced( pAbc->pGia, nSuppSize );
+    Abc_FrameUpdateGia( pAbc, pTemp );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &slice [-S num] [-vh]\n" );
+    Abc_Print( -2, "\t         cuts the lower part of the AIG with nodes using their support\n" );
+    Abc_Print( -2, "\t-S num : the largest support size to keep in the slide [default = %d]\n", nSuppSize );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9PoPart( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Gia_ManFindPoPartition( Gia_Man_t * p, int SelectShift, int fOnlyCis, int fSetLargest, int fVerbose, Vec_Ptr_t ** pvPosEquivs );
+    Gia_Man_t * pTemp;
+    Vec_Ptr_t * vPosEquivs = NULL;
+    int c, SelectShift = 0, fOnlyCis = 0, fSetLargest = 0, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "Simvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            SelectShift = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( SelectShift < 0 )
+                goto usage;
+            break;
+        case 'i':
+            fOnlyCis ^= 1;
+            break;
+        case 'm':
+            fSetLargest ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9PoPart(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManFindPoPartition( pAbc->pGia, SelectShift, fOnlyCis, fSetLargest, fVerbose, &vPosEquivs );
+    if ( pTemp )
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &popart [-S num] [-imvh]\n" );
+    Abc_Print( -2, "\t         partitioning of POs into equivalence classes\n" );
+    Abc_Print( -2, "\t-S num : random seed to select the set of pivot nodes [default = %d]\n", SelectShift );
+    Abc_Print( -2, "\t       : (if the seed is 0, the nodes with max fanout counts are used)\n" );
+    Abc_Print( -2, "\t-i     : toggle allowing only CIs to be the pivots [default = %s]\n", fOnlyCis? "yes": "no" );
+    Abc_Print( -2, "\t-m     : toggle using the largest part as the current network [default = %s]\n", fSetLargest? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9PoPart2( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Gia_Man_t * Gia_ManFindPoPartition2( Gia_Man_t * p, int iStartNum, int nDelta, int nOutsMin, int nOutsMax, int fSetLargest, int fVerbose, Vec_Ptr_t ** pvPosEquivs );
+    Gia_Man_t * pTemp = NULL;
+    Vec_Ptr_t * vPosEquivs = NULL;
+    int c, iStartNum = 0, nDelta = 10, nOutsMin = 100, nOutsMax = 1000, fSetLargest = 0, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "SDLUmvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            iStartNum = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( iStartNum < 0 )
+                goto usage;
+            break;
+        case 'D':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-D\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nDelta = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nDelta < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nOutsMin = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nOutsMin < 0 )
+                goto usage;
+            break;
+        case 'U':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-U\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nOutsMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nOutsMax < 0 )
+                goto usage;
+            break;
+        case 'm':
+            fSetLargest ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9PoPart(): There is no AIG.\n" );
+        return 1;
+    }
+    pTemp = Gia_ManFindPoPartition2( pAbc->pGia, iStartNum, nDelta, nOutsMin, nOutsMax, fSetLargest, fVerbose, &vPosEquivs );
+    if ( pTemp )
+        Abc_FrameUpdateGia( pAbc, pTemp );
+    Abc_FrameReplacePoEquivs( pAbc, &vPosEquivs );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &popart2 [-SDLU num] [-mvh]\n" );
+    Abc_Print( -2, "\t         extracting multi-output sequential logic cones\n" );
+    Abc_Print( -2, "\t-S num : the index of the PO to start the cluster [default = %d]\n", iStartNum );
+    Abc_Print( -2, "\t-D num : the max increase in flop count after adding one PO [default = %d]\n", nDelta );
+    Abc_Print( -2, "\t-L num : the minimum number of POs in a cluster [default = %d]\n", nOutsMin );
+    Abc_Print( -2, "\t-U num : the maximum number of POs in a cluster [default = %d]\n", nOutsMax );
+    Abc_Print( -2, "\t-m     : toggle selecting the largest cluster [default = %s]\n", fSetLargest? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9GroupProve( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern Vec_Int_t * Gia_ManGroupProve( Gia_Man_t * p, char * pCommLine, int nGroupSize, int fVerbose );
+    Vec_Int_t * vStatus;
+    char * pCommLine = NULL;
+    int c, nGroupSize = 1, fVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "GSvh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nGroupSize = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nGroupSize <= 0 )
+                goto usage;
+            break;
+        case 'S':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-S\" should be followed by a file name.\n" );
+                goto usage;
+            }
+            pCommLine = argv[globalUtilOptind];
+            globalUtilOptind++;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9GroupProve(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( pCommLine == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9GroupProve(): Command line is not given.\n" );
+        return 1;
+    }
+    vStatus = Gia_ManGroupProve( pAbc->pGia, pCommLine, nGroupSize, fVerbose );
+    Vec_IntFree( vStatus );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &gprove [-GS num] [-vh]\n" );
+    Abc_Print( -2, "\t         proves multi-output testcase by splitting outputs into groups\n" );
+    Abc_Print( -2, "\t         (currently, group size more than one works only for \"bmc3\" and \"pdr\")\n" );
+    Abc_Print( -2, "\t-G num : the size of one group [default = %d]\n", nGroupSize );
+    Abc_Print( -2, "\t-S str : the command line to be executed for each group [default = %s]\n", pCommLine ? pCommLine : "none" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9MultiProve( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Gia_ManMultiProve( Gia_Man_t * p, Bmc_MulPar_t * pPars );
+    Vec_Int_t * vStatuses; int c;
+    Bmc_MulPar_t Pars, * pPars = &Pars;
+    memset( pPars, 0, sizeof(Bmc_MulPar_t) );
+    pPars->TimeOutGlo =  30;
+    pPars->TimeOutLoc =   2;
+    pPars->TimeOutInc = 100;
+    pPars->TimeOutGap =   0;
+    pPars->TimePerOut =   0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "TLMGHsdvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOutGlo = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOutGlo < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOutLoc = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOutLoc <= 0 )
+                goto usage;
+            break;
+        case 'M':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-M\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOutInc = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOutInc <= 0 )
+                goto usage;
+            break;
+        case 'G':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-G\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimeOutGap = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimeOutGap <= 0 )
+                goto usage;
+            break;
+        case 'H':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-H\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            pPars->TimePerOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( pPars->TimePerOut <= 0 )
+                goto usage;
+            break;
+        case 's':
+            pPars->fUseSyn ^= 1;
+            break;
+        case 'd':
+            pPars->fDumpFinal ^= 1;
+            break;
+        case 'v':
+            pPars->fVerbose ^= 1;
+            break;
+        case 'w':
+            pPars->fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9MultiProve(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) == 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9MultiProve(): The problem is combinational.\n" );
+        return 1;
+    }
+    pAbc->Status = Gia_ManMultiProve( pAbc->pGia, pPars );
+    vStatuses = Abc_FrameDeriveStatusArray( pAbc->pGia->vSeqModelVec );
+    Abc_FrameReplacePoStatuses( pAbc, &vStatuses );        
+    Abc_FrameReplaceCexVec( pAbc, &pAbc->pGia->vSeqModelVec );
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &mprove [-TLMGH num] [-sdvwh]\n" );
+    Abc_Print( -2, "\t         proves multi-output testcase by applying several engines\n" );
+    Abc_Print( -2, "\t-T num : approximate global runtime limit in seconds [default = %d]\n",     pPars->TimeOutGlo );
+    Abc_Print( -2, "\t-L num : approximate local runtime limit in seconds [default = %d]\n",      pPars->TimeOutLoc );
+    Abc_Print( -2, "\t-M num : percentage of local runtime limit increase [default = %d]\n",      pPars->TimeOutInc );
+    Abc_Print( -2, "\t-G num : approximate gap runtime limit in seconds [default = %d]\n",        pPars->TimeOutGap );
+    Abc_Print( -2, "\t-H num : timeout per output in miliseconds [default = %d]\n",               pPars->TimePerOut );
+    Abc_Print( -2, "\t-s     : toggle using combinational synthesis [default = %s]\n",            pPars->fUseSyn?      "yes": "no" );
+    Abc_Print( -2, "\t-d     : toggle dumping invariant into a file [default = %s]\n",            pPars->fDumpFinal?   "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",             pPars->fVerbose?     "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing additional verbose information [default = %s]\n",  pPars->fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+#ifdef ABC_USE_PTHREADS
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9SplitProve( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    extern int Cec_GiaSplitTest( Gia_Man_t * p, int nProcs, int nTimeOut, int nIterMax, int LookAhead, int fVerbose, int fVeryVerbose );
+    int c, nProcs = 1, nTimeOut = 10, nIterMax = 0, LookAhead = 1, fVerbose = 0, fVeryVerbose = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "PTILvwh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'P':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-P\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nProcs = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nProcs <= 0 )
+                goto usage;
+            break;
+        case 'T':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-T\" should be followed by a positive integer.\n" );
+                goto usage;
+            }
+            nTimeOut = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nTimeOut <= 0 )
+                goto usage;
+            break;
+        case 'I':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-I\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            nIterMax = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( nIterMax < 0 )
+                goto usage;
+            break;
+        case 'L':
+            if ( globalUtilOptind >= argc )
+            {
+                Abc_Print( -1, "Command line switch \"-L\" should be followed by an integer.\n" );
+                goto usage;
+            }
+            LookAhead = atoi(argv[globalUtilOptind]);
+            globalUtilOptind++;
+            if ( LookAhead <= 0 || LookAhead > 100 )
+            {
+                Abc_Print( -1, "Look-ahead value (\"-L <num>\") should be between 1 and 100.\n", LookAhead );
+                goto usage;
+            }
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'w':
+            fVeryVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pAbc->pGia == NULL )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9SplitProve(): There is no AIG.\n" );
+        return 1;
+    }
+    if ( Gia_ManRegNum(pAbc->pGia) > 0 )
+    {
+        Abc_Print( -1, "Abc_CommandAbc9SplitProve(): The problem is sequential.\n" );
+        return 1;
+    }
+    pAbc->Status = Cec_GiaSplitTest( pAbc->pGia, nProcs, nTimeOut, nIterMax, LookAhead, fVerbose, fVeryVerbose );
+    pAbc->pCex = pAbc->pGia->pCexComb;  pAbc->pGia->pCexComb = NULL;
+    return 0;
+
+usage:
+    Abc_Print( -2, "usage: &splitprove [-PTIL num] [-vwh]\n" );
+    Abc_Print( -2, "\t         proves CEC problem by case-splitting\n" );
+    Abc_Print( -2, "\t-P num : the number of concurrent processes [default = %d]\n",          nProcs );
+    Abc_Print( -2, "\t-T num : runtime limit in seconds per subproblem [default = %d]\n",     nTimeOut );
+    Abc_Print( -2, "\t-I num : the max number of iterations (0 = infinity) [default = %d]\n", nIterMax );
+    Abc_Print( -2, "\t-L num : maximum look-ahead during cofactoring [default = %d]\n",       LookAhead );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",         fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-w     : toggle printing more verbose information [default = %s]\n",    fVeryVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+#endif
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Abc_CommandAbc9Bmc( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    int c;
+    Bmc_AndPar_t Pars, * pPars = &Pars;
+    memset( pPars, 0, sizeof(Bmc_AndPar_t) );
+    pPars->nStart        =    0;  // starting timeframe
+    pPars->nFramesMax    =    0;  // maximum number of timeframes 
+    pPars->nFramesAdd    =   50;  // the number of additional frames
+    pPars->nConfLimit    =    0;  // maximum number of conflicts at a node
+    pPars->nTimeOut      =    0;  // timeout in seconds
+    pPars->fLoadCnf      =    0;  // dynamic CNF loading
+    pPars->fDumpFrames   =    0;  // dump unrolled timeframes
+    pPars->fUseSynth     =    0;  // use synthesis
+    pPars->fUseOldCnf    =    1;  // use old CNF construction
     pPars->fVerbose      =    0;  // verbose 
     pPars->fVeryVerbose  =    0;  // very verbose 
     pPars->fNotVerbose   =    0;  // skip line-by-line print-out 
diff --git a/abc-build/src/base/abci/abcCollapse.c b/abc-build/src/base/abci/abcCollapse.c
--- a/abc-build/src/base/abci/abcCollapse.c
+++ b/abc-build/src/base/abci/abcCollapse.c
@@ -115,7 +115,41 @@
     Abc_Obj_t * pNode, * pDriver, * pNodeNew;
 //    DdManager * dd = pNtk->pManGlob;
     DdManager * dd = (DdManager *)Abc_NtkGlobalBddMan( pNtk );
-    int i;
+    int i;
+
+    // extract don't-care and compute ISOP
+    if ( pNtk->pExdc )
+    {
+        DdManager * ddExdc = NULL;
+        DdNode * bBddMin, * bBddDc, * bBddL, * bBddU;
+        assert( Abc_NtkIsStrash(pNtk->pExdc) );
+        assert( Abc_NtkCoNum(pNtk->pExdc) == 1 );
+        // compute the global BDDs
+        if ( Abc_NtkBuildGlobalBdds(pNtk->pExdc, 10000000, 1, 1, 0) == NULL )
+            return NULL;
+        // transfer tot the same manager
+        ddExdc = (DdManager *)Abc_NtkGlobalBddMan( pNtk->pExdc );
+        bBddDc = (DdNode *)Abc_ObjGlobalBdd(Abc_NtkCo(pNtk->pExdc, 0));
+        bBddDc = Cudd_bddTransfer( ddExdc, dd, bBddDc );  Cudd_Ref( bBddDc );
+        Abc_NtkFreeGlobalBdds( pNtk->pExdc, 1 );
+        // minimize the output
+        Abc_NtkForEachCo( pNtk, pNode, i )
+        {
+            bBddMin = (DdNode *)Abc_ObjGlobalBdd(pNode);
+            // derive lower and uppwer bound
+            bBddL = Cudd_bddAnd( dd, bBddMin,           Cudd_Not(bBddDc) );  Cudd_Ref( bBddL );
+            bBddU = Cudd_bddAnd( dd, Cudd_Not(bBddMin), Cudd_Not(bBddDc) );  Cudd_Ref( bBddU );
+            Cudd_RecursiveDeref( dd, bBddMin );
+            // compute new one
+            bBddMin = Cudd_bddIsop( dd, bBddL, Cudd_Not(bBddU) );            Cudd_Ref( bBddMin );
+            Cudd_RecursiveDeref( dd, bBddL );
+            Cudd_RecursiveDeref( dd, bBddU );
+            // update global BDD
+            Abc_ObjSetGlobalBdd( pNode, bBddMin );
+            //Extra_bddPrint( dd, bBddMin ); printf( "\n" );
+        }
+        Cudd_RecursiveDeref( dd, bBddDc );
+    }
 
 //    pReo = Extra_ReorderInit( Abc_NtkCiNum(pNtk), 1000 );
 //    runtime1 = runtime2 = 0;
@@ -175,7 +209,6 @@
     pNodeNew->pData = Extra_TransferLevelByLevel( dd, (DdManager *)pNtkNew->pManFunc, bFunc );  Cudd_Ref( (DdNode *)pNodeNew->pData );
     return pNodeNew;
 }
-
 
 ////////////////////////////////////////////////////////////////////////
 ///                       END OF FILE                                ///
diff --git a/abc-build/src/base/abci/abcDsd.c b/abc-build/src/base/abci/abcDsd.c
--- a/abc-build/src/base/abci/abcDsd.c
+++ b/abc-build/src/base/abci/abcDsd.c
@@ -136,8 +136,11 @@
     if ( fPrint )
     {
         ppNamesCi = Abc_NtkCollectCioNames( pNtk, 0 );
-        ppNamesCo = Abc_NtkCollectCioNames( pNtk, 1 );
-        Dsd_TreePrint( stdout, pManDsd, ppNamesCi, ppNamesCo, fShort, -1 );
+        ppNamesCo = Abc_NtkCollectCioNames( pNtk, 1 );
+        if ( fVerbose )
+            Dsd_TreePrint( stdout, pManDsd, ppNamesCi, ppNamesCo, fShort, -1 );
+        else
+            Dsd_TreePrint2( stdout, pManDsd, ppNamesCi, ppNamesCo, -1 );
         ABC_FREE( ppNamesCi );
         ABC_FREE( ppNamesCo );
     }
@@ -553,6 +556,137 @@
     return iVar;
 }
 
+
+/**Function********************************************************************
+
+  Synopsis    [Computes the positive polarty cube composed of the first vars in the array.]
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+******************************************************************************/
+DdNode * Extra_bddComputeSum( DdManager * dd, DdNode ** pbCubes, int nCubes )
+{
+    DdNode * bRes, * bTemp;
+    int i;
+    bRes = b0; Cudd_Ref( bRes );
+    for ( i = 0; i < nCubes; i++ )
+    {
+        bRes = Cudd_bddOr( dd, bTemp = bRes, pbCubes[i] );  Cudd_Ref( bRes );
+        Cudd_RecursiveDeref( dd, bTemp );
+    }
+    Cudd_Deref( bRes );
+    return bRes;
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Derives network with the given percentage of on-set and off-set minterms.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+DdNode * Abc_NtkSparsifyInternalOne( DdManager * ddNew, DdNode * bFunc, int nFanins, int nPerc )
+{
+    int nSpace = (int)Cudd_CountMinterm( ddNew, bFunc, nFanins );
+    int i, nMints = Abc_MaxInt( 1, (int)(0.01 * nPerc * nSpace) );
+    DdNode ** pbMints = Cudd_bddPickArbitraryMinterms( ddNew, bFunc, ddNew->vars, nFanins, nMints );
+    DdNode * bRes;
+    for ( i = 0; i < nMints; i++ )
+        Cudd_Ref( pbMints[i] );
+    bRes = Extra_bddComputeSum( ddNew, pbMints, nMints ); Cudd_Ref( bRes );
+    for ( i = 0; i < nMints; i++ )
+        Cudd_RecursiveDeref( ddNew, pbMints[i] );
+    Cudd_Deref( bRes );
+    ABC_FREE( pbMints );
+    return bRes;
+}
+Abc_Ntk_t * Abc_NtkSparsifyInternal( Abc_Ntk_t * pNtk, int nPerc, int fVerbose )
+{
+    Abc_Ntk_t * pNtkNew;
+    Abc_Obj_t * pObj, * pDriver, * pFanin;
+    DdNode * bFunc, * bFuncOld;
+    DdManager * ddNew;
+    int i, k, c;
+    // start the new network
+    pNtkNew = Abc_NtkAlloc( ABC_NTK_LOGIC, ABC_FUNC_BDD, 1 );
+    Abc_NtkForEachCi( pNtk, pObj, i )
+        Abc_NtkDupObj( pNtkNew, pObj, 1 );
+    // duplicate the name and the spec
+    pNtkNew->pName = Extra_UtilStrsav(pNtk->pName);
+    pNtkNew->pSpec = Extra_UtilStrsav(pNtk->pSpec);
+    // make sure the new manager has enough inputs
+    ddNew = (DdManager *)pNtkNew->pManFunc;
+    Cudd_bddIthVar( ddNew, Abc_NtkCiNum(pNtk)-1 );
+    // go through the outputs
+    Abc_NtkForEachCo( pNtk, pObj, i )
+    {
+        pDriver = Abc_ObjFanin0( pObj );
+        if ( Abc_ObjIsCi(pDriver) )
+        {
+            Abc_NtkDupObj( pNtkNew, pObj, 0 );
+            Abc_ObjAddFanin( pObj->pCopy, Abc_ObjNotCond(pDriver->pCopy, Abc_ObjFaninC0(pObj)) );
+            Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), "_on" );
+
+            Abc_NtkDupObj( pNtkNew, pObj, 0 );
+            Abc_ObjAddFanin( pObj->pCopy, Abc_ObjNotCond(pDriver->pCopy, !Abc_ObjFaninC0(pObj)) );
+            Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), "_off" );
+            continue;
+        }
+        if ( Abc_ObjFaninNum(pDriver) == 0 )
+        {
+            Abc_NtkDupObj( pNtkNew, pObj, 0 );
+            Abc_ObjAddFanin( pObj->pCopy, Abc_ObjFaninC0(pObj) ? Abc_NtkCreateNodeConst0(pNtkNew) : Abc_NtkCreateNodeConst1(pNtkNew) );
+            Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), "_on" );
+
+            Abc_NtkDupObj( pNtkNew, pObj, 0 );
+            Abc_ObjAddFanin( pObj->pCopy, Abc_ObjFaninC0(pObj) ? Abc_NtkCreateNodeConst1(pNtkNew) : Abc_NtkCreateNodeConst0(pNtkNew) );
+            Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), "_off" );
+            continue;
+        }
+        assert( Abc_ObjFaninNum(pObj) > 0 );
+        // onset/offset
+        for ( c = 0; c < 2; c++ )
+        {
+            Cudd_Srandom( 0 );
+            Abc_NtkDupObj( pNtkNew, pDriver, 0 );
+            Abc_ObjForEachFanin( pDriver, pFanin, k )
+                Abc_ObjAddFanin( pDriver->pCopy, pFanin->pCopy );
+            bFuncOld = Cudd_NotCond( (DdNode *)pDriver->pCopy->pData, c );
+            bFunc = Abc_NtkSparsifyInternalOne( ddNew, bFuncOld, Abc_ObjFaninNum(pDriver), nPerc );  Cudd_Ref( bFunc );
+            Cudd_RecursiveDeref( ddNew, bFuncOld );
+            pDriver->pCopy->pData = bFunc;
+            Abc_NtkDupObj( pNtkNew, pObj, 0 );
+            Abc_ObjAddFanin( pObj->pCopy, pDriver->pCopy );
+            Abc_ObjAssignName( pObj->pCopy, Abc_ObjName(pObj), c ? "_off" : "_on" );
+        }
+    }
+    Abc_NtkLogicMakeSimpleCos( pNtkNew, 0 );
+    return pNtkNew;
+}
+Abc_Ntk_t * Abc_NtkSparsify( Abc_Ntk_t * pNtk, int nPerc, int fVerbose )
+{
+    Abc_Ntk_t * pNtkNew;
+    assert( Abc_NtkIsComb(pNtk) );
+    assert( Abc_NtkIsBddLogic(pNtk) );
+    pNtkNew = Abc_NtkSparsifyInternal( pNtk, nPerc, fVerbose );
+    if ( pNtkNew == NULL )
+        return NULL;
+    if ( !Abc_NtkCheck( pNtkNew ) )
+    {
+        printf( "Abc_NtkSparsify: The network check has failed.\n" );
+        Abc_NtkDelete( pNtkNew );
+        return NULL;
+    }
+    return pNtkNew;
+}
 
 ////////////////////////////////////////////////////////////////////////
 ///                       END OF FILE                                ///
diff --git a/abc-build/src/base/abci/abcIf.c b/abc-build/src/base/abci/abcIf.c
--- a/abc-build/src/base/abci/abcIf.c
+++ b/abc-build/src/base/abci/abcIf.c
@@ -494,6 +494,8 @@
                     if ( If_CutLeafBit(pCutBest, i) )
                         Abc_TtFlip( pTruth, Abc_TtWordNum(pCutBest->nLeaves), i );
             pNodeNew->pData = Kit_TruthToHop( (Hop_Man_t *)pNtkNew->pManFunc, (unsigned *)pTruth, If_CutLeaveNum(pCutBest), vCover );
+//            if ( pIfMan->pPars->fUseBat )
+//                Bat_ManFuncPrintCell( *pTruth );
         }
         // complement the node if the cut was complemented
         if ( pCutBest->fCompl && !pIfMan->pPars->fDelayOpt && !pIfMan->pPars->fDsdBalance )
diff --git a/abc-build/src/base/abci/abcPrint.c b/abc-build/src/base/abci/abcPrint.c
--- a/abc-build/src/base/abci/abcPrint.c
+++ b/abc-build/src/base/abci/abcPrint.c
@@ -236,10 +236,10 @@
 
 #ifdef WIN32
     SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 15 ); // bright
-    Abc_Print( 1,"%-13s:", pNtk->pName );
+    Abc_Print( 1,"%-30s:", pNtk->pName );
     SetConsoleTextAttribute( GetStdHandle(STD_OUTPUT_HANDLE), 7 );  // normal
 #else
-    Abc_Print( 1,"%s%-13s:%s", "\033[1;37m", pNtk->pName, "\033[0m" );  // bright
+    Abc_Print( 1,"%s%-30s:%s", "\033[1;37m", pNtk->pName, "\033[0m" );  // bright
 #endif
     Abc_Print( 1," i/o =%5d/%5d", Abc_NtkPiNum(pNtk), Abc_NtkPoNum(pNtk) );
     if ( Abc_NtkConstrNum(pNtk) )
diff --git a/abc-build/src/base/abci/abcRec3.c b/abc-build/src/base/abci/abcRec3.c
--- a/abc-build/src/base/abci/abcRec3.c
+++ b/abc-build/src/base/abci/abcRec3.c
@@ -979,6 +979,26 @@
     pCut->Cost = Vec_StrEntry(p->vAreas, iBestPo);
     for ( i = 0; i < nLeaves; i++ )
         pPerm[(int)pCanonPerm[i]] = Lms_DelayGet(DelayProfile, i);
+    if ( 0 )
+    {
+        int Max = 0, Two = 0, pTimes[16];
+        for ( i = 0; i < nLeaves; i++ )
+            pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(pIfMan, pCut, i))->Delay;
+        for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+            Max = Abc_MaxInt( Max, pTimes[i] );
+        for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+            if ( pTimes[i] != Max )
+                Two = Abc_MaxInt( Two, pTimes[i] );
+        if ( Two + 2 < Max && Max + 3 < BestDelay )
+        {
+            for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+                printf( "%3d ", pTimes[i] );
+            for ( ; i < pIfMan->pPars->nLutSize; i++ )
+                printf( "    " );
+            printf( "-> %3d   ", BestDelay );
+            Dau_DsdPrintFromTruth( If_CutTruthW(pIfMan, pCut), If_CutLeaveNum(pCut) );
+        }
+    }
     return BestDelay; 
 }
 int If_CutDelayRecCost3( If_Man_t * pIfMan, If_Cut_t * pCut, If_Obj_t * pObj )
diff --git a/abc-build/src/base/abci/abcStrash.c b/abc-build/src/base/abci/abcStrash.c
--- a/abc-build/src/base/abci/abcStrash.c
+++ b/abc-build/src/base/abci/abcStrash.c
@@ -293,7 +293,7 @@
 //        printf( "Warning: AIG cleanup removed %d nodes (this is not a bug).\n", nNodes );
     // duplicate EXDC 
     if ( pNtk->pExdc )
-        pNtkAig->pExdc = Abc_NtkDup( pNtk->pExdc );
+        pNtkAig->pExdc = Abc_NtkStrash( pNtk->pExdc, fAllNodes, fCleanup, fRecord );
     // make sure everything is okay
     if ( !Abc_NtkCheck( pNtkAig ) )
     {
diff --git a/abc-build/src/base/io/io.c b/abc-build/src/base/io/io.c
--- a/abc-build/src/base/io/io.c
+++ b/abc-build/src/base/io/io.c
@@ -242,7 +242,7 @@
     }
     // replace the current network
     Abc_FrameReplaceCurrentNetwork( pAbc, pNtk );
-	Abc_FrameCopyLTLDataBase( pAbc, pNtk );
+    Abc_FrameCopyLTLDataBase( pAbc, pNtk );
     Abc_FrameClearVerifStatus( pAbc );
     return 0;
 
@@ -1190,7 +1190,7 @@
     fprintf( pAbc->Err, "\tfile   : the name of a file to read\n" );
     return 1;
 }
-
+
 
 /**Function*************************************************************
 
@@ -1568,20 +1568,20 @@
     {
         switch ( c )
         {
-		    case 'S':
+            case 'S':
                 if ( globalUtilOptind >= argc )
                 {
                     Abc_Print( -1, "Command line switch \"-S\" should be followed by string.\n" );
                     goto usage;
                 }
-			    pLutStruct = argv[globalUtilOptind];
-			    globalUtilOptind++;
-			    if ( strlen(pLutStruct) != 2 && strlen(pLutStruct) != 3 ) 
+                pLutStruct = argv[globalUtilOptind];
+                globalUtilOptind++;
+                if ( strlen(pLutStruct) != 2 && strlen(pLutStruct) != 3 ) 
                 {
                     Abc_Print( -1, "Command line switch \"-S\" should be followed by a 2- or 3-char string (e.g. \"44\" or \"555\").\n" );
                     goto usage;
                 }
-			    break;
+                break;
             case 'j':
                 fSpecial ^= 1;
                 break;
@@ -1748,7 +1748,7 @@
 int IoCommandWriteBook( Abc_Frame_t * pAbc, int argc, char **argv )
 {
     char * pFileName;
-		int c;
+        int c;
     Extra_UtilGetoptReset();
     while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
     {
@@ -1764,7 +1764,7 @@
         goto usage;
     // get the output file name
     pFileName = argv[globalUtilOptind];
-		// call the corresponding file writer
+        // call the corresponding file writer
     Io_Write( pAbc->pNtkCur, pFileName, IO_FILE_BOOK );
     return 0;
 
diff --git a/abc-build/src/base/io/ioReadBlifMv.c b/abc-build/src/base/io/ioReadBlifMv.c
--- a/abc-build/src/base/io/ioReadBlifMv.c
+++ b/abc-build/src/base/io/ioReadBlifMv.c
@@ -18,6 +18,8 @@
 
 ***********************************************************************/
 
+#include "misc/zlib/zlib.h"
+#include "misc/bzlib/bzlib.h"
 #include "base/abc/abc.h"
 #include "misc/vec/vecPtr.h"
 #include "ioAbc.h"
@@ -528,6 +530,126 @@
             return i;
     return -1;
 }
+
+/**Function*************************************************************
+
+  Synopsis    [Reads the file into a character buffer.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+typedef struct buflist {
+  char buf[1<<20];
+  int nBuf;
+  struct buflist * next;
+} buflist;
+
+static char * Io_MvLoadFileBz2( char * pFileName, int * pnFileSize )
+{
+    FILE    * pFile;
+    int       nFileSize = 0;
+    char    * pContents;
+    BZFILE  * b;
+    int       bzError, RetValue;
+    struct buflist * pNext;
+    buflist * bufHead = NULL, * buf = NULL;
+
+    pFile = fopen( pFileName, "rb" );
+    if ( pFile == NULL )
+    {
+        Abc_Print( -1, "Io_MvLoadFileBz2(): The file is unavailable (absent or open).\n" );
+        return NULL;
+    }
+    b = BZ2_bzReadOpen(&bzError,pFile,0,0,NULL,0);
+    if (bzError != BZ_OK) {
+        Abc_Print( -1, "Io_MvLoadFileBz2(): BZ2_bzReadOpen() failed with error %d.\n",bzError );
+        return NULL;
+    }
+    do {
+        if (!bufHead)
+            buf = bufHead = ABC_ALLOC( buflist, 1 );
+        else
+            buf = buf->next = ABC_ALLOC( buflist, 1 );
+        nFileSize += buf->nBuf = BZ2_bzRead(&bzError,b,buf->buf,1<<20);
+        buf->next = NULL;
+    } while (bzError == BZ_OK);
+    if (bzError == BZ_STREAM_END) {
+        // we're okay
+        char * p;
+        int nBytes = 0;
+        BZ2_bzReadClose(&bzError,b);
+        p = pContents = ABC_ALLOC( char, nFileSize + 10 );
+        buf = bufHead;
+        do {
+            memcpy(p+nBytes,buf->buf,buf->nBuf);
+            nBytes += buf->nBuf;
+//        } while((buf = buf->next));
+            pNext = buf->next;
+            ABC_FREE( buf );
+        } while((buf = pNext));
+    } else if (bzError == BZ_DATA_ERROR_MAGIC) {
+        // not a BZIP2 file
+        BZ2_bzReadClose(&bzError,b);
+        fseek( pFile, 0, SEEK_END );
+        nFileSize = ftell( pFile );
+        if ( nFileSize == 0 )
+        {
+            Abc_Print( -1, "Io_MvLoadFileBz2(): The file is empty.\n" );
+            return NULL;
+        }
+        pContents = ABC_ALLOC( char, nFileSize + 10 );
+        rewind( pFile );
+        RetValue = fread( pContents, nFileSize, 1, pFile );
+    } else { 
+        // Some other error.
+        Abc_Print( -1, "Io_MvLoadFileBz2(): Unable to read the compressed BLIF.\n" );
+        return NULL;
+    }
+    fclose( pFile );
+    // finish off the file with the spare .end line
+    // some benchmarks suddenly break off without this line
+    strcpy( pContents + nFileSize, "\n.end\n" );
+    *pnFileSize = nFileSize;
+    return pContents;
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Reads the file into a character buffer.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static char * Io_MvLoadFileGz( char * pFileName, int * pnFileSize )
+{
+    const int READ_BLOCK_SIZE = 100000;
+    gzFile pFile;
+    char * pContents;
+    int amtRead, readBlock, nFileSize = READ_BLOCK_SIZE;
+    pFile = gzopen( pFileName, "rb" ); // if pFileName doesn't end in ".gz" then this acts as a passthrough to fopen
+    pContents = ABC_ALLOC( char, nFileSize );        
+    readBlock = 0;
+    while ((amtRead = gzread(pFile, pContents + readBlock * READ_BLOCK_SIZE, READ_BLOCK_SIZE)) == READ_BLOCK_SIZE) {
+        //Abc_Print( 1,"%d: read %d bytes\n", readBlock, amtRead);
+        nFileSize += READ_BLOCK_SIZE;
+        pContents = ABC_REALLOC(char, pContents, nFileSize);
+        ++readBlock;
+    }
+    //Abc_Print( 1,"%d: read %d bytes\n", readBlock, amtRead);
+    assert( amtRead != -1 ); // indicates a zlib error
+    nFileSize -= (READ_BLOCK_SIZE - amtRead);
+    gzclose(pFile);
+    *pnFileSize = nFileSize;
+    return pContents;
+}
 
 /**Function*************************************************************
 
@@ -545,7 +667,11 @@
     FILE * pFile;
     int nFileSize;
     char * pContents;
-    int RetValue;
+    int RetValue;
+    if ( !strncmp(pFileName+strlen(pFileName)-4,".bz2",4) )
+        return Io_MvLoadFileBz2( pFileName, &nFileSize );
+	if ( !strncmp(pFileName+strlen(pFileName)-3,".gz",3) )
+        return Io_MvLoadFileGz( pFileName, &nFileSize );
     pFile = fopen( pFileName, "rb" );
     if ( pFile == NULL )
     {
@@ -568,7 +694,7 @@
     // some benchmarks suddenly break off without this line
     strcpy( pContents + nFileSize, "\n.end\n" );
     return pContents;
-}
+}
 
 /**Function*************************************************************
 
diff --git a/abc-build/src/base/main/main.h b/abc-build/src/base/main/main.h
--- a/abc-build/src/base/main/main.h
+++ b/abc-build/src/base/main/main.h
@@ -106,6 +106,7 @@
 extern ABC_DLL void *          Abc_FrameReadManDd();                     
 extern ABC_DLL void *          Abc_FrameReadManDec();                    
 extern ABC_DLL void *          Abc_FrameReadManDsd();           
+extern ABC_DLL void *          Abc_FrameReadManDsd2();           
          
 extern ABC_DLL char *          Abc_FrameReadFlag( char * pFlag ); 
 extern ABC_DLL int             Abc_FrameIsFlagEnabled( char * pFlag );
@@ -140,6 +141,7 @@
 extern ABC_DLL void            Abc_FrameSetNFrames( int nFrames );
 extern ABC_DLL void            Abc_FrameSetStatus( int Status );
 extern ABC_DLL void            Abc_FrameSetManDsd( void * pMan );
+extern ABC_DLL void            Abc_FrameSetManDsd2( void * pMan );
 
 extern ABC_DLL int             Abc_FrameCheckPoConst( Abc_Frame_t * p, int iPoNum );
 
diff --git a/abc-build/src/base/main/mainFrame.c b/abc-build/src/base/main/mainFrame.c
--- a/abc-build/src/base/main/mainFrame.c
+++ b/abc-build/src/base/main/mainFrame.c
@@ -60,6 +60,7 @@
 void *      Abc_FrameReadManDd()                             { if ( s_GlobalFrame->dd == NULL )      s_GlobalFrame->dd = Cudd_Init( 0, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 );  return s_GlobalFrame->dd;      } 
 void *      Abc_FrameReadManDec()                            { if ( s_GlobalFrame->pManDec == NULL ) s_GlobalFrame->pManDec = Dec_ManStart();                                        return s_GlobalFrame->pManDec; } 
 void *      Abc_FrameReadManDsd()                            { return s_GlobalFrame->pManDsd;      } 
+void *      Abc_FrameReadManDsd2()                           { return s_GlobalFrame->pManDsd2;     } 
 char *      Abc_FrameReadFlag( char * pFlag )                { return Cmd_FlagReadByName( s_GlobalFrame, pFlag );   } 
 
 int         Abc_FrameReadBmcFrames( Abc_Frame_t * p )        { return s_GlobalFrame->nFrames;      }               
@@ -85,7 +86,8 @@
 void        Abc_FrameSetCex( Abc_Cex_t * pCex )              { ABC_FREE( s_GlobalFrame->pCex ); s_GlobalFrame->pCex = pCex;       }
 void        Abc_FrameSetNFrames( int nFrames )               { ABC_FREE( s_GlobalFrame->pCex ); s_GlobalFrame->nFrames = nFrames; }
 void        Abc_FrameSetStatus( int Status )                 { ABC_FREE( s_GlobalFrame->pCex ); s_GlobalFrame->Status = Status;   }
-void        Abc_FrameSetManDsd( void * pMan )                { if (s_GlobalFrame->pManDsd && s_GlobalFrame->pManDsd != pMan) If_DsdManFree((If_DsdMan_t *)s_GlobalFrame->pManDsd, 0); s_GlobalFrame->pManDsd = pMan; }
+void        Abc_FrameSetManDsd( void * pMan )                { if (s_GlobalFrame->pManDsd  && s_GlobalFrame->pManDsd  != pMan) If_DsdManFree((If_DsdMan_t *)s_GlobalFrame->pManDsd,  0); s_GlobalFrame->pManDsd = pMan;  }
+void        Abc_FrameSetManDsd2( void * pMan )               { if (s_GlobalFrame->pManDsd2 && s_GlobalFrame->pManDsd2 != pMan) If_DsdManFree((If_DsdMan_t *)s_GlobalFrame->pManDsd2, 0); s_GlobalFrame->pManDsd2 = pMan; }
 
 int         Abc_FrameIsBatchMode()                           { return s_GlobalFrame ? s_GlobalFrame->fBatchMode : 0;              } 
 
@@ -195,6 +197,7 @@
     if ( p->pSave3    )  Aig_ManStop( (Aig_Man_t *)p->pSave3 );
     if ( p->pSave4    )  Aig_ManStop( (Aig_Man_t *)p->pSave4 );
     if ( p->pManDsd   )  If_DsdManFree( (If_DsdMan_t *)p->pManDsd, 0 );
+    if ( p->pManDsd2  )  If_DsdManFree( (If_DsdMan_t *)p->pManDsd2, 0 );
     if ( p->vPlugInComBinPairs ) 
     {
         char * pTemp;
diff --git a/abc-build/src/base/main/mainInit.c b/abc-build/src/base/main/mainInit.c
--- a/abc-build/src/base/main/mainInit.c
+++ b/abc-build/src/base/main/mainInit.c
@@ -50,6 +50,8 @@
 extern void Load_End( Abc_Frame_t * pAbc );
 extern void Scl_Init( Abc_Frame_t * pAbc );
 extern void Scl_End( Abc_Frame_t * pAbc );
+extern void Wlc_Init( Abc_Frame_t * pAbc );
+extern void Wlc_End( Abc_Frame_t * pAbc );
 extern void Test_Init( Abc_Frame_t * pAbc );
 extern void Test_End( Abc_Frame_t * pAbc );
 extern void Abc2_Init( Abc_Frame_t * pAbc );
@@ -85,6 +87,7 @@
     Libs_Init( pAbc );
     Load_Init( pAbc );
     Scl_Init( pAbc );
+    Wlc_Init( pAbc );
     Test_Init( pAbc );
 #ifdef USE_ABC2
     Abc2_Init( pAbc );
@@ -119,6 +122,7 @@
     Libs_End( pAbc );
     Load_End( pAbc );
     Scl_End( pAbc );
+    Wlc_End( pAbc );
     Test_End( pAbc );
 #ifdef USE_ABC2
     Abc2_End( pAbc );
diff --git a/abc-build/src/base/main/mainInt.h b/abc-build/src/base/main/mainInt.h
--- a/abc-build/src/base/main/mainInt.h
+++ b/abc-build/src/base/main/mainInt.h
@@ -71,7 +71,7 @@
     int             nSteps;        // the counter of different network processed
     int             fSource;       // marks the source mode
     int             fAutoexac;     // marks the autoexec mode
-	int				fBatchMode;	   // batch mode flag
+    int             fBatchMode;    // batch mode flag
     int             fBridgeMode;   // bridge mode flag
     // output streams
     FILE *          Out;
@@ -85,6 +85,7 @@
     // decomposition package    
     void *          pManDec;       // decomposition manager
     void *          pManDsd;       // decomposition manager
+    void *          pManDsd2;      // decomposition manager
     DdManager *     dd;            // temporary BDD package
     // libraries for mapping
     void *          pLibLut;       // the current LUT library
@@ -103,6 +104,10 @@
     // new code
     Gia_Man_t *     pGia;          // alternative current network as a light-weight AIG
     Gia_Man_t *     pGia2;         // copy of the above
+    Gia_Man_t *     pGiaBest;      // copy of the above
+    int             nBestLuts;     // best LUT count
+    int             nBestEdges;    // best edge count
+    int             nBestLevels;   // best level count
     Abc_Cex_t *     pCex;          // a counter-example to fail the current network
     Abc_Cex_t *     pCex2;         // copy of the above
     Vec_Ptr_t *     vCexVec;       // a vector of counter-examples if more than one PO fails
@@ -112,7 +117,7 @@
     int             Status;                // the status of verification problem (proved=1, disproved=0, undecided=-1)
     int             nFrames;               // the number of time frames completed by BMC
     Vec_Ptr_t *     vPlugInComBinPairs;    // pairs of command and its binary name
-	Vec_Ptr_t *     vLTLProperties_global; // related to LTL
+    Vec_Ptr_t *     vLTLProperties_global; // related to LTL
     void *          pSave1; 
     void *          pSave2; 
     void *          pSave3; 
@@ -120,7 +125,8 @@
     void *          pAbc85Ntl;
     void *          pAbc85Ntl2;
     void *          pAbc85Best;
-    void *          pAbc85Delay;
+    void *          pAbc85Delay;
+    void *          pAbcWlc;
 
     EXT_ABC_FRAME   // plugin for external functionality
 };
diff --git a/abc-build/src/base/ver/verCore.c b/abc-build/src/base/ver/verCore.c
--- a/abc-build/src/base/ver/verCore.c
+++ b/abc-build/src/base/ver/verCore.c
@@ -497,6 +497,8 @@
             RetValue = Ver_ParseGate( pMan, pNtk, pGate );
 //        else if ( pMan->pDesign->pLibrary && st__lookup(pMan->pDesign->pLibrary->tModules, pWord, (char**)&pNtkTemp) ) // gate library
 //            RetValue = Ver_ParseGate( pMan, pNtkTemp );
+        else if ( !strcmp( pWord, "wire" ) )
+            RetValue = Ver_ParseSignal( pMan, pNtk, VER_SIG_WIRE );
         else // assume this is the box used in the current design
         {
             pNtkTemp = Ver_ParseFindOrCreateNetwork( pMan, pWord );
@@ -811,7 +813,10 @@
         // get the next word
         pWord = Ver_ParseGetName( pMan );
         if ( pWord == NULL )
-            return 0;
+            return 0;
+
+        if ( !strcmp(pWord, "wire") )
+            continue;
 
         // check if the range is specified
         if ( pWord[0] == '[' && !pMan->fNameLast )
@@ -846,8 +851,12 @@
             // add signals from Lsb to Msb
             Limit = nMsb > nLsb? nMsb - nLsb + 1: nLsb - nMsb + 1;
             for ( i = 0, Bit = nLsb; i < Limit; i++, Bit = nMsb > nLsb ? Bit + 1: Bit - 1  )
-            {
-                sprintf( Buffer, "%s[%d]", pWord, Bit );
+            {
+//                sprintf( Buffer, "%s[%d]", pWord, Bit );
+                if ( Limit > 1 )
+                    sprintf( Buffer, "%s[%d]", pWord, Bit );
+                else
+                    sprintf( Buffer, "%s", pWord );
                 if ( SigType == VER_SIG_INPUT || SigType == VER_SIG_INOUT )
                     Ver_ParseCreatePi( pNtk, Buffer );
                 if ( SigType == VER_SIG_OUTPUT || SigType == VER_SIG_INOUT )
@@ -1107,10 +1116,16 @@
         if ( !Ver_ParseLookupSuffix( pMan, pWord, &nMsb, &nLsb ) )
             return 0;
         // handle special case of constant assignment
-        if ( nMsb >= 0 && nLsb >= 0 )
+        Limit = nMsb > nLsb? nMsb - nLsb + 1: nLsb - nMsb + 1;
+        if ( nMsb >= 0 && nLsb >= 0 && Limit > 1 )
         {
-            // save the fanout name
-            strcpy( Buffer, pWord );
+            // save the fanout name
+            if ( !strcmp(pWord, "1\'h0") )
+                strcpy( Buffer, "1\'b0" );
+            else if ( !strcmp(pWord, "1\'h1") )
+                strcpy( Buffer, "1\'b1" );
+            else
+                strcpy( Buffer, pWord );
             // get the equality sign
             if ( Ver_StreamPopChar(p) != '=' )
             {
@@ -1272,9 +1287,16 @@
                 // get the name of this signal
                 Length = (int)(ABC_PTRUINT_T)Vec_PtrEntry( pMan->vNames, 2*i );
                 pName  = (char *)Vec_PtrEntry( pMan->vNames, 2*i + 1 );
-                pName[Length] = 0;
+                pName[Length] = 0;
+                // try name
+//                pNet = Ver_ParseFindNet( pNtk, pName );
+                if ( !strcmp(pName, "1\'h0") )
+                    pNet = Ver_ParseFindNet( pNtk, "1\'b0" );
+                else if ( !strcmp(pName, "1\'h1") )
+                    pNet = Ver_ParseFindNet( pNtk, "1\'b1" );
+                else
+                    pNet = Ver_ParseFindNet( pNtk, pName );
                 // find the corresponding net
-                pNet = Ver_ParseFindNet( pNtk, pName );
                 if ( pNet == NULL )
                 {
                     sprintf( pMan->sError, "Cannot read the assign statement for %s (input wire %s is not defined).", pWord, pName );
@@ -1863,8 +1885,8 @@
                         Limit = (nMsb > nLsb) ? nMsb - nLsb + 1: nLsb - nMsb + 1;  
                         for ( Bit = nMsb, k = Limit - 1; k >= 0; Bit = (nMsb > nLsb ? Bit - 1: Bit + 1), k--, i++ )
                         {
-                            // get the actual net
-                            sprintf( Buffer, "%s[%d]", pWord, Bit );
+                            // get the actual net
+                            sprintf( Buffer, "%s[%d]", pWord, Bit );
                             pNetActual = Ver_ParseFindNet( pNtk, Buffer );
                             if ( pNetActual == NULL )
                             {
diff --git a/abc-build/src/base/wlc/module.make b/abc-build/src/base/wlc/module.make
new file mode 100644
--- /dev/null
+++ b/abc-build/src/base/wlc/module.make
@@ -0,0 +1,6 @@
+SRC +=	src/base/wlc/wlc.c \
+	src/base/wlc/wlcBlast.c \
+	src/base/wlc/wlcCom.c \
+	src/base/wlc/wlcNtk.c \
+	src/base/wlc/wlcReadVer.c \
+	src/base/wlc/wlcWriteVer.c 
diff --git a/abc-build/src/base/wlc/wlc.c b/abc-build/src/base/wlc/wlc.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/base/wlc/wlc.c
@@ -0,0 +1,52 @@
+/**CFile****************************************************************
+
+  FileName    [wlc.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Verilog parser.]
+
+  Synopsis    [Parses several flavors of word-level Verilog.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - August 22, 2014.]
+
+  Revision    [$Id: wlc.c,v 1.00 2014/09/12 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "wlc.h"
+
+ABC_NAMESPACE_IMPL_START
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/base/wlc/wlc.h b/abc-build/src/base/wlc/wlc.h
new file mode 100644
--- /dev/null
+++ b/abc-build/src/base/wlc/wlc.h
@@ -0,0 +1,228 @@
+/**CFile****************************************************************
+
+  FileName    [wlc.h]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Verilog parser.]
+
+  Synopsis    [External declarations.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - August 22, 2014.]
+
+  Revision    [$Id: wlc.h,v 1.00 2014/09/12 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#ifndef ABC__base__wlc__wlc_h
+#define ABC__base__wlc__wlc_h
+
+
+////////////////////////////////////////////////////////////////////////
+///                          INCLUDES                                ///
+////////////////////////////////////////////////////////////////////////
+
+#include "aig/gia/gia.h"
+#include "misc/extra/extra.h"
+#include "misc/util/utilNam.h"
+#include "misc/mem/mem.h"
+#include "misc/extra/extra.h"
+#include "misc/util/utilTruth.h"
+
+////////////////////////////////////////////////////////////////////////
+///                         PARAMETERS                               ///
+////////////////////////////////////////////////////////////////////////
+
+ABC_NAMESPACE_HEADER_START 
+
+// object types
+typedef enum { 
+    WLC_OBJ_NONE = 0,      // 00: unknown
+    WLC_OBJ_PI,            // 01: primary input terminal
+    WLC_OBJ_PO,            // 02: primary output terminal
+    WLC_OBJ_BO,            // 03: box output
+    WLC_OBJ_BI,            // 04: box input
+    WLC_OBJ_FF,            // 05: flop
+    WLC_OBJ_CONST,         // 06: constant
+    WLC_OBJ_BUF,           // 07: buffer
+    WLC_OBJ_MUX,           // 08: multiplexer
+    WLC_OBJ_SHIFT_R,       // 09: shift right
+    WLC_OBJ_SHIFT_RA,      // 10: shift right (arithmetic)
+    WLC_OBJ_SHIFT_L,       // 11: shift left
+    WLC_OBJ_SHIFT_LA,      // 12: shift left (arithmetic)
+    WLC_OBJ_BIT_NOT,       // 13: bitwise NOT
+    WLC_OBJ_BIT_AND,       // 14: bitwise AND
+    WLC_OBJ_BIT_OR,        // 15: bitwise OR
+    WLC_OBJ_BIT_XOR,       // 16: bitwise XOR
+    WLC_OBJ_BIT_SELECT,    // 17: bit selection
+    WLC_OBJ_BIT_CONCAT,    // 18: bit concatenation
+    WLC_OBJ_BIT_ZEROPAD,   // 19: zero padding
+    WLC_OBJ_BIT_SIGNEXT,   // 20: sign extension
+    WLC_OBJ_LOGIC_NOT,     // 21: logic NOT
+    WLC_OBJ_LOGIC_AND,     // 22: logic AND
+    WLC_OBJ_LOGIC_OR,      // 23: logic OR
+    WLC_OBJ_COMP_EQU,      // 24: compare equal
+    WLC_OBJ_COMP_NOT,      // 25: compare not equal
+    WLC_OBJ_COMP_LESS,     // 26: compare less
+    WLC_OBJ_COMP_MORE,     // 27: compare more
+    WLC_OBJ_COMP_LESSEQU,  // 28: compare less or equal
+    WLC_OBJ_COMP_MOREEQU,  // 29: compare more or equal
+    WLC_OBJ_REDUCT_AND,    // 30: reduction AND
+    WLC_OBJ_REDUCT_OR,     // 31: reduction OR
+    WLC_OBJ_REDUCT_XOR,    // 32: reduction XOR
+    WLC_OBJ_ARI_ADD,       // 33: arithmetic addition
+    WLC_OBJ_ARI_SUB,       // 34: arithmetic subtraction
+    WLC_OBJ_ARI_MULTI,     // 35: arithmetic multiplier
+    WLC_OBJ_ARI_DIVIDE,    // 36: arithmetic division
+    WLC_OBJ_ARI_MODULUS,   // 37: arithmetic modulus
+    WLC_OBJ_ARI_POWER,     // 38: arithmetic power
+    WLC_OBJ_NUMBER         // 39: unused
+} Wlc_ObjType_t;
+
+
+////////////////////////////////////////////////////////////////////////
+///                         BASIC TYPES                              ///
+////////////////////////////////////////////////////////////////////////
+
+typedef struct Wlc_Ntk_t_  Wlc_Ntk_t;
+typedef struct Wlc_Obj_t_  Wlc_Obj_t;
+
+struct Wlc_Obj_t_ // 16 bytes
+{
+    unsigned               Type    :  6;       // node type
+    unsigned               Signed  :  1;       // signed
+    unsigned               Mark    :  1;       // user mark
+    unsigned               nFanins : 24;       // fanin count
+    unsigned               End     : 16;       // range end
+    unsigned               Beg     : 16;       // range begin
+    union { int            Fanins[2];          // fanin IDs
+            int *          pFanins[1]; };
+};
+
+struct Wlc_Ntk_t_ 
+{
+    char *                 pName;              // model name
+    Vec_Int_t              vPis;               // primary inputs 
+    Vec_Int_t              vPos;               // primary outputs
+    Vec_Int_t              vCis;               // combinational inputs
+    Vec_Int_t              vCos;               // combinational outputs
+    Vec_Int_t              vFfs;               // flops
+    int                    nObjs[WLC_OBJ_NUMBER]; // counter of objects of each type
+    // memory for objects
+    Wlc_Obj_t *            pObjs;
+    int                    iObj;
+    int                    nObjsAlloc;
+    Mem_Flex_t *           pMemFanin;
+    // object names
+    Abc_Nam_t *            pManName;           // object names
+    Vec_Int_t              vNameIds;           // object name IDs
+    // object attributes
+    int                    nTravIds;           // counter of traversal IDs
+    Vec_Int_t              vTravIds;           // trav IDs of the objects
+    Vec_Int_t              vCopies;            // object first bits
+};
+
+static inline int          Wlc_NtkObjNum( Wlc_Ntk_t * p )                         { return p->iObj - 1;                                          }
+static inline int          Wlc_NtkObjNumMax( Wlc_Ntk_t * p )                      { return p->iObj;                                              }
+static inline int          Wlc_NtkPiNum( Wlc_Ntk_t * p )                          { return Vec_IntSize(&p->vPis);                                }
+static inline int          Wlc_NtkPoNum( Wlc_Ntk_t * p )                          { return Vec_IntSize(&p->vPos);                                }
+static inline int          Wlc_NtkCiNum( Wlc_Ntk_t * p )                          { return Vec_IntSize(&p->vCis);                                }
+static inline int          Wlc_NtkCoNum( Wlc_Ntk_t * p )                          { return Vec_IntSize(&p->vCos);                                }
+static inline int          Wlc_NtkFfNum( Wlc_Ntk_t * p )                          { return Vec_IntSize(&p->vFfs);                                }
+
+static inline Wlc_Obj_t *  Wlc_NtkObj( Wlc_Ntk_t * p, int Id )                    { assert(Id > 0 && Id < p->nObjsAlloc); return p->pObjs + Id;  }
+static inline Wlc_Obj_t *  Wlc_NtkPi( Wlc_Ntk_t * p, int i )                      { return Wlc_NtkObj( p, Vec_IntEntry(&p->vPis, i) );           }
+static inline Wlc_Obj_t *  Wlc_NtkPo( Wlc_Ntk_t * p, int i )                      { return Wlc_NtkObj( p, Vec_IntEntry(&p->vPos, i) );           }
+static inline Wlc_Obj_t *  Wlc_NtkCi( Wlc_Ntk_t * p, int i )                      { return Wlc_NtkObj( p, Vec_IntEntry(&p->vCis, i) );           }
+static inline Wlc_Obj_t *  Wlc_NtkCo( Wlc_Ntk_t * p, int i )                      { return Wlc_NtkObj( p, Vec_IntEntry(&p->vCos, i) );           }
+static inline Wlc_Obj_t *  Wlc_NtkFf( Wlc_Ntk_t * p, int i )                      { return Wlc_NtkObj( p, Vec_IntEntry(&p->vFfs, i) );           }
+
+static inline int          Wlc_ObjId( Wlc_Ntk_t * p, Wlc_Obj_t * pObj )           { return pObj - p->pObjs;                                      }
+static inline int          Wlc_ObjPioId( Wlc_Obj_t * p )                          { assert(p->Type==WLC_OBJ_PI||p->Type==WLC_OBJ_PO);return p->Fanins[1]; }
+static inline int          Wlc_ObjFaninNum( Wlc_Obj_t * p )                       { return p->nFanins;                                           }
+static inline int          Wlc_ObjHasArray( Wlc_Obj_t * p )                       { return p->nFanins > 2 || p->Type == WLC_OBJ_CONST;           }
+static inline int *        Wlc_ObjFanins( Wlc_Obj_t * p )                         { return Wlc_ObjHasArray(p) ? p->pFanins[0] : p->Fanins;       }
+static inline int          Wlc_ObjFaninId( Wlc_Obj_t * p, int i )                 { return Wlc_ObjFanins(p)[i];                                  }
+static inline int          Wlc_ObjFaninId0( Wlc_Obj_t * p )                       { return Wlc_ObjFanins(p)[0];                                  }
+static inline int          Wlc_ObjFaninId1( Wlc_Obj_t * p )                       { return Wlc_ObjFanins(p)[1];                                  }
+static inline int          Wlc_ObjFaninId2( Wlc_Obj_t * p )                       { return Wlc_ObjFanins(p)[2];                                  }
+static inline Wlc_Obj_t *  Wlc_ObjFanin( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, int i ) { return Wlc_NtkObj( p, Wlc_ObjFaninId(pObj, i) );             }
+static inline Wlc_Obj_t *  Wlc_ObjFanin0( Wlc_Ntk_t * p, Wlc_Obj_t * pObj )       { return Wlc_NtkObj( p, Wlc_ObjFaninId(pObj, 0) );             }
+static inline Wlc_Obj_t *  Wlc_ObjFanin1( Wlc_Ntk_t * p, Wlc_Obj_t * pObj )       { return Wlc_NtkObj( p, Wlc_ObjFaninId(pObj, 1) );             }
+static inline Wlc_Obj_t *  Wlc_ObjFanin2( Wlc_Ntk_t * p, Wlc_Obj_t * pObj )       { return Wlc_NtkObj( p, Wlc_ObjFaninId(pObj, 2) );             }
+
+static inline int          Wlc_ObjRange( Wlc_Obj_t * p )                          { return p->End - p->Beg + 1;                                  }
+static inline int          Wlc_ObjRangeEnd( Wlc_Obj_t * p )                       { assert(p->Type == WLC_OBJ_BIT_SELECT); return p->Fanins[1] >> 16;     }
+static inline int          Wlc_ObjRangeBeg( Wlc_Obj_t * p )                       { assert(p->Type == WLC_OBJ_BIT_SELECT); return p->Fanins[1] & 0xFFFF;  }
+static inline int *        Wlc_ObjConstValue( Wlc_Obj_t * p )                     { assert(p->Type == WLC_OBJ_CONST);      return Wlc_ObjFanins(p);       }
+
+static inline void         Wlc_NtkCleanCopy( Wlc_Ntk_t * p )                      { Vec_IntFill( &p->vCopies, p->nObjsAlloc, 0 );                }
+static inline int          Wlc_NtkHasCopy( Wlc_Ntk_t * p )                        { return Vec_IntSize( &p->vCopies ) > 0;                       }
+static inline void         Wlc_ObjSetCopy( Wlc_Ntk_t * p, int iObj, int i )       { Vec_IntWriteEntry( &p->vCopies, iObj, i );                   }
+static inline int          Wlc_ObjCopy( Wlc_Ntk_t * p, int iObj )                 { return Vec_IntEntry( &p->vCopies, iObj );                    }
+
+static inline void         Wlc_NtkCleanNameId( Wlc_Ntk_t * p )                    { Vec_IntFill( &p->vNameIds, p->nObjsAlloc, 0 );               }
+static inline int          Wlc_NtkHasNameId( Wlc_Ntk_t * p )                      { return Vec_IntSize( &p->vNameIds ) > 0;                      }
+static inline void         Wlc_ObjSetNameId( Wlc_Ntk_t * p, int iObj, int i )     { Vec_IntWriteEntry( &p->vNameIds, iObj, i );                  }
+static inline int          Wlc_ObjNameId( Wlc_Ntk_t * p, int iObj )               { return Vec_IntEntry( &p->vNameIds, iObj );                   }
+
+////////////////////////////////////////////////////////////////////////
+///                      MACRO DEFINITIONS                           ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+///                             ITERATORS                            ///
+////////////////////////////////////////////////////////////////////////
+
+#define Wlc_NtkForEachObj( p, pObj, i )                                             \
+    for ( i = 1; (i < Wlc_NtkObjNumMax(p)) && (((pObj) = Wlc_NtkObj(p, i)), 1); i++ )
+#define Wlc_NtkForEachPi( p, pPi, i )                                               \
+    for ( i = 0; (i < Wlc_NtkPiNum(p)) && (((pPi) = Wlc_NtkPi(p, i)), 1); i++ )
+#define Wlc_NtkForEachPo( p, pPo, i )                                               \
+    for ( i = 0; (i < Wlc_NtkPoNum(p)) && (((pPo) = Wlc_NtkPo(p, i)), 1); i++ )
+#define Wlc_NtkForEachCi( p, pCi, i )                                               \
+    for ( i = 0; (i < Wlc_NtkCiNum(p)) && (((pCi) = Wlc_NtkCi(p, i)), 1); i++ )
+#define Wlc_NtkForEachCo( p, pCo, i )                                               \
+    for ( i = 0; (i < Wlc_NtkCoNum(p)) && (((pCo) = Wlc_NtkCo(p, i)), 1); i++ )
+
+#define Wlc_ObjForEachFanin( pObj, iFanin, i )                                      \
+    for ( i = 0; (i < Wlc_ObjFaninNum(pObj)) && (((iFanin) = Wlc_ObjFaninId(pObj, i)), 1); i++ )
+#define Wlc_ObjForEachFaninReverse( pObj, iFanin, i )                               \
+    for ( i = Wlc_ObjFaninNum(pObj) - 1; (i >= 0) && (((iFanin) = Wlc_ObjFaninId(pObj, i)), 1); i-- )
+
+
+////////////////////////////////////////////////////////////////////////
+///                    FUNCTION DECLARATIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/*=== wlcBlast.c ========================================================*/
+extern Gia_Man_t *    Wlc_NtkBitBlast( Wlc_Ntk_t * p );
+/*=== wlcNtk.c ========================================================*/
+extern Wlc_Ntk_t *    Wlc_NtkAlloc( char * pName, int nObjsAlloc );
+extern int            Wlc_ObjAlloc( Wlc_Ntk_t * p, int Type, int Signed, int End, int Beg );
+extern char *         Wlc_ObjName( Wlc_Ntk_t * p, int iObj );
+extern void           Wlc_ObjUpdateType( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, int Type );
+extern void           Wlc_ObjAddFanins( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, Vec_Int_t * vFanins );
+extern void           Wlc_NtkFree( Wlc_Ntk_t * p );
+extern void           Wlc_NtkPrintNodes( Wlc_Ntk_t * p, int Type );
+extern void           Wlc_NtkPrintStats( Wlc_Ntk_t * p, int fVerbose );
+extern Wlc_Ntk_t *    Wlc_NtkDupDfs( Wlc_Ntk_t * p );
+extern void           Wlc_NtkTransferNames( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p );
+/*=== wlcReadWord.c ========================================================*/
+extern Wlc_Ntk_t *    Wlc_ReadVer( char * pFileName );
+/*=== wlcWriteWord.c ========================================================*/
+extern void           Wlc_WriteVer( Wlc_Ntk_t * p, char * pFileName );
+
+
+ABC_NAMESPACE_HEADER_END
+
+#endif
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
diff --git a/abc-build/src/base/wlc/wlcBlast.c b/abc-build/src/base/wlc/wlcBlast.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/base/wlc/wlcBlast.c
@@ -0,0 +1,363 @@
+/**CFile****************************************************************
+
+  FileName    [wlcBlast.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Verilog parser.]
+
+  Synopsis    [Bit-blasting.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - August 22, 2014.]
+
+  Revision    [$Id: wlcBlast.c,v 1.00 2014/09/12 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "wlc.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Wlc_NtkPrepareBits( Wlc_Ntk_t * p )
+{
+    Wlc_Obj_t * pObj;
+    int i, nBits = 0;
+    Wlc_NtkCleanCopy( p );
+    Wlc_NtkForEachObj( p, pObj, i )
+    {
+        Wlc_ObjSetCopy( p, i, nBits );
+        nBits += Wlc_ObjRange(pObj);
+    }
+    return nBits;
+}
+int Wlc_NtkComputeReduction( Gia_Man_t * pNew, int * pFans, int nFans, int Type )
+{
+    if ( Type == WLC_OBJ_REDUCT_AND )
+    {
+        int k, iLit = 1;
+        for ( k = 0; k < nFans; k++ )
+            iLit = Gia_ManHashAnd( pNew, iLit, pFans[k] );
+        return iLit;
+    }
+    if ( Type == WLC_OBJ_REDUCT_OR )
+    {
+        int k, iLit = 0;
+        for ( k = 0; k < nFans; k++ )
+            iLit = Gia_ManHashOr( pNew, iLit, pFans[k] );
+        return iLit;
+    }
+    if ( Type == WLC_OBJ_REDUCT_XOR )
+    {
+        int k, iLit = 0;
+        for ( k = 0; k < nFans; k++ )
+            iLit = Gia_ManHashXor( pNew, iLit, pFans[k] );
+        return iLit;
+    }
+    assert( 0 );
+    return -1;
+}
+int Wlc_NtkMuxTree_rec( Gia_Man_t * pNew, int * pCtrl, int nCtrl, Vec_Int_t * vData, int Shift )
+{
+    int iLit0, iLit1;
+    if ( nCtrl == 0 )
+        return Vec_IntEntry( vData, Shift );
+    iLit0 = Wlc_NtkMuxTree_rec( pNew, pCtrl, nCtrl-1, vData, Shift );
+    iLit1 = Wlc_NtkMuxTree_rec( pNew, pCtrl, nCtrl-1, vData, Shift + (1<<(nCtrl-1)) );
+    return Gia_ManHashMux( pNew, pCtrl[nCtrl-1], iLit1, iLit0 );
+}
+void Wlc_NtkAdderChain( Gia_Man_t * pNew, int * pAdd0, int * pAdd1, int nBits )
+{
+    int iCarry = 0, iTerm1, iTerm2, iTerm3, iSum, b;
+    for ( b = 0; b < nBits; b++ )
+    {
+        iSum   = Gia_ManHashXor( pNew, iCarry, Gia_ManHashXor(pNew, pAdd0[b], pAdd1[b]) );
+        iTerm1 = Gia_ManHashAnd( pNew, pAdd0[b], pAdd1[b] );
+        iTerm2 = Gia_ManHashAnd( pNew, pAdd0[b], iCarry );
+        iTerm3 = Gia_ManHashAnd( pNew, pAdd1[b], iCarry );
+        iCarry = Gia_ManHashOr( pNew, iTerm1, Gia_ManHashOr(pNew, iTerm2, iTerm3) );
+        pAdd0[b] = iSum;
+    }
+}
+Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p )
+{
+    Gia_Man_t * pTemp, * pNew;
+    Wlc_Obj_t * pObj;
+    Vec_Int_t * vBits, * vTemp0, * vTemp1, * vTemp2, * vTemp3;
+    int nBits = Wlc_NtkPrepareBits( p );
+    int nRange, nRange0, nRange1, nRange2;
+    int i, k, b, iLit, * pFans0, * pFans1, * pFans2;
+    vBits  = Vec_IntAlloc( nBits );
+    vTemp0 = Vec_IntAlloc( 1000 );
+    vTemp1 = Vec_IntAlloc( 1000 );
+    vTemp2 = Vec_IntAlloc( 1000 );
+    vTemp3 = Vec_IntAlloc( 1000 );
+    // craete AIG manager
+    pNew = Gia_ManStart( 5 * Wlc_NtkObjNum(p) + 1000 );
+    pNew->pName = Abc_UtilStrsav( p->pName );
+    Gia_ManHashAlloc( pNew );
+    // create primary inputs
+    Wlc_NtkForEachObj( p, pObj, i )
+    {
+//        char * pName = Wlc_ObjName(p, i);
+        nRange  = Wlc_ObjRange( pObj );
+        nRange0 = Wlc_ObjFaninNum(pObj) > 0 ? Wlc_ObjRange( Wlc_ObjFanin0(p, pObj) ) : -1;
+        nRange1 = Wlc_ObjFaninNum(pObj) > 1 ? Wlc_ObjRange( Wlc_ObjFanin1(p, pObj) ) : -1;
+        nRange2 = Wlc_ObjFaninNum(pObj) > 2 ? Wlc_ObjRange( Wlc_ObjFanin2(p, pObj) ) : -1;
+        pFans0 = Wlc_ObjFaninNum(pObj) > 0 ? Vec_IntEntryP( vBits, Wlc_ObjCopy(p, Wlc_ObjFaninId0(pObj)) ) : NULL;
+        pFans1 = Wlc_ObjFaninNum(pObj) > 1 ? Vec_IntEntryP( vBits, Wlc_ObjCopy(p, Wlc_ObjFaninId1(pObj)) ) : NULL;
+        pFans2 = Wlc_ObjFaninNum(pObj) > 2 ? Vec_IntEntryP( vBits, Wlc_ObjCopy(p, Wlc_ObjFaninId2(pObj)) ) : NULL;
+        if ( pObj->Type == WLC_OBJ_PI )
+        {
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Gia_ManAppendCi(pNew) );
+        }
+        else if ( pObj->Type == WLC_OBJ_PO || pObj->Type == WLC_OBJ_BUF )
+        {
+//            assert( nRange <= nRange0 );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, k < nRange0 ? pFans0[k] : 0 );
+        }
+        else if ( pObj->Type == WLC_OBJ_CONST )
+        {
+            word * pTruth = (word *)Wlc_ObjFanins(pObj);
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Abc_TtGetBit(pTruth, k) );
+        }
+        else if ( pObj->Type == WLC_OBJ_MUX )
+        {
+            assert( nRange0 == 1 );
+            assert( nRange1 == nRange );
+            assert( nRange2 == nRange );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Gia_ManHashMux(pNew, pFans0[0], pFans1[k], pFans2[k]) );
+        }
+        else if ( pObj->Type == WLC_OBJ_SHIFT_R || pObj->Type == WLC_OBJ_SHIFT_RA )
+        {
+            // prepare data
+            int Fill = pObj->Type == WLC_OBJ_SHIFT_R ? 0 : pFans0[nRange0-1];
+            int nTotal = nRange + (1 << nRange1);
+            Vec_IntClear( vTemp0 );
+            for ( k = 0; k < nRange0; k++ )
+                Vec_IntPush( vTemp0, pFans0[k] );
+            for ( k = 0; k < nTotal; k++ )
+                Vec_IntPush( vTemp0, Fill );
+            // derive the result
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Wlc_NtkMuxTree_rec(pNew, pFans1, nRange1, vTemp0, k) );
+        }
+        else if ( pObj->Type == WLC_OBJ_SHIFT_L || pObj->Type == WLC_OBJ_SHIFT_LA )
+        {
+            // prepare data
+            int Fill = pObj->Type == WLC_OBJ_SHIFT_L ? 0 : pFans0[0];
+            int nTotal = nRange + (1 << nRange1);
+            Vec_IntClear( vTemp0 );
+            for ( k = 0; k < nRange0; k++ )
+                Vec_IntPush( vTemp0, pFans0[k] );
+            for ( k = 0; k < nTotal; k++ )
+                Vec_IntPush( vTemp0, Fill );
+            // derive the result
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Wlc_NtkMuxTree_rec(pNew, pFans1, nRange1, vTemp0, k) );
+        }
+        else if ( pObj->Type == WLC_OBJ_BIT_NOT )
+        {
+            assert( nRange == nRange0 );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Abc_LitNot(pFans0[k]) );
+        }
+        else if ( pObj->Type == WLC_OBJ_BIT_AND )
+        {
+            assert( nRange0 == nRange && nRange1 == nRange );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Gia_ManHashAnd(pNew, pFans0[k], pFans1[k]) );
+        }
+        else if ( pObj->Type == WLC_OBJ_BIT_OR )
+        {
+            assert( nRange0 == nRange && nRange1 == nRange );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Gia_ManHashOr(pNew, pFans0[k], pFans1[k]) );
+        }
+        else if ( pObj->Type == WLC_OBJ_BIT_XOR )
+        {
+            assert( nRange0 == nRange && nRange1 == nRange );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vBits, Gia_ManHashXor(pNew, pFans0[k], pFans1[k]) );
+        }
+        else if ( pObj->Type == WLC_OBJ_BIT_SELECT )
+        {
+            int End = Wlc_ObjRangeEnd(pObj);
+            int Beg = Wlc_ObjRangeBeg(pObj);
+            assert( nRange == End - Beg + 1 );
+            for ( k = Beg; k <= End; k++ )
+                Vec_IntPush( vBits, pFans0[k] );
+        }
+        else if ( pObj->Type == WLC_OBJ_BIT_CONCAT )
+        {
+            int iFanin, nTotal = 0;
+            Wlc_ObjForEachFanin( pObj, iFanin, k )
+                nTotal += Wlc_ObjRange( Wlc_NtkObj(p, iFanin) );
+            assert( nRange == nTotal );
+            Wlc_ObjForEachFaninReverse( pObj, iFanin, k )
+            {
+                nRange0 = Wlc_ObjRange( Wlc_NtkObj(p, iFanin) );
+                pFans0 = Vec_IntEntryP( vBits, Wlc_ObjCopy(p, iFanin) );
+                for ( b = 0; b < nRange0; b++ )
+                    Vec_IntPush( vBits, pFans0[b] );
+            }
+        }
+        else if ( pObj->Type == WLC_OBJ_BIT_ZEROPAD || pObj->Type == WLC_OBJ_BIT_SIGNEXT )
+        {
+            int Pad = pObj->Type == WLC_OBJ_BIT_ZEROPAD ? 0 : pFans0[nRange0-1];
+            assert( nRange0 < nRange );
+            for ( k = 0; k < nRange0; k++ )
+                Vec_IntPush( vBits, pFans0[k] );
+            for (      ; k < nRange; k++ )
+                Vec_IntPush( vBits, Pad );
+        }
+        else if ( pObj->Type == WLC_OBJ_LOGIC_NOT )
+        {
+            iLit = Wlc_NtkComputeReduction( pNew, pFans0, nRange, WLC_OBJ_REDUCT_OR );
+            assert( nRange == 1 );
+            Vec_IntPush( vBits, Abc_LitNot(iLit) );
+        }
+        else if ( pObj->Type == WLC_OBJ_LOGIC_AND )
+        {
+            int iLit0 = Wlc_NtkComputeReduction( pNew, pFans0, nRange, WLC_OBJ_REDUCT_OR );
+            int iLit1 = Wlc_NtkComputeReduction( pNew, pFans0, nRange, WLC_OBJ_REDUCT_OR );
+            assert( nRange == 1 );
+            Vec_IntPush( vBits, Gia_ManHashAnd(pNew, iLit0, iLit1) );
+        }
+        else if ( pObj->Type == WLC_OBJ_LOGIC_OR )
+        {
+            int iLit0 = Wlc_NtkComputeReduction( pNew, pFans0, nRange, WLC_OBJ_REDUCT_OR );
+            int iLit1 = Wlc_NtkComputeReduction( pNew, pFans0, nRange, WLC_OBJ_REDUCT_OR );
+            assert( nRange == 1 );
+            Vec_IntPush( vBits, Gia_ManHashOr(pNew, iLit0, iLit1) );
+        }
+        else if ( pObj->Type == WLC_OBJ_COMP_EQU || pObj->Type == WLC_OBJ_COMP_NOT )
+        {
+            int iLit = 0;
+            assert( nRange == 1 );
+            assert( nRange0 == nRange1 );
+            for ( k = 0; k < nRange0; k++ )
+                iLit = Gia_ManHashOr( pNew, iLit, Gia_ManHashXor(pNew, pFans0[k], pFans1[k]) ); 
+            Vec_IntPush( vBits, Abc_LitNotCond(iLit, pObj->Type == WLC_OBJ_COMP_EQU) );
+        }
+        else if ( pObj->Type == WLC_OBJ_COMP_LESS || pObj->Type == WLC_OBJ_COMP_MOREEQU ||
+                  pObj->Type == WLC_OBJ_COMP_MORE || pObj->Type == WLC_OBJ_COMP_LESSEQU )
+        {
+            int iTerm, iEqu = 1, iLit = 0;
+            assert( nRange == 1 );
+            assert( nRange0 == nRange1 );
+            if ( pObj->Type == WLC_OBJ_COMP_MORE || pObj->Type == WLC_OBJ_COMP_LESSEQU )
+                ABC_SWAP( int *, pFans0, pFans1 );
+            for ( k = nRange0 - 1; k >= 0; k-- )
+            {
+                iTerm = Gia_ManHashAnd( pNew, Abc_LitNot(pFans0[k]), pFans1[k] );
+                iTerm = Gia_ManHashAnd( pNew, iTerm, iEqu );
+                iLit  = Gia_ManHashOr( pNew, iLit, iTerm ); 
+                iEqu  = Abc_LitNot( Gia_ManHashXor( pNew, pFans0[k], pFans1[k] ) );
+            }
+            Vec_IntPush( vBits, Abc_LitNotCond(iLit, pObj->Type == WLC_OBJ_COMP_MOREEQU) );
+        }
+        else if ( pObj->Type == WLC_OBJ_REDUCT_AND || pObj->Type == WLC_OBJ_REDUCT_OR || pObj->Type == WLC_OBJ_REDUCT_XOR )
+            Vec_IntPush( vBits, Wlc_NtkComputeReduction( pNew, pFans0, nRange, pObj->Type ) );
+        else if ( pObj->Type == WLC_OBJ_ARI_ADD )
+        {
+            int Pad0 = Wlc_ObjFanin0(p, pObj)->Signed ? pFans0[nRange0-1] : 0;
+            int Pad1 = Wlc_ObjFanin1(p, pObj)->Signed ? pFans1[nRange1-1] : 0;
+            assert( nRange0 <= nRange && nRange1 <= nRange );
+            Vec_IntClear( vTemp0 );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vTemp0, k < nRange0 ? pFans0[k] : Pad0 );
+            Vec_IntClear( vTemp1 );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vTemp1, k < nRange1 ? pFans1[k] : Pad1 );
+            Wlc_NtkAdderChain( pNew, Vec_IntArray(vTemp0), Vec_IntArray(vTemp1), nRange );
+            Vec_IntAppend( vBits, vTemp0 );
+        }
+        else if ( pObj->Type == WLC_OBJ_ARI_MULTI )
+        {
+            int Pad0 = Wlc_ObjFanin0(p, pObj)->Signed ? pFans0[nRange0-1] : 0;
+            int Pad1 = Wlc_ObjFanin1(p, pObj)->Signed ? pFans1[nRange1-1] : 0;
+            assert( nRange0 <= nRange && nRange1 <= nRange );
+            Vec_IntClear( vTemp0 );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vTemp0, k < nRange0 ? pFans0[k] : Pad0 );
+            Vec_IntClear( vTemp1 );
+            for ( k = 0; k < nRange; k++ )
+                Vec_IntPush( vTemp1, k < nRange1 ? pFans1[k] : Pad1 );
+            // iterate
+            Vec_IntFill( vTemp3, nRange, 0 );
+            for ( k = 0; k < nRange; k++ )
+            {
+                Vec_IntFill( vTemp2, k, 0 );
+                Vec_IntForEachEntry( vTemp0, iLit, b )
+                {
+                    Vec_IntPush( vTemp2, Gia_ManHashAnd(pNew, iLit, Vec_IntEntry(vTemp1, k)) );
+                    if ( Vec_IntSize(vTemp2) == nRange )
+                        break;
+                }
+                assert( Vec_IntSize(vTemp2) == nRange );
+                Wlc_NtkAdderChain( pNew, Vec_IntArray(vTemp3), Vec_IntArray(vTemp2), nRange );
+            }
+            assert( Vec_IntSize(vTemp3) == nRange );
+            Vec_IntAppend( vBits, vTemp3 );
+        }
+        else assert( 0 );
+    }
+    assert( nBits == Vec_IntSize(vBits) );
+    Vec_IntFree( vTemp0 );
+    Vec_IntFree( vTemp1 );
+    Vec_IntFree( vTemp2 );
+    Vec_IntFree( vTemp3 );
+    // create POs
+    Wlc_NtkForEachPo( p, pObj, i )
+    {
+        nRange = Wlc_ObjRange( pObj );
+        nRange0 = Wlc_ObjFaninNum(pObj) > 0 ? Wlc_ObjRange( Wlc_ObjFanin0(p, pObj) ) : -1;
+        assert( nRange == nRange0 );
+        pFans0 = Vec_IntEntryP( vBits, Wlc_ObjCopy(p, Wlc_ObjId(p, pObj)) );
+        for ( k = 0; k < nRange; k++ )
+            Gia_ManAppendCo( pNew, pFans0[k] );
+    }
+    Vec_IntFree( vBits );
+    Vec_IntErase( &p->vCopies );
+    // finalize and cleanup
+    pNew = Gia_ManCleanup( pTemp = pNew );
+    Gia_ManStop( pTemp );
+    return pNew;
+}
+
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/base/wlc/wlcCom.c b/abc-build/src/base/wlc/wlcCom.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/base/wlc/wlcCom.c
@@ -0,0 +1,311 @@
+/**CFile****************************************************************
+
+  FileName    [wlcCom.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Verilog parser.]
+
+  Synopsis    [Command handlers.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - August 22, 2014.]
+
+  Revision    [$Id: wlcCom.c,v 1.00 2014/09/12 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "wlc.h"
+#include "base/main/mainInt.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+static int  Abc_CommandReadVer  ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int  Abc_CommandWriteVer ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int  Abc_CommandPs       ( Abc_Frame_t * pAbc, int argc, char ** argv );
+static int  Abc_CommandBlast    ( Abc_Frame_t * pAbc, int argc, char ** argv );
+
+static inline Wlc_Ntk_t * Wlc_AbcGetNtk( Abc_Frame_t * pAbc )                       { return (Wlc_Ntk_t *)pAbc->pAbcWlc;                      }
+static inline void        Wlc_AbcFreeNtk( Abc_Frame_t * pAbc )                      { if ( pAbc->pAbcWlc ) Wlc_NtkFree(Wlc_AbcGetNtk(pAbc));  }
+static inline void        Wlc_AbcUpdateNtk( Abc_Frame_t * pAbc, Wlc_Ntk_t * pNtk )  { Wlc_AbcFreeNtk(pAbc); pAbc->pAbcWlc = pNtk;             }
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function********************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+******************************************************************************/
+void Wlc_Init( Abc_Frame_t * pAbc )
+{
+    Cmd_CommandAdd( pAbc, "Word level", "%read_ver",   Abc_CommandReadVer,   0 );
+    Cmd_CommandAdd( pAbc, "Word level", "%write_ver",  Abc_CommandWriteVer,  0 );
+    Cmd_CommandAdd( pAbc, "Word level", "%ps",         Abc_CommandPs,        0 );
+    Cmd_CommandAdd( pAbc, "Word level", "%blast",      Abc_CommandBlast,     0 );
+}
+
+/**Function********************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+******************************************************************************/
+void Wlc_End( Abc_Frame_t * pAbc )
+{
+    Wlc_AbcFreeNtk( pAbc );
+}
+
+
+/**Function********************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+******************************************************************************/
+int Abc_CommandReadVer( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    FILE * pFile;
+    Wlc_Ntk_t * pNtk = NULL;
+    char * pFileName = NULL;
+    int c, fVerbose  =    0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( argc != globalUtilOptind + 1 )
+    {
+        printf( "Abc_CommandReadVer(): Input file name should be given on the command line.\n" );
+        return 0;
+    }
+    // get the file name
+    pFileName = argv[globalUtilOptind];
+    if ( (pFile = fopen( pFileName, "r" )) == NULL )
+    {
+        Abc_Print( 1, "Cannot open input file \"%s\". ", pFileName );
+        if ( (pFileName = Extra_FileGetSimilarName( pFileName, ".v", ".smt", NULL, NULL, NULL )) )
+            Abc_Print( 1, "Did you mean \"%s\"?", pFileName );
+        Abc_Print( 1, "\n" );
+        return 0;
+    }
+    fclose( pFile );
+
+    // perform reading
+    pNtk = Wlc_ReadVer( pFileName );
+    Wlc_AbcUpdateNtk( pAbc, pNtk );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: %%read_ver [-vh] <file_name>\n" );
+    Abc_Print( -2, "\t         reads word-level design from Verilog file\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function********************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+******************************************************************************/
+int Abc_CommandWriteVer( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Wlc_Ntk_t * pNtk = Wlc_AbcGetNtk(pAbc);
+    char * pFileName = NULL;
+    int c, fVerbose  =    0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( 1, "Abc_CommandWriteVer(): There is no current design.\n" );
+        return 0;
+    }
+    if ( argc == globalUtilOptind )
+        pFileName = Extra_FileNameGenericAppend( pNtk->pName, "_out.v" );
+    else if ( argc == globalUtilOptind + 1 )
+        pFileName = argv[globalUtilOptind];
+    else
+    {
+        printf( "Output file name should be given on the command line.\n" );
+        return 0;
+    }
+    Wlc_WriteVer( pNtk, pFileName );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: %%write_ver [-vh]\n" );
+    Abc_Print( -2, "\t         writes the design into a file\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n",        fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+
+/**Function********************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+******************************************************************************/
+int Abc_CommandPs( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Wlc_Ntk_t * pNtk = Wlc_AbcGetNtk(pAbc);
+    int fShowMulti   = 0;
+    int fShowAdder   = 0;
+    int c, fVerbose  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "mavh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'm':
+            fShowMulti ^= 1;
+            break;
+        case 'a':
+            fShowAdder ^= 1;
+            break;
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( 1, "Abc_CommandPs(): There is no current design.\n" );
+        return 0;
+    }
+    Wlc_NtkPrintStats( pNtk, fVerbose );
+    if ( fShowMulti )
+        Wlc_NtkPrintNodes( pNtk, WLC_OBJ_ARI_MULTI );
+    if ( fShowAdder )
+        Wlc_NtkPrintNodes( pNtk, WLC_OBJ_ARI_ADD );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: %%ps [-mavh]\n" );
+    Abc_Print( -2, "\t         prints statistics\n" );
+    Abc_Print( -2, "\t-m     : toggle printing multipliers [default = %s]\n",         fShowMulti? "yes": "no" );
+    Abc_Print( -2, "\t-a     : toggle printing adders [default = %s]\n",              fShowAdder? "yes": "no" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+/**Function********************************************************************
+
+  Synopsis    []
+
+  Description []
+
+  SideEffects []
+
+  SeeAlso     []
+
+******************************************************************************/
+int Abc_CommandBlast( Abc_Frame_t * pAbc, int argc, char ** argv )
+{
+    Wlc_Ntk_t * pNtk = Wlc_AbcGetNtk(pAbc);
+    Gia_Man_t * pNew = NULL;
+    int c, fVerbose  = 0;
+    Extra_UtilGetoptReset();
+    while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
+    {
+        switch ( c )
+        {
+        case 'v':
+            fVerbose ^= 1;
+            break;
+        case 'h':
+            goto usage;
+        default:
+            goto usage;
+        }
+    }
+    if ( pNtk == NULL )
+    {
+        Abc_Print( 1, "Abc_CommandBlast(): There is no current design.\n" );
+        return 0;
+    }
+    // transform
+    pNew = Wlc_NtkBitBlast( pNtk );
+    if ( pNew == NULL )
+    {
+        Abc_Print( 1, "Abc_CommandBlast(): Bit-blasting has failed.\n" );
+        return 0;
+    }
+    Abc_FrameUpdateGia( pAbc, pNew );
+    return 0;
+usage:
+    Abc_Print( -2, "usage: %%blast [-vh]\n" );
+    Abc_Print( -2, "\t         performs bit-blasting of the word-level design\n" );
+    Abc_Print( -2, "\t-v     : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
+    Abc_Print( -2, "\t-h     : print the command usage\n");
+    return 1;
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/base/wlc/wlcNtk.c b/abc-build/src/base/wlc/wlcNtk.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/base/wlc/wlcNtk.c
@@ -0,0 +1,327 @@
+/**CFile****************************************************************
+
+  FileName    [wlcNtk.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Verilog parser.]
+
+  Synopsis    [Network data-structure.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - August 22, 2014.]
+
+  Revision    [$Id: wlcNtk.c,v 1.00 2014/09/12 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "wlc.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+// object types
+static char * Wlc_Names[WLC_OBJ_NUMBER+1] = { 
+    NULL,                  // 00: unknown
+    "pi",                  // 01: primary input 
+    "po",                  // 02: primary output 
+    "bo",                  // 03: box output
+    "bi",                  // 04: box input
+    "ff",                  // 05: flop
+    "const",               // 06: constant
+    "buf",                 // 07: buffer
+    "mux",                 // 08: multiplexer
+    ">>",                  // 09: shift right
+    ">>>",                 // 10: shift right (arithmetic)
+    "<<",                  // 11: shift left
+    "<<<",                 // 12: shift left (arithmetic)
+    "~",                   // 13: bitwise NOT
+    "&",                   // 14: bitwise AND
+    "|",                   // 15: bitwise OR
+    "^",                   // 16: bitwise XOR
+    "[:]",                 // 17: bit selection
+    "{,}",                 // 18: bit concatenation
+    "BitPad",              // 19: zero padding
+    "SgnExt",              // 20: sign extension
+    "!",                   // 21: logic NOT
+    "&&",                  // 22: logic AND
+    "||",                  // 23: logic OR
+    "==",                  // 24: compare equal
+    "!=",                  // 25: compare not equal
+    "<",                   // 26: compare less
+    ">",                   // 27: compare more
+    "<=",                  // 28: compare less or equal
+    ">=",                  // 29: compare more or equal
+    "&",                   // 30: reduction AND
+    "|",                   // 31: reduction OR
+    "^",                   // 32: reduction XOR
+    "+",                   // 33: arithmetic addition
+    "-",                   // 34: arithmetic subtraction
+    "*",                   // 35: arithmetic multiplier
+    "//",                  // 36: arithmetic division
+    "%%",                  // 37: arithmetic modulus
+    "**",                  // 38: arithmetic power
+    NULL                   // 39: unused
+};
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    [Working with models.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Wlc_Ntk_t * Wlc_NtkAlloc( char * pName, int nObjsAlloc )
+{
+    Wlc_Ntk_t * p;
+    p = ABC_CALLOC( Wlc_Ntk_t, 1 );
+    p->pName = Extra_FileNameGeneric( pName );
+    Vec_IntGrow( &p->vPis, 111 );
+    Vec_IntGrow( &p->vPos, 111 );
+    Vec_IntGrow( &p->vCis, 111 );
+    Vec_IntGrow( &p->vCos, 111 );
+    Vec_IntGrow( &p->vFfs, 111 );
+    p->pMemFanin = Mem_FlexStart();
+    p->nObjsAlloc = nObjsAlloc;  
+    p->pObjs = ABC_CALLOC( Wlc_Obj_t, p->nObjsAlloc );
+    p->iObj = 1;
+    return p;
+}
+int Wlc_ObjAlloc( Wlc_Ntk_t * p, int Type, int Signed, int End, int Beg )
+{
+    Wlc_Obj_t * pObj;
+    if ( p->iObj == p->nObjsAlloc )
+    {
+        p->pObjs = ABC_REALLOC( Wlc_Obj_t, p->pObjs, 2 * p->nObjsAlloc );
+        memset( p->pObjs + p->nObjsAlloc, 0, sizeof(Wlc_Obj_t) * p->nObjsAlloc );
+        p->nObjsAlloc *= 2;
+    }
+    pObj = Wlc_NtkObj( p, p->iObj );
+    pObj->Type   = Type;
+    pObj->Signed = Signed;
+    pObj->End    = End;
+    pObj->Beg    = Beg;
+    if ( Type == WLC_OBJ_PI )
+    {
+        pObj->Fanins[1] = Vec_IntSize(&p->vPis);
+        Vec_IntPush( &p->vPis, p->iObj );
+    }
+    else if ( Type == WLC_OBJ_PO )
+    {
+        pObj->Fanins[1] = Vec_IntSize(&p->vPos);
+        Vec_IntPush( &p->vPos, p->iObj );
+    }
+    p->nObjs[Type]++;
+    return p->iObj++;
+}
+char * Wlc_ObjName( Wlc_Ntk_t * p, int iObj )
+{
+    static char Buffer[100];
+    if ( Wlc_NtkHasNameId(p) && Wlc_ObjNameId(p, iObj) )
+        return Abc_NamStr( p->pManName, Wlc_ObjNameId(p, iObj) );
+    sprintf( Buffer, "n%d", iObj );
+    return Buffer;
+}                          
+void Wlc_ObjUpdateType( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, int Type )
+{
+    if ( pObj->Type == WLC_OBJ_PO )
+    {
+        assert( Type == WLC_OBJ_BUF );
+        return;
+    }
+    p->nObjs[pObj->Type]--;
+    pObj->Type = Type;
+    p->nObjs[pObj->Type]++;
+}
+void Wlc_ObjAddFanins( Wlc_Ntk_t * p, Wlc_Obj_t * pObj, Vec_Int_t * vFanins )
+{
+    assert( pObj->nFanins == 0 );
+    pObj->nFanins = Vec_IntSize(vFanins);
+    if ( Wlc_ObjHasArray(pObj) )
+        pObj->pFanins[0] = (int *)Mem_FlexEntryFetch( p->pMemFanin, Vec_IntSize(vFanins) * sizeof(int) );
+    memcpy( Wlc_ObjFanins(pObj), Vec_IntArray(vFanins), sizeof(int) * Vec_IntSize(vFanins) );
+    // special treatment of CONST and SELECT
+    if ( pObj->Type == WLC_OBJ_CONST )
+        pObj->nFanins = 0;
+    else if ( pObj->Type == WLC_OBJ_BIT_SELECT )
+        pObj->nFanins = 1;
+}
+void Wlc_NtkFree( Wlc_Ntk_t * p )
+{
+    if ( p->pManName )
+        Abc_NamStop( p->pManName );
+    if ( p->pMemFanin )
+        Mem_FlexStop( p->pMemFanin, 0 );
+    ABC_FREE( p->vPis.pArray );
+    ABC_FREE( p->vPos.pArray );
+    ABC_FREE( p->vCis.pArray );
+    ABC_FREE( p->vCos.pArray );
+    ABC_FREE( p->vFfs.pArray );
+    ABC_FREE( p->vTravIds.pArray );
+    ABC_FREE( p->vNameIds.pArray );
+    ABC_FREE( p->vCopies.pArray );
+    ABC_FREE( p->pObjs );
+    ABC_FREE( p->pName );
+    ABC_FREE( p );
+}
+int Wlc_NtkMemUsage( Wlc_Ntk_t * p )
+{
+    int Mem = sizeof(Wlc_Ntk_t);
+    Mem += 4 * p->vPis.nCap;
+    Mem += 4 * p->vPos.nCap;
+    Mem += 4 * p->vCis.nCap;
+    Mem += 4 * p->vCos.nCap;
+    Mem += 4 * p->vFfs.nCap;
+    Mem += sizeof(Wlc_Obj_t) * p->nObjsAlloc;
+    Mem += Abc_NamMemUsed(p->pManName);
+    Mem += Mem_FlexReadMemUsage(p->pMemFanin);
+    return Mem;
+}
+void Wlc_NtkPrintNodes( Wlc_Ntk_t * p, int Type )
+{
+    Wlc_Obj_t * pObj; 
+    int i, Counter = 0;
+    printf( "Operation %s\n", Wlc_Names[Type] );
+    Wlc_NtkForEachObj( p, pObj, i )
+    {
+        if ( (int)pObj->Type != Type )
+            continue;
+        printf( "%8d  :",      Counter++ );
+        printf( "%8d  :  ",    i );
+        printf( "%3d%s = ",    Wlc_ObjRange(pObj),                   pObj->Signed ? "s" : " " );
+        printf( "%3d%s  %s ",  Wlc_ObjRange(Wlc_ObjFanin0(p, pObj)), Wlc_ObjFanin0(p, pObj)->Signed ? "s" : " ", Wlc_Names[Type] );
+        printf( "%3d%s ",      Wlc_ObjRange(Wlc_ObjFanin1(p, pObj)), Wlc_ObjFanin1(p, pObj)->Signed ? "s" : " " );
+        printf( " :    " );
+        printf( "%-12s =  ",   Wlc_ObjName(p, i) );
+        printf( "%-12s  %s  ", Wlc_ObjName(p, Wlc_ObjFaninId0(pObj)), Wlc_Names[Type] );
+        printf( "%-12s ",      Wlc_ObjName(p, Wlc_ObjFaninId1(pObj)) );
+        printf( "\n" );
+    }
+}
+void Wlc_NtkPrintStats( Wlc_Ntk_t * p, int fVerbose )
+{
+    int i;
+    printf( "%-20s : ",        p->pName );
+    printf( "PI = %4d  ",      Wlc_NtkPiNum(p) );
+    printf( "PO = %4d  ",      Wlc_NtkPoNum(p) );
+    printf( "FF = %4d  ",      Wlc_NtkFfNum(p) );
+    printf( "Obj = %6d  ",     Wlc_NtkObjNum(p) );
+    printf( "Mem = %.3f MB",   1.0*Wlc_NtkMemUsage(p)/(1<<20) );
+    printf( "\n" );
+    if ( !fVerbose )
+        return;
+    printf( "Node type statisticts:\n" );
+    for ( i = 0; i < WLC_OBJ_NUMBER; i++ )
+        if ( p->nObjs[i] )
+            printf( "%2d  :  %6d  %-8s\n", i, p->nObjs[i], Wlc_Names[i] );
+//    Wlc_NtkPrintNodes( p, WLC_OBJ_ARI_MULTI );
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Duplicates the network in a topological order.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Wlc_ObjCollectCopyFanins( Wlc_Ntk_t * p, int iObj, Vec_Int_t * vFanins )
+{
+    int i, iFanin;
+    Wlc_Obj_t * pObj = Wlc_NtkObj( p, iObj );
+    Vec_IntClear( vFanins );
+    Wlc_ObjForEachFanin( pObj, iFanin, i )
+        Vec_IntPush( vFanins, Wlc_ObjCopy(p, iFanin) );
+    // special treatment of CONST and SELECT
+    if ( pObj->Type == WLC_OBJ_CONST )
+    {
+        int * pInts = Wlc_ObjConstValue( pObj );
+        int nInts = Abc_BitWordNum( Wlc_ObjRange(pObj) );
+        for ( i = 0; i < nInts; i++ )
+            Vec_IntPush( vFanins, pInts[i] );
+    }
+    else if ( pObj->Type == WLC_OBJ_BIT_SELECT )
+    {
+        assert( Vec_IntSize(vFanins) == 1 );
+        Vec_IntPush( vFanins, pObj->Fanins[1] );
+    }
+}
+int Wlc_ObjDup( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p, int iObj, Vec_Int_t * vFanins )
+{
+    Wlc_Obj_t * pObj = Wlc_NtkObj( p, iObj );
+    int iFaninNew = Wlc_ObjAlloc( pNew, pObj->Type, pObj->Signed, pObj->End, pObj->Beg );
+    Wlc_Obj_t * pObjNew = Wlc_NtkObj(pNew, iFaninNew);
+    Wlc_ObjCollectCopyFanins( p, iObj, vFanins );
+    Wlc_ObjAddFanins( pNew, pObjNew, vFanins );
+    Wlc_ObjSetCopy( p, iObj, iFaninNew );
+    return iFaninNew;
+}
+void Wlc_NtkDupDfs_rec( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p, int iObj, Vec_Int_t * vFanins )
+{
+    Wlc_Obj_t * pObj;
+    int i, iFanin;
+    if ( Wlc_ObjCopy(p, iObj) )
+        return;
+    pObj = Wlc_NtkObj( p, iObj );
+    Wlc_ObjForEachFanin( pObj, iFanin, i )
+        Wlc_NtkDupDfs_rec( pNew, p, iFanin, vFanins );
+    Wlc_ObjDup( pNew, p, iObj, vFanins );
+}
+Wlc_Ntk_t * Wlc_NtkDupDfs( Wlc_Ntk_t * p )
+{
+    Wlc_Ntk_t * pNew;
+    Wlc_Obj_t * pObj;
+    Vec_Int_t * vFanins;
+    int i;
+    Wlc_NtkCleanCopy( p );
+    vFanins = Vec_IntAlloc( 100 );
+    pNew = Wlc_NtkAlloc( p->pName, p->nObjsAlloc );
+    Wlc_NtkForEachPi( p, pObj, i )
+        Wlc_ObjDup( pNew, p, Wlc_ObjId(p, pObj), vFanins );
+    Wlc_NtkForEachPo( p, pObj, i )
+        Wlc_NtkDupDfs_rec( pNew, p, Wlc_ObjFaninId0(pObj), vFanins );
+    Wlc_NtkForEachPo( p, pObj, i )
+        Wlc_ObjDup( pNew, p, Wlc_ObjId(p, pObj), vFanins );
+    Vec_IntFree( vFanins );
+    return pNew;
+}
+void Wlc_NtkTransferNames( Wlc_Ntk_t * pNew, Wlc_Ntk_t * p )
+{
+    int i;
+    assert( !Wlc_NtkHasCopy(pNew)   && Wlc_NtkHasCopy(p)   );
+    assert( !Wlc_NtkHasNameId(pNew) && Wlc_NtkHasNameId(p) );
+    assert( pNew->pManName  == NULL && p->pManName != NULL );
+    Wlc_NtkCleanNameId( pNew );
+    for ( i = 0; i < p->nObjsAlloc; i++ )
+        if ( Wlc_ObjCopy(p, i) && Wlc_ObjNameId(p, i) )
+            Wlc_ObjSetNameId( pNew, Wlc_ObjCopy(p, i), Wlc_ObjNameId(p, i) );
+    pNew->pManName = p->pManName; 
+    p->pManName = NULL;
+    Vec_IntErase( &p->vNameIds );
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/base/wlc/wlcReadVer.c b/abc-build/src/base/wlc/wlcReadVer.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/base/wlc/wlcReadVer.c
@@ -0,0 +1,711 @@
+/**CFile****************************************************************
+
+  FileName    [wlcReadVer.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Verilog parser.]
+
+  Synopsis    [Parses several flavors of word-level Verilog.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - August 22, 2014.]
+
+  Revision    [$Id: wlcReadVer.c,v 1.00 2014/09/12 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "wlc.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+// Word-level Verilog file parser
+#define WLV_PRS_MAX_LINE   1000
+
+typedef struct Wlc_Prs_t_  Wlc_Prs_t;
+struct Wlc_Prs_t_ 
+{
+    int                    nFileSize;
+    char *                 pFileName;
+    char *                 pBuffer;
+    Vec_Int_t *            vLines;
+    Vec_Int_t *            vStarts;
+    Vec_Int_t *            vFanins;
+    Wlc_Ntk_t *            pNtk;
+    char                   sError[WLV_PRS_MAX_LINE];
+};
+
+static inline int          Wlc_PrsOffset( Wlc_Prs_t * p, char * pStr )  { return pStr - p->pBuffer;                     }
+static inline char *       Wlc_PrsStr( Wlc_Prs_t * p, int iOffset )     { return p->pBuffer + iOffset;                  }
+static inline int          Wlc_PrsStrCmp( char * pStr, char * pWhat )   { return !strncmp( pStr, pWhat, strlen(pWhat)); }
+
+#define Wlc_PrsForEachLine( p, pLine, i ) \
+    for ( i = 0; (i < Vec_IntSize((p)->vStarts)) && ((pLine) = Wlc_PrsStr(p, Vec_IntEntry((p)->vStarts, i))); i++ )
+
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+Wlc_Prs_t * Wlc_PrsStart( char * pFileName )
+{
+    Wlc_Prs_t * p;
+    if ( !Extra_FileCheck( pFileName ) )
+        return NULL;
+    p = ABC_CALLOC( Wlc_Prs_t, 1 );
+    p->pFileName = pFileName;
+    p->pBuffer   = Extra_FileReadContents( pFileName );
+    p->nFileSize = strlen(p->pBuffer);  assert( p->nFileSize > 0 );
+    p->vLines    = Vec_IntAlloc( p->nFileSize / 50 );
+    p->vStarts   = Vec_IntAlloc( p->nFileSize / 50 );
+    p->vFanins   = Vec_IntAlloc( 100 );
+    return p;
+}
+void Wlc_PrsStop( Wlc_Prs_t * p )
+{
+    if ( p->pNtk )
+        Wlc_NtkFree( p->pNtk );
+    Vec_IntFree( p->vLines );
+    Vec_IntFree( p->vStarts );
+    Vec_IntFree( p->vFanins );
+    ABC_FREE( p->pBuffer );
+    ABC_FREE( p );
+}
+
+/**Function*************************************************************
+
+  Synopsis    [Prints the error message including the file name and line number.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Wlc_PrsWriteErrorMessage( Wlc_Prs_t * p, char * pCur, const char * format, ... )
+{
+    char * pMessage;
+    // derive message
+    va_list args;
+    va_start( args, format );
+    pMessage = vnsprintf( format, args );
+    va_end( args );
+    // print messsage
+    assert( strlen(pMessage) < WLV_PRS_MAX_LINE - 100 );
+    assert( p->sError[0] == 0 );
+    if ( pCur == NULL ) // the line number is not given
+        sprintf( p->sError, "%s: %s\n", p->pFileName, pMessage );
+    else                // print the error message with the line number
+    {
+        int Entry, iLine = 0;
+        Vec_IntForEachEntry( p->vLines, Entry, iLine )
+            if ( Entry > pCur - p->pBuffer )
+                break;
+        sprintf( p->sError, "%s (line %d): %s\n", p->pFileName, iLine+1, pMessage );
+    }
+    free( pMessage );
+    return 0;
+}
+void Wlc_PrsPrintErrorMessage( Wlc_Prs_t * p )
+{
+    if ( p->sError[0] == 0 )
+        return;
+    fprintf( stdout, "%s", p->sError );
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Wlc_PrsIsDigit( char * pStr )
+{
+    return (pStr[0] >= '0' && pStr[0] <= '9');
+}
+static inline int Wlc_PrsIsChar( char * pStr )
+{
+    return (pStr[0] >= 'a' && pStr[0] <= 'z') || 
+           (pStr[0] >= 'A' && pStr[0] <= 'Z') || 
+           (pStr[0] >= '0' && pStr[0] <= '9') || 
+            pStr[0] == '_' || pStr[0] == '$';
+}
+static inline char * Wlc_PrsSkipSpaces( char * pStr )
+{
+    while ( *pStr && *pStr == ' ' )
+        pStr++;
+    return pStr;
+}
+static inline char * Wlc_PrsFindSymbol( char * pStr, char Symb )
+{
+    for ( ; *pStr; pStr++ )
+        if ( *pStr == Symb )
+            return pStr;
+    return NULL;
+}
+static inline char * Wlc_PrsFindSymbolTwo( char * pStr, char Symb, char Symb2 )
+{
+    for ( ; pStr[1]; pStr++ )
+        if ( pStr[0] == Symb  && pStr[1] == Symb2 )
+            return pStr;
+    return NULL;
+}
+static inline char * Wlc_PrsFindClosingParanthesis( char * pStr, char Open, char Close )
+{
+    int Counter = 0;
+    int fNotName = 1;
+    assert( *pStr == Open );
+    for ( ; *pStr; pStr++ )
+    {
+        if ( fNotName )
+        {
+            if ( *pStr == Open )
+                Counter++;
+            if ( *pStr == Close )
+                Counter--;
+            if ( Counter == 0 )
+                return pStr;
+        }
+        if ( *pStr == '\\' )
+            fNotName = 0;
+        else if ( !fNotName && *pStr == ' ' )
+            fNotName = 1;
+    }
+    return NULL;
+}
+int Wlc_PrsRemoveComments( Wlc_Prs_t * p )
+{
+    int fSpecifyFound = 0;
+    char * pCur, * pNext, * pEnd = p->pBuffer + p->nFileSize;
+    for ( pCur = p->pBuffer; pCur < pEnd; pCur++ )
+    {
+        // regular comment (//)
+        if ( *pCur == '/' && pCur[1] == '/' )
+        {
+            if ( pCur + 5 < pEnd && pCur[2] == 'a' && pCur[3] == 'b' && pCur[4] == 'c' && pCur[5] == '2' )
+                pCur[0] = pCur[1] = pCur[2] = pCur[3] = pCur[4] = pCur[5] = ' ';
+            else
+            {
+                pNext = Wlc_PrsFindSymbol( pCur, '\n' );
+                if ( pNext == NULL )
+                    return Wlc_PrsWriteErrorMessage( p, pCur, "Cannot find end-of-line after symbols \"//\"." );
+                for ( ; pCur < pNext; pCur++ )
+                    *pCur = ' ';
+            }
+        }
+        // skip preprocessor directive (`timescale, `celldefine, etc)
+        else if ( *pCur == '`' )
+        {
+            pNext = Wlc_PrsFindSymbol( pCur, '\n' );
+            if ( pNext == NULL )
+                return Wlc_PrsWriteErrorMessage( p, pCur, "Cannot find end-of-line after symbols \"`\"." );
+            for ( ; pCur < pNext; pCur++ )
+                *pCur = ' ';
+        }
+        // regular comment (/* ... */)
+        else if ( *pCur == '/' && pCur[1] == '*' )
+        {
+            pNext = Wlc_PrsFindSymbolTwo( pCur, '*', '/' );
+            if ( pNext == NULL )
+                return Wlc_PrsWriteErrorMessage( p, pCur, "Cannot find symbols \"*/\" after symbols \"/*\"." );
+            // overwrite comment
+            for ( ; pCur < pNext + 2; pCur++ )
+                *pCur = ' ';
+        }
+        // 'specify' treated as comments
+        else if ( *pCur == 's' && pCur[1] == 'p' && pCur[2] == 'e' && !strncmp(pCur, "specify", 7) )
+        {
+            for ( pNext = pCur; pNext < pEnd - 10; pNext++ )
+                if ( *pNext == 'e' && pNext[1] == 'n' && pNext[2] == 'd' && !strncmp(pNext, "endspecify", 10) )
+                {
+                    // overwrite comment
+                    for ( ; pCur < pNext + 10; pCur++ )
+                        *pCur = ' ';
+                    if ( fSpecifyFound == 0 )
+                        Abc_Print( 0, "Ignoring specify/endspecify directives.\n" );
+                    fSpecifyFound = 1;
+                    break;
+                }
+        }
+        // insert semicolons
+        else if ( *pCur == 'e' && pCur[1] == 'n' && pCur[2] == 'd' && !strncmp(pCur, "endmodule", 9) )
+            pCur[strlen("endmodule")] = ';';
+        // overwrite end-of-lines with spaces (less checking to do later on)
+        if ( *pCur == '\n' || *pCur == '\r'  || *pCur == '\t' )
+            *pCur = ' ';
+    }
+    return 1;
+}
+int Wlc_PrsPrepare( Wlc_Prs_t * p )
+{
+    int fPrettyPrint = 0;
+    int fNotName = 1;
+    char * pTemp, * pPrev, * pThis;
+    // collect info about lines
+    assert( Vec_IntSize(p->vLines) == 0 );
+    for ( pTemp = p->pBuffer; *pTemp; pTemp++ )
+        if ( *pTemp == '\n' )
+            Vec_IntPush( p->vLines, pTemp - p->pBuffer );
+    // delete comments and insert breaks
+    if ( !Wlc_PrsRemoveComments( p ) )
+        return 0;
+    // collect info about breaks
+    assert( Vec_IntSize(p->vStarts) == 0 );
+    for ( pPrev = pThis = p->pBuffer; *pThis; pThis++ )
+    {
+        if ( fNotName && *pThis == ';' )
+        {
+            *pThis = 0;
+            Vec_IntPush( p->vStarts, Wlc_PrsOffset(p, Wlc_PrsSkipSpaces(pPrev)) );
+            pPrev = pThis + 1;
+        }
+        if ( *pThis == '\\' )
+            fNotName = 0;
+        else if ( !fNotName && *pThis == ' ' )
+            fNotName = 1;
+    }
+
+    if ( fPrettyPrint )
+    {
+        int i, k;
+        // print the line types
+        Wlc_PrsForEachLine( p, pTemp, i )
+        {
+            if ( Wlc_PrsStrCmp( pTemp, "module" ) )
+                printf( "\n" );
+            if ( !Wlc_PrsStrCmp( pTemp, "module" ) && !Wlc_PrsStrCmp( pTemp, "endmodule" ) )
+                printf( "    " );
+            printf( "%c", pTemp[0] );
+            for ( k = 1; pTemp[k]; k++ )
+                if ( pTemp[k] != ' ' || pTemp[k-1] != ' ' )
+                    printf( "%c", pTemp[k] );
+            printf( ";\n" );
+        }
+/*    
+        // print the line types
+        Wlc_PrsForEachLine( p, pTemp, i )
+        {
+            int k;  
+            if ( !Wlc_PrsStrCmp( pTemp, "module" ) )
+                continue;
+            printf( "%3d : ", i );
+            for ( k = 0; k < 40; k++ )
+                printf( "%c", pTemp[k] ? pTemp[k] : ' ' );
+            printf( "\n" );
+        }
+*/
+    }
+    return 1;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline char * Wlc_PrsFindRange( char * pStr, int * End, int * Beg )
+{
+    *End = *Beg = 0;
+    pStr = Wlc_PrsSkipSpaces( pStr );
+    if ( pStr[0] != '[' )
+        return pStr;
+    pStr = Wlc_PrsSkipSpaces( pStr+1 );
+    if ( !Wlc_PrsIsDigit(pStr) )
+        return NULL;
+    *End = *Beg = atoi( pStr );
+    if ( Wlc_PrsFindSymbol( pStr, ':' ) == NULL )
+    {
+        pStr = Wlc_PrsFindSymbol( pStr, ']' );
+        if ( pStr == NULL )
+            return NULL;
+    }
+    else
+    {
+        pStr = Wlc_PrsFindSymbol( pStr, ':' );
+        pStr = Wlc_PrsSkipSpaces( pStr+1 );
+        if ( !Wlc_PrsIsDigit(pStr) )
+            return NULL;
+        *Beg = atoi( pStr );
+        pStr = Wlc_PrsFindSymbol( pStr, ']' );
+        if ( pStr == NULL )
+            return NULL;
+    }
+    assert( *End >= *Beg );
+    return pStr + 1;
+}
+static inline char * Wlc_PrsFindWord( char * pStr, char * pWord, int * fFound )
+{
+    *fFound = 0;
+    pStr = Wlc_PrsSkipSpaces( pStr );
+    if ( !Wlc_PrsStrCmp(pStr, pWord) )
+        return pStr;
+    *fFound = 1;
+    return pStr + strlen(pWord);
+}
+static inline char * Wlc_PrsFindName( char * pStr, char ** ppPlace )
+{
+    static char Buffer[WLV_PRS_MAX_LINE];
+    char * pThis = *ppPlace = Buffer;
+    pStr = Wlc_PrsSkipSpaces( pStr );
+    if ( !Wlc_PrsIsChar(pStr) )
+        return NULL;
+    while ( Wlc_PrsIsChar(pStr) )
+        *pThis++ = *pStr++;
+    *pThis = 0;
+    return pStr;
+}
+static inline char * Wlc_PrsReadName( Wlc_Prs_t * p, char * pStr, Vec_Int_t * vFanins )
+{
+    char * pName;
+    int NameId, fFound;
+    pStr = Wlc_PrsFindName( pStr, &pName );
+    if ( pStr == NULL )
+        return (char *)(ABC_PTRINT_T)Wlc_PrsWriteErrorMessage( p, pStr, "Cannot read name." );
+    NameId = Abc_NamStrFindOrAdd( p->pNtk->pManName, pName, &fFound );
+    if ( !fFound )
+        return (char *)(ABC_PTRINT_T)Wlc_PrsWriteErrorMessage( p, pStr, "Name %s is used but not declared.", pName );
+    Vec_IntPush( vFanins, NameId );
+    return Wlc_PrsSkipSpaces( pStr );
+}
+static inline int Wlc_PrsFindDefinition( Wlc_Prs_t * p, char * pStr, Vec_Int_t * vFanins )
+{
+    char * pName;
+    int Type = WLC_OBJ_NONE;
+    Vec_IntClear( vFanins );
+    pStr = Wlc_PrsSkipSpaces( pStr );
+    if ( pStr[0] != '=' )
+        return 0;
+    pStr = Wlc_PrsSkipSpaces( pStr+1 );
+    if ( pStr[0] == '(' )
+    {
+        char * pClose = Wlc_PrsFindClosingParanthesis( pStr, '(', ')' );
+        if ( pClose == NULL )
+            return Wlc_PrsWriteErrorMessage( p, pStr, "Expecting closing paranthesis." );
+        *pStr = *pClose = ' ';
+        pStr = Wlc_PrsSkipSpaces( pStr );
+    }
+    if ( Wlc_PrsIsDigit(pStr) )
+    {
+        int nDigits, nBits = atoi( pStr );
+        pStr = Wlc_PrsFindSymbol( pStr, '\'' );
+        if ( pStr == NULL )
+            return Wlc_PrsWriteErrorMessage( p, pStr, "Expecting constant symbol (\')." );
+        if ( pStr[1] == 's' )
+            pStr++;
+        if ( pStr[1] != 'h' )
+            return Wlc_PrsWriteErrorMessage( p, pStr, "Expecting hexadecimal constant and not \"%c\".", pStr[1] );
+        Vec_IntFill( vFanins, Abc_BitWordNum(nBits), 0 );
+        nDigits = Abc_TtReadHexNumber( (word *)Vec_IntArray(vFanins), pStr+2 );
+        if ( nDigits != (nBits + 3)/4 )
+            return Wlc_PrsWriteErrorMessage( p, pStr, "The length of contant does not match." );
+        pStr += nDigits + 2;
+        Type = WLC_OBJ_CONST;
+    }
+    else if ( pStr[0] == '!' || pStr[0] == '~' )
+    {
+        if ( pStr[0] == '!' )
+            Type = WLC_OBJ_LOGIC_NOT;
+        else if ( pStr[0] == '~' )
+            Type = WLC_OBJ_BIT_NOT;
+        else assert( 0 );
+        if ( !(pStr = Wlc_PrsReadName(p, pStr+1, vFanins)) )
+            return Wlc_PrsWriteErrorMessage( p, pStr, "Cannot read name after !." );
+    }
+    else if ( pStr[0] == '&' || pStr[0] == '|' || pStr[0] == '^' )
+    {
+        if ( pStr[0] == '&' )
+            Type = WLC_OBJ_REDUCT_AND;
+        else if ( pStr[0] == '|' )
+            Type = WLC_OBJ_REDUCT_OR;
+        else if ( pStr[0] == '^' )
+            Type = WLC_OBJ_REDUCT_XOR;
+        else assert( 0 );
+        if ( !(pStr = Wlc_PrsReadName(p, pStr+1, vFanins)) )
+            return Wlc_PrsWriteErrorMessage( p, pStr, "Cannot read name after reduction operator." );
+    }
+    else if ( pStr[0] == '{' )
+    {
+        // THIS IS SHORTCUT TO DETECT zero padding AND sign extension
+        if ( Wlc_PrsFindSymbol(pStr+1, '{') )
+        {
+            if ( Wlc_PrsFindSymbol(pStr+1, '\'') )
+                Type = WLC_OBJ_BIT_ZEROPAD;
+            else
+                Type = WLC_OBJ_BIT_SIGNEXT;
+            pStr = Wlc_PrsFindSymbol(pStr+1, ',');
+            if ( pStr == NULL )
+                return Wlc_PrsWriteErrorMessage( p, pStr, "Expecting one comma in this line." );
+            if ( !(pStr = Wlc_PrsReadName(p, pStr+1, vFanins)) )
+                return Wlc_PrsWriteErrorMessage( p, pStr, "Cannot read name in sign-extension." );
+            pStr = Wlc_PrsSkipSpaces( pStr );
+            if ( pStr[0] != '}' )
+                return Wlc_PrsWriteErrorMessage( p, pStr, "There is no closing brace (})." );
+        }
+        else // concatenation
+        {
+            while ( 1 )
+            {
+                if ( !(pStr = Wlc_PrsReadName(p, pStr+1, vFanins)) )
+                    return Wlc_PrsWriteErrorMessage( p, pStr, "Cannot read name in concatenation." );
+                if ( pStr[0] == '}' )
+                    break;
+                if ( pStr[0] != ',' )
+                    return Wlc_PrsWriteErrorMessage( p, pStr, "Expected comma (,) in this place." );
+            }
+            Type = WLC_OBJ_BIT_CONCAT;
+        }
+        assert( pStr[0] == '}' );
+        pStr++;
+    }
+    else
+    {
+        if ( !(pStr = Wlc_PrsReadName(p, pStr, vFanins)) )
+            return 0;
+        // get the next symbol
+        if ( pStr[0] == 0 )
+            Type = WLC_OBJ_BUF;
+        else if ( pStr[0] == '?' )
+        {
+            if ( !(pStr = Wlc_PrsReadName(p, pStr+1, vFanins)) )
+                return Wlc_PrsWriteErrorMessage( p, pStr, "Cannot read name in MUX." );
+            if ( pStr[0] != ':' )
+                return Wlc_PrsWriteErrorMessage( p, pStr, "MUX lacks the colon symbol (:)." );
+            if ( !(pStr = Wlc_PrsReadName(p, pStr+1, vFanins)) )
+                return Wlc_PrsWriteErrorMessage( p, pStr, "Cannot read name in MUX." );
+            Type = WLC_OBJ_MUX;
+        }
+        else if ( pStr[0] == '[' )
+        {
+            int End, Beg;
+            pStr = Wlc_PrsFindRange( pStr, &End, &Beg );
+            Vec_IntPush( vFanins, (End << 16) | Beg );
+            Type = WLC_OBJ_BIT_SELECT;
+        }
+        else 
+        {
+                 if ( pStr[0] == '>' && pStr[1] == '>' && pStr[2] != '>' ) pStr += 2, Type = WLC_OBJ_SHIFT_R;
+            else if ( pStr[0] == '>' && pStr[1] == '>' && pStr[2] == '>' ) pStr += 3, Type = WLC_OBJ_SHIFT_RA;      
+            else if ( pStr[0] == '<' && pStr[1] == '<' && pStr[2] != '<' ) pStr += 2, Type = WLC_OBJ_SHIFT_L;       
+            else if ( pStr[0] == '<' && pStr[1] == '<' && pStr[2] == '<' ) pStr += 3, Type = WLC_OBJ_SHIFT_LA;      
+            else if ( pStr[0] == '&' && pStr[1] != '&'                   ) pStr += 1, Type = WLC_OBJ_BIT_AND;       
+            else if ( pStr[0] == '|' && pStr[1] != '|'                   ) pStr += 1, Type = WLC_OBJ_BIT_OR;        
+            else if ( pStr[0] == '^' && pStr[1] != '^'                   ) pStr += 1, Type = WLC_OBJ_BIT_XOR;       
+            else if ( pStr[0] == '&' && pStr[1] == '&'                   ) pStr += 2, Type = WLC_OBJ_LOGIC_AND;     
+            else if ( pStr[0] == '|' && pStr[1] == '|'                   ) pStr += 2, Type = WLC_OBJ_LOGIC_OR;      
+            else if ( pStr[0] == '=' && pStr[1] == '='                   ) pStr += 2, Type = WLC_OBJ_COMP_EQU;      
+            else if ( pStr[0] == '!' && pStr[1] == '='                   ) pStr += 2, Type = WLC_OBJ_COMP_NOT;      
+            else if ( pStr[0] == '<' && pStr[1] != '='                   ) pStr += 1, Type = WLC_OBJ_COMP_LESS;     
+            else if ( pStr[0] == '>' && pStr[1] != '='                   ) pStr += 1, Type = WLC_OBJ_COMP_MORE;     
+            else if ( pStr[0] == '<' && pStr[1] == '='                   ) pStr += 2, Type = WLC_OBJ_COMP_LESSEQU;
+            else if ( pStr[0] == '>' && pStr[1] == '='                   ) pStr += 2, Type = WLC_OBJ_COMP_MOREEQU;  
+            else if ( pStr[0] == '+'                                     ) pStr += 1, Type = WLC_OBJ_ARI_ADD;       
+            else if ( pStr[0] == '-'                                     ) pStr += 1, Type = WLC_OBJ_ARI_SUB;       
+            else if ( pStr[0] == '*' && pStr[1] != '*'                   ) pStr += 1, Type = WLC_OBJ_ARI_MULTI;     
+            else if ( pStr[0] == '/'                                     ) pStr += 1, Type = WLC_OBJ_ARI_DIVIDE;        
+            else if ( pStr[0] == '%'                                     ) pStr += 1, Type = WLC_OBJ_ARI_MODULUS;   
+            else if ( pStr[0] == '*' && pStr[1] == '*'                   ) pStr += 2, Type = WLC_OBJ_ARI_POWER;
+            else return Wlc_PrsWriteErrorMessage( p, pStr, "Unsupported operation (%c).", pStr[0] );
+            if ( !(pStr = Wlc_PrsReadName(p, pStr+1, vFanins)) )
+                return 0;
+        }
+    }
+    // make sure there is nothing left there
+    if ( pStr )
+    {
+        pStr = Wlc_PrsFindName( pStr, &pName );
+        if ( pStr != NULL )
+            return Wlc_PrsWriteErrorMessage( p, pStr, "Name %s is left at the end of the line.", pName );   
+    }
+    return Type;
+}
+int Wlc_PrsDerive( Wlc_Prs_t * p )
+{
+    char * pStart, * pName;
+    int i;
+    // go through the directives
+    Wlc_PrsForEachLine( p, pStart, i )
+    {
+        if ( Wlc_PrsStrCmp( pStart, "module" ) )
+        {
+            // get module name
+            pName = strtok( pStart + strlen("module"), " (" );
+            if ( pName == NULL )
+                return Wlc_PrsWriteErrorMessage( p, pStart, "Cannot read model name." );
+            if ( p->pNtk != NULL )
+                return Wlc_PrsWriteErrorMessage( p, pStart, "Network is already defined." );
+            p->pNtk = Wlc_NtkAlloc( pName, Vec_IntSize(p->vStarts) );
+            p->pNtk->pManName = Abc_NamStart( Vec_IntSize(p->vStarts), 20 );
+        }
+        else if ( Wlc_PrsStrCmp( pStart, "endmodule" ) )
+        {
+            Vec_Int_t * vTemp = Vec_IntStartNatural( Wlc_NtkObjNumMax(p->pNtk) );
+            Vec_IntAppend( &p->pNtk->vNameIds, vTemp );
+            Vec_IntFree( vTemp );
+            break;
+        }
+        // these are read as part of the interface
+        else if ( Wlc_PrsStrCmp( pStart, "input" ) || Wlc_PrsStrCmp( pStart, "output" ) || Wlc_PrsStrCmp( pStart, "wire" ) )
+        {
+            int fFound = 0, Type = WLC_OBJ_NONE, iObj; 
+            int Signed = 0, Beg = 0, End = 0, NameId;
+            if ( Wlc_PrsStrCmp( pStart, "input" ) )
+                Type = WLC_OBJ_PI, pStart += strlen("input");
+            else if ( Wlc_PrsStrCmp( pStart, "output" ) )
+                Type = WLC_OBJ_PO, pStart += strlen("output");
+            pStart = Wlc_PrsSkipSpaces( pStart );
+            if ( Wlc_PrsStrCmp( pStart, "wire" ) )
+                pStart += strlen("wire");
+            // read 'signed'
+            pStart = Wlc_PrsFindWord( pStart, "signed", &Signed );
+            // read range
+            pStart = Wlc_PrsFindRange( pStart, &End, &Beg );
+            if ( pStart == NULL )
+                return Wlc_PrsWriteErrorMessage( p, pStart, "Cannot read range." );
+            while ( 1 )
+            {
+                // read name
+                pStart = Wlc_PrsFindName( pStart, &pName );
+                if ( pStart == NULL )
+                    return Wlc_PrsWriteErrorMessage( p, pStart, "Cannot read name." );
+                NameId = Abc_NamStrFindOrAdd( p->pNtk->pManName, pName, &fFound );
+                if ( fFound )
+                    return Wlc_PrsWriteErrorMessage( p, pStart, "Name %s is declared more than once.", pName );
+                iObj = Wlc_ObjAlloc( p->pNtk, Type, Signed, End, Beg );
+                assert( iObj == NameId );
+                // check next definition
+                pStart = Wlc_PrsSkipSpaces( pStart );
+                if ( pStart[0] == ',' )
+                {
+                    pStart++;
+                    continue;
+                }
+                // check definition
+                Type = Wlc_PrsFindDefinition( p, pStart, p->vFanins );
+                if ( Type )
+                {
+                    Wlc_Obj_t * pObj = Wlc_NtkObj( p->pNtk, iObj );
+                    Wlc_ObjUpdateType( p->pNtk, pObj, Type );
+                    Wlc_ObjAddFanins( p->pNtk, pObj, p->vFanins );
+                }
+                break;
+            }
+        }
+        else if ( Wlc_PrsStrCmp( pStart, "assign" ) )
+        {
+            int Type, NameId, fFound;
+            pStart += strlen("assign");
+            // read name
+            pStart = Wlc_PrsFindName( pStart, &pName );
+            if ( pStart == NULL )
+                return Wlc_PrsWriteErrorMessage( p, pStart, "Cannot read name after assign." );
+            NameId = Abc_NamStrFindOrAdd( p->pNtk->pManName, pName, &fFound );
+            if ( !fFound )
+                return Wlc_PrsWriteErrorMessage( p, pStart, "Name %s is not declared.", pName );
+            // read definition
+            Type = Wlc_PrsFindDefinition( p, pStart, p->vFanins );
+            if ( Type )
+            {
+                Wlc_Obj_t * pObj = Wlc_NtkObj( p->pNtk, NameId );
+                Wlc_ObjUpdateType( p->pNtk, pObj, Type );
+                Wlc_ObjAddFanins( p->pNtk, pObj, p->vFanins );
+            }
+            else
+                return 0;
+        }
+//        else if ( Wlc_PrsStrCmp( pStart, "CPL_FF" ) )
+        else
+        {
+            pStart = Wlc_PrsFindName( pStart, &pName );
+            return Wlc_PrsWriteErrorMessage( p, pStart, "Cannot read line beginning with %s.", pName );
+        }
+    }
+    return 1;
+}
+Wlc_Ntk_t * Wlc_ReadVer( char * pFileName )
+{
+    Wlc_Prs_t * p;
+    Wlc_Ntk_t * pNtk = NULL;
+    // start the parser 
+    p = Wlc_PrsStart( pFileName );
+    if ( p == NULL )
+        return NULL;
+    // detect lines
+    if ( !Wlc_PrsPrepare( p ) )
+        goto finish;
+    // parse models
+    if ( !Wlc_PrsDerive( p ) )
+        goto finish;
+    // derive topological order
+    pNtk = Wlc_NtkDupDfs( p->pNtk );
+    Wlc_NtkTransferNames( pNtk, p->pNtk );
+finish:
+    Wlc_PrsPrintErrorMessage( p );
+    Wlc_PrsStop( p );
+    return pNtk;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Io_ReadWordTest( char * pFileName )
+{
+    Gia_Man_t * pNew;
+    Wlc_Ntk_t * pNtk = Wlc_ReadVer( pFileName );
+    if ( pNtk == NULL )
+        return;
+    Wlc_WriteVer( pNtk, "test.v" );
+
+    pNew = Wlc_NtkBitBlast( pNtk );
+    Gia_AigerWrite( pNew, "test.aig", 0, 0 );
+    Gia_ManStop( pNew );
+
+    Wlc_NtkFree( pNtk );
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/base/wlc/wlcWriteVer.c b/abc-build/src/base/wlc/wlcWriteVer.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/base/wlc/wlcWriteVer.c
@@ -0,0 +1,204 @@
+/**CFile****************************************************************
+
+  FileName    [wlcWriteVer.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [Verilog parser.]
+
+  Synopsis    [Writes word-level Verilog.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - August 22, 2014.]
+
+  Revision    [$Id: wlcWriteVer.c,v 1.00 2014/09/12 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "wlc.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Wlc_WriteVerIntVec( FILE * pFile, Wlc_Ntk_t * p, Vec_Int_t * vVec, int Start )
+{
+    char * pName;
+    int LineLength  = Start;
+    int NameCounter = 0;
+    int AddedLength, i, iObj;
+    Vec_IntForEachEntry( vVec, iObj, i )
+    {
+        pName = Wlc_ObjName( p, iObj );
+        // get the line length after this name is written
+        AddedLength = strlen(pName) + 2;
+        if ( NameCounter && LineLength + AddedLength + 3 > 70 )
+        { // write the line extender
+            fprintf( pFile, "\n   " );
+            // reset the line length
+            LineLength  = Start;
+            NameCounter = 0;
+        }
+        fprintf( pFile, " %s%s", pName, (i==Vec_IntSize(vVec)-1)? "" : "," );
+        LineLength += AddedLength;
+        NameCounter++;
+    }
+} 
+void Wlc_WriteVerInt( FILE * pFile, Wlc_Ntk_t * p )
+{
+    Wlc_Obj_t * pObj;
+    int i, k, iFanin;
+    char Range[100];
+    fprintf( pFile, "module %s ( ", p->pName );
+    fprintf( pFile, "\n   " );
+    if ( Wlc_NtkPiNum(p) > 0  )
+    {
+        Wlc_WriteVerIntVec( pFile, p, &p->vPis, 3 );
+        fprintf( pFile, ",\n   " );
+    }
+    if ( Wlc_NtkPoNum(p) > 0  )
+        Wlc_WriteVerIntVec( pFile, p, &p->vPos, 3 );
+    fprintf( pFile, "  );\n" );
+    Wlc_NtkForEachObj( p, pObj, i )
+    {
+        char * pName  = Wlc_ObjName(p, i);
+        char * pName0 = Wlc_ObjFaninNum(pObj) ? Wlc_ObjName(p, Wlc_ObjFaninId0(pObj)) : NULL;
+        int nDigits   = Abc_Base10Log(pObj->End+1) + Abc_Base10Log(pObj->Beg+1);
+        sprintf( Range, "%s[%d:%d]%*s", pObj->Signed ? "signed ":"       ", pObj->End, pObj->Beg, 8-nDigits, "" );
+        fprintf( pFile, "  " );
+        if ( pObj->Type == WLC_OBJ_PI )
+            fprintf( pFile, "input  wire %s %-16s", Range, pName );
+        else if ( pObj->Type == WLC_OBJ_PO )
+            fprintf( pFile, "output wire %s %-16s = %s", Range, pName, pName0 );
+        else if ( pObj->Type == WLC_OBJ_CONST )
+        {
+            fprintf( pFile, "       wire %s %-16s = %d\'%sh", Range, pName, Wlc_ObjRange(pObj), pObj->Signed ? "s":"" );
+            Abc_TtPrintHexArrayRev( pFile, (word *)Wlc_ObjConstValue(pObj), (Wlc_ObjRange(pObj) + 3) / 4 );
+        }
+        else
+        {
+            fprintf( pFile, "       wire %s %-16s = ", Range, Wlc_ObjName(p, i) );
+            if ( pObj->Type == WLC_OBJ_BUF )
+                fprintf( pFile, "%s", pName0 );
+            else if ( pObj->Type == WLC_OBJ_MUX )
+                fprintf( pFile, "%s ? %s : %s", pName0, Wlc_ObjName(p, Wlc_ObjFaninId1(pObj)), Wlc_ObjName(p, Wlc_ObjFaninId2(pObj)) );
+            else if ( pObj->Type == WLC_OBJ_BIT_NOT )
+                fprintf( pFile, "~%s", pName0 );
+            else if ( pObj->Type == WLC_OBJ_LOGIC_NOT )
+                fprintf( pFile, "!%s", pName0 );
+            else if ( pObj->Type == WLC_OBJ_REDUCT_AND )
+                fprintf( pFile, "&%s", pName0 );
+            else if ( pObj->Type == WLC_OBJ_REDUCT_OR )
+                fprintf( pFile, "|%s", pName0 );
+            else if ( pObj->Type == WLC_OBJ_REDUCT_XOR )
+                fprintf( pFile, "^%s", pName0 );
+            else if ( pObj->Type == WLC_OBJ_BIT_SELECT )
+                fprintf( pFile, "%s [%d:%d]", pName0, Wlc_ObjRangeEnd(pObj), Wlc_ObjRangeBeg(pObj) );
+            else if ( pObj->Type == WLC_OBJ_BIT_SIGNEXT )
+                fprintf( pFile, "{ {%d{%s[%d]}}, %s }", Wlc_ObjRange(pObj) - Wlc_ObjRange(Wlc_ObjFanin0(p, pObj)), pName0, Wlc_ObjRange(Wlc_ObjFanin0(p, pObj)) - 1, pName0 );
+            else if ( pObj->Type == WLC_OBJ_BIT_ZEROPAD )
+                fprintf( pFile, "{ {%d{1\'b0}}, %s }", Wlc_ObjRange(pObj) - Wlc_ObjRange(Wlc_ObjFanin0(p, pObj)), pName0 );
+            else if ( pObj->Type == WLC_OBJ_BIT_CONCAT )
+            {
+                fprintf( pFile, "{" );
+                Wlc_ObjForEachFanin( pObj, iFanin, k )
+                    fprintf( pFile, " %s%s", Wlc_ObjName(p, Wlc_ObjFaninId(pObj, k)), k == Wlc_ObjFaninNum(pObj)-1 ? "":"," );
+                fprintf( pFile, " }" );
+            }
+            else 
+            {
+                fprintf( pFile, "%s ", Wlc_ObjName(p, Wlc_ObjFaninId(pObj, 0)) );
+                if ( pObj->Type == WLC_OBJ_SHIFT_R )
+                    fprintf( pFile, ">>" );
+                else if ( pObj->Type == WLC_OBJ_SHIFT_RA )
+                    fprintf( pFile, ">>>" );
+                else if ( pObj->Type == WLC_OBJ_SHIFT_L )
+                    fprintf( pFile, "<<" );
+                else if ( pObj->Type == WLC_OBJ_SHIFT_LA )
+                    fprintf( pFile, "<<<" );
+                else if ( pObj->Type == WLC_OBJ_BIT_AND )
+                    fprintf( pFile, "&" );
+                else if ( pObj->Type == WLC_OBJ_BIT_OR )
+                    fprintf( pFile, "|" );
+                else if ( pObj->Type == WLC_OBJ_BIT_XOR )
+                    fprintf( pFile, "^" );
+                else if ( pObj->Type == WLC_OBJ_LOGIC_AND )
+                    fprintf( pFile, "&&" );
+                else if ( pObj->Type == WLC_OBJ_LOGIC_OR )
+                    fprintf( pFile, "||" );
+                else if ( pObj->Type == WLC_OBJ_COMP_EQU )
+                    fprintf( pFile, "==" );
+                else if ( pObj->Type == WLC_OBJ_COMP_NOT )
+                    fprintf( pFile, "!=" );
+                else if ( pObj->Type == WLC_OBJ_COMP_LESS )
+                    fprintf( pFile, "<" );
+                else if ( pObj->Type == WLC_OBJ_COMP_MORE )
+                    fprintf( pFile, ">" );
+                else if ( pObj->Type == WLC_OBJ_COMP_LESSEQU )
+                    fprintf( pFile, "<=" );
+                else if ( pObj->Type == WLC_OBJ_COMP_MOREEQU )
+                    fprintf( pFile, ">=" );
+                else if ( pObj->Type == WLC_OBJ_ARI_ADD )
+                    fprintf( pFile, "+" );
+                else if ( pObj->Type == WLC_OBJ_ARI_SUB )
+                    fprintf( pFile, "-" );
+                else if ( pObj->Type == WLC_OBJ_ARI_MULTI )
+                    fprintf( pFile, "*" );
+                else if ( pObj->Type == WLC_OBJ_ARI_DIVIDE )
+                    fprintf( pFile, "//" );
+                else if ( pObj->Type == WLC_OBJ_ARI_MODULUS )
+                    fprintf( pFile, "%%" );
+                else if ( pObj->Type == WLC_OBJ_ARI_POWER )
+                    fprintf( pFile, "**" );
+                else assert( 0 );
+                fprintf( pFile, " %s", Wlc_ObjName(p, Wlc_ObjFaninId(pObj, 1)) );
+            }
+        }
+        fprintf( pFile, " ;\n" );
+    }
+    fprintf( pFile, "endmodule\n\n" );
+} 
+void Wlc_WriteVer( Wlc_Ntk_t * p, char * pFileName )
+{
+    FILE * pFile;
+    pFile = fopen( pFileName, "w" );
+    if ( pFile == NULL )
+    {
+        fprintf( stdout, "Wlc_WriteVer(): Cannot open the output file \"%s\".\n", pFileName );
+        return;
+    }
+    fprintf( pFile, "// Benchmark \"%s\" written by ABC on %s\n", p->pName, Extra_TimeStamp() );
+    fprintf( pFile, "\n" );
+    Wlc_WriteVerInt( pFile, p );
+    fprintf( pFile, "\n" );
+    fclose( pFile );
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/bdd/dsd/dsd.h b/abc-build/src/bdd/dsd/dsd.h
--- a/abc-build/src/bdd/dsd/dsd.h
+++ b/abc-build/src/bdd/dsd/dsd.h
@@ -116,6 +116,7 @@
 extern Dsd_Node_t **   Dsd_TreeCollectNodesDfs( Dsd_Manager_t * dMan, int * pnNodes );
 extern Dsd_Node_t **   Dsd_TreeCollectNodesDfsOne( Dsd_Manager_t * pDsdMan, Dsd_Node_t * pNode, int * pnNodes );
 extern void            Dsd_TreePrint( FILE * pFile, Dsd_Manager_t * dMan, char * pInputNames[], char * pOutputNames[], int fShortNames, int Output );
+extern void            Dsd_TreePrint2( FILE * pFile, Dsd_Manager_t * dMan, char * pInputNames[], char * pOutputNames[], int Output );
 extern void            Dsd_NodePrint( FILE * pFile, Dsd_Node_t * pNode );
 /*=== dsdLocal.c =======================================================*/
 extern DdNode *        Dsd_TreeGetPrimeFunction( DdManager * dd, Dsd_Node_t * pNode );
diff --git a/abc-build/src/bdd/dsd/dsdTree.c b/abc-build/src/bdd/dsd/dsdTree.c
--- a/abc-build/src/bdd/dsd/dsdTree.c
+++ b/abc-build/src/bdd/dsd/dsdTree.c
@@ -17,6 +17,7 @@
 ***********************************************************************/
 
 #include "dsdInt.h"
+#include "misc/util/utilTruth.h"
 
 ABC_NAMESPACE_IMPL_START
 
@@ -820,6 +821,119 @@
     }
     ABC_FREE( pInputNums );
 }
+
+/**Function*************************************************************
+
+  Synopsis    [Prints the decompostion tree into file.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+word Dsd_TreeFunc2Truth_rec( DdManager * dd, DdNode * bFunc )
+{
+    word Cof0, Cof1;
+    int Level;
+    if ( bFunc == b0 )
+        return 0;
+    if ( bFunc == b1 )
+        return ~(word)0;
+    if ( Cudd_IsComplement(bFunc) )
+        return ~Dsd_TreeFunc2Truth_rec( dd, Cudd_Not(bFunc) );
+    Level = dd->perm[bFunc->index];
+    assert( Level >= 0 && Level < 6 );
+    Cof0 = Dsd_TreeFunc2Truth_rec( dd, cuddE(bFunc) );
+    Cof1 = Dsd_TreeFunc2Truth_rec( dd, cuddT(bFunc) );
+    return (s_Truths6[Level] & Cof1) | (~s_Truths6[Level] & Cof0);
+}
+void Dsd_TreePrint2_rec( FILE * pFile, DdManager * dd, Dsd_Node_t * pNode, int fComp, char * pInputNames[] )
+{
+    int i;
+    if ( pNode->Type == DSD_NODE_CONST1 )
+    {
+        fprintf( pFile, "Const%d", !fComp );
+        return;
+    }
+    assert( pNode->Type == DSD_NODE_BUF || pNode->Type == DSD_NODE_PRIME || pNode->Type == DSD_NODE_OR || pNode->Type == DSD_NODE_EXOR ); 
+//    fprintf( pFile, "%s", (fComp ^ (pNode->Type == DSD_NODE_OR))? "!" : "" );
+    if ( pNode->Type == DSD_NODE_BUF )
+    {
+        fprintf( pFile, "%s", fComp? "!" : "" );
+        fprintf( pFile, "%s", pInputNames[pNode->S->index] );
+    }
+    else if ( pNode->Type == DSD_NODE_PRIME )
+    {
+        fprintf( pFile, " " );
+        if ( pNode->nDecs <= 6 )
+        {
+            extern unsigned Abc_TtCanonicize( word * pTruth, int nVars, char * pCanonPerm );
+            char pCanonPerm[6]; int uCanonPhase;
+            // compute truth table
+            DdNode * bFunc = Dsd_TreeGetPrimeFunction( dd, pNode );  
+            word uTruth = Dsd_TreeFunc2Truth_rec( dd, bFunc );
+            Cudd_Ref( bFunc );
+            Cudd_RecursiveDeref( dd, bFunc );
+            // canonicize truth table
+            uCanonPhase = Abc_TtCanonicize( &uTruth, pNode->nDecs, pCanonPerm );
+            fprintf( pFile, "%s", (fComp ^ ((uCanonPhase >> pNode->nDecs) & 1)) ? "!" : "" );
+            Abc_TtPrintHexRev( pFile, &uTruth, pNode->nDecs );
+            fprintf( pFile, "{" );
+            for ( i = 0; i < pNode->nDecs; i++ )
+            {
+                Dsd_Node_t * pInput = pNode->pDecs[(int)pCanonPerm[i]];
+                Dsd_TreePrint2_rec( pFile, dd, Dsd_Regular(pInput), Dsd_IsComplement(pInput) ^ ((uCanonPhase>>i)&1), pInputNames );
+            }
+            fprintf( pFile, "} " );
+        }
+        else
+        {
+            fprintf( pFile, "|%d|", pNode->nDecs );
+            fprintf( pFile, "{" );
+            for ( i = 0; i < pNode->nDecs; i++ )
+                Dsd_TreePrint2_rec( pFile, dd, Dsd_Regular(pNode->pDecs[i]), Dsd_IsComplement(pNode->pDecs[i]), pInputNames );
+            fprintf( pFile, "} " );
+        }
+    }
+    else if ( pNode->Type == DSD_NODE_OR )
+    {
+        fprintf( pFile, "%s", !fComp? "!" : "" );
+        fprintf( pFile, "(" );
+        for ( i = 0; i < pNode->nDecs; i++ )
+            Dsd_TreePrint2_rec( pFile, dd, Dsd_Regular(pNode->pDecs[i]), !Dsd_IsComplement(pNode->pDecs[i]), pInputNames );
+        fprintf( pFile, ")" );
+    }
+    else if ( pNode->Type == DSD_NODE_EXOR )
+    {
+        fprintf( pFile, "%s", fComp? "!" : "" );
+        fprintf( pFile, "[" );
+        for ( i = 0; i < pNode->nDecs; i++ )
+            Dsd_TreePrint2_rec( pFile, dd, Dsd_Regular(pNode->pDecs[i]), Dsd_IsComplement(pNode->pDecs[i]), pInputNames );
+        fprintf( pFile, "]" );
+    }
+}
+void Dsd_TreePrint2( FILE * pFile, Dsd_Manager_t * pDsdMan, char * pInputNames[], char * pOutputNames[], int Output )
+{
+    if ( Output == -1 )
+    {
+        int i;
+        for ( i = 0; i < pDsdMan->nRoots; i++ )
+        {
+            fprintf( pFile, "%8s = ", pOutputNames[i] );
+            Dsd_TreePrint2_rec( pFile, pDsdMan->dd, Dsd_Regular(pDsdMan->pRoots[i]), Dsd_IsComplement(pDsdMan->pRoots[i]), pInputNames );
+            fprintf( pFile, "\n" );
+        }
+    }
+    else
+    {
+        assert( Output >= 0 && Output < pDsdMan->nRoots );
+        fprintf( pFile, "%8s = ", pOutputNames[Output] );
+        Dsd_TreePrint2_rec( pFile, pDsdMan->dd, Dsd_Regular(pDsdMan->pRoots[Output]), Dsd_IsComplement(pDsdMan->pRoots[Output]), pInputNames );
+        fprintf( pFile, "\n" );
+    }
+}
 
 /**Function*************************************************************
 
diff --git a/abc-build/src/bool/kit/kit.h b/abc-build/src/bool/kit/kit.h
--- a/abc-build/src/bool/kit/kit.h
+++ b/abc-build/src/bool/kit/kit.h
@@ -570,6 +570,7 @@
 /*=== kitIsop.c ==========================================================*/
 extern int             Kit_TruthIsop( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth );
 extern void            Kit_TruthIsopPrint( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth );
+extern void            Kit_TruthIsopPrintCover( Vec_Int_t * vCover, int nVars, int fCompl );
 /*=== kitPla.c ==========================================================*/
 extern int             Kit_PlaIsConst0( char * pSop );
 extern int             Kit_PlaIsConst1( char * pSop );
diff --git a/abc-build/src/map/if/ifData2.c b/abc-build/src/map/if/ifData2.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/map/if/ifData2.c
@@ -0,0 +1,52 @@
+/**CFile****************************************************************
+
+  FileName    [ifData2.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [FPGA mapping based on priority cuts.]
+
+  Synopsis    [Precomputed data.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - September 1, 2009.]
+
+  Revision    [$Id: ifData2.c,v 1.00 2009/09/01 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "if.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/map/if/ifDelay.c b/abc-build/src/map/if/ifDelay.c
--- a/abc-build/src/map/if/ifDelay.c
+++ b/abc-build/src/map/if/ifDelay.c
@@ -20,6 +20,7 @@
 
 #include "if.h"
 #include "ifCount.h"
+#include "bool/kit/kit.h"
 
 ABC_NAMESPACE_IMPL_START
 
@@ -269,6 +270,7 @@
     }
     else
     {
+        int fVerbose = 0;
         Vec_Int_t * vCover = Vec_WecEntry( p->vTtIsops[pCut->nLeaves], Abc_Lit2Var(If_CutTruthLit(pCut)) );
         int Delay, Area = 0;
         int i, pTimes[IF_MAX_FUNC_LUTSIZE];
@@ -279,6 +281,34 @@
             pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(p, pCut, i))->Delay; 
         Delay = If_CutSopBalanceEvalIntInt( vCover, If_CutLeaveNum(pCut), pTimes, vAig, Abc_LitIsCompl(If_CutTruthLit(pCut)) ^ pCut->fCompl, &Area );
         pCut->Cost = Area;
+        if ( fVerbose )
+        {
+            int Max = 0, Two = 0;
+            for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+                Max = Abc_MaxInt( Max, pTimes[i] );
+            for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+                if ( pTimes[i] != Max )
+                    Two = Abc_MaxInt( Two, pTimes[i] );
+            if ( Two + 2 < Max && Max + 3 < Delay )
+            {
+                for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+                    printf( "%3d ", pTimes[i] );
+                for ( ; i < p->pPars->nLutSize; i++ )
+                    printf( "    " );
+                printf( "-> %3d   ", Delay );
+                Dau_DsdPrintFromTruth( If_CutTruthW(p, pCut), If_CutLeaveNum(pCut) );
+                Kit_TruthIsopPrintCover( vCover, If_CutLeaveNum(pCut), Abc_LitIsCompl(If_CutTruthLit(pCut)) ^ pCut->fCompl );
+                {
+                    Vec_Int_t vIsop;
+                    int pIsop[64];
+                    vIsop.nCap = vIsop.nSize = Abc_Tt6Esop( *If_CutTruthW(p, pCut), pCut->nLeaves, pIsop );
+                    vIsop.pArray = pIsop;
+                    printf( "ESOP (%d -> %d)\n", Vec_IntSize(vCover), vIsop.nSize );
+                    Kit_TruthIsopPrintCover( &vIsop, If_CutLeaveNum(pCut), 0 );
+                }
+                printf( "\n" );
+            }
+        }
         return Delay;
     }
 }
diff --git a/abc-build/src/map/if/ifDsd.c b/abc-build/src/map/if/ifDsd.c
--- a/abc-build/src/map/if/ifDsd.c
+++ b/abc-build/src/map/if/ifDsd.c
@@ -713,6 +713,31 @@
  
 /**Function*************************************************************
 
+  Synopsis    [Check if the function is non-trivial.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int If_DsdManCheckNonTriv( If_DsdMan_t * p, int Id, int nVars, int iVarMax )
+{
+    If_DsdObj_t * pObj; int i, iFanin;
+    pObj = If_DsdVecObj( &p->vObjs, Id );
+    if ( If_DsdObjType(pObj) == IF_DSD_PRIME )
+        return 1;
+    if ( If_DsdObjFaninNum(pObj) == nVars )
+        return 0;
+    If_DsdObjForEachFaninLit( &p->vObjs, pObj, iFanin, i )
+        if ( Abc_Lit2Var(iFanin) == 1 && i == iVarMax )
+            return 0;
+    return 1;
+}
+
+/**Function*************************************************************
+
   Synopsis    [Sorting DSD literals.]
 
   Description []
@@ -1983,6 +2008,28 @@
 
 /**Function*************************************************************
 
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int If_CutDsdPermLitMax( char * pPermLits, int nVars, int iVar )
+{
+    int i;
+    assert( iVar >= 0 && iVar < nVars );
+    for ( i = 0; i < nVars; i++ )
+        if ( iVar == Abc_Lit2Var((int)pPermLits[i]) )
+            return i;
+    assert( 0 );
+    return -1;
+}
+
+/**Function*************************************************************
+
   Synopsis    [Evaluate delay using DSD balancing.]
 
   Description []
@@ -2073,6 +2120,7 @@
 }
 int If_CutDsdBalanceEval( If_Man_t * p, If_Cut_t * pCut, Vec_Int_t * vAig )
 {
+    int fUseCofs = 0;
     pCut->fUser = 1;
     if ( vAig )
         Vec_IntClear( vAig );
@@ -2096,12 +2144,54 @@
     }
     else
     {
+        int fVerbose = 0;
         int i, pTimes[IF_MAX_FUNC_LUTSIZE];
         int Delay, Area = 0;
+        char * pPermLits = If_CutDsdPerm(p, pCut);
         for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
             pTimes[i] = (int)If_ObjCutBest(If_CutLeaf(p, pCut, i))->Delay; 
         Delay = If_CutDsdBalanceEvalInt( p->pIfDsdMan, Abc_LitNotCond(If_CutDsdLit(p, pCut), pCut->fCompl), pTimes, vAig, &Area, If_CutDsdPerm(p, pCut) );
         pCut->Cost = Area;
+        // try cofactoring 
+        if ( fUseCofs )
+        {
+            // count how many times the max one appears
+            int iMax = 0, nCountMax = 1;
+            for ( i = 1; i < If_CutLeaveNum(pCut); i++ )
+                if ( pTimes[i] > pTimes[iMax] )
+                    iMax = i, nCountMax = 1;
+                else if ( pTimes[i] == pTimes[iMax] )
+                    nCountMax++;
+            // decide when to try the decomposition
+            if ( nCountMax == 1 && pTimes[iMax] + 2 < Delay && If_DsdManCheckNonTriv( p->pIfDsdMan, Abc_Lit2Var(If_CutDsdLit(p, pCut)), 
+                 If_CutLeaveNum(pCut), If_CutDsdPermLitMax(pPermLits, If_CutLeaveNum(pCut), iMax)) )
+            {
+//                fVerbose = 1;
+                Delay = pTimes[iMax] + 2;
+            }
+        }
+        // report the result
+        if ( fVerbose )
+        {
+/*
+            int Max = 0, Two = 0;
+            for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+                Max = Abc_MaxInt( Max, pTimes[i] );
+            for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+                if ( pTimes[i] != Max )
+                    Two = Abc_MaxInt( Two, pTimes[i] );
+            if ( Two + 2 < Max && Max + 3 < Delay )
+*/
+            {
+                for ( i = 0; i < If_CutLeaveNum(pCut); i++ )
+                    printf( "%3d ", pTimes[Abc_Lit2Var(pPermLits[i])] );
+                for ( ; i < p->pPars->nLutSize; i++ )
+                    printf( "    " );
+                printf( "-> %3d   ", Delay );
+                If_DsdManPrintOne( stdout, p->pIfDsdMan, Abc_Lit2Var(If_CutDsdLit(p, pCut)), NULL, 0 );
+                printf( "\n" );
+            }
+        }
         return Delay;
     }
 }
diff --git a/abc-build/src/map/if/ifLibBox.c b/abc-build/src/map/if/ifLibBox.c
--- a/abc-build/src/map/if/ifLibBox.c
+++ b/abc-build/src/map/if/ifLibBox.c
@@ -323,7 +323,7 @@
         for ( i = 0; i < nPis * nPos; i++ )
         {
             pToken = If_LibBoxGetToken( pFile );
-            pBox->pDelays[i] = (pToken[0] == '-') ? -1 : atoi(pToken);
+            pBox->pDelays[i] = (pToken[0] == '-') ? -ABC_INFINITY : atoi(pToken);
         }
         // extract next name
         pToken = If_LibBoxGetToken( pFile );
@@ -342,7 +342,7 @@
         fprintf( pFile, "%s %d %d %d %d\n", pBox->pName, pBox->Id, !pBox->fBlack, pBox->nPis, pBox->nPos );
         for ( j = 0; j < pBox->nPos; j++, printf("\n") )
             for ( k = 0; k < pBox->nPis; k++ )
-                if ( pBox->pDelays[j * pBox->nPis + k] == -1 )
+                if ( pBox->pDelays[j * pBox->nPis + k] == -ABC_INFINITY )
                     fprintf( pFile, "    - " );
                 else
                     fprintf( pFile, "%5d ", pBox->pDelays[j * pBox->nPis + k] );
diff --git a/abc-build/src/map/if/ifMan.c b/abc-build/src/map/if/ifMan.c
--- a/abc-build/src/map/if/ifMan.c
+++ b/abc-build/src/map/if/ifMan.c
@@ -79,7 +79,7 @@
             for ( v = 0; v < 6; v++ )
                 p->vTtIsops[v] = p->vTtIsops[6];
         }
-        if ( p->pPars->fDelayOpt || pPars->nGateSize > 0 || p->pPars->fDsdBalance );
+        if ( pPars->fDelayOpt || pPars->nGateSize > 0 || pPars->fDsdBalance )
         {
             p->vCover = Vec_IntAlloc( 0 );
             p->vArray = Vec_IntAlloc( 1000 );
@@ -125,6 +125,15 @@
         p->vPairRes = Vec_IntAlloc( 1000 );
         Vec_IntPush( p->vPairRes, -1 );
     }
+    if ( pPars->fUseBat )
+    {
+//        abctime clk = Abc_Clock();
+        extern int Bat_ManCellFuncLookup( void * pMan, unsigned * pTruth, int nVars, int nLeaves, char * pStr );
+        extern void Bat_ManFuncSetupTable();
+        pPars->pFuncCell = (int (*)  (If_Man_t *, unsigned *, int, int, char *))Bat_ManCellFuncLookup;
+        Bat_ManFuncSetupTable();
+//        Abc_PrintTime( 1, "Setup time", Abc_Clock() - clk );
+    }
     // create the constant node
     p->pConst1   = If_ManSetupObj( p );
     p->pConst1->Type   = IF_CONST1;
@@ -249,6 +258,11 @@
         Tim_ManStop( p->pManTim );
     if ( p->vSwitching )
         Vec_IntFree( p->vSwitching );
+    if ( p->pPars->fUseBat )
+    {
+        extern void Bat_ManFuncSetdownTable();
+        Bat_ManFuncSetdownTable();
+    }
     // hash table
 //    if ( p->pPars->fVerbose && p->nTableEntries[0] )
 //        printf( "Hash table 2:  Entries = %7d.  Size = %7d.\n", p->nTableEntries[0], p->nTableSize[0] );
diff --git a/abc-build/src/map/if/ifMap.c b/abc-build/src/map/if/ifMap.c
--- a/abc-build/src/map/if/ifMap.c
+++ b/abc-build/src/map/if/ifMap.c
@@ -99,7 +99,7 @@
     If_Cut_t * pCut0R, * pCut1R;
     int fFunc0R, fFunc1R;
     int i, k, v, iCutDsd, fChange;
-    int fSave0 = p->pPars->fDelayOpt || p->pPars->fDelayOptLut || p->pPars->fDsdBalance || p->pPars->fUserRecLib;
+    int fSave0 = p->pPars->fDelayOpt || p->pPars->fDelayOptLut || p->pPars->fDsdBalance || p->pPars->fUserRecLib || p->pPars->pLutStruct != NULL;
     assert( !If_ObjIsAnd(pObj->pFanin0) || pObj->pFanin0->pCutSet->nCuts > 0 );
     assert( !If_ObjIsAnd(pObj->pFanin1) || pObj->pFanin1->pCutSet->nCuts > 0 );
 
diff --git a/abc-build/src/map/if/ifMatch2.c b/abc-build/src/map/if/ifMatch2.c
new file mode 100644
--- /dev/null
+++ b/abc-build/src/map/if/ifMatch2.c
@@ -0,0 +1,62 @@
+/**CFile****************************************************************
+
+  FileName    [ifMatch2.c]
+
+  SystemName  [ABC: Logic synthesis and verification system.]
+
+  PackageName [FPGA mapping based on priority cuts.]
+
+  Synopsis    [Specialized matching.]
+
+  Author      [Alan Mishchenko]
+  
+  Affiliation [UC Berkeley]
+
+  Date        [Ver. 1.0. Started - September 1, 2009.]
+
+  Revision    [$Id: ifMatch2.c,v 1.00 2009/09/01 00:00:00 alanmi Exp $]
+
+***********************************************************************/
+
+#include "if.h"
+
+ABC_NAMESPACE_IMPL_START
+
+
+////////////////////////////////////////////////////////////////////////
+///                        DECLARATIONS                              ///
+////////////////////////////////////////////////////////////////////////
+
+////////////////////////////////////////////////////////////////////////
+///                     FUNCTION DEFINITIONS                         ///
+////////////////////////////////////////////////////////////////////////
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Bat_ManFuncSetupTable()
+{
+}
+void Bat_ManFuncSetdownTable()
+{
+}
+int Bat_ManCellFuncLookup( void * pMan, unsigned * pTruth, int nVars, int nLeaves, char * pStr )
+{
+    return 1;
+}
+
+////////////////////////////////////////////////////////////////////////
+///                       END OF FILE                                ///
+////////////////////////////////////////////////////////////////////////
+
+
+ABC_NAMESPACE_IMPL_END
+
diff --git a/abc-build/src/map/if/ifTune.c b/abc-build/src/map/if/ifTune.c
--- a/abc-build/src/map/if/ifTune.c
+++ b/abc-build/src/map/if/ifTune.c
@@ -23,12 +23,17 @@
 #include "sat/bsat/satStore.h"
 #include "sat/cnf/cnf.h"
 #include "misc/extra/extra.h"
+#include "bool/kit/kit.h"
 
 ABC_NAMESPACE_IMPL_START
 
 ////////////////////////////////////////////////////////////////////////
 ///                        DECLARATIONS                              ///
 ////////////////////////////////////////////////////////////////////////
+ 
+#define IFN_INS    11
+#define IFN_WRD  (IFN_INS > 6 ? 1 << (IFN_INS-6) : 1)
+#define IFN_PAR  1024
 
 // network types
 typedef enum { 
@@ -40,13 +45,122 @@
     IF_DSD_MUX,                    // 5:  MUX
     IF_DSD_PRIME                   // 6:  PRIME
 } If_DsdType_t;
+
+// object types
+static char * Ifn_Symbs[16] = { 
+    NULL,                          // 0:  unknown
+    "const",                       // 1:  constant
+    "var",                         // 2:  variable
+    "()",                          // 3:  AND
+    "[]",                          // 4:  XOR
+    "<>",                          // 5:  MUX
+    "{}"                           // 6:  PRIME
+};
+
+typedef struct Ift_Obj_t_  Ift_Obj_t;
+typedef struct Ift_Ntk_t_  Ift_Ntk_t;
+
+struct Ift_Obj_t_
+{
+    unsigned               Type    :  3;      // node type
+    unsigned               nFanins :  5;      // fanin counter
+    unsigned               iFirst  :  8;      // first parameter
+    unsigned               Var     : 16;      // current variable
+    int                    Fanins[IFN_INS];   // fanin IDs
+};
+struct Ift_Ntk_t_ 
+{
+    // cell structure
+    int                    nInps;             // inputs
+    int                    nObjs;             // objects
+    Ift_Obj_t              Nodes[2*IFN_INS];  // nodes
+    // constraints
+    int                    pConstr[IFN_INS];  // constraint pairs
+    int                    nConstr;           // number of pairs
+    // user data
+    int                    nVars;             // variables
+    int                    nWords;            // truth table words
+    int                    nParsVNum;         // selection parameters per variable
+    int                    nParsVIni;         // first selection parameter
+    int                    nPars;             // total parameters
+    word *                 pTruth;            // user truth table
+    // matching procedures
+    int                    Values[IFN_PAR];            // variable values
+    word                   pTtElems[IFN_INS*IFN_WRD];  // elementary truth tables
+    word                   pTtObjs[2*IFN_INS*IFN_WRD]; // object truth tables
+};
+
+static inline word *       Ift_ElemTruth( Ift_Ntk_t * p, int i ) { return p->pTtElems + i * Abc_TtWordNum(p->nInps); }
+static inline word *       Ift_ObjTruth( Ift_Ntk_t * p, int i )  { return p->pTtObjs + i * p->nWords;                }
+ 
+// variable ordering
+// - primary inputs            [0;            p->nInps)
+// - internal nodes            [p->nInps;     p->nObjs)
+// - configuration params      [p->nObjs;     p->nParsVIni)
+// - variable selection params [p->nParsVIni; p->pPars)
 
 ////////////////////////////////////////////////////////////////////////
 ///                     FUNCTION DEFINITIONS                         ///
 ////////////////////////////////////////////////////////////////////////
- 
+
 /**Function*************************************************************
 
+  Synopsis    [Prepare network to check the given function.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Ifn_Prepare( Ift_Ntk_t * p, word * pTruth, int nVars )
+{
+    int i, fVerbose = 0;
+    assert( nVars <= p->nInps );
+    p->pTruth = pTruth;
+    p->nVars  = nVars;
+    p->nWords = Abc_TtWordNum(nVars);
+    p->nPars  = p->nObjs;
+    for ( i = p->nInps; i < p->nObjs; i++ )
+    {
+        if ( p->Nodes[i].Type != IF_DSD_PRIME )
+            continue;
+        p->Nodes[i].iFirst = p->nPars;
+        p->nPars += (1 << p->Nodes[i].nFanins);
+        if ( fVerbose )
+            printf( "Node %d  Start %d  Vars %d\n", i, p->Nodes[i].iFirst, (1 << p->Nodes[i].nFanins) );
+    }
+    if ( fVerbose )
+        printf( "Groups start %d\n", p->nPars );
+    p->nParsVIni = p->nPars;
+    p->nParsVNum = Abc_Base2Log(nVars);
+    p->nPars    += p->nParsVNum * p->nInps;
+    assert( p->nPars <= IFN_PAR );
+    memset( p->Values, 0xFF, sizeof(int) * p->nPars );
+    return p->nPars;
+}
+void Ifn_NtkPrint( Ift_Ntk_t * p )
+{
+    int i, k; 
+    if ( p == NULL )
+        printf( "String is empty.\n" );
+    if ( p == NULL )
+        return;
+    for ( i = p->nInps; i < p->nObjs; i++ )
+    {
+        printf( "%c=", 'a'+i );
+        printf( "%c", Ifn_Symbs[p->Nodes[i].Type][0] );
+        for ( k = 0; k < (int)p->Nodes[i].nFanins; k++ )
+            printf( "%c", 'a'+p->Nodes[i].Fanins[k] );
+        printf( "%c", Ifn_Symbs[p->Nodes[i].Type][1] );
+        printf( ";" );
+    }
+    printf( "\n" );
+}
+
+/**Function*************************************************************
+
   Synopsis    []
 
   Description []
@@ -56,7 +170,7 @@
   SeeAlso     []
 
 ***********************************************************************/
-int If_ManStrCheck( char * pStr, int * pnVars, int * pnObjs )
+int Ifn_ManStrCheck( char * pStr, int * pnInps, int * pnObjs )
 {
     int i, Marks[32] = {0}, MaxVar = 0, MaxDef = 0, RetValue = 1;
     for ( i = 0; pStr[i]; i++ )
@@ -110,141 +224,207 @@
             printf( "String \"%s\" has no definition for internal variable (%c).\n", pStr, 'a' + i ), RetValue = 0;
     if ( !RetValue )
         return 0;
-    *pnVars = MaxVar;
+    *pnInps = MaxVar;
     *pnObjs = MaxDef;
     return 1;
 }
-int If_ManStrParse( char * pStr, int nVars, int nObjs, int * pTypes, int * pnFans, int ppFans[][6], int * pFirsts, int * pnSatVars )
+Ift_Ntk_t * Ifn_ManStrParse( char * pStr )
 {
-    int i, k, n, f, nPars = nVars;
-    char Next = 0;
-    assert( nVars < nObjs );
-    for ( i = nVars; i < nObjs; i++ )
+    int i, k, n, f, nFans, iFan;
+    static Ift_Ntk_t P, * p = &P;
+    memset( p, 0, sizeof(Ift_Ntk_t) );
+    if ( !Ifn_ManStrCheck(pStr, &p->nInps, &p->nObjs) )
+        return NULL;
+    if ( p->nInps > IFN_INS )
     {
+        printf( "The number of variables (%d) exceeds predefined limit (%d). Recompile with different value of IFN_INS.\n", p->nInps, IFN_INS );
+        return NULL;
+    }
+    assert( p->nInps > 1 && p->nInps < p->nObjs && p->nInps <= IFN_INS && p->nObjs < 2*IFN_INS );
+    for ( i = p->nInps; i < p->nObjs; i++ )
+    {
+        char Next = 0;
         for ( k = 0; pStr[k]; k++ )
             if ( pStr[k] == 'a' + i && pStr[k+1] == '=' )
                 break;
-        assert( pStr[k] );
+        if ( pStr[k] == 0 )
+        {
+            printf( "Cannot find definition of signal %c.\n", 'a' + i );
+            return NULL;
+        }
         if ( pStr[k+2] == '(' )
-            pTypes[i] = IF_DSD_AND, Next = ')';
+            p->Nodes[i].Type = IF_DSD_AND, Next = ')';
         else if ( pStr[k+2] == '[' )
-            pTypes[i] = IF_DSD_XOR, Next = ']';
+            p->Nodes[i].Type = IF_DSD_XOR, Next = ']';
         else if ( pStr[k+2] == '<' )
-            pTypes[i] = IF_DSD_MUX, Next = '>';
+            p->Nodes[i].Type = IF_DSD_MUX, Next = '>';
         else if ( pStr[k+2] == '{' )
-            pTypes[i] = IF_DSD_PRIME, Next = '}';
-        else assert( 0 );
+            p->Nodes[i].Type = IF_DSD_PRIME, Next = '}';
+        else 
+        {
+            printf( "Cannot find openning operation symbol in the defition of of signal %c.\n", 'a' + i );
+            return NULL;
+        }
         for ( n = k + 3; pStr[n]; n++ )
             if ( pStr[n] == Next )
                 break;
-        assert( pStr[k] );
-        pnFans[i] = n - k - 3;
-        assert( pnFans[i] > 0 && pnFans[i] <= 6 );
-        for ( f = 0; f < pnFans[i]; f++ )
+        if ( pStr[n] == 0 )
         {
-            ppFans[i][f] = pStr[k + 3 + f] - 'a';
-            assert( ppFans[i][k] < i );
-            if ( ppFans[i][f] < 0 || ppFans[i][f] >= nObjs )
-                printf( "Error!\n" );
+            printf( "Cannot find closing operation symbol in the defition of of signal %c.\n", 'a' + i );
+            return NULL;
         }
-        if ( pTypes[i] != IF_DSD_PRIME )
-            continue;
-        pFirsts[i] = nPars;
-        nPars += (1 << pnFans[i]);
+        nFans = n - k - 3;
+        if ( nFans < 1 || nFans > 8 )
+        {
+            printf( "Cannot find matching operation symbol in the defition of of signal %c.\n", 'a' + i );
+            return NULL;
+        }
+        for ( f = 0; f < nFans; f++ )
+        {
+            iFan = pStr[k + 3 + f] - 'a';
+            if ( iFan < 0 || iFan >= i )
+            {
+                printf( "Fanin number %d is signal %d is out of range.\n", f, 'a' + i );
+                return NULL;
+            }
+            p->Nodes[i].Fanins[f] = iFan;
+        }
+        p->Nodes[i].nFanins = nFans;
     }
-    *pnSatVars = nPars;
-    return 1;
+    // truth tables
+    Abc_TtElemInit2( p->pTtElems, p->nInps );
+/*
+    // constraints
+    p->nConstr = 5;
+    p->pConstr[0] = (0 << 16) | 1;
+
+    p->pConstr[1] = (2 << 16) | 3;
+    p->pConstr[2] = (3 << 16) | 4;
+
+    p->pConstr[3] = (6 << 16) | 7;
+    p->pConstr[4] = (7 << 16) | 8;
+*/
+    return p;
 }
-Gia_Man_t * If_ManStrFindModel( int nVars, int nObjs, int nSatVars, int * pTypes, int * pnFans, int ppFans[][6], int * pFirsts )
+
+/**Function*************************************************************
+
+  Synopsis    [Derive truth table given the configulation values.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+word * Ift_NtkDeriveTruth( Ift_Ntk_t * p, int * pValues )
 {
-    Gia_Man_t * pNew, * pTemp;
-    int * pVarsPar, * pVarsObj;
-    int i, k, n, Step, iLit, nMints, nPars = 0;
-    pNew = Gia_ManStart( 1000 );
-    pNew->pName = Abc_UtilStrsav( "model" );
-    Gia_ManHashStart( pNew );
-    pVarsPar = ABC_ALLOC( int, nSatVars );
-    pVarsObj = ABC_ALLOC( int, nObjs );
-    for ( i = 0; i < nSatVars; i++ )
-        pVarsPar[i] = Gia_ManAppendCi(pNew);
-    for ( i = 0; i < nVars; i++ )
-        pVarsObj[i] = pVarsPar[nSatVars - nVars + i];
-    for ( i = nVars; i < nObjs; i++ )
+    int i, v, f, iVar, iStart;
+    // elementary variables
+    for ( i = 0; i < p->nInps; i++ )
     {
-        if ( pTypes[i] == IF_DSD_AND )
+        // find variable
+        iStart = p->nParsVIni + i * p->nParsVNum;
+        for ( v = iVar = 0; v < p->nParsVNum; v++ )
+            if ( p->Values[iStart+v] )
+                iVar += (1 << v);
+        // assign variable
+        Abc_TtCopy( Ift_ObjTruth(p, i), Ift_ElemTruth(p, iVar), p->nWords, 0 );
+    }
+    // internal variables
+    for ( i = p->nInps; i < p->nObjs; i++ )
+    {
+        int nFans = p->Nodes[i].nFanins;
+        int * pFans = p->Nodes[i].Fanins;
+        word * pTruth = Ift_ObjTruth( p, i );
+        if ( p->Nodes[i].Type == IF_DSD_AND )
         {
-            iLit = 1;
-            for ( k = 0; k < pnFans[i]; k++ )
-                iLit = Gia_ManHashAnd( pNew, iLit, pVarsObj[ppFans[i][k]] );
-            pVarsObj[i] = iLit;
+            Abc_TtFill( pTruth, p->nWords );
+            for ( f = 0; f < nFans; f++ )
+                Abc_TtAnd( pTruth, pTruth, Ift_ObjTruth(p, pFans[f]), p->nWords, 0 );
         }
-        else if ( pTypes[i] == IF_DSD_XOR )
+        else if ( p->Nodes[i].Type == IF_DSD_XOR )
         {
-            iLit = 0;
-            for ( k = 0; k < pnFans[i]; k++ )
-                iLit = Gia_ManHashXor( pNew, iLit, pVarsObj[ppFans[i][k]] );
-            pVarsObj[i] = iLit;
+            Abc_TtClear( pTruth, p->nWords );
+            for ( f = 0; f < nFans; f++ )
+                Abc_TtXor( pTruth, pTruth, Ift_ObjTruth(p, pFans[f]), p->nWords, 0 );
         }
-        else if ( pTypes[i] == IF_DSD_MUX )
+        else if ( p->Nodes[i].Type == IF_DSD_MUX )
         {
-            assert( pnFans[i] == 3 );
-            pVarsObj[i] = Gia_ManHashMux( pNew, pVarsObj[ppFans[i][0]], pVarsObj[ppFans[i][1]], pVarsObj[ppFans[i][2]] );
+            assert( nFans == 3 );
+            Abc_TtMux( pTruth, Ift_ObjTruth(p, pFans[0]), Ift_ObjTruth(p, pFans[1]), Ift_ObjTruth(p, pFans[2]), p->nWords );
         }
-        else if ( pTypes[i] == IF_DSD_PRIME )
+        else if ( p->Nodes[i].Type == IF_DSD_PRIME )
         {
-            int pVarsData[64];
-            assert( pnFans[i] >= 1 && pnFans[i] <= 6 );
-            nMints = (1 << pnFans[i]);
-            for ( k = 0; k < nMints; k++ )
-                pVarsData[k] = pVarsPar[nPars++];
-            for ( Step = 1, k = 0; k < pnFans[i]; k++, Step <<= 1 )
-                for ( n = 0; n < nMints; n += Step << 1 )
-                    pVarsData[n] = Gia_ManHashMux( pNew, pVarsObj[ppFans[i][k]], pVarsData[n+Step], pVarsData[n] );
-            assert( Step == nMints );
-            pVarsObj[i] = pVarsData[0];
+            int nValues = (1 << nFans);
+            word * pTemp = Ift_ObjTruth(p, p->nObjs);
+            Abc_TtClear( pTruth, p->nWords );
+            for ( v = 0; v < nValues; v++ )
+            {
+                if ( pValues[p->Nodes[i].iFirst + v] == 0 )
+                    continue;
+                Abc_TtFill( pTemp, p->nWords );
+                for ( f = 0; f < nFans; f++ )
+                    if ( (v >> f) & 1 )
+                        Abc_TtAnd( pTemp, pTemp, Ift_ObjTruth(p, pFans[f]), p->nWords, 0 );
+                    else
+                        Abc_TtSharp( pTemp, pTemp, Ift_ObjTruth(p, pFans[f]), p->nWords );
+                Abc_TtOr( pTruth, pTruth, pTemp, p->nWords );
+            }
         }
         else assert( 0 );
+//Dau_DsdPrintFromTruth( pTruth, p->nVars );
     }
-    assert( nPars + nVars == nSatVars );
-    Gia_ManAppendCo( pNew, pVarsObj[nObjs-1] );
-    pNew = Gia_ManCleanup( pTemp = pNew );
-    Gia_ManStop( pTemp );
-    ABC_FREE( pVarsPar );
-    ABC_FREE( pVarsObj );
-    assert( Gia_ManPiNum(pNew) == nSatVars );
-    assert( Gia_ManPoNum(pNew) == 1 );
-    return pNew;
+    return Ift_ObjTruth(p, p->nObjs-1);
 }
-Gia_Man_t * If_ManStrFindCofactors( int nPars, Gia_Man_t * p )
+
+/**Function*************************************************************
+
+  Synopsis    [Compute more or equal]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Ift_TtComparisonConstr( word * pTruth, int nVars, int fMore, int fEqual )
 {
-    Gia_Man_t * pNew, * pTemp; 
-    Gia_Obj_t * pObj;
-    int i, m, nMints = 1 << (Gia_ManCiNum(p) - nPars);
-    pNew = Gia_ManStart( Gia_ManObjNum(p) );
-    pNew->pName = Abc_UtilStrsav( p->pName );
-    Gia_ManHashAlloc( pNew );
-    Gia_ManConst0(p)->Value = 0;
-    Gia_ManForEachCi( p, pObj, i )
-        if ( i < nPars )
-            pObj->Value = Gia_ManAppendCi( pNew );
-    for ( m = 0; m < nMints; m++ )
+    word Cond[4], Equa[4], Temp[4];
+    word s_TtElems[8][4] = {
+        ABC_CONST(0xAAAAAAAAAAAAAAAA),ABC_CONST(0xAAAAAAAAAAAAAAAA),ABC_CONST(0xAAAAAAAAAAAAAAAA),ABC_CONST(0xAAAAAAAAAAAAAAAA),
+        ABC_CONST(0xCCCCCCCCCCCCCCCC),ABC_CONST(0xCCCCCCCCCCCCCCCC),ABC_CONST(0xCCCCCCCCCCCCCCCC),ABC_CONST(0xCCCCCCCCCCCCCCCC),
+        ABC_CONST(0xF0F0F0F0F0F0F0F0),ABC_CONST(0xF0F0F0F0F0F0F0F0),ABC_CONST(0xF0F0F0F0F0F0F0F0),ABC_CONST(0xF0F0F0F0F0F0F0F0),
+        ABC_CONST(0xFF00FF00FF00FF00),ABC_CONST(0xFF00FF00FF00FF00),ABC_CONST(0xFF00FF00FF00FF00),ABC_CONST(0xFF00FF00FF00FF00),
+        ABC_CONST(0xFFFF0000FFFF0000),ABC_CONST(0xFFFF0000FFFF0000),ABC_CONST(0xFFFF0000FFFF0000),ABC_CONST(0xFFFF0000FFFF0000),
+        ABC_CONST(0xFFFFFFFF00000000),ABC_CONST(0xFFFFFFFF00000000),ABC_CONST(0xFFFFFFFF00000000),ABC_CONST(0xFFFFFFFF00000000),
+        ABC_CONST(0x0000000000000000),ABC_CONST(0xFFFFFFFFFFFFFFFF),ABC_CONST(0x0000000000000000),ABC_CONST(0xFFFFFFFFFFFFFFFF),
+        ABC_CONST(0x0000000000000000),ABC_CONST(0x0000000000000000),ABC_CONST(0xFFFFFFFFFFFFFFFF),ABC_CONST(0xFFFFFFFFFFFFFFFF)
+    };
+    int i, nWords = Abc_TtWordNum(2*nVars);
+    assert( nVars > 0 && nVars <= 4 );
+    Abc_TtClear( pTruth, nWords );
+    Abc_TtFill( Equa, nWords );
+    for ( i = nVars - 1; i >= 0; i-- )
     {
-        Gia_ManForEachCi( p, pObj, i )
-            if ( i >= nPars )
-                pObj->Value = ((m >> (i - nPars)) & 1);
-        Gia_ManForEachAnd( p, pObj, i )
-            pObj->Value = Gia_ManHashAnd( pNew, Gia_ObjFanin0Copy(pObj), Gia_ObjFanin1Copy(pObj) );
-        Gia_ManForEachPo( p, pObj, i )
-            pObj->Value = Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
+        if ( fMore )
+            Abc_TtSharp( Cond, s_TtElems[2*i+1], s_TtElems[2*i+0], nWords );
+        else
+            Abc_TtSharp( Cond, s_TtElems[2*i+0], s_TtElems[2*i+1], nWords );
+        Abc_TtAnd( Temp, Equa, Cond, nWords, 0 );
+        Abc_TtOr( pTruth, pTruth, Temp, nWords );
+        Abc_TtXor( Temp, s_TtElems[2*i+0], s_TtElems[2*i+1], nWords, 1 );
+        Abc_TtAnd( Equa, Equa, Temp, nWords, 0 );
     }
-    pNew = Gia_ManCleanup( pTemp = pNew );
-    Gia_ManStop( pTemp );
-    return pNew;
+    if ( fEqual )
+        Abc_TtNot( pTruth, nWords );
 }
 
 /**Function*************************************************************
 
-  Synopsis    []
+  Synopsis    [Adds parameter constraints.]
 
   Description []
                
@@ -253,70 +433,86 @@
   SeeAlso     []
 
 ***********************************************************************/
-static inline Cnf_Dat_t * Cnf_DeriveGiaRemapped( Gia_Man_t * p )
+void Ift_AddClause( sat_solver * pSat, int * pBeg, int * pEnd )
 {
-    Cnf_Dat_t * pCnf;
-    Aig_Man_t * pAig = Gia_ManToAigSimple( p );
-    pAig->nRegs = 0;
-    pCnf = Cnf_Derive( pAig, Aig_ManCoNum(pAig) );
-    Aig_ManStop( pAig );
-    return pCnf;
+    int fVerbose = 0;
+    int RetValue = sat_solver_addclause( pSat, pBeg, pEnd );
+    if ( fVerbose )
+    {
+        for ( ; pBeg < pEnd; pBeg++ )
+            printf( "%c%d ", Abc_LitIsCompl(*pBeg) ? '-':'+', Abc_Lit2Var(*pBeg) );
+        printf( "\n" );
+    }
+    assert( RetValue );
 }
-sat_solver * If_ManStrFindSolver( Gia_Man_t * p, Vec_Int_t ** pvPiVars, Vec_Int_t ** pvPoVars )
+void Ift_NtkAddConstrOne( sat_solver * pSat, Vec_Int_t * vCover, int * pVars, int nVars )
 {
-    sat_solver * pSat;
-    Gia_Obj_t * pObj;
-    Cnf_Dat_t * pCnf;
-    int i;    
-    pCnf = Cnf_DeriveGiaRemapped( p );
-    // start the SAT solver
-    pSat = sat_solver_new();
-    sat_solver_setnvars( pSat, pCnf->nVars );
-    // add timeframe clauses
-    for ( i = 0; i < pCnf->nClauses; i++ )
-        if ( !sat_solver_addclause( pSat, pCnf->pClauses[i], pCnf->pClauses[i+1] ) )
-            assert( 0 );
-    // inputs/outputs
-    *pvPiVars = Vec_IntAlloc( Gia_ManPiNum(p) );
-    Gia_ManForEachCi( p, pObj, i )
-        Vec_IntPush( *pvPiVars, pCnf->pVarNums[Gia_ObjId(p, pObj)] );
-    *pvPoVars = Vec_IntAlloc( Gia_ManPoNum(p) );
-    Gia_ManForEachCo( p, pObj, i )
-        Vec_IntPush( *pvPoVars, pCnf->pVarNums[Gia_ObjId(p, pObj)] );
-    Cnf_DataFree( pCnf );
-    return pSat;
+    int k, c, Cube, Literal, nLits, pLits[IFN_INS];
+    Vec_IntForEachEntry( vCover, Cube, c )
+    {
+        nLits = 0;
+        for ( k = 0; k < nVars; k++ )
+        {
+            Literal = 3 & (Cube >> (k << 1));
+            if ( Literal == 1 )      // '0'  -> pos lit
+                pLits[nLits++] = Abc_Var2Lit(pVars[k], 0);
+            else if ( Literal == 2 ) // '1'  -> neg lit
+                pLits[nLits++] = Abc_Var2Lit(pVars[k], 1);
+            else if ( Literal != 0 )
+                assert( 0 );
+        }
+        Ift_AddClause( pSat, pLits, pLits + nLits );
+    }
 }
-
-sat_solver * If_ManSatBuild( char * pStr, Vec_Int_t ** pvPiVars, Vec_Int_t ** pvPoVars )
+void Ift_NtkAddConstraints( Ift_Ntk_t * p, sat_solver * pSat )
 {
-    int nVars, nObjs, nSatVars;
-    int pTypes[32] = {0};
-    int pnFans[32] = {0};
-    int ppFans[32][6] = {{0}};
-    int pFirsts[32] = {0};
-    Gia_Man_t * p1, * p2;
-    sat_solver * pSat = NULL;
-    *pvPiVars = *pvPoVars = NULL;
-    if ( !If_ManStrCheck(pStr, &nVars, &nObjs) )
-        return NULL;
-    if ( !If_ManStrParse(pStr, nVars, nObjs, pTypes, pnFans, ppFans, pFirsts, &nSatVars) )
-        return NULL;
-    p1 = If_ManStrFindModel(nVars, nObjs, nSatVars, pTypes, pnFans, ppFans, pFirsts);
-    if ( p1 == NULL )
-        return NULL;
-//    Gia_AigerWrite( p1, "satbuild.aig", 0, 0 );
-    p2 = If_ManStrFindCofactors( nSatVars - nVars, p1 );
-    Gia_ManStop( p1 );
-    if ( p2 == NULL )
-        return NULL;
-//    Gia_AigerWrite( p2, "satbuild2.aig", 0, 0 );
-    pSat = If_ManStrFindSolver( p2, pvPiVars, pvPoVars );
-    Gia_ManStop( p2 );
-    return pSat;
+    int fAddConstr = 0;
+    Vec_Int_t * vCover = Vec_IntAlloc( 0 );
+    word uTruth = Abc_Tt6Stretch( ~Abc_Tt6Mask(p->nVars), p->nParsVNum );
+    assert( p->nParsVNum <= 4 );
+    if ( uTruth )
+    {
+        int i, k, pVars[IFN_INS];
+        int RetValue = Kit_TruthIsop( (unsigned *)&uTruth, p->nParsVNum, vCover, 0 );
+        assert( RetValue == 0 );
+//        Dau_DsdPrintFromTruth( &uTruth, p->nParsVNum );
+        // add capacity constraints
+        for ( i = 0; i < p->nInps; i++ )
+        {
+            for ( k = 0; k < p->nParsVNum; k++ )
+                pVars[k] = p->nParsVIni + i * p->nParsVNum + k;
+            Ift_NtkAddConstrOne( pSat, vCover, pVars, p->nParsVNum );
+        }
+    }
+    // ordering constraints
+    if ( fAddConstr && p->nConstr )
+    {
+        word pTruth[4];
+        int i, k, RetValue, pVars[2*IFN_INS];
+        int fForceDiff = (p->nVars == p->nInps);
+        Ift_TtComparisonConstr( pTruth, p->nParsVNum, fForceDiff, fForceDiff );
+        RetValue = Kit_TruthIsop( (unsigned *)pTruth, 2*p->nParsVNum, vCover, 0 );
+        assert( RetValue == 0 );
+//        Kit_TruthIsopPrintCover( vCover, 2*p->nParsVNum, 0 );
+        for ( i = 0; i < p->nConstr; i++ )
+        {
+            int iVar1 = p->pConstr[i] >> 16;
+            int iVar2 = p->pConstr[i] & 0xFFFF;
+            for ( k = 0; k < p->nParsVNum; k++ )
+            {
+                pVars[2*k+0] = p->nParsVIni + iVar1 * p->nParsVNum + k;
+                pVars[2*k+1] = p->nParsVIni + iVar2 * p->nParsVNum + k;
+            }
+            Ift_NtkAddConstrOne( pSat, vCover, pVars, 2*p->nParsVNum );
+//            printf( "added constraint with %d clauses for %d and %d\n", Vec_IntSize(vCover), iVar1, iVar2 );
+        }
+    }
+    Vec_IntFree( vCover );
 }
+
 /**Function*************************************************************
 
-  Synopsis    []
+  Synopsis    [Derive clauses given variable assignment.]
 
   Description []
                
@@ -325,68 +521,225 @@
   SeeAlso     []
 
 ***********************************************************************/
-void If_ManSatPrintPerm( char * pPerms, int nVars )
-{
-    int i;
-    for ( i = 0; i < nVars; i++ )
-        printf( "%c", 'a' + pPerms[i] );
-    printf( "\n" );
-}
-int If_ManSatCheckOne( sat_solver * pSat, Vec_Int_t * vPoVars, word * pTruth, int nVars, int * pPerm, int nVarsAll, Vec_Int_t * vLits )
+int Ift_NtkAddClauses( Ift_Ntk_t * p, int * pValues, sat_solver * pSat )
 {
-    int v, Value, m, mNew, nMints = (1 << nVars);
-    assert( (1 << nVarsAll) == Vec_IntSize(vPoVars) );
-    assert( nMints <= Vec_IntSize(vPoVars) );
-    // remap minterms
-    Vec_IntFill( vLits, Vec_IntSize(vPoVars), -1 );
-    for ( m = 0; m < nMints; m++ )
+    int i, f, v, nLits, pLits[IFN_INS+2], pLits2[IFN_INS+2];
+    // assign new variables
+    int nSatVars = sat_solver_nvars(pSat);
+    for ( i = 0; i < p->nObjs-1; i++ )
+        p->Nodes[i].Var = nSatVars++;
+    p->Nodes[p->nObjs-1].Var = -ABC_INFINITY;
+    sat_solver_setnvars( pSat, nSatVars );
+    // verify variable values
+    for ( i = 0; i < p->nVars; i++ )
+        assert( pValues[i] != -1 );
+    for ( i = p->nVars; i < p->nObjs-1; i++ )
+        assert( pValues[i] == -1 );
+    assert( pValues[p->nObjs-1] != -1 );
+    // internal variables
+//printf( "\n" );
+    for ( i = 0; i < p->nInps; i++ )
     {
-        mNew = 0;
-        for ( v = 0; v < nVarsAll; v++ )
+        int iParStart = p->nParsVIni + i * p->nParsVNum;
+        for ( v = 0; v < p->nVars; v++ )
         {
-            assert( pPerm[v] < nVars );
-            if ( ((m >> pPerm[v]) & 1) )
-                mNew |= (1 << v);
+            // add output literal
+            pLits[0] = Abc_Var2Lit( p->Nodes[i].Var, pValues[v]==0 );
+            // add clause literals
+            for ( f = 0; f < p->nParsVNum; f++ )
+                pLits[f+1] = Abc_Var2Lit( iParStart + f, (v >> f) & 1 ); 
+            Ift_AddClause( pSat, pLits, pLits+p->nParsVNum+1 );
         }
-        assert( Vec_IntEntry(vLits, mNew) == -1 );
-        Vec_IntWriteEntry( vLits, mNew, Abc_TtGetBit(pTruth, m) );
     }
-    // find assumptions
-    v = 0;
-    Vec_IntForEachEntry( vLits, Value, m )
-        if ( Value >= 0 )
-            Vec_IntWriteEntry( vLits, v++, Abc_Var2Lit(Vec_IntEntry(vPoVars, m), !Value) );
-    Vec_IntShrink( vLits, v );
-    // run SAT solver
-    Value = sat_solver_solve( pSat, Vec_IntArray(vLits), Vec_IntArray(vLits) + Vec_IntSize(vLits), 0, 0, 0, 0 );
-    return (int)(Value == l_True);
+//printf( "\n" );
+    for ( i = p->nInps; i < p->nObjs; i++ )
+    {
+        int nFans = p->Nodes[i].nFanins;
+        int * pFans = p->Nodes[i].Fanins;
+        if ( p->Nodes[i].Type == IF_DSD_AND )
+        {
+            nLits = 0;
+            pLits[nLits++] = Abc_Var2Lit( p->Nodes[i].Var, 0 );
+            for ( f = 0; f < nFans; f++ )
+            {
+                pLits[nLits++] = Abc_Var2Lit( p->Nodes[pFans[f]].Var, 1 );
+                // add small clause
+                pLits2[0] = Abc_Var2Lit( p->Nodes[i].Var, 1 );
+                pLits2[1] = Abc_Var2Lit( p->Nodes[pFans[f]].Var, 0 );
+                Ift_AddClause( pSat, pLits2, pLits2 + 2 );
+            }
+            // add big clause
+            Ift_AddClause( pSat, pLits, pLits + nLits );
+        }
+        else if ( p->Nodes[i].Type == IF_DSD_XOR )
+        {
+            assert( 0 );
+        }
+        else if ( p->Nodes[i].Type == IF_DSD_MUX )
+        {
+            assert( 0 );
+        }
+        else if ( p->Nodes[i].Type == IF_DSD_PRIME )
+        {
+            int nValues = (1 << nFans);
+            int iParStart = p->Nodes[i].iFirst;
+            for ( v = 0; v < nValues; v++ )
+            {
+                nLits = 0;
+                if ( pValues[i] == -1 )
+                {
+                    pLits[nLits]  = Abc_Var2Lit( p->Nodes[i].Var, 0 );
+                    pLits2[nLits] = Abc_Var2Lit( p->Nodes[i].Var, 1 );
+                    nLits++;
+                }
+                for ( f = 0; f < nFans; f++, nLits++ )
+                    pLits[nLits] = pLits2[nLits] = Abc_Var2Lit( p->Nodes[pFans[f]].Var, (v >> f) & 1 ); 
+                pLits[nLits]  = Abc_Var2Lit( iParStart + v, 1 ); 
+                pLits2[nLits] = Abc_Var2Lit( iParStart + v, 0 ); 
+                nLits++;
+                if ( pValues[i] != 0 )
+                    Ift_AddClause( pSat, pLits2, pLits2 + nLits );
+                if ( pValues[i] != 1 )
+                    Ift_AddClause( pSat, pLits,  pLits + nLits );
+            }
+        }
+        else assert( 0 );
+//printf( "\n" );
+    }
+    return 1;
 }
-void If_ManSatDeriveOne( sat_solver * pSat, Vec_Int_t * vPiVars, Vec_Int_t * vValues )
+
+/**Function*************************************************************
+
+  Synopsis    [Returns the minterm number for which there is a mismatch.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Ift_SatPrintStatus( sat_solver * p, int Iter, int status, int iMint, int Value, abctime clk )
 {
-    int i, iVar;
-    Vec_IntClear( vValues );
-    Vec_IntForEachEntry( vPiVars, iVar, i )
-        Vec_IntPush( vValues, sat_solver_var_value(pSat, iVar) );
+    printf( "Iter = %5d  ",  Iter );
+    printf( "Mint = %5d  ",  iMint );
+    printf( "Value = %2d  ", Value );
+    printf( "Var = %6d  ",   sat_solver_nvars(p) );
+    printf( "Cla = %6d  ",   sat_solver_nclauses(p) );
+    printf( "Conf = %6d  ",  sat_solver_nconflicts(p) );
+    if ( status == l_False )
+        printf( "status = unsat" );
+    else if ( status == l_True )
+        printf( "status = sat  " );
+    else 
+        printf( "status = undec" );
+    Abc_PrintTime( 1, "", clk );
 }
-int If_ManSatCheckAll_int( sat_solver * pSat, Vec_Int_t * vPoVars, word * pTruth, int nVars, Vec_Int_t * vLits, char ** pPerms, int nPerms )
+void Ift_SatPrintConfig( Ift_Ntk_t * p, sat_solver * pSat )
 {
-    int pPerm[IF_MAX_FUNC_LUTSIZE];
-    int p, i;
-    for ( p = 0; p < nPerms; p++ )
+    int v;
+    for ( v = p->nObjs; v < p->nPars; v++ )
     {
-        for ( i = 0; i < nVars; i++ )
-            pPerm[i] = (int)pPerms[p][i];
-        if ( If_ManSatCheckOne(pSat, vPoVars, pTruth, nVars, pPerm, nVars, vLits) )
-            return p;
+        if ( v >= p->nParsVIni && (v - p->nParsVIni) % p->nParsVNum == 0 )
+            printf( " %d=", (v - p->nParsVIni) / p->nParsVNum );
+        printf( "%d", sat_solver_var_value(pSat, v) );
     }
-    return -1;
+    printf( "\n" );
 }
-int If_ManSatCheckAll( sat_solver * pSat, Vec_Int_t * vPoVars, word * pTruth, int nVars, Vec_Int_t * vLits, char ** pPerms, int nPerms )
+
+int Ift_NtkMatch( Ift_Ntk_t * p, word * pTruth, int nVars, int fVerbose )
 {
+    word * pTruth1;
+    int RetValue = 0;
+    int nIterMax = (1<<nVars);
+    int i, v, status, iMint = 0;
     abctime clk = Abc_Clock();
-    int RetValue = If_ManSatCheckAll_int( pSat, vPoVars, pTruth, nVars, vLits, pPerms, nPerms );
-    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
+//    abctime clkTru = 0, clkSat = 0, clk2;
+    sat_solver * pSat = sat_solver_new();
+    Ifn_Prepare( p, pTruth, nVars );
+    sat_solver_setnvars( pSat, p->nPars );
+    Ift_NtkAddConstraints( p, pSat );
+    if ( fVerbose )
+        Ift_SatPrintStatus( pSat, 0, l_True, -1, -1, Abc_Clock() - clk );
+    for ( i = 0; i < nIterMax; i++ )
+    {
+        // get variable assignment
+        for ( v = 0; v < p->nObjs; v++ )
+            p->Values[v] = v < p->nVars ? (iMint >> v) & 1 :  -1;
+        p->Values[p->nObjs-1] = Abc_TtGetBit( pTruth, iMint );
+        // derive clauses
+        if ( !Ift_NtkAddClauses( p, p->Values, pSat ) )
+            break;
+        // find assignment of parameters
+//        clk2 = Abc_Clock();
+        status = sat_solver_solve( pSat, NULL, NULL, 0, 0, 0, 0 );
+//        clkSat += Abc_Clock() - clk2;
+        if ( fVerbose )
+            Ift_SatPrintStatus( pSat, i+1, status, iMint, p->Values[p->nObjs-1], Abc_Clock() - clk );
+        if ( status == l_False )
+            break;
+        assert( status == l_True );
+        // collect assignment
+        for ( v = p->nObjs; v < p->nPars; v++ )
+            p->Values[v] = sat_solver_var_value(pSat, v);
+        // find truth table
+//        clk2 = Abc_Clock();
+        pTruth1 = Ift_NtkDeriveTruth( p, p->Values );
+//        clkTru += Abc_Clock() - clk2;
+        Abc_TtXor( pTruth1, pTruth1, p->pTruth, p->nWords, 0 );
+        // find mismatch if present
+        iMint = Abc_TtFindFirstBit( pTruth1, p->nVars );
+        if ( iMint == -1 )
+        {
+            Ift_SatPrintConfig( p, pSat );
+            RetValue = 1;
+            break;
+        }
+    }
+    assert( i < nIterMax );
+    sat_solver_delete( pSat );
+    printf( "Matching = %d  Iters = %d. ", RetValue, i );
+//    Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
+//    Abc_PrintTime( 1, "Sat", clkSat );
+//    Abc_PrintTime( 1, "Tru", clkTru );
     return RetValue;
+}
+
+/**Function*************************************************************
+
+  Synopsis    []
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+void Ifn_NtkRead()
+{
+    int RetValue;
+    int nVars = 9;
+//    int nVars = 8;
+//    int nVars = 3;
+//    word * pTruth = Dau_DsdToTruth( "(abcdefghi)", nVars );
+    word * pTruth = Dau_DsdToTruth( "1008{(1008{(ab)cde}f)ghi}", nVars );
+//    word * pTruth = Dau_DsdToTruth( "18{(1008{(ab)cde}f)gh}", nVars );
+//    word * pTruth = Dau_DsdToTruth( "1008{(1008{[ab]cde}f)ghi}", nVars );
+//    word * pTruth = Dau_DsdToTruth( "(abcd)", nVars );
+//    word * pTruth = Dau_DsdToTruth( "(abc)", nVars );
+//    char * pStr = "e={abc};f={ed};";
+//    char * pStr = "d={ab};e={cd};";
+    char * pStr = "j=(ab);k={jcde};l=(kf);m={lghi};";
+//    char * pStr = "i={abc};j={ide};k={ifg};l={jkh};";
+//    char * pStr = "h={abcde};i={abcdf};j=<ghi>;";
+//    char * pStr = "g=<abc>;h=<ade>;i={fgh};";
+    Ift_Ntk_t * p = Ifn_ManStrParse( pStr );
+    Ifn_NtkPrint( p );
+    Dau_DsdPrintFromTruth( pTruth, nVars );
+    // get the given function
+    RetValue = Ift_NtkMatch( p, pTruth, nVars, 1 );
 }
 
 ////////////////////////////////////////////////////////////////////////
diff --git a/abc-build/src/map/if/module.make b/abc-build/src/map/if/module.make
--- a/abc-build/src/map/if/module.make
+++ b/abc-build/src/map/if/module.make
@@ -2,6 +2,7 @@
 	src/map/if/ifCache.c \
 	src/map/if/ifCore.c \
 	src/map/if/ifCut.c \
+	src/map/if/ifData2.c \
 	src/map/if/ifDec07.c \
 	src/map/if/ifDec08.c \
 	src/map/if/ifDec10.c \
@@ -13,6 +14,7 @@
 	src/map/if/ifLibLut.c \
 	src/map/if/ifMan.c \
 	src/map/if/ifMap.c \
+	src/map/if/ifMatch2.c \
 	src/map/if/ifReduce.c \
 	src/map/if/ifSat.c \
 	src/map/if/ifSelect.c \
diff --git a/abc-build/src/map/scl/sclUtil.c b/abc-build/src/map/scl/sclUtil.c
--- a/abc-build/src/map/scl/sclUtil.c
+++ b/abc-build/src/map/scl/sclUtil.c
@@ -218,6 +218,8 @@
     while ( fgets( Buffer, 1000, pFile ) )
     {
         pToken = strtok( Buffer, " \t\r\n" );
+        if ( pToken == NULL )
+            continue;
         if ( !strcmp(pToken, "set_driving_cell") )
         {
             Abc_FrameSetDrivingCell( Abc_UtilStrsav(strtok(NULL, " \t\r\n")) );
diff --git a/abc-build/src/misc/tim/timMan.c b/abc-build/src/misc/tim/timMan.c
--- a/abc-build/src/misc/tim/timMan.c
+++ b/abc-build/src/misc/tim/timMan.c
@@ -128,7 +128,10 @@
             pDelayTableNew[1] = (int)pDelayTable[1];
             pDelayTableNew[2] = (int)pDelayTable[2];
             for ( k = 0; k < nInputs * nOutputs; k++ )
-                pDelayTableNew[3+k] = fUnitDelay ? 1.0 : pDelayTable[3+k];
+				if ( pDelayTable[3+k] == -ABC_INFINITY )
+					pDelayTableNew[3+k] = -ABC_INFINITY;
+				else
+					pDelayTableNew[3+k] = fUnitDelay ? (float)fUnitDelay : pDelayTable[3+k];
 //            assert( (int)pDelayTableNew[0] == Vec_PtrSize(pNew->vDelayTables) );
             assert( Vec_PtrEntry(pNew->vDelayTables, i) == NULL );
             Vec_PtrWriteEntry( pNew->vDelayTables, i, pDelayTableNew );
diff --git a/abc-build/src/misc/tim/timTime.c b/abc-build/src/misc/tim/timTime.c
--- a/abc-build/src/misc/tim/timTime.c
+++ b/abc-build/src/misc/tim/timTime.c
@@ -154,7 +154,7 @@
 void Tim_ManSetCoRequired( Tim_Man_t * p, int iCo, float Delay )
 {
     assert( iCo < p->nCos );
-    assert( !p->fUseTravId || p->pCos[iCo].TravId != p->nTravIds );
+    assert( !p->fUseTravId || !p->nTravIds || p->pCos[iCo].TravId != p->nTravIds );
     p->pCos[iCo].timeReq = Delay;
     p->pCos[iCo].TravId = p->nTravIds;
 }
@@ -200,7 +200,8 @@
         pDelays = pTable + 3 + i * pBox->nInputs;
         DelayBest = -TIM_ETERNITY;
         Tim_ManBoxForEachInput( p, pBox, pObj, k )
-            DelayBest = Abc_MaxInt( DelayBest, pObj->timeArr + pDelays[k] );
+			if ( pDelays[k] != -ABC_INFINITY )
+				DelayBest = Abc_MaxInt( DelayBest, pObj->timeArr + pDelays[k] );
         pObjRes->timeArr = DelayBest;
         pObjRes->TravId = p->nTravIds;
     }
@@ -248,7 +249,8 @@
         Tim_ManBoxForEachOutput( p, pBox, pObj, k )
         {
             pDelays = pTable + 3 + k * pBox->nInputs;
-            DelayBest = Abc_MinFloat( DelayBest, pObj->timeReq - pDelays[i] );
+			if ( pDelays[k] != -ABC_INFINITY )
+				DelayBest = Abc_MinFloat( DelayBest, pObj->timeReq - pDelays[i] );
         }
         pObjRes->timeReq = DelayBest;
         pObjRes->TravId = p->nTravIds;
diff --git a/abc-build/src/misc/util/utilTruth.h b/abc-build/src/misc/util/utilTruth.h
--- a/abc-build/src/misc/util/utilTruth.h
+++ b/abc-build/src/misc/util/utilTruth.h
@@ -53,6 +53,15 @@
     ABC_CONST(0x00000000FFFFFFFF)
 };
 
+static word s_TruthXors[6] = {
+    ABC_CONST(0x0000000000000000),
+    ABC_CONST(0x6666666666666666),
+    ABC_CONST(0x6969696969696969),
+    ABC_CONST(0x6996699669966996),
+    ABC_CONST(0x6996966969969669),
+    ABC_CONST(0x6996966996696996)
+};
+
 static word s_PMasks[5][3] = {
     { ABC_CONST(0x9999999999999999), ABC_CONST(0x2222222222222222), ABC_CONST(0x4444444444444444) },
     { ABC_CONST(0xC3C3C3C3C3C3C3C3), ABC_CONST(0x0C0C0C0C0C0C0C0C), ABC_CONST(0x3030303030303030) },
@@ -163,6 +172,19 @@
 
 /**Function*************************************************************
 
+  Synopsis    [Bit mask.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline word Abc_Tt6Mask( int nBits )       { assert( nBits >= 0 && nBits <= 64 ); return (~(word)0) >> (64-nBits);        }
+
+/**Function*************************************************************
+
   Synopsis    []
 
   Description []
@@ -319,6 +341,20 @@
             for ( k = 0; k < nWords; k++ )
                 pTtElems[i][k] = (k & (1 << (i-6))) ? ~(word)0 : 0;
 }
+static inline void Abc_TtElemInit2( word * pTtElems, int nVars )
+{
+    int i, k, nWords = Abc_TtWordNum( nVars );
+    for ( i = 0; i < nVars; i++ )
+    {
+        word * pTruth = pTtElems + i * nWords;
+        if ( i < 6 )
+            for ( k = 0; k < nWords; k++ )
+                pTruth[k] = s_Truths6[i];
+        else
+            for ( k = 0; k < nWords; k++ )
+                pTruth[k] = (k & (1 << (i-6))) ? ~(word)0 : 0;
+    }
+}
 
 /**Function*************************************************************
 
@@ -710,6 +746,13 @@
         return '0' + Digit;
     return 'A' + Digit-10;
 }
+static inline char Abc_TtPrintDigitLower( int Digit )
+{
+    assert( Digit >= 0 && Digit < 16 );
+    if ( Digit < 10 )
+        return '0' + Digit;
+    return 'a' + Digit-10;
+}
 static inline int Abc_TtReadHexDigit( char HexChar )
 {
     if ( HexChar >= '0' && HexChar <= '9' )
@@ -774,6 +817,12 @@
             *pStr++ = Abc_TtPrintDigit( (int)(pThis[0] >> (k << 2)) & 15 );
     return pStr - pStrInit;
 }
+static inline void Abc_TtPrintHexArrayRev( FILE * pFile, word * pTruth, int nDigits )
+{
+	int k;
+	for ( k = nDigits - 1; k >= 0; k-- )
+        fprintf( pFile, "%c", Abc_TtPrintDigitLower( Abc_TtGetHex(pTruth, k) ) );
+}
 
 /**Function*************************************************************
 
@@ -826,6 +875,22 @@
         pTruth[0] = Abc_Tt6Stretch( pTruth[0], nVars );
     return nVars;
 }
+static inline int Abc_TtReadHexNumber( word * pTruth, char * pString )
+{
+    // count the number of hex digits
+    int k, Digit, nDigits = 0;
+    for ( k = 0; Abc_TtIsHexDigit(pString[k]); k++ )
+        nDigits++;
+    // read hexadecimal digits in the reverse order
+    // (the last symbol in the string is the least significant digit)
+    for ( k = 0; k < nDigits; k++ )
+    {
+        Digit = Abc_TtReadHexDigit( pString[nDigits - 1 - k] );
+        assert( Digit >= 0 && Digit < 16 );
+        Abc_TtSetHex( pTruth, k, Digit );
+    }
+	return nDigits;
+}
 
 
 /**Function*************************************************************
@@ -949,6 +1014,37 @@
 
 /**Function*************************************************************
 
+  Synopsis    [Detecting elementary functions.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Abc_TtOnlyOneOne( word t )
+{
+    if ( t == 0 )
+        return 0;
+    return (t & (t-1)) == 0;
+}
+static inline int Gia_ManTtIsAndType( word t, int nVars )
+{
+    return Abc_TtOnlyOneOne( t & Abc_Tt6Mask(1 << nVars) );
+}
+static inline int Gia_ManTtIsOrType( word t, int nVars )
+{
+    return Abc_TtOnlyOneOne( ~t & Abc_Tt6Mask(1 << nVars) );
+}
+static inline int Gia_ManTtIsXorType( word t, int nVars )
+{
+    return ((((t & 1) ? ~t : t) ^ s_TruthXors[nVars]) & Abc_Tt6Mask(1 << nVars)) == 0;
+}
+
+
+/**Function*************************************************************
+
   Synopsis    []
 
   Description []
@@ -1725,6 +1821,93 @@
     return nCubes;
 }
 
+
+/**Function*************************************************************
+
+  Synopsis    [Computes ISOP for 6 variables or less.]
+
+  Description []
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+static inline int Abc_Tt6Esop( word t, int nVars, int * pCover )
+{
+    word c0, c1;
+    int Var, r0, r1, r2, Max, i;
+    assert( nVars <= 6 );
+    if ( t == 0 )
+        return 0;
+    if ( t == ~(word)0 )
+    {
+        if ( pCover ) *pCover = 0;
+        return 1;
+    }
+    assert( nVars > 0 );
+    // find the topmost var
+    for ( Var = nVars-1; Var >= 0; Var-- )
+        if ( Abc_Tt6HasVar( t, Var ) )
+             break;
+    assert( Var >= 0 );
+    // cofactor
+    c0 = Abc_Tt6Cofactor0( t, Var );
+    c1 = Abc_Tt6Cofactor1( t, Var );
+    // call recursively
+    r0 = Abc_Tt6Esop( c0,      Var, pCover ? pCover : NULL );
+    r1 = Abc_Tt6Esop( c1,      Var, pCover ? pCover + r0 : NULL );
+    r2 = Abc_Tt6Esop( c0 ^ c1, Var, pCover ? pCover + r0 + r1 : NULL );
+    Max = Abc_MaxInt( r0, Abc_MaxInt(r1, r2) );
+    // add literals
+    if ( pCover )
+    {
+        if ( Max == r0 )
+        {
+            for ( i = 0; i < r1; i++ )
+                pCover[i] = pCover[r0+i];
+            for ( i = 0; i < r2; i++ )
+                pCover[r1+i] = pCover[r0+r1+i] | (1 << (2*Var+0));
+        }
+        else if ( Max == r1 )
+        {
+            for ( i = 0; i < r2; i++ )
+                pCover[r0+i] = pCover[r0+r1+i] | (1 << (2*Var+1));
+        }
+        else
+        {
+            for ( i = 0; i < r0; i++ )
+                pCover[i] |= (1 << (2*Var+0));
+            for ( i = 0; i < r1; i++ )
+                pCover[r0+i] |= (1 << (2*Var+1));
+        }
+    }
+    return r0 + r1 + r2 - Max;
+}
+static inline word Abc_Tt6EsopBuild( int nVars, int * pCover, int nCubes )
+{
+    word p, t = 0; int c, v;
+    for ( c = 0; c < nCubes; c++ )
+    {
+        p = ~(word)0;
+        for ( v = 0; v < nVars; v++ )
+            if ( ((pCover[c] >> (v << 1)) & 3) == 1 )
+                p &= ~s_Truths6[v];
+            else if ( ((pCover[c] >> (v << 1)) & 3) == 2 )
+                p &= s_Truths6[v];
+        t ^= p;
+    }
+    return t;
+}
+static inline int Abc_Tt6EsopVerify( word t, int nVars )
+{
+    int pCover[64];
+    int nCubes = Abc_Tt6Esop( t, nVars, pCover );
+    word t2 = Abc_Tt6EsopBuild( nVars, pCover, nCubes );
+    if ( t != t2 )
+        printf( "Verification failed.\n" );
+    return nCubes;
+}
 
 /**Function*************************************************************
 
diff --git a/abc-build/src/misc/vec/vecWrd.h b/abc-build/src/misc/vec/vecWrd.h
--- a/abc-build/src/misc/vec/vecWrd.h
+++ b/abc-build/src/misc/vec/vecWrd.h
@@ -1083,6 +1083,17 @@
         if ( p->pArray[i] != p->pArray[i-1] )
             p->pArray[k++] = p->pArray[i];
     p->nSize = k;
+}
+static inline int Vec_WrdUniqueCount( Vec_Wrd_t * vData, int nWordSize, Vec_Int_t ** pvMap )
+{
+    int Result;
+    Vec_Int_t * vDataInt = (Vec_Int_t *)vData;
+    vDataInt->nSize *= 2;
+    vDataInt->nCap *= 2;
+    Result = Vec_IntUniqueCount( vDataInt, 2 * nWordSize, pvMap );
+    vDataInt->nSize /= 2;
+    vDataInt->nCap /= 2;
+    return Result;
 }
 static inline Vec_Wrd_t * Vec_WrdUniqifyHash( Vec_Wrd_t * vData, int nWordSize )
 {
diff --git a/abc-build/src/opt/dar/darBalance.c b/abc-build/src/opt/dar/darBalance.c
--- a/abc-build/src/opt/dar/darBalance.c
+++ b/abc-build/src/opt/dar/darBalance.c
@@ -81,6 +81,8 @@
             i++;
     }
     Vec_PtrShrink( vNodes, k );
+    if ( Vec_PtrSize(vNodes) < 2 )
+        return;
     // check that there is no duplicates
     pTemp = (Aig_Obj_t *)Vec_PtrEntry( vNodes, 0 );
     Vec_PtrForEachEntryStart( Aig_Obj_t *, vNodes, pTempNext, i, 1 )
diff --git a/abc-build/src/opt/dar/darLib.c b/abc-build/src/opt/dar/darLib.c
--- a/abc-build/src/opt/dar/darLib.c
+++ b/abc-build/src/opt/dar/darLib.c
@@ -592,7 +592,9 @@
 ***********************************************************************/
 void Dar_LibStart()
 {
-//    abctime clk = Abc_Clock();
+//    abctime clk = Abc_Clock();
+    if ( s_DarLib != NULL )
+        return;
     assert( s_DarLib == NULL );
     s_DarLib = Dar_LibRead();
 //    printf( "The 4-input library started with %d nodes and %d subgraphs. ", s_DarLib->nObjs - 4, s_DarLib->nSubgrTotal );
diff --git a/abc-build/src/proof/cec/cec.h b/abc-build/src/proof/cec/cec.h
--- a/abc-build/src/proof/cec/cec.h
+++ b/abc-build/src/proof/cec/cec.h
@@ -106,7 +106,8 @@
 //    int              fFirstStop;    // stop on the first sat output
     int              fDualOut;      // miter with separate outputs
     int              fColorDiff;    // miter with separate outputs
-    int              fSatSweeping;  // enable SAT sweeping
+    int              fSatSweeping;  // enable SAT sweeping
+    int              fRunCSat;      // enable another solver
     int              fVeryVerbose;  // verbose stats
     int              fVerbose;      // verbose stats
     int              iOutFail;      // the failed output
diff --git a/abc-build/src/proof/cec/cecCore.c b/abc-build/src/proof/cec/cecCore.c
--- a/abc-build/src/proof/cec/cecCore.c
+++ b/abc-build/src/proof/cec/cecCore.c
@@ -425,8 +425,11 @@
             }
             break;
         }
-clk = Abc_Clock();
-        Cec_ManSatSolve( pPat, pSrm, pParsSat ); 
+clk = Abc_Clock();
+        if ( pPars->fRunCSat )
+            Cec_ManSatSolveCSat( pPat, pSrm, pParsSat ); 
+        else
+            Cec_ManSatSolve( pPat, pSrm, pParsSat ); 
 p->timeSat += Abc_Clock() - clk;
         if ( Cec_ManFraClassesUpdate( p, pSim, pPat, pSrm ) )
         {
diff --git a/abc-build/src/proof/cec/cecInt.h b/abc-build/src/proof/cec/cecInt.h
--- a/abc-build/src/proof/cec/cecInt.h
+++ b/abc-build/src/proof/cec/cecInt.h
@@ -189,7 +189,8 @@
 extern Cec_ManFra_t *       Cec_ManFraStart( Gia_Man_t * pAig, Cec_ParFra_t *  pPars );  
 extern void                 Cec_ManFraStop( Cec_ManFra_t * p );
 /*=== cecPat.c ============================================================*/
-extern void                 Cec_ManPatSavePattern( Cec_ManPat_t *  pPat, Cec_ManSat_t *  p, Gia_Obj_t * pObj );
+extern void                 Cec_ManPatSavePattern( Cec_ManPat_t *  pPat, Cec_ManSat_t *  p, Gia_Obj_t * pObj );
+extern void                 Cec_ManPatSavePatternCSat( Cec_ManPat_t * pMan, Vec_Int_t * vPat );
 extern Vec_Ptr_t *          Cec_ManPatCollectPatterns( Cec_ManPat_t *  pMan, int nInputs, int nWords );
 extern Vec_Ptr_t *          Cec_ManPatPackPatterns( Vec_Int_t * vCexStore, int nInputs, int nRegs, int nWordsInit );
 /*=== cecSeq.c ============================================================*/
@@ -200,7 +201,8 @@
 extern int                  Cec_ManCheckNonTrivialCands( Gia_Man_t * pAig );
 /*=== cecSolve.c ============================================================*/
 extern int                  Cec_ObjSatVarValue( Cec_ManSat_t * p, Gia_Obj_t * pObj );
-extern void                 Cec_ManSatSolve( Cec_ManPat_t * pPat, Gia_Man_t * pAig, Cec_ParSat_t * pPars );
+extern void                 Cec_ManSatSolve( Cec_ManPat_t * pPat, Gia_Man_t * pAig, Cec_ParSat_t * pPars );
+extern void                 Cec_ManSatSolveCSat( Cec_ManPat_t * pPat, Gia_Man_t * pAig, Cec_ParSat_t * pPars );
 extern Vec_Str_t *          Cec_ManSatSolveSeq( Vec_Ptr_t * vPatts, Gia_Man_t * pAig, Cec_ParSat_t * pPars, int nRegs, int * pnPats );
 extern Vec_Int_t *          Cec_ManSatSolveMiter( Gia_Man_t * pAig, Cec_ParSat_t * pPars, Vec_Str_t ** pvStatus );
 extern int                  Cec_ManSatCheckNode( Cec_ManSat_t * p, Gia_Obj_t * pObj );
diff --git a/abc-build/src/proof/cec/cecPat.c b/abc-build/src/proof/cec/cecPat.c
--- a/abc-build/src/proof/cec/cecPat.c
+++ b/abc-build/src/proof/cec/cecPat.c
@@ -360,20 +360,21 @@
 {
     Vec_Int_t * vPat;
     int nPatLits;
-    abctime clk, clkTotal = Abc_Clock();
+    abctime clkTotal = Abc_Clock();
+//    abctime clk;
     assert( Gia_ObjIsCo(pObj) );
     pMan->nPats++;
     pMan->nPatsAll++;
     // compute values in the cone of influence
-clk = Abc_Clock();
+//clk = Abc_Clock();
     Gia_ManIncrementTravId( p->pAig );
     nPatLits = Cec_ManPatComputePattern_rec( p, p->pAig, Gia_ObjFanin0(pObj) );
     assert( (Gia_ObjFanin0(pObj)->fMark1 ^ Gia_ObjFaninC0(pObj)) == 1 );
     pMan->nPatLits += nPatLits;
     pMan->nPatLitsAll += nPatLits;
-pMan->timeFind += Abc_Clock() - clk;
+//pMan->timeFind += Abc_Clock() - clk;
     // compute sensitizing path
-clk = Abc_Clock();
+//clk = Abc_Clock();
     Vec_IntClear( pMan->vPattern1 );
     Gia_ManIncrementTravId( p->pAig );
     Cec_ManPatComputePattern1_rec( p->pAig, Gia_ObjFanin0(pObj), pMan->vPattern1 );
@@ -385,19 +386,26 @@
     vPat = Vec_IntSize(pMan->vPattern1) < Vec_IntSize(pMan->vPattern2) ? pMan->vPattern1 : pMan->vPattern2;
     pMan->nPatLitsMin += Vec_IntSize(vPat);
     pMan->nPatLitsMinAll += Vec_IntSize(vPat);
-pMan->timeShrink += Abc_Clock() - clk;
+//pMan->timeShrink += Abc_Clock() - clk;
     // verify pattern using ternary simulation
-clk = Abc_Clock();
-    Cec_ManPatVerifyPattern( p->pAig, pObj, vPat );
-pMan->timeVerify += Abc_Clock() - clk;
+//clk = Abc_Clock();
+//    Cec_ManPatVerifyPattern( p->pAig, pObj, vPat );
+//pMan->timeVerify += Abc_Clock() - clk;
     // sort pattern
-clk = Abc_Clock();
+//clk = Abc_Clock();
     Vec_IntSort( vPat, 0 );
-pMan->timeSort += Abc_Clock() - clk;
+//pMan->timeSort += Abc_Clock() - clk;
     // save pattern
     Cec_ManPatStore( pMan, vPat );
     pMan->timeTotal += Abc_Clock() - clkTotal;
 }
+void Cec_ManPatSavePatternCSat( Cec_ManPat_t * pMan, Vec_Int_t * vPat )
+{
+    // sort pattern
+    Vec_IntSort( vPat, 0 );
+    // save pattern
+    Cec_ManPatStore( pMan, vPat );
+}
 
 /**Function*************************************************************
 
diff --git a/abc-build/src/proof/cec/cecSolve.c b/abc-build/src/proof/cec/cecSolve.c
--- a/abc-build/src/proof/cec/cecSolve.c
+++ b/abc-build/src/proof/cec/cecSolve.c
@@ -734,6 +734,75 @@
         Cec_ManSatPrintStats( p );
     Cec_ManSatStop( p );
 }
+
+/**Function*************************************************************
+
+  Synopsis    [Performs one round of solving for the POs of the AIG.]
+
+  Description [Labels the nodes that have been proved (pObj->fMark1) 
+  and returns the set of satisfying assignments.]
+               
+  SideEffects []
+
+  SeeAlso     []
+
+***********************************************************************/
+int Cec_ManSatSolveExractPattern( Vec_Int_t * vCexStore, int iStart, Vec_Int_t * vPat )
+{
+    int k, nSize;
+    Vec_IntClear( vPat );
+    // skip the output number
+    iStart++;
+    // get the number of items
+    nSize = Vec_IntEntry( vCexStore, iStart++ );
+    if ( nSize <= 0 )
+        return iStart;
+    // extract pattern
+    for ( k = 0; k < nSize; k++ )
+        Vec_IntPush( vPat, Vec_IntEntry( vCexStore, iStart++ ) );
+    return iStart;
+}
+void Cec_ManSatSolveCSat( Cec_ManPat_t * pPat, Gia_Man_t * pAig, Cec_ParSat_t * pPars )
+{
+    Vec_Str_t * vStatus;
+    Vec_Int_t * vPat = Vec_IntAlloc( 1000 );
+    Vec_Int_t * vCexStore = Cbs_ManSolveMiterNc( pAig, pPars->nBTLimit, &vStatus, 0 );
+    Gia_Obj_t * pObj;
+    int i, status, iStart = 0;
+    assert( Vec_StrSize(vStatus) == Gia_ManCoNum(pAig) );
+    // reset the manager
+    if ( pPat )
+    {
+        pPat->iStart = Vec_StrSize(pPat->vStorage);
+        pPat->nPats = 0;
+        pPat->nPatLits = 0;
+        pPat->nPatLitsMin = 0;
+    } 
+    Gia_ManForEachCo( pAig, pObj, i )
+    {
+        status = (int)Vec_StrEntry(vStatus, i);
+        pObj->fMark0 = (status == 0);
+        pObj->fMark1 = (status == 1);
+        if ( Vec_IntSize(vCexStore) > 0 && status != 1 )
+            iStart = Cec_ManSatSolveExractPattern( vCexStore, iStart, vPat );
+        if ( status != 0 )
+            continue;
+        // save the pattern
+        if ( pPat && Vec_IntSize(vPat) > 0 )
+        {
+            abctime clk3 = Abc_Clock();
+            Cec_ManPatSavePatternCSat( pPat, vPat );
+            pPat->timeTotalSave += Abc_Clock() - clk3;
+        }
+        // quit if one of them is solved
+        if ( pPars->fCheckMiter )
+            break;
+    }
+    assert( iStart == Vec_IntSize(vCexStore) );
+    Vec_IntFree( vPat );
+    Vec_StrFree( vStatus );
+    Vec_IntFree( vCexStore );
+}
 
 
 
diff --git a/abc-build/src/proof/cec/cecSweep.c b/abc-build/src/proof/cec/cecSweep.c
--- a/abc-build/src/proof/cec/cecSweep.c
+++ b/abc-build/src/proof/cec/cecSweep.c
@@ -84,8 +84,8 @@
         if ( Abc_LitRegular(iNode) == Abc_LitRegular(iRepr) )
             continue;
         if ( p->pPars->nLevelMax && 
-            (Gia_ObjLevel(p->pAig, pObj)  > p->pPars->nLevelMax || 
-             Gia_ObjLevel(p->pAig, pRepr) > p->pPars->nLevelMax) )
+            (Gia_ObjLevelId(p->pAig, i)  > p->pPars->nLevelMax || 
+             Gia_ObjLevelId(p->pAig, Abc_Lit2Var(iRepr)) > p->pPars->nLevelMax) )
             continue;
         if ( p->pPars->fDualOut )
         {
diff --git a/abc-build/src/sat/bmc/bmcBmcAnd.c b/abc-build/src/sat/bmc/bmcBmcAnd.c
--- a/abc-build/src/sat/bmc/bmcBmcAnd.c
+++ b/abc-build/src/sat/bmc/bmcBmcAnd.c
@@ -786,7 +786,7 @@
     if ( pPars->fUseSynth )
     {
         Gia_Man_t * pTemp = p->pFrames;
-        p->pFrames = Gia_ManAigSyn2( pTemp, 1, 0, 0, 0, pPars->fVerbose, 0 );
+        p->pFrames = Gia_ManAigSyn2( pTemp, 1, 0, 0, 0, 0, pPars->fVerbose, 0 );
         Gia_ManStop( pTemp );
     }
     else if ( pPars->fVerbose )
@@ -970,7 +970,7 @@
     }
     if ( pPars->fUseSynth )
     {
-        p->pFrames = Gia_ManAigSyn2( pTemp = p->pFrames, 1, 0, 0, 0, pPars->fVerbose, 0 );  Gia_ManStop( pTemp );
+        p->pFrames = Gia_ManAigSyn2( pTemp = p->pFrames, 1, 0, 0, 0, 0, pPars->fVerbose, 0 );  Gia_ManStop( pTemp );
     }
     else if ( pPars->fVerbose )
         Gia_ManPrintStats( p->pFrames, NULL );
@@ -985,6 +985,8 @@
     {
         p->pFrames = Jf_ManDeriveCnf( pTemp = p->pFrames, 1 );  Gia_ManStop( pTemp );
         p->pCnf = (Cnf_Dat_t *)p->pFrames->pData; p->pFrames->pData = NULL;
+//        extern Cnf_Dat_t * Mf_ManGenerateCnf( Gia_Man_t * pGia, int nLutSize, int fCnfObjIds, int fAddOrCla, int fVerbose );
+//        p->pCnf = Mf_ManGenerateCnf( p->pFrames, 6, 1, 0, 0 );
     }
     Vec_IntFillExtra( p->vId2Var, Gia_ManObjNum(p->pFrames), 0 );
     // create clauses for constant node
diff --git a/abc-build/src/sat/bmc/bmcMulti.c b/abc-build/src/sat/bmc/bmcMulti.c
--- a/abc-build/src/sat/bmc/bmcMulti.c
+++ b/abc-build/src/sat/bmc/bmcMulti.c
@@ -140,7 +140,7 @@
     Aig_Man_t * pAig;
     Gia_Man_t * pGia, * pTemp;
     pGia = Gia_ManFromAig( p );
-    pGia = Gia_ManAigSyn2( pTemp = pGia, 1, 0, 0, 0, 0, 0 );
+    pGia = Gia_ManAigSyn2( pTemp = pGia, 1, 0, 0, 0, 0, 0, 0 );
     Gia_ManStop( pTemp );
     pAig = Gia_ManToAig( pGia, 0 );
     Gia_ManStop( pGia );
diff --git a/abcBridge.cabal b/abcBridge.cabal
--- a/abcBridge.cabal
+++ b/abcBridge.cabal
@@ -1,5 +1,5 @@
 Name:               abcBridge
-Version:            0.10.0.0
+Version:            0.11
 Synopsis:           Bindings for ABC, A System for Sequential
                     Synthesis and Verification
 Description:        Bindings for ABC focused on creating And-Inverter
@@ -18,12 +18,11 @@
   include/*.h
   cbits/*.c
   scripts/*.sh
-  scripts/*.txt
   tests/eijk.S298.S.aig
 
 flag enable-pthreads
   Description: Turn on multithreading
-  Default: False
+  Default: True
 
 -- Ugh. Temporary fix to make Hackage happy.
 --flag enable-hpc
@@ -62,7 +61,7 @@
                         FlexibleContexts,
                         MultiParamTypeClasses,
                         EmptyDataDecls
-  Ghc-options:          -Wall
+  Ghc-options:          -Wall  -auto-all -caf-all -fno-ignore-asserts
   -- -U__BLOCKS__ to work around https://github.com/haskell/c2hs/issues/29
   Cc-options:           -U__BLOCKS__ -U__has_attribute -w
 
@@ -89,6 +88,7 @@
   Build-depends:
     base >= 4,
     aig,
+    containers,
     directory,
     vector
   Extra-libraries:      abc
@@ -132,12 +132,14 @@
     abcBridge,
     aig,
     directory,
-    HUnit,
-    QuickCheck >= 2.7,
-    test-framework,
-    test-framework-hunit,
-    test-framework-quickcheck2,
-    vector
+    vector,
+
+    tasty,
+    tasty-ant-xml,
+    tasty-hunit,
+    tasty-quickcheck,
+    QuickCheck >= 2.7
+
 
 Executable long-test
   hs-source-dirs: tests
diff --git a/cbits/abcbridge.c b/cbits/abcbridge.c
--- a/cbits/abcbridge.c
+++ b/cbits/abcbridge.c
@@ -70,6 +70,10 @@
     Abc_NtkDelete(*pp);
 }
 
+void AbcBridge_Gia_ClearGiaObj( Gia_Obj_t* pObj ) {
+  memset( pObj, 0, sizeof(Gia_Obj_t) );
+}
+
 void AbcBridge_Gia_MmFixedStop( Gia_MmFixed_t *p ) {
     Gia_MmFixedStop(p, 0);
 }
diff --git a/cbits/pthread_stubs.c b/cbits/pthread_stubs.c
--- a/cbits/pthread_stubs.c
+++ b/cbits/pthread_stubs.c
@@ -13,12 +13,33 @@
 
 #ifdef _WIN32
 #include "../abc-build/lib/pthread.h"
+
 #else
+
 #include <unistd.h>
 #include <pthread.h>
+
+/* Declare these symbols as weak on platforms that have weak symbols. */
+int __attribute__((weak))
+  pthread_create(pthread_t * thread, const pthread_attr_t* attr, void *(*start_routine)(void *), void* arg );
+
+void __attribute__((weak)) pthread_exit( void* value );
+int __attribute__((weak)) pthread_equal(pthread_t t1, pthread_t t2);
+int __attribute__((weak)) pthread_detach(pthread_t t);
+int __attribute__((weak)) pthread_join(pthread_t t, void** v);
+int __attribute__((weak)) pthread_cancel(pthread_t t);
+pthread_t __attribute__((weak)) pthread_self(void);
+
+int __attribute__((weak)) pthread_mutex_lock( pthread_mutex_t *m );
+int __attribute__((weak)) pthread_mutex_unlock( pthread_mutex_t *m );
+int __attribute__((weak)) pthread_mutex_trylock( pthread_mutex_t *m );
+int __attribute__((weak)) pthread_mutex_destroy( pthread_mutex_t *m );
+int __attribute__((weak)) pthread_mutex_init( pthread_mutex_t *m, const pthread_mutexattr_t *attr );
+int __attribute__((weak)) pthread_mutextattr_init( pthread_mutexattr_t *attr );
+int __attribute__((weak)) pthread_mutextattr_destroy( pthread_mutexattr_t *attr );
 #endif
 
-int pthread_create(pthread_t * thread, const pthread_attr_t* attr, void *(*start_routine)(void *), void* arg ) { 
+int pthread_create(pthread_t * thread, const pthread_attr_t* attr, void *(*start_routine)(void *), void* arg ) {
   fprintf(stderr,"ABC tried to use pthreads on a system not configured with a pthread library... sorry.");
   exit(1);
 }
diff --git a/include/abcbridge.h b/include/abcbridge.h
--- a/include/abcbridge.h
+++ b/include/abcbridge.h
@@ -27,3 +27,5 @@
 Aig_Obj_t * AbcBridge_Aig_ManCi( Aig_Man_t * p, int v );
 Aig_Obj_t * AbcBridge_Aig_ManCo( Aig_Man_t * p, int v );
 int AbcBridge_Aig_ObjId( Aig_Obj_t * pObj );
+
+void AbcBridge_Gia_ClearGiaObj( Gia_Obj_t* pObj );
diff --git a/scripts/abc-incl-dirs.txt b/scripts/abc-incl-dirs.txt
deleted file mode 100644
--- a/scripts/abc-incl-dirs.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-abc-build/src
-abc-build/src/aig
-abc-build/src/aig/aig
-abc-build/src/aig/gia
-abc-build/src/aig/hop
-abc-build/src/aig/ioa
-abc-build/src/aig/ivy
-abc-build/src/aig/miniaig
-abc-build/src/aig/saig
-abc-build/src/base
-abc-build/src/base/abc
-abc-build/src/base/abci
-abc-build/src/base/cmd
-abc-build/src/base/io
-abc-build/src/base/main
-abc-build/src/base/test
-abc-build/src/base/ver
-abc-build/src/bdd
-abc-build/src/bdd/cas
-abc-build/src/bdd/cudd
-abc-build/src/bdd/dsd
-abc-build/src/bdd/epd
-abc-build/src/bdd/mtr
-abc-build/src/bdd/parse
-abc-build/src/bdd/reo
-abc-build/src/bool
-abc-build/src/bool/bdc
-abc-build/src/bool/dec
-abc-build/src/bool/deco
-abc-build/src/bool/kit
-abc-build/src/bool/lucky
-abc-build/src/bool/rpo
-abc-build/src/bool/rsb
-abc-build/src/map
-abc-build/src/map/amap
-abc-build/src/map/cov
-abc-build/src/map/fpga
-abc-build/src/map/if
-abc-build/src/map/mapper
-abc-build/src/map/mio
-abc-build/src/map/mpm
-abc-build/src/map/scl
-abc-build/src/map/super
-abc-build/src/misc
-abc-build/src/misc/avl
-abc-build/src/misc/bar
-abc-build/src/misc/bbl
-abc-build/src/misc/bzlib
-abc-build/src/misc/espresso
-abc-build/src/misc/ext
-abc-build/src/misc/extra
-abc-build/src/misc/hash
-abc-build/src/misc/mem
-abc-build/src/misc/mvc
-abc-build/src/misc/nm
-abc-build/src/misc/st
-abc-build/src/misc/tim
-abc-build/src/misc/util
-abc-build/src/misc/vec
-abc-build/src/misc/zlib
-abc-build/src/opt
-abc-build/src/opt/cgt
-abc-build/src/opt/csw
-abc-build/src/opt/cut
-abc-build/src/opt/dar
-abc-build/src/opt/dau
-abc-build/src/opt/fsim
-abc-build/src/opt/fxu
-abc-build/src/opt/lpk
-abc-build/src/opt/mfs
-abc-build/src/opt/nwk
-abc-build/src/opt/res
-abc-build/src/opt/ret
-abc-build/src/opt/rwr
-abc-build/src/opt/rwt
-abc-build/src/opt/sfm
-abc-build/src/opt/sim
-abc-build/src/phys
-abc-build/src/phys/place
-abc-build/src/proof
-abc-build/src/proof/abs
-abc-build/src/proof/bbr
-abc-build/src/proof/cec
-abc-build/src/proof/dch
-abc-build/src/proof/fra
-abc-build/src/proof/fraig
-abc-build/src/proof/int
-abc-build/src/proof/int2
-abc-build/src/proof/live
-abc-build/src/proof/llb
-abc-build/src/proof/pdr
-abc-build/src/proof/ssc
-abc-build/src/proof/ssw
-abc-build/src/python
-abc-build/src/sat
-abc-build/src/sat/bmc
-abc-build/src/sat/bsat
-abc-build/src/sat/cnf
-abc-build/src/sat/csat
-abc-build/src/sat/lsat
-abc-build/src/sat/msat
-abc-build/src/sat/proof
-abc-build/src/sat/psat
diff --git a/scripts/abc-sources.txt b/scripts/abc-sources.txt
deleted file mode 100644
--- a/scripts/abc-sources.txt
+++ /dev/null
@@ -1,1436 +0,0 @@
-abc-build/.hg_archival.txt
-abc-build/.hgignore
-abc-build/abc.rc
-abc-build/abcexe.dsp
-abc-build/abclib.dsp
-abc-build/abcspace.dsw
-abc-build/arch_flags.c
-abc-build/copyright.txt
-abc-build/depends.sh
-abc-build/i10.aig
-abc-build/lib/pthread.h
-abc-build/lib/sched.h
-abc-build/lib/semaphore.h
-abc-build/lib/x64/pthreadVC2.dll
-abc-build/lib/x64/pthreadVC2.lib
-abc-build/lib/x86/pthreadVC2.dll
-abc-build/lib/x86/pthreadVC2.lib
-abc-build/Makefile
-abc-build/readme.md
-abc-build/readmeaig
-abc-build/scripts/abc.rc
-abc-build/scripts/abc_common.py
-abc-build/scripts/main.py
-abc-build/scripts/multi_prove.sh
-abc-build/scripts/new_abc_commands.py
-abc-build/scripts/niklas.py
-abc-build/scripts/par.py
-abc-build/scripts/simple.sh
-abc-build/scripts/simple_bip.sh
-abc-build/scripts/simple_liveness.sh
-abc-build/scripts/simple_sat.sh
-abc-build/scripts/super_prove.sh
-abc-build/src/aig/aig/aig.h
-abc-build/src/aig/aig/aig_.c
-abc-build/src/aig/aig/aigCanon.c
-abc-build/src/aig/aig/aigCheck.c
-abc-build/src/aig/aig/aigCuts.c
-abc-build/src/aig/aig/aigDfs.c
-abc-build/src/aig/aig/aigDoms.c
-abc-build/src/aig/aig/aigDup.c
-abc-build/src/aig/aig/aigFact.c
-abc-build/src/aig/aig/aigFanout.c
-abc-build/src/aig/aig/aigFrames.c
-abc-build/src/aig/aig/aigInter.c
-abc-build/src/aig/aig/aigJust.c
-abc-build/src/aig/aig/aigMan.c
-abc-build/src/aig/aig/aigMem.c
-abc-build/src/aig/aig/aigMffc.c
-abc-build/src/aig/aig/aigObj.c
-abc-build/src/aig/aig/aigOper.c
-abc-build/src/aig/aig/aigOrder.c
-abc-build/src/aig/aig/aigPack.c
-abc-build/src/aig/aig/aigPart.c
-abc-build/src/aig/aig/aigPartReg.c
-abc-build/src/aig/aig/aigPartSat.c
-abc-build/src/aig/aig/aigRepar.c
-abc-build/src/aig/aig/aigRepr.c
-abc-build/src/aig/aig/aigRet.c
-abc-build/src/aig/aig/aigRetF.c
-abc-build/src/aig/aig/aigScl.c
-abc-build/src/aig/aig/aigShow.c
-abc-build/src/aig/aig/aigSplit.c
-abc-build/src/aig/aig/aigTable.c
-abc-build/src/aig/aig/aigTest.c
-abc-build/src/aig/aig/aigTiming.c
-abc-build/src/aig/aig/aigTruth.c
-abc-build/src/aig/aig/aigTsim.c
-abc-build/src/aig/aig/aigUtil.c
-abc-build/src/aig/aig/aigWin.c
-abc-build/src/aig/aig/module.make
-abc-build/src/aig/gia/gia.c
-abc-build/src/aig/gia/gia.h
-abc-build/src/aig/gia/giaAgi.c
-abc-build/src/aig/gia/giaAig.c
-abc-build/src/aig/gia/giaAig.h
-abc-build/src/aig/gia/giaAiger.c
-abc-build/src/aig/gia/giaAigerExt.c
-abc-build/src/aig/gia/giaBalance.c
-abc-build/src/aig/gia/giaBalance2.c
-abc-build/src/aig/gia/giaBidec.c
-abc-build/src/aig/gia/giaCCof.c
-abc-build/src/aig/gia/giaCex.c
-abc-build/src/aig/gia/giaCof.c
-abc-build/src/aig/gia/giaCone.c
-abc-build/src/aig/gia/giaConstr.c
-abc-build/src/aig/gia/giaCSat.c
-abc-build/src/aig/gia/giaCSatOld.c
-abc-build/src/aig/gia/giaCTas.c
-abc-build/src/aig/gia/giaCTas2.c
-abc-build/src/aig/gia/giaDfs.c
-abc-build/src/aig/gia/giaDup.c
-abc-build/src/aig/gia/giaEmbed.c
-abc-build/src/aig/gia/giaEnable.c
-abc-build/src/aig/gia/giaEquiv.c
-abc-build/src/aig/gia/giaEra.c
-abc-build/src/aig/gia/giaEra2.c
-abc-build/src/aig/gia/giaFalse.c
-abc-build/src/aig/gia/giaFanout.c
-abc-build/src/aig/gia/giaForce.c
-abc-build/src/aig/gia/giaFrames.c
-abc-build/src/aig/gia/giaFront.c
-abc-build/src/aig/gia/giaFx.c
-abc-build/src/aig/gia/giaGiarf.c
-abc-build/src/aig/gia/giaGig.c
-abc-build/src/aig/gia/giaGlitch.c
-abc-build/src/aig/gia/giaHash.c
-abc-build/src/aig/gia/giaHcd.c
-abc-build/src/aig/gia/giaIf.c
-abc-build/src/aig/gia/giaIff.c
-abc-build/src/aig/gia/giaIso.c
-abc-build/src/aig/gia/giaIso2.c
-abc-build/src/aig/gia/giaIso3.c
-abc-build/src/aig/gia/giaJf.c
-abc-build/src/aig/gia/giaKf.c
-abc-build/src/aig/gia/giaLf.c
-abc-build/src/aig/gia/giaMan.c
-abc-build/src/aig/gia/giaMem.c
-abc-build/src/aig/gia/giaMf.c
-abc-build/src/aig/gia/giaMfs.c
-abc-build/src/aig/gia/giaMini.c
-abc-build/src/aig/gia/giaMuxes.c
-abc-build/src/aig/gia/giaNf.c
-abc-build/src/aig/gia/giaPat.c
-abc-build/src/aig/gia/giaProp.c
-abc-build/src/aig/gia/giaResub.c
-abc-build/src/aig/gia/giaRetime.c
-abc-build/src/aig/gia/giaSat.c
-abc-build/src/aig/gia/giaScl.c
-abc-build/src/aig/gia/giaShrink.c
-abc-build/src/aig/gia/giaShrink6.c
-abc-build/src/aig/gia/giaShrink7.c
-abc-build/src/aig/gia/giaSim.c
-abc-build/src/aig/gia/giaSim2.c
-abc-build/src/aig/gia/giaSopb.c
-abc-build/src/aig/gia/giaSort.c
-abc-build/src/aig/gia/giaSpeedup.c
-abc-build/src/aig/gia/giaStg.c
-abc-build/src/aig/gia/giaStr.c
-abc-build/src/aig/gia/giaSupMin.c
-abc-build/src/aig/gia/giaSweep.c
-abc-build/src/aig/gia/giaSweeper.c
-abc-build/src/aig/gia/giaSwitch.c
-abc-build/src/aig/gia/giaTim.c
-abc-build/src/aig/gia/giaTis.c
-abc-build/src/aig/gia/giaTruth.c
-abc-build/src/aig/gia/giaTsim.c
-abc-build/src/aig/gia/giaUtil.c
-abc-build/src/aig/gia/module.make
-abc-build/src/aig/hop/cudd2.c
-abc-build/src/aig/hop/cudd2.h
-abc-build/src/aig/hop/hop.h
-abc-build/src/aig/hop/hop_.c
-abc-build/src/aig/hop/hopBalance.c
-abc-build/src/aig/hop/hopCheck.c
-abc-build/src/aig/hop/hopDfs.c
-abc-build/src/aig/hop/hopMan.c
-abc-build/src/aig/hop/hopMem.c
-abc-build/src/aig/hop/hopObj.c
-abc-build/src/aig/hop/hopOper.c
-abc-build/src/aig/hop/hopTable.c
-abc-build/src/aig/hop/hopTruth.c
-abc-build/src/aig/hop/hopUtil.c
-abc-build/src/aig/hop/module.make
-abc-build/src/aig/ioa/ioa.h
-abc-build/src/aig/ioa/ioaReadAig.c
-abc-build/src/aig/ioa/ioaUtil.c
-abc-build/src/aig/ioa/ioaWriteAig.c
-abc-build/src/aig/ioa/module.make
-abc-build/src/aig/ivy/attr.h
-abc-build/src/aig/ivy/ivy.h
-abc-build/src/aig/ivy/ivy_.c
-abc-build/src/aig/ivy/ivyBalance.c
-abc-build/src/aig/ivy/ivyCanon.c
-abc-build/src/aig/ivy/ivyCheck.c
-abc-build/src/aig/ivy/ivyCut.c
-abc-build/src/aig/ivy/ivyCutTrav.c
-abc-build/src/aig/ivy/ivyDfs.c
-abc-build/src/aig/ivy/ivyDsd.c
-abc-build/src/aig/ivy/ivyFanout.c
-abc-build/src/aig/ivy/ivyFastMap.c
-abc-build/src/aig/ivy/ivyFraig.c
-abc-build/src/aig/ivy/ivyHaig.c
-abc-build/src/aig/ivy/ivyMan.c
-abc-build/src/aig/ivy/ivyMem.c
-abc-build/src/aig/ivy/ivyMulti.c
-abc-build/src/aig/ivy/ivyMulti8.c
-abc-build/src/aig/ivy/ivyObj.c
-abc-build/src/aig/ivy/ivyOper.c
-abc-build/src/aig/ivy/ivyResyn.c
-abc-build/src/aig/ivy/ivyRwr.c
-abc-build/src/aig/ivy/ivyRwrAlg.c
-abc-build/src/aig/ivy/ivySeq.c
-abc-build/src/aig/ivy/ivyShow.c
-abc-build/src/aig/ivy/ivyTable.c
-abc-build/src/aig/ivy/ivyUtil.c
-abc-build/src/aig/ivy/module.make
-abc-build/src/aig/miniaig/abcapis.h
-abc-build/src/aig/miniaig/miniaig.h
-abc-build/src/aig/miniaig/module.make
-abc-build/src/aig/saig/module.make
-abc-build/src/aig/saig/saig.h
-abc-build/src/aig/saig/saig_.c
-abc-build/src/aig/saig/saigCone.c
-abc-build/src/aig/saig/saigConstr.c
-abc-build/src/aig/saig/saigConstr2.c
-abc-build/src/aig/saig/saigDual.c
-abc-build/src/aig/saig/saigDup.c
-abc-build/src/aig/saig/saigGlaCba.c
-abc-build/src/aig/saig/saigGlaPba.c
-abc-build/src/aig/saig/saigGlaPba2.c
-abc-build/src/aig/saig/saigInd.c
-abc-build/src/aig/saig/saigIoa.c
-abc-build/src/aig/saig/saigIso.c
-abc-build/src/aig/saig/saigIsoFast.c
-abc-build/src/aig/saig/saigIsoSlow.c
-abc-build/src/aig/saig/saigMiter.c
-abc-build/src/aig/saig/saigOutDec.c
-abc-build/src/aig/saig/saigPhase.c
-abc-build/src/aig/saig/saigRefSat.c
-abc-build/src/aig/saig/saigRetFwd.c
-abc-build/src/aig/saig/saigRetMin.c
-abc-build/src/aig/saig/saigRetStep.c
-abc-build/src/aig/saig/saigScl.c
-abc-build/src/aig/saig/saigSimFast.c
-abc-build/src/aig/saig/saigSimMv.c
-abc-build/src/aig/saig/saigSimSeq.c
-abc-build/src/aig/saig/saigStrSim.c
-abc-build/src/aig/saig/saigSwitch.c
-abc-build/src/aig/saig/saigSynch.c
-abc-build/src/aig/saig/saigTempor.c
-abc-build/src/aig/saig/saigTrans.c
-abc-build/src/aig/saig/saigUnfold2.c
-abc-build/src/aig/saig/saigWnd.c
-abc-build/src/base/abc/abc.h
-abc-build/src/base/abc/abc_.c
-abc-build/src/base/abc/abcAig.c
-abc-build/src/base/abc/abcBarBuf.c
-abc-build/src/base/abc/abcBlifMv.c
-abc-build/src/base/abc/abcCheck.c
-abc-build/src/base/abc/abcDfs.c
-abc-build/src/base/abc/abcFanio.c
-abc-build/src/base/abc/abcFanOrder.c
-abc-build/src/base/abc/abcFunc.c
-abc-build/src/base/abc/abcHie.c
-abc-build/src/base/abc/abcHieCec.c
-abc-build/src/base/abc/abcHieNew.c
-abc-build/src/base/abc/abcInt.h
-abc-build/src/base/abc/abcLatch.c
-abc-build/src/base/abc/abcLib.c
-abc-build/src/base/abc/abcMinBase.c
-abc-build/src/base/abc/abcNames.c
-abc-build/src/base/abc/abcNetlist.c
-abc-build/src/base/abc/abcNtk.c
-abc-build/src/base/abc/abcObj.c
-abc-build/src/base/abc/abcRefs.c
-abc-build/src/base/abc/abcShow.c
-abc-build/src/base/abc/abcSop.c
-abc-build/src/base/abc/abcUtil.c
-abc-build/src/base/abc/module.make
-abc-build/src/base/abci/abc.c
-abc-build/src/base/abci/abcAttach.c
-abc-build/src/base/abci/abcAuto.c
-abc-build/src/base/abci/abcBalance.c
-abc-build/src/base/abci/abcBidec.c
-abc-build/src/base/abci/abcBm.c
-abc-build/src/base/abci/abcBmc.c
-abc-build/src/base/abci/abcCas.c
-abc-build/src/base/abci/abcCascade.c
-abc-build/src/base/abci/abcCollapse.c
-abc-build/src/base/abci/abcCut.c
-abc-build/src/base/abci/abcDar.c
-abc-build/src/base/abci/abcDarUnfold2.c
-abc-build/src/base/abci/abcDebug.c
-abc-build/src/base/abci/abcDec.c
-abc-build/src/base/abci/abcDress.c
-abc-build/src/base/abci/abcDress2.c
-abc-build/src/base/abci/abcDsd.c
-abc-build/src/base/abci/abcEspresso.c
-abc-build/src/base/abci/abcExtract.c
-abc-build/src/base/abci/abcFlop.c
-abc-build/src/base/abci/abcFpga.c
-abc-build/src/base/abci/abcFpgaFast.c
-abc-build/src/base/abci/abcFraig.c
-abc-build/src/base/abci/abcFx.c
-abc-build/src/base/abci/abcFxu.c
-abc-build/src/base/abci/abcGen.c
-abc-build/src/base/abci/abcHaig.c
-abc-build/src/base/abci/abcIf.c
-abc-build/src/base/abci/abcIfif.c
-abc-build/src/base/abci/abcIfMux.c
-abc-build/src/base/abci/abciUnfold2.c
-abc-build/src/base/abci/abcIvy.c
-abc-build/src/base/abci/abcLog.c
-abc-build/src/base/abci/abcLut.c
-abc-build/src/base/abci/abcLutmin.c
-abc-build/src/base/abci/abcMap.c
-abc-build/src/base/abci/abcMeasure.c
-abc-build/src/base/abci/abcMerge.c
-abc-build/src/base/abci/abcMffc.c
-abc-build/src/base/abci/abcMfs.c
-abc-build/src/base/abci/abcMini.c
-abc-build/src/base/abci/abcMiter.c
-abc-build/src/base/abci/abcMulti.c
-abc-build/src/base/abci/abcMv.c
-abc-build/src/base/abci/abcNpn.c
-abc-build/src/base/abci/abcNpnSave.c
-abc-build/src/base/abci/abcNtbdd.c
-abc-build/src/base/abci/abcOdc.c
-abc-build/src/base/abci/abcOrder.c
-abc-build/src/base/abci/abcPart.c
-abc-build/src/base/abci/abcPlace.c
-abc-build/src/base/abci/abcPrint.c
-abc-build/src/base/abci/abcProve.c
-abc-build/src/base/abci/abcQbf.c
-abc-build/src/base/abci/abcQuant.c
-abc-build/src/base/abci/abcReach.c
-abc-build/src/base/abci/abcRec3.c
-abc-build/src/base/abci/abcReconv.c
-abc-build/src/base/abci/abcRefactor.c
-abc-build/src/base/abci/abcRenode.c
-abc-build/src/base/abci/abcReorder.c
-abc-build/src/base/abci/abcRestruct.c
-abc-build/src/base/abci/abcResub.c
-abc-build/src/base/abci/abcRewrite.c
-abc-build/src/base/abci/abcRpo.c
-abc-build/src/base/abci/abcRr.c
-abc-build/src/base/abci/abcSat.c
-abc-build/src/base/abci/abcSaucy.c
-abc-build/src/base/abci/abcScorr.c
-abc-build/src/base/abci/abcSense.c
-abc-build/src/base/abci/abcSpeedup.c
-abc-build/src/base/abci/abcStrash.c
-abc-build/src/base/abci/abcSweep.c
-abc-build/src/base/abci/abcSymm.c
-abc-build/src/base/abci/abcTim.c
-abc-build/src/base/abci/abcTiming.c
-abc-build/src/base/abci/abcUnate.c
-abc-build/src/base/abci/abcUnreach.c
-abc-build/src/base/abci/abcVerify.c
-abc-build/src/base/abci/abcXsim.c
-abc-build/src/base/abci/fahout_cut.c
-abc-build/src/base/abci/module.make
-abc-build/src/base/cmd/cmd.c
-abc-build/src/base/cmd/cmd.h
-abc-build/src/base/cmd/cmdAlias.c
-abc-build/src/base/cmd/cmdApi.c
-abc-build/src/base/cmd/cmdFlag.c
-abc-build/src/base/cmd/cmdHist.c
-abc-build/src/base/cmd/cmdInt.h
-abc-build/src/base/cmd/cmdLoad.c
-abc-build/src/base/cmd/cmdPlugin.c
-abc-build/src/base/cmd/cmdStarter.c
-abc-build/src/base/cmd/cmdUtils.c
-abc-build/src/base/cmd/module.make
-abc-build/src/base/io/io.c
-abc-build/src/base/io/ioAbc.h
-abc-build/src/base/io/ioInt.h
-abc-build/src/base/io/ioReadAiger.c
-abc-build/src/base/io/ioReadBaf.c
-abc-build/src/base/io/ioReadBblif.c
-abc-build/src/base/io/ioReadBench.c
-abc-build/src/base/io/ioReadBlif.c
-abc-build/src/base/io/ioReadBlifAig.c
-abc-build/src/base/io/ioReadBlifMv.c
-abc-build/src/base/io/ioReadDsd.c
-abc-build/src/base/io/ioReadEdif.c
-abc-build/src/base/io/ioReadEqn.c
-abc-build/src/base/io/ioReadPla.c
-abc-build/src/base/io/ioReadVerilog.c
-abc-build/src/base/io/ioUtil.c
-abc-build/src/base/io/ioWriteAiger.c
-abc-build/src/base/io/ioWriteBaf.c
-abc-build/src/base/io/ioWriteBblif.c
-abc-build/src/base/io/ioWriteBench.c
-abc-build/src/base/io/ioWriteBlif.c
-abc-build/src/base/io/ioWriteBlifMv.c
-abc-build/src/base/io/ioWriteBook.c
-abc-build/src/base/io/ioWriteCnf.c
-abc-build/src/base/io/ioWriteDot.c
-abc-build/src/base/io/ioWriteEqn.c
-abc-build/src/base/io/ioWriteGml.c
-abc-build/src/base/io/ioWriteList.c
-abc-build/src/base/io/ioWritePla.c
-abc-build/src/base/io/ioWriteSmv.c
-abc-build/src/base/io/ioWriteVerilog.c
-abc-build/src/base/io/module.make
-abc-build/src/base/main/libSupport.c
-abc-build/src/base/main/main.c
-abc-build/src/base/main/main.h
-abc-build/src/base/main/mainFrame.c
-abc-build/src/base/main/mainInit.c
-abc-build/src/base/main/mainInt.h
-abc-build/src/base/main/mainLib.c
-abc-build/src/base/main/mainMC.c
-abc-build/src/base/main/mainUtils.c
-abc-build/src/base/main/module.make
-abc-build/src/base/test/module.make
-abc-build/src/base/test/test.c
-abc-build/src/base/ver/module.make
-abc-build/src/base/ver/ver.h
-abc-build/src/base/ver/ver_.c
-abc-build/src/base/ver/verCore.c
-abc-build/src/base/ver/verFormula.c
-abc-build/src/base/ver/verParse.c
-abc-build/src/base/ver/verStream.c
-abc-build/src/base/ver/verWords.c
-abc-build/src/bdd/cas/cas.h
-abc-build/src/bdd/cas/casCore.c
-abc-build/src/bdd/cas/casDec.c
-abc-build/src/bdd/cas/module.make
-abc-build/src/bdd/cudd/cuBdd.make
-abc-build/src/bdd/cudd/cudd.h
-abc-build/src/bdd/cudd/cudd.make
-abc-build/src/bdd/cudd/cuddAddAbs.c
-abc-build/src/bdd/cudd/cuddAddApply.c
-abc-build/src/bdd/cudd/cuddAddFind.c
-abc-build/src/bdd/cudd/cuddAddInv.c
-abc-build/src/bdd/cudd/cuddAddIte.c
-abc-build/src/bdd/cudd/cuddAddNeg.c
-abc-build/src/bdd/cudd/cuddAddWalsh.c
-abc-build/src/bdd/cudd/cuddAndAbs.c
-abc-build/src/bdd/cudd/cuddAnneal.c
-abc-build/src/bdd/cudd/cuddApa.c
-abc-build/src/bdd/cudd/cuddAPI.c
-abc-build/src/bdd/cudd/cuddApprox.c
-abc-build/src/bdd/cudd/cuddBddAbs.c
-abc-build/src/bdd/cudd/cuddBddCorr.c
-abc-build/src/bdd/cudd/cuddBddIte.c
-abc-build/src/bdd/cudd/cuddBridge.c
-abc-build/src/bdd/cudd/cuddCache.c
-abc-build/src/bdd/cudd/cuddCheck.c
-abc-build/src/bdd/cudd/cuddClip.c
-abc-build/src/bdd/cudd/cuddCof.c
-abc-build/src/bdd/cudd/cuddCompose.c
-abc-build/src/bdd/cudd/cuddDecomp.c
-abc-build/src/bdd/cudd/cuddEssent.c
-abc-build/src/bdd/cudd/cuddExact.c
-abc-build/src/bdd/cudd/cuddExport.c
-abc-build/src/bdd/cudd/cuddGenCof.c
-abc-build/src/bdd/cudd/cuddGenetic.c
-abc-build/src/bdd/cudd/cuddGroup.c
-abc-build/src/bdd/cudd/cuddHarwell.c
-abc-build/src/bdd/cudd/cuddInit.c
-abc-build/src/bdd/cudd/cuddInt.h
-abc-build/src/bdd/cudd/cuddInteract.c
-abc-build/src/bdd/cudd/cuddLCache.c
-abc-build/src/bdd/cudd/cuddLevelQ.c
-abc-build/src/bdd/cudd/cuddLinear.c
-abc-build/src/bdd/cudd/cuddLiteral.c
-abc-build/src/bdd/cudd/cuddMatMult.c
-abc-build/src/bdd/cudd/cuddPriority.c
-abc-build/src/bdd/cudd/cuddRead.c
-abc-build/src/bdd/cudd/cuddRef.c
-abc-build/src/bdd/cudd/cuddReorder.c
-abc-build/src/bdd/cudd/cuddSat.c
-abc-build/src/bdd/cudd/cuddSign.c
-abc-build/src/bdd/cudd/cuddSolve.c
-abc-build/src/bdd/cudd/cuddSplit.c
-abc-build/src/bdd/cudd/cuddSubsetHB.c
-abc-build/src/bdd/cudd/cuddSubsetSP.c
-abc-build/src/bdd/cudd/cuddSymmetry.c
-abc-build/src/bdd/cudd/cuddTable.c
-abc-build/src/bdd/cudd/cuddUtil.c
-abc-build/src/bdd/cudd/cuddWindow.c
-abc-build/src/bdd/cudd/cuddZddCount.c
-abc-build/src/bdd/cudd/cuddZddFuncs.c
-abc-build/src/bdd/cudd/cuddZddGroup.c
-abc-build/src/bdd/cudd/cuddZddIsop.c
-abc-build/src/bdd/cudd/cuddZddLin.c
-abc-build/src/bdd/cudd/cuddZddMisc.c
-abc-build/src/bdd/cudd/cuddZddPort.c
-abc-build/src/bdd/cudd/cuddZddReord.c
-abc-build/src/bdd/cudd/cuddZddSetop.c
-abc-build/src/bdd/cudd/cuddZddSymm.c
-abc-build/src/bdd/cudd/cuddZddUtil.c
-abc-build/src/bdd/cudd/license
-abc-build/src/bdd/cudd/Makefile
-abc-build/src/bdd/cudd/module.make
-abc-build/src/bdd/cudd/r7x8.1.mat
-abc-build/src/bdd/cudd/r7x8.1.out
-abc-build/src/bdd/cudd/testcudd.c
-abc-build/src/bdd/dsd/dsd.h
-abc-build/src/bdd/dsd/dsdApi.c
-abc-build/src/bdd/dsd/dsdCheck.c
-abc-build/src/bdd/dsd/dsdInt.h
-abc-build/src/bdd/dsd/dsdLocal.c
-abc-build/src/bdd/dsd/dsdMan.c
-abc-build/src/bdd/dsd/dsdProc.c
-abc-build/src/bdd/dsd/dsdTree.c
-abc-build/src/bdd/dsd/module.make
-abc-build/src/bdd/epd/epd.c
-abc-build/src/bdd/epd/epd.h
-abc-build/src/bdd/epd/module.make
-abc-build/src/bdd/mtr/module.make
-abc-build/src/bdd/mtr/mtr.h
-abc-build/src/bdd/mtr/mtrBasic.c
-abc-build/src/bdd/mtr/mtrGroup.c
-abc-build/src/bdd/mtr/mtrInt.h
-abc-build/src/bdd/parse/module.make
-abc-build/src/bdd/parse/parse.h
-abc-build/src/bdd/parse/parseCore.c
-abc-build/src/bdd/parse/parseEqn.c
-abc-build/src/bdd/parse/parseInt.h
-abc-build/src/bdd/parse/parseStack.c
-abc-build/src/bdd/reo/module.make
-abc-build/src/bdd/reo/reo.h
-abc-build/src/bdd/reo/reoApi.c
-abc-build/src/bdd/reo/reoCore.c
-abc-build/src/bdd/reo/reoProfile.c
-abc-build/src/bdd/reo/reoShuffle.c
-abc-build/src/bdd/reo/reoSift.c
-abc-build/src/bdd/reo/reoSwap.c
-abc-build/src/bdd/reo/reoTest.c
-abc-build/src/bdd/reo/reoTransfer.c
-abc-build/src/bdd/reo/reoUnits.c
-abc-build/src/bool/bdc/bdc.h
-abc-build/src/bool/bdc/bdc_.c
-abc-build/src/bool/bdc/bdcCore.c
-abc-build/src/bool/bdc/bdcDec.c
-abc-build/src/bool/bdc/bdcInt.h
-abc-build/src/bool/bdc/bdcSpfd.c
-abc-build/src/bool/bdc/bdcTable.c
-abc-build/src/bool/bdc/module.make
-abc-build/src/bool/dec/dec.h
-abc-build/src/bool/dec/decAbc.c
-abc-build/src/bool/dec/decFactor.c
-abc-build/src/bool/dec/decMan.c
-abc-build/src/bool/dec/decPrint.c
-abc-build/src/bool/dec/decUtil.c
-abc-build/src/bool/dec/module.make
-abc-build/src/bool/deco/deco.h
-abc-build/src/bool/deco/module.make
-abc-build/src/bool/kit/cloud.c
-abc-build/src/bool/kit/cloud.h
-abc-build/src/bool/kit/kit.h
-abc-build/src/bool/kit/kit_.c
-abc-build/src/bool/kit/kitAig.c
-abc-build/src/bool/kit/kitBdd.c
-abc-build/src/bool/kit/kitCloud.c
-abc-build/src/bool/kit/kitDec.c
-abc-build/src/bool/kit/kitDsd.c
-abc-build/src/bool/kit/kitFactor.c
-abc-build/src/bool/kit/kitGraph.c
-abc-build/src/bool/kit/kitHop.c
-abc-build/src/bool/kit/kitIsop.c
-abc-build/src/bool/kit/kitPerm.c
-abc-build/src/bool/kit/kitPla.c
-abc-build/src/bool/kit/kitSop.c
-abc-build/src/bool/kit/kitTruth.c
-abc-build/src/bool/kit/module.make
-abc-build/src/bool/lucky/lucky.c
-abc-build/src/bool/lucky/lucky.h
-abc-build/src/bool/lucky/luckyFast16.c
-abc-build/src/bool/lucky/luckyFast6.c
-abc-build/src/bool/lucky/luckyInt.h
-abc-build/src/bool/lucky/luckyRead.c
-abc-build/src/bool/lucky/luckySimple.c
-abc-build/src/bool/lucky/luckySwap.c
-abc-build/src/bool/lucky/luckySwapIJ.c
-abc-build/src/bool/lucky/module.make
-abc-build/src/bool/rpo/literal.h
-abc-build/src/bool/rpo/module.make
-abc-build/src/bool/rpo/rpo.c
-abc-build/src/bool/rpo/rpo.h
-abc-build/src/bool/rsb/module.make
-abc-build/src/bool/rsb/rsb.h
-abc-build/src/bool/rsb/rsbDec6.c
-abc-build/src/bool/rsb/rsbInt.h
-abc-build/src/bool/rsb/rsbMan.c
-abc-build/src/demo.c
-abc-build/src/generic.c
-abc-build/src/generic.h
-abc-build/src/map/amap/amap.h
-abc-build/src/map/amap/amapCore.c
-abc-build/src/map/amap/amapGraph.c
-abc-build/src/map/amap/amapInt.h
-abc-build/src/map/amap/amapLib.c
-abc-build/src/map/amap/amapLiberty.c
-abc-build/src/map/amap/amapMan.c
-abc-build/src/map/amap/amapMatch.c
-abc-build/src/map/amap/amapMerge.c
-abc-build/src/map/amap/amapOutput.c
-abc-build/src/map/amap/amapParse.c
-abc-build/src/map/amap/amapPerm.c
-abc-build/src/map/amap/amapRead.c
-abc-build/src/map/amap/amapRule.c
-abc-build/src/map/amap/amapUniq.c
-abc-build/src/map/amap/module.make
-abc-build/src/map/cov/cov.h
-abc-build/src/map/cov/covBuild.c
-abc-build/src/map/cov/covCore.c
-abc-build/src/map/cov/covInt.h
-abc-build/src/map/cov/covMan.c
-abc-build/src/map/cov/covMinEsop.c
-abc-build/src/map/cov/covMinMan.c
-abc-build/src/map/cov/covMinSop.c
-abc-build/src/map/cov/covMinUtil.c
-abc-build/src/map/cov/covTest.c
-abc-build/src/map/cov/module.make
-abc-build/src/map/fpga/fpga.c
-abc-build/src/map/fpga/fpga.h
-abc-build/src/map/fpga/fpgaCore.c
-abc-build/src/map/fpga/fpgaCreate.c
-abc-build/src/map/fpga/fpgaCut.c
-abc-build/src/map/fpga/fpgaCutUtils.c
-abc-build/src/map/fpga/fpgaFanout.c
-abc-build/src/map/fpga/fpgaGENERIC.c
-abc-build/src/map/fpga/fpgaInt.h
-abc-build/src/map/fpga/fpgaLib.c
-abc-build/src/map/fpga/fpgaMatch.c
-abc-build/src/map/fpga/fpgaSwitch.c
-abc-build/src/map/fpga/fpgaTime.c
-abc-build/src/map/fpga/fpgaTruth.c
-abc-build/src/map/fpga/fpgaUtils.c
-abc-build/src/map/fpga/fpgaVec.c
-abc-build/src/map/fpga/module.make
-abc-build/src/map/if/if.h
-abc-build/src/map/if/if_.c
-abc-build/src/map/if/ifCache.c
-abc-build/src/map/if/ifCheck.c
-abc-build/src/map/if/ifCom.c
-abc-build/src/map/if/ifCore.c
-abc-build/src/map/if/ifCount.h
-abc-build/src/map/if/ifCut.c
-abc-build/src/map/if/ifDec07.c
-abc-build/src/map/if/ifDec08.c
-abc-build/src/map/if/ifDec10.c
-abc-build/src/map/if/ifDec16.c
-abc-build/src/map/if/ifDec75.c
-abc-build/src/map/if/ifDelay.c
-abc-build/src/map/if/ifDsd.c
-abc-build/src/map/if/ifLibBox.c
-abc-build/src/map/if/ifLibLut.c
-abc-build/src/map/if/ifMan.c
-abc-build/src/map/if/ifMap.c
-abc-build/src/map/if/ifReduce.c
-abc-build/src/map/if/ifSat.c
-abc-build/src/map/if/ifSelect.c
-abc-build/src/map/if/ifSeq.c
-abc-build/src/map/if/ifTest.c
-abc-build/src/map/if/ifTime.c
-abc-build/src/map/if/ifTruth.c
-abc-build/src/map/if/ifTune.c
-abc-build/src/map/if/ifUtil.c
-abc-build/src/map/if/module.make
-abc-build/src/map/mapper/mapper.c
-abc-build/src/map/mapper/mapper.h
-abc-build/src/map/mapper/mapperCanon.c
-abc-build/src/map/mapper/mapperCore.c
-abc-build/src/map/mapper/mapperCreate.c
-abc-build/src/map/mapper/mapperCut.c
-abc-build/src/map/mapper/mapperCutUtils.c
-abc-build/src/map/mapper/mapperFanout.c
-abc-build/src/map/mapper/mapperInt.h
-abc-build/src/map/mapper/mapperLib.c
-abc-build/src/map/mapper/mapperMatch.c
-abc-build/src/map/mapper/mapperRefs.c
-abc-build/src/map/mapper/mapperSuper.c
-abc-build/src/map/mapper/mapperSwitch.c
-abc-build/src/map/mapper/mapperTable.c
-abc-build/src/map/mapper/mapperTime.c
-abc-build/src/map/mapper/mapperTree.c
-abc-build/src/map/mapper/mapperTruth.c
-abc-build/src/map/mapper/mapperUtils.c
-abc-build/src/map/mapper/mapperVec.c
-abc-build/src/map/mapper/module.make
-abc-build/src/map/mio/exp.h
-abc-build/src/map/mio/mio.c
-abc-build/src/map/mio/mio.h
-abc-build/src/map/mio/mioApi.c
-abc-build/src/map/mio/mioForm.c
-abc-build/src/map/mio/mioFunc.c
-abc-build/src/map/mio/mioInt.h
-abc-build/src/map/mio/mioParse.c
-abc-build/src/map/mio/mioRead.c
-abc-build/src/map/mio/mioSop.c
-abc-build/src/map/mio/mioUtils.c
-abc-build/src/map/mio/module.make
-abc-build/src/map/mpm/module.make
-abc-build/src/map/mpm/mpm.c
-abc-build/src/map/mpm/mpm.h
-abc-build/src/map/mpm/mpmAbc.c
-abc-build/src/map/mpm/mpmCore.c
-abc-build/src/map/mpm/mpmDsd.c
-abc-build/src/map/mpm/mpmGates.c
-abc-build/src/map/mpm/mpmInt.h
-abc-build/src/map/mpm/mpmLib.c
-abc-build/src/map/mpm/mpmMan.c
-abc-build/src/map/mpm/mpmMap.c
-abc-build/src/map/mpm/mpmMig.c
-abc-build/src/map/mpm/mpmMig.h
-abc-build/src/map/mpm/mpmPre.c
-abc-build/src/map/mpm/mpmTruth.c
-abc-build/src/map/mpm/mpmUtil.c
-abc-build/src/map/scl/module.make
-abc-build/src/map/scl/scl.c
-abc-build/src/map/scl/scl.h
-abc-build/src/map/scl/sclBuffer.c
-abc-build/src/map/scl/sclBufSize.c
-abc-build/src/map/scl/sclDnsize.c
-abc-build/src/map/scl/sclLib.h
-abc-build/src/map/scl/sclLiberty.c
-abc-build/src/map/scl/sclLibScl.c
-abc-build/src/map/scl/sclLibUtil.c
-abc-build/src/map/scl/sclLoad.c
-abc-build/src/map/scl/sclSize.c
-abc-build/src/map/scl/sclSize.h
-abc-build/src/map/scl/sclTime.h
-abc-build/src/map/scl/sclUpsize.c
-abc-build/src/map/scl/sclUtil.c
-abc-build/src/map/super/module.make
-abc-build/src/map/super/super.c
-abc-build/src/map/super/super.h
-abc-build/src/map/super/superAnd.c
-abc-build/src/map/super/superGate.c
-abc-build/src/map/super/superGENERIC.c
-abc-build/src/map/super/superInt.h
-abc-build/src/map/super/superWrite.c
-abc-build/src/misc/avl/avl.c
-abc-build/src/misc/avl/avl.doc
-abc-build/src/misc/avl/avl.h
-abc-build/src/misc/bar/bar.c
-abc-build/src/misc/bar/bar.h
-abc-build/src/misc/bar/module.make
-abc-build/src/misc/bbl/bblif.c
-abc-build/src/misc/bbl/bblif.h
-abc-build/src/misc/bbl/module.make
-abc-build/src/misc/bzlib/blocksort.c
-abc-build/src/misc/bzlib/bzip2.txt
-abc-build/src/misc/bzlib/bzlib.c
-abc-build/src/misc/bzlib/bzlib.h
-abc-build/src/misc/bzlib/bzlib_private.h
-abc-build/src/misc/bzlib/CHANGES
-abc-build/src/misc/bzlib/compress.c
-abc-build/src/misc/bzlib/crctable.c
-abc-build/src/misc/bzlib/decompress.c
-abc-build/src/misc/bzlib/huffman.c
-abc-build/src/misc/bzlib/LICENSE
-abc-build/src/misc/bzlib/link.txt
-abc-build/src/misc/bzlib/manual.html
-abc-build/src/misc/bzlib/module.make
-abc-build/src/misc/bzlib/randtable.c
-abc-build/src/misc/espresso/cofactor.c
-abc-build/src/misc/espresso/cols.c
-abc-build/src/misc/espresso/compl.c
-abc-build/src/misc/espresso/contain.c
-abc-build/src/misc/espresso/cubehack.c
-abc-build/src/misc/espresso/cubestr.c
-abc-build/src/misc/espresso/cvrin.c
-abc-build/src/misc/espresso/cvrm.c
-abc-build/src/misc/espresso/cvrmisc.c
-abc-build/src/misc/espresso/cvrout.c
-abc-build/src/misc/espresso/dominate.c
-abc-build/src/misc/espresso/equiv.c
-abc-build/src/misc/espresso/espresso.c
-abc-build/src/misc/espresso/espresso.h
-abc-build/src/misc/espresso/essen.c
-abc-build/src/misc/espresso/exact.c
-abc-build/src/misc/espresso/expand.c
-abc-build/src/misc/espresso/gasp.c
-abc-build/src/misc/espresso/gimpel.c
-abc-build/src/misc/espresso/globals.c
-abc-build/src/misc/espresso/hack.c
-abc-build/src/misc/espresso/indep.c
-abc-build/src/misc/espresso/irred.c
-abc-build/src/misc/espresso/main.c
-abc-build/src/misc/espresso/main.h.bak
-abc-build/src/misc/espresso/map.c
-abc-build/src/misc/espresso/matrix.c
-abc-build/src/misc/espresso/mincov.c
-abc-build/src/misc/espresso/mincov.h
-abc-build/src/misc/espresso/mincov_int.h
-abc-build/src/misc/espresso/module.make
-abc-build/src/misc/espresso/opo.c
-abc-build/src/misc/espresso/pair.c
-abc-build/src/misc/espresso/part.c
-abc-build/src/misc/espresso/primes.c
-abc-build/src/misc/espresso/reduce.c
-abc-build/src/misc/espresso/rows.c
-abc-build/src/misc/espresso/set.c
-abc-build/src/misc/espresso/setc.c
-abc-build/src/misc/espresso/sharp.c
-abc-build/src/misc/espresso/sminterf.c
-abc-build/src/misc/espresso/solution.c
-abc-build/src/misc/espresso/sparse.c
-abc-build/src/misc/espresso/sparse.h
-abc-build/src/misc/espresso/sparse_int.h
-abc-build/src/misc/espresso/unate.c
-abc-build/src/misc/espresso/util_old.h
-abc-build/src/misc/espresso/verify.c
-abc-build/src/misc/ext/ext.h
-abc-build/src/misc/ext/module.make
-abc-build/src/misc/extra/extra.h
-abc-build/src/misc/extra/extraBdd.h
-abc-build/src/misc/extra/extraBddAuto.c
-abc-build/src/misc/extra/extraBddCas.c
-abc-build/src/misc/extra/extraBddImage.c
-abc-build/src/misc/extra/extraBddKmap.c
-abc-build/src/misc/extra/extraBddMisc.c
-abc-build/src/misc/extra/extraBddSymm.c
-abc-build/src/misc/extra/extraBddTime.c
-abc-build/src/misc/extra/extraBddUnate.c
-abc-build/src/misc/extra/extraUtilBitMatrix.c
-abc-build/src/misc/extra/extraUtilCanon.c
-abc-build/src/misc/extra/extraUtilCube.c
-abc-build/src/misc/extra/extraUtilDsd.c
-abc-build/src/misc/extra/extraUtilEnum.c
-abc-build/src/misc/extra/extraUtilFile.c
-abc-build/src/misc/extra/extraUtilMemory.c
-abc-build/src/misc/extra/extraUtilMisc.c
-abc-build/src/misc/extra/extraUtilPerm.c
-abc-build/src/misc/extra/extraUtilProgress.c
-abc-build/src/misc/extra/extraUtilReader.c
-abc-build/src/misc/extra/extraUtilSupp.c
-abc-build/src/misc/extra/extraUtilTruth.c
-abc-build/src/misc/extra/extraUtilUtil.c
-abc-build/src/misc/extra/extraZddTrunc.c
-abc-build/src/misc/extra/module.make
-abc-build/src/misc/hash/hash.h
-abc-build/src/misc/hash/hashFlt.h
-abc-build/src/misc/hash/hashGen.h
-abc-build/src/misc/hash/hashInt.h
-abc-build/src/misc/hash/hashPtr.h
-abc-build/src/misc/hash/module.make
-abc-build/src/misc/mem/mem.c
-abc-build/src/misc/mem/mem.h
-abc-build/src/misc/mem/mem2.h
-abc-build/src/misc/mem/module.make
-abc-build/src/misc/mvc/module.make
-abc-build/src/misc/mvc/mvc.c
-abc-build/src/misc/mvc/mvc.h
-abc-build/src/misc/mvc/mvcApi.c
-abc-build/src/misc/mvc/mvcCompare.c
-abc-build/src/misc/mvc/mvcContain.c
-abc-build/src/misc/mvc/mvcCover.c
-abc-build/src/misc/mvc/mvcCube.c
-abc-build/src/misc/mvc/mvcDivide.c
-abc-build/src/misc/mvc/mvcDivisor.c
-abc-build/src/misc/mvc/mvcList.c
-abc-build/src/misc/mvc/mvcLits.c
-abc-build/src/misc/mvc/mvcMan.c
-abc-build/src/misc/mvc/mvcOpAlg.c
-abc-build/src/misc/mvc/mvcOpBool.c
-abc-build/src/misc/mvc/mvcPrint.c
-abc-build/src/misc/mvc/mvcSort.c
-abc-build/src/misc/mvc/mvcUtils.c
-abc-build/src/misc/nm/module.make
-abc-build/src/misc/nm/nm.h
-abc-build/src/misc/nm/nmApi.c
-abc-build/src/misc/nm/nmInt.h
-abc-build/src/misc/nm/nmTable.c
-abc-build/src/misc/st/module.make
-abc-build/src/misc/st/st.c
-abc-build/src/misc/st/st.h
-abc-build/src/misc/st/stmm.c
-abc-build/src/misc/st/stmm.h
-abc-build/src/misc/tim/module.make
-abc-build/src/misc/tim/tim.c
-abc-build/src/misc/tim/tim.h
-abc-build/src/misc/tim/timBox.c
-abc-build/src/misc/tim/timDump.c
-abc-build/src/misc/tim/timInt.h
-abc-build/src/misc/tim/timMan.c
-abc-build/src/misc/tim/timTime.c
-abc-build/src/misc/tim/timTrav.c
-abc-build/src/misc/util/abc_global.h
-abc-build/src/misc/util/module.make
-abc-build/src/misc/util/util_hack.h
-abc-build/src/misc/util/utilBridge.c
-abc-build/src/misc/util/utilCex.c
-abc-build/src/misc/util/utilCex.h
-abc-build/src/misc/util/utilColor.c
-abc-build/src/misc/util/utilFile.c
-abc-build/src/misc/util/utilMem.c
-abc-build/src/misc/util/utilMem.h
-abc-build/src/misc/util/utilNam.c
-abc-build/src/misc/util/utilNam.h
-abc-build/src/misc/util/utilSignal.c
-abc-build/src/misc/util/utilSignal.h
-abc-build/src/misc/util/utilSort.c
-abc-build/src/misc/util/utilTruth.h
-abc-build/src/misc/vec/module.make
-abc-build/src/misc/vec/vec.h
-abc-build/src/misc/vec/vecAtt.h
-abc-build/src/misc/vec/vecBit.h
-abc-build/src/misc/vec/vecFlt.h
-abc-build/src/misc/vec/vecHash.h
-abc-build/src/misc/vec/vecHsh.h
-abc-build/src/misc/vec/vecInt.h
-abc-build/src/misc/vec/vecMem.h
-abc-build/src/misc/vec/vecPtr.h
-abc-build/src/misc/vec/vecQue.h
-abc-build/src/misc/vec/vecSet.h
-abc-build/src/misc/vec/vecStr.h
-abc-build/src/misc/vec/vecVec.h
-abc-build/src/misc/vec/vecWec.h
-abc-build/src/misc/vec/vecWrd.h
-abc-build/src/misc/zlib/adler32.c
-abc-build/src/misc/zlib/algorithm.txt
-abc-build/src/misc/zlib/compress_.c
-abc-build/src/misc/zlib/crc32.c
-abc-build/src/misc/zlib/crc32.h
-abc-build/src/misc/zlib/deflate.c
-abc-build/src/misc/zlib/deflate.h
-abc-build/src/misc/zlib/gzclose.c
-abc-build/src/misc/zlib/gzguts.h
-abc-build/src/misc/zlib/gzlib.c
-abc-build/src/misc/zlib/gzread.c
-abc-build/src/misc/zlib/gzwrite.c
-abc-build/src/misc/zlib/infback.c
-abc-build/src/misc/zlib/inffast.c
-abc-build/src/misc/zlib/inffast.h
-abc-build/src/misc/zlib/inffixed.h
-abc-build/src/misc/zlib/inflate.c
-abc-build/src/misc/zlib/inflate.h
-abc-build/src/misc/zlib/inftrees.c
-abc-build/src/misc/zlib/inftrees.h
-abc-build/src/misc/zlib/license
-abc-build/src/misc/zlib/link.txt
-abc-build/src/misc/zlib/module.make
-abc-build/src/misc/zlib/README
-abc-build/src/misc/zlib/trees.c
-abc-build/src/misc/zlib/trees.h
-abc-build/src/misc/zlib/uncompr.c
-abc-build/src/misc/zlib/zconf.h
-abc-build/src/misc/zlib/zlib.h
-abc-build/src/misc/zlib/zutil.c
-abc-build/src/misc/zlib/zutil.h
-abc-build/src/opt/cgt/cgt.h
-abc-build/src/opt/cgt/cgtAig.c
-abc-build/src/opt/cgt/cgtCore.c
-abc-build/src/opt/cgt/cgtDecide.c
-abc-build/src/opt/cgt/cgtInt.h
-abc-build/src/opt/cgt/cgtMan.c
-abc-build/src/opt/cgt/cgtSat.c
-abc-build/src/opt/cgt/module.make
-abc-build/src/opt/csw/csw.h
-abc-build/src/opt/csw/csw_.c
-abc-build/src/opt/csw/cswCore.c
-abc-build/src/opt/csw/cswCut.c
-abc-build/src/opt/csw/cswInt.h
-abc-build/src/opt/csw/cswMan.c
-abc-build/src/opt/csw/cswTable.c
-abc-build/src/opt/csw/module.make
-abc-build/src/opt/cut/abcCut.c
-abc-build/src/opt/cut/cut.h
-abc-build/src/opt/cut/cutApi.c
-abc-build/src/opt/cut/cutCut.c
-abc-build/src/opt/cut/cutExpand.c
-abc-build/src/opt/cut/cutInt.h
-abc-build/src/opt/cut/cutList.h
-abc-build/src/opt/cut/cutMan.c
-abc-build/src/opt/cut/cutMerge.c
-abc-build/src/opt/cut/cutNode.c
-abc-build/src/opt/cut/cutOracle.c
-abc-build/src/opt/cut/cutPre22.c
-abc-build/src/opt/cut/cutSeq.c
-abc-build/src/opt/cut/cutTruth.c
-abc-build/src/opt/cut/module.make
-abc-build/src/opt/dar/dar.h
-abc-build/src/opt/dar/dar_.c
-abc-build/src/opt/dar/darBalance.c
-abc-build/src/opt/dar/darCore.c
-abc-build/src/opt/dar/darCut.c
-abc-build/src/opt/dar/darData.c
-abc-build/src/opt/dar/darInt.h
-abc-build/src/opt/dar/darLib.c
-abc-build/src/opt/dar/darMan.c
-abc-build/src/opt/dar/darPrec.c
-abc-build/src/opt/dar/darRefact.c
-abc-build/src/opt/dar/darResub.c
-abc-build/src/opt/dar/darScript.c
-abc-build/src/opt/dar/module.make
-abc-build/src/opt/dau/dau.c
-abc-build/src/opt/dau/dau.h
-abc-build/src/opt/dau/dauArray.c
-abc-build/src/opt/dau/dauCanon.c
-abc-build/src/opt/dau/dauCore.c
-abc-build/src/opt/dau/dauDivs.c
-abc-build/src/opt/dau/dauDsd.c
-abc-build/src/opt/dau/dauDsd2.c
-abc-build/src/opt/dau/dauEnum.c
-abc-build/src/opt/dau/dauGia.c
-abc-build/src/opt/dau/dauInt.h
-abc-build/src/opt/dau/dauMerge.c
-abc-build/src/opt/dau/dauNonDsd.c
-abc-build/src/opt/dau/dauTree.c
-abc-build/src/opt/dau/module.make
-abc-build/src/opt/fsim/fsim.h
-abc-build/src/opt/fsim/fsimCore.c
-abc-build/src/opt/fsim/fsimFront.c
-abc-build/src/opt/fsim/fsimInt.h
-abc-build/src/opt/fsim/fsimMan.c
-abc-build/src/opt/fsim/fsimSim.c
-abc-build/src/opt/fsim/fsimSwitch.c
-abc-build/src/opt/fsim/fsimTsim.c
-abc-build/src/opt/fsim/module.make
-abc-build/src/opt/fxu/fxu.c
-abc-build/src/opt/fxu/fxu.h
-abc-build/src/opt/fxu/fxuCreate.c
-abc-build/src/opt/fxu/fxuHeapD.c
-abc-build/src/opt/fxu/fxuHeapS.c
-abc-build/src/opt/fxu/fxuInt.h
-abc-build/src/opt/fxu/fxuList.c
-abc-build/src/opt/fxu/fxuMatrix.c
-abc-build/src/opt/fxu/fxuPair.c
-abc-build/src/opt/fxu/fxuPrint.c
-abc-build/src/opt/fxu/fxuReduce.c
-abc-build/src/opt/fxu/fxuSelect.c
-abc-build/src/opt/fxu/fxuSingle.c
-abc-build/src/opt/fxu/fxuUpdate.c
-abc-build/src/opt/fxu/module.make
-abc-build/src/opt/lpk/lpk.h
-abc-build/src/opt/lpk/lpk_.c
-abc-build/src/opt/lpk/lpkAbcDec.c
-abc-build/src/opt/lpk/lpkAbcDsd.c
-abc-build/src/opt/lpk/lpkAbcMux.c
-abc-build/src/opt/lpk/lpkAbcUtil.c
-abc-build/src/opt/lpk/lpkCore.c
-abc-build/src/opt/lpk/lpkCut.c
-abc-build/src/opt/lpk/lpkInt.h
-abc-build/src/opt/lpk/lpkMan.c
-abc-build/src/opt/lpk/lpkMap.c
-abc-build/src/opt/lpk/lpkMulti.c
-abc-build/src/opt/lpk/lpkMux.c
-abc-build/src/opt/lpk/lpkSets.c
-abc-build/src/opt/lpk/module.make
-abc-build/src/opt/mfs/mfs.h
-abc-build/src/opt/mfs/mfs_.c
-abc-build/src/opt/mfs/mfsCore.c
-abc-build/src/opt/mfs/mfsCore_.c
-abc-build/src/opt/mfs/mfsDiv.c
-abc-build/src/opt/mfs/mfsGia.c
-abc-build/src/opt/mfs/mfsInt.h
-abc-build/src/opt/mfs/mfsInter.c
-abc-build/src/opt/mfs/mfsMan.c
-abc-build/src/opt/mfs/mfsResub.c
-abc-build/src/opt/mfs/mfsResub_.c
-abc-build/src/opt/mfs/mfsSat.c
-abc-build/src/opt/mfs/mfsStrash.c
-abc-build/src/opt/mfs/mfsWin.c
-abc-build/src/opt/mfs/module.make
-abc-build/src/opt/nwk/module.make
-abc-build/src/opt/nwk/ntlnwk.h
-abc-build/src/opt/nwk/nwk.h
-abc-build/src/opt/nwk/nwk_.c
-abc-build/src/opt/nwk/nwkAig.c
-abc-build/src/opt/nwk/nwkBidec.c
-abc-build/src/opt/nwk/nwkCheck.c
-abc-build/src/opt/nwk/nwkDfs.c
-abc-build/src/opt/nwk/nwkFanio.c
-abc-build/src/opt/nwk/nwkFlow.c
-abc-build/src/opt/nwk/nwkFlow_depth.c
-abc-build/src/opt/nwk/nwkMan.c
-abc-build/src/opt/nwk/nwkMap.c
-abc-build/src/opt/nwk/nwkMerge.c
-abc-build/src/opt/nwk/nwkMerge.h
-abc-build/src/opt/nwk/nwkObj.c
-abc-build/src/opt/nwk/nwkSpeedup.c
-abc-build/src/opt/nwk/nwkStrash.c
-abc-build/src/opt/nwk/nwkTiming.c
-abc-build/src/opt/nwk/nwkUtil.c
-abc-build/src/opt/res/module.make
-abc-build/src/opt/res/res.h
-abc-build/src/opt/res/res_.c
-abc-build/src/opt/res/resCore.c
-abc-build/src/opt/res/resDivs.c
-abc-build/src/opt/res/resFilter.c
-abc-build/src/opt/res/resInt.h
-abc-build/src/opt/res/resSat.c
-abc-build/src/opt/res/resSim.c
-abc-build/src/opt/res/resSim_old.c
-abc-build/src/opt/res/resStrash.c
-abc-build/src/opt/res/resWin.c
-abc-build/src/opt/ret/module.make
-abc-build/src/opt/ret/ret_.c
-abc-build/src/opt/ret/retArea.c
-abc-build/src/opt/ret/retCore.c
-abc-build/src/opt/ret/retDelay.c
-abc-build/src/opt/ret/retFlow.c
-abc-build/src/opt/ret/retIncrem.c
-abc-build/src/opt/ret/retInit.c
-abc-build/src/opt/ret/retInt.h
-abc-build/src/opt/ret/retLvalue.c
-abc-build/src/opt/rwr/module.make
-abc-build/src/opt/rwr/rwr.h
-abc-build/src/opt/rwr/rwrDec.c
-abc-build/src/opt/rwr/rwrEva.c
-abc-build/src/opt/rwr/rwrExp.c
-abc-build/src/opt/rwr/rwrLib.c
-abc-build/src/opt/rwr/rwrMan.c
-abc-build/src/opt/rwr/rwrPrint.c
-abc-build/src/opt/rwr/rwrTemp.c
-abc-build/src/opt/rwr/rwrUtil.c
-abc-build/src/opt/rwt/module.make
-abc-build/src/opt/rwt/rwt.h
-abc-build/src/opt/rwt/rwtDec.c
-abc-build/src/opt/rwt/rwtMan.c
-abc-build/src/opt/rwt/rwtUtil.c
-abc-build/src/opt/sfm/module.make
-abc-build/src/opt/sfm/sfm.h
-abc-build/src/opt/sfm/sfmCnf.c
-abc-build/src/opt/sfm/sfmCore.c
-abc-build/src/opt/sfm/sfmInt.h
-abc-build/src/opt/sfm/sfmNtk.c
-abc-build/src/opt/sfm/sfmSat.c
-abc-build/src/opt/sfm/sfmWin.c
-abc-build/src/opt/sim/module.make
-abc-build/src/opt/sim/sim.h
-abc-build/src/opt/sim/simMan.c
-abc-build/src/opt/sim/simSat.c
-abc-build/src/opt/sim/simSeq.c
-abc-build/src/opt/sim/simSupp.c
-abc-build/src/opt/sim/simSwitch.c
-abc-build/src/opt/sim/simSym.c
-abc-build/src/opt/sim/simSymSat.c
-abc-build/src/opt/sim/simSymSim.c
-abc-build/src/opt/sim/simSymStr.c
-abc-build/src/opt/sim/simUtils.c
-abc-build/src/phys/place/hpwl
-abc-build/src/phys/place/libhmetis.h
-abc-build/src/phys/place/Makefile
-abc-build/src/phys/place/module.make
-abc-build/src/phys/place/place_base.c
-abc-build/src/phys/place/place_base.h
-abc-build/src/phys/place/place_bin.c
-abc-build/src/phys/place/place_genqp.c
-abc-build/src/phys/place/place_gordian.c
-abc-build/src/phys/place/place_gordian.h
-abc-build/src/phys/place/place_inc.c
-abc-build/src/phys/place/place_io.c
-abc-build/src/phys/place/place_legalize.c
-abc-build/src/phys/place/place_pads.c
-abc-build/src/phys/place/place_partition.c
-abc-build/src/phys/place/place_qpsolver.c
-abc-build/src/phys/place/place_qpsolver.h
-abc-build/src/phys/place/place_test.c
-abc-build/src/phys/place/README
-abc-build/src/proof/abs/abs.c
-abc-build/src/proof/abs/abs.h
-abc-build/src/proof/abs/absDup.c
-abc-build/src/proof/abs/absGla.c
-abc-build/src/proof/abs/absGlaOld.c
-abc-build/src/proof/abs/absIter.c
-abc-build/src/proof/abs/absOldCex.c
-abc-build/src/proof/abs/absOldRef.c
-abc-build/src/proof/abs/absOldSat.c
-abc-build/src/proof/abs/absOldSim.c
-abc-build/src/proof/abs/absOut.c
-abc-build/src/proof/abs/absPth.c
-abc-build/src/proof/abs/absRef.c
-abc-build/src/proof/abs/absRef.h
-abc-build/src/proof/abs/absRefJ.c
-abc-build/src/proof/abs/absRefJ.h
-abc-build/src/proof/abs/absRefSelect.c
-abc-build/src/proof/abs/absRpm.c
-abc-build/src/proof/abs/absRpmOld.c
-abc-build/src/proof/abs/absUtil.c
-abc-build/src/proof/abs/absVta.c
-abc-build/src/proof/abs/module.make
-abc-build/src/proof/bbr/bbr.h
-abc-build/src/proof/bbr/bbr_.c
-abc-build/src/proof/bbr/bbrCex.c
-abc-build/src/proof/bbr/bbrImage.c
-abc-build/src/proof/bbr/bbrNtbdd.c
-abc-build/src/proof/bbr/bbrReach.c
-abc-build/src/proof/bbr/module.make
-abc-build/src/proof/cec/cec.c
-abc-build/src/proof/cec/cec.h
-abc-build/src/proof/cec/cecCec.c
-abc-build/src/proof/cec/cecChoice.c
-abc-build/src/proof/cec/cecClass.c
-abc-build/src/proof/cec/cecCore.c
-abc-build/src/proof/cec/cecCorr.c
-abc-build/src/proof/cec/cecInt.h
-abc-build/src/proof/cec/cecIso.c
-abc-build/src/proof/cec/cecMan.c
-abc-build/src/proof/cec/cecPat.c
-abc-build/src/proof/cec/cecSeq.c
-abc-build/src/proof/cec/cecSim.c
-abc-build/src/proof/cec/cecSolve.c
-abc-build/src/proof/cec/cecSplit.c
-abc-build/src/proof/cec/cecSweep.c
-abc-build/src/proof/cec/cecSynth.c
-abc-build/src/proof/cec/module.make
-abc-build/src/proof/dch/dch.h
-abc-build/src/proof/dch/dchAig.c
-abc-build/src/proof/dch/dchChoice.c
-abc-build/src/proof/dch/dchClass.c
-abc-build/src/proof/dch/dchCnf.c
-abc-build/src/proof/dch/dchCore.c
-abc-build/src/proof/dch/dchInt.h
-abc-build/src/proof/dch/dchMan.c
-abc-build/src/proof/dch/dchSat.c
-abc-build/src/proof/dch/dchSim.c
-abc-build/src/proof/dch/dchSimSat.c
-abc-build/src/proof/dch/dchSweep.c
-abc-build/src/proof/dch/module.make
-abc-build/src/proof/fra/fra.h
-abc-build/src/proof/fra/fra_.c
-abc-build/src/proof/fra/fraBmc.c
-abc-build/src/proof/fra/fraCec.c
-abc-build/src/proof/fra/fraClass.c
-abc-build/src/proof/fra/fraClau.c
-abc-build/src/proof/fra/fraClaus.c
-abc-build/src/proof/fra/fraCnf.c
-abc-build/src/proof/fra/fraCore.c
-abc-build/src/proof/fra/fraHot.c
-abc-build/src/proof/fra/fraImp.c
-abc-build/src/proof/fra/fraInd.c
-abc-build/src/proof/fra/fraIndVer.c
-abc-build/src/proof/fra/fraLcr.c
-abc-build/src/proof/fra/fraMan.c
-abc-build/src/proof/fra/fraPart.c
-abc-build/src/proof/fra/fraSat.c
-abc-build/src/proof/fra/fraSec.c
-abc-build/src/proof/fra/fraSim.c
-abc-build/src/proof/fra/module.make
-abc-build/src/proof/fraig/fraig.h
-abc-build/src/proof/fraig/fraigApi.c
-abc-build/src/proof/fraig/fraigCanon.c
-abc-build/src/proof/fraig/fraigChoice.c
-abc-build/src/proof/fraig/fraigFanout.c
-abc-build/src/proof/fraig/fraigFeed.c
-abc-build/src/proof/fraig/fraigInt.h
-abc-build/src/proof/fraig/fraigMan.c
-abc-build/src/proof/fraig/fraigMem.c
-abc-build/src/proof/fraig/fraigNode.c
-abc-build/src/proof/fraig/fraigPrime.c
-abc-build/src/proof/fraig/fraigSat.c
-abc-build/src/proof/fraig/fraigTable.c
-abc-build/src/proof/fraig/fraigUtil.c
-abc-build/src/proof/fraig/fraigVec.c
-abc-build/src/proof/fraig/module.make
-abc-build/src/proof/int/int.h
-abc-build/src/proof/int/intCheck.c
-abc-build/src/proof/int/intContain.c
-abc-build/src/proof/int/intCore.c
-abc-build/src/proof/int/intCtrex.c
-abc-build/src/proof/int/intDup.c
-abc-build/src/proof/int/intFrames.c
-abc-build/src/proof/int/intInt.h
-abc-build/src/proof/int/intInter.c
-abc-build/src/proof/int/intM114.c
-abc-build/src/proof/int/intM114p.c
-abc-build/src/proof/int/intMan.c
-abc-build/src/proof/int/intUtil.c
-abc-build/src/proof/int/module.make
-abc-build/src/proof/int2/int2.h
-abc-build/src/proof/int2/int2Bmc.c
-abc-build/src/proof/int2/int2Core.c
-abc-build/src/proof/int2/int2Int.h
-abc-build/src/proof/int2/int2Refine.c
-abc-build/src/proof/int2/int2Util.c
-abc-build/src/proof/int2/module.make
-abc-build/src/proof/live/arenaViolation.c
-abc-build/src/proof/live/combination.c
-abc-build/src/proof/live/disjunctiveMonotone.c
-abc-build/src/proof/live/kLiveConstraints.c
-abc-build/src/proof/live/kliveness.c
-abc-build/src/proof/live/liveness.c
-abc-build/src/proof/live/liveness_sim.c
-abc-build/src/proof/live/ltl_parser.c
-abc-build/src/proof/live/module.make
-abc-build/src/proof/live/monotone.c
-abc-build/src/proof/llb/llb.c
-abc-build/src/proof/llb/llb.h
-abc-build/src/proof/llb/llb1Cluster.c
-abc-build/src/proof/llb/llb1Constr.c
-abc-build/src/proof/llb/llb1Core.c
-abc-build/src/proof/llb/llb1Group.c
-abc-build/src/proof/llb/llb1Hint.c
-abc-build/src/proof/llb/llb1Man.c
-abc-build/src/proof/llb/llb1Matrix.c
-abc-build/src/proof/llb/llb1Pivot.c
-abc-build/src/proof/llb/llb1Reach.c
-abc-build/src/proof/llb/llb1Sched.c
-abc-build/src/proof/llb/llb2Bad.c
-abc-build/src/proof/llb/llb2Core.c
-abc-build/src/proof/llb/llb2Driver.c
-abc-build/src/proof/llb/llb2Dump.c
-abc-build/src/proof/llb/llb2Flow.c
-abc-build/src/proof/llb/llb2Image.c
-abc-build/src/proof/llb/llb3Image.c
-abc-build/src/proof/llb/llb3Nonlin.c
-abc-build/src/proof/llb/llb4Cex.c
-abc-build/src/proof/llb/llb4Cluster.c
-abc-build/src/proof/llb/llb4Image.c
-abc-build/src/proof/llb/llb4Map.c
-abc-build/src/proof/llb/llb4Nonlin.c
-abc-build/src/proof/llb/llb4Sweep.c
-abc-build/src/proof/llb/llbInt.h
-abc-build/src/proof/llb/module.make
-abc-build/src/proof/pdr/module.make
-abc-build/src/proof/pdr/pdr.c
-abc-build/src/proof/pdr/pdr.h
-abc-build/src/proof/pdr/pdrClass.c
-abc-build/src/proof/pdr/pdrCnf.c
-abc-build/src/proof/pdr/pdrCore.c
-abc-build/src/proof/pdr/pdrInt.h
-abc-build/src/proof/pdr/pdrInv.c
-abc-build/src/proof/pdr/pdrMan.c
-abc-build/src/proof/pdr/pdrSat.c
-abc-build/src/proof/pdr/pdrTsim.c
-abc-build/src/proof/pdr/pdrUtil.c
-abc-build/src/proof/ssc/module.make
-abc-build/src/proof/ssc/ssc.h
-abc-build/src/proof/ssc/sscClass.c
-abc-build/src/proof/ssc/sscCore.c
-abc-build/src/proof/ssc/sscInt.h
-abc-build/src/proof/ssc/sscSat.c
-abc-build/src/proof/ssc/sscSim.c
-abc-build/src/proof/ssc/sscUtil.c
-abc-build/src/proof/ssw/module.make
-abc-build/src/proof/ssw/ssw.h
-abc-build/src/proof/ssw/sswAig.c
-abc-build/src/proof/ssw/sswBmc.c
-abc-build/src/proof/ssw/sswClass.c
-abc-build/src/proof/ssw/sswCnf.c
-abc-build/src/proof/ssw/sswConstr.c
-abc-build/src/proof/ssw/sswCore.c
-abc-build/src/proof/ssw/sswDyn.c
-abc-build/src/proof/ssw/sswFilter.c
-abc-build/src/proof/ssw/sswInt.h
-abc-build/src/proof/ssw/sswIslands.c
-abc-build/src/proof/ssw/sswLcorr.c
-abc-build/src/proof/ssw/sswMan.c
-abc-build/src/proof/ssw/sswPairs.c
-abc-build/src/proof/ssw/sswPart.c
-abc-build/src/proof/ssw/sswRarity.c
-abc-build/src/proof/ssw/sswRarity2.c
-abc-build/src/proof/ssw/sswSat.c
-abc-build/src/proof/ssw/sswSemi.c
-abc-build/src/proof/ssw/sswSim.c
-abc-build/src/proof/ssw/sswSimSat.c
-abc-build/src/proof/ssw/sswSweep.c
-abc-build/src/proof/ssw/sswUnique.c
-abc-build/src/python/abc.sh
-abc-build/src/python/abcpy_test.py
-abc-build/src/python/build.txt
-abc-build/src/python/getch.py
-abc-build/src/python/module.make
-abc-build/src/python/package.py
-abc-build/src/python/pyabc.i
-abc-build/src/python/pyabc_split.py
-abc-build/src/python/reachx_cmd.py
-abc-build/src/python/redirect.py
-abc-build/src/python/setup.py
-abc-build/src/sat/bmc/bmc.c
-abc-build/src/sat/bmc/bmc.h
-abc-build/src/sat/bmc/bmcBCore.c
-abc-build/src/sat/bmc/bmcBmc.c
-abc-build/src/sat/bmc/bmcBmc2.c
-abc-build/src/sat/bmc/bmcBmc3.c
-abc-build/src/sat/bmc/bmcBmcAnd.c
-abc-build/src/sat/bmc/bmcBmci.c
-abc-build/src/sat/bmc/bmcCexCare.c
-abc-build/src/sat/bmc/bmcCexCut.c
-abc-build/src/sat/bmc/bmcCexDepth.c
-abc-build/src/sat/bmc/bmcCexMin1.c
-abc-build/src/sat/bmc/bmcCexMin2.c
-abc-build/src/sat/bmc/bmcCexTools.c
-abc-build/src/sat/bmc/bmcEco.c
-abc-build/src/sat/bmc/bmcFault.c
-abc-build/src/sat/bmc/bmcICheck.c
-abc-build/src/sat/bmc/bmcInse.c
-abc-build/src/sat/bmc/bmcLoad.c
-abc-build/src/sat/bmc/bmcMaxi.c
-abc-build/src/sat/bmc/bmcMulti.c
-abc-build/src/sat/bmc/bmcUnroll.c
-abc-build/src/sat/bmc/module.make
-abc-build/src/sat/bsat/license
-abc-build/src/sat/bsat/module.make
-abc-build/src/sat/bsat/satChecker.c
-abc-build/src/sat/bsat/satClause.h
-abc-build/src/sat/bsat/satInter.c
-abc-build/src/sat/bsat/satInterA.c
-abc-build/src/sat/bsat/satInterB.c
-abc-build/src/sat/bsat/satInterP.c
-abc-build/src/sat/bsat/satMem.c
-abc-build/src/sat/bsat/satMem.h
-abc-build/src/sat/bsat/satProof.c
-abc-build/src/sat/bsat/satProof2.h
-abc-build/src/sat/bsat/satSolver.c
-abc-build/src/sat/bsat/satSolver.h
-abc-build/src/sat/bsat/satSolver2.c
-abc-build/src/sat/bsat/satSolver2.h
-abc-build/src/sat/bsat/satSolver2i.c
-abc-build/src/sat/bsat/satStore.c
-abc-build/src/sat/bsat/satStore.h
-abc-build/src/sat/bsat/satTrace.c
-abc-build/src/sat/bsat/satTruth.c
-abc-build/src/sat/bsat/satTruth.h
-abc-build/src/sat/bsat/satUtil.c
-abc-build/src/sat/bsat/satVec.h
-abc-build/src/sat/cnf/cnf.h
-abc-build/src/sat/cnf/cnf_.c
-abc-build/src/sat/cnf/cnfCore.c
-abc-build/src/sat/cnf/cnfCut.c
-abc-build/src/sat/cnf/cnfData.c
-abc-build/src/sat/cnf/cnfFast.c
-abc-build/src/sat/cnf/cnfMan.c
-abc-build/src/sat/cnf/cnfMap.c
-abc-build/src/sat/cnf/cnfPost.c
-abc-build/src/sat/cnf/cnfUtil.c
-abc-build/src/sat/cnf/cnfWrite.c
-abc-build/src/sat/cnf/module.make
-abc-build/src/sat/csat/csat_apis.c
-abc-build/src/sat/csat/csat_apis.h
-abc-build/src/sat/csat/module.make
-abc-build/src/sat/lsat/solver.h
-abc-build/src/sat/msat/module.make
-abc-build/src/sat/msat/msat.h
-abc-build/src/sat/msat/msatActivity.c
-abc-build/src/sat/msat/msatClause.c
-abc-build/src/sat/msat/msatClauseVec.c
-abc-build/src/sat/msat/msatInt.h
-abc-build/src/sat/msat/msatMem.c
-abc-build/src/sat/msat/msatOrderH.c
-abc-build/src/sat/msat/msatOrderJ.c
-abc-build/src/sat/msat/msatQueue.c
-abc-build/src/sat/msat/msatRead.c
-abc-build/src/sat/msat/msatSolverApi.c
-abc-build/src/sat/msat/msatSolverCore.c
-abc-build/src/sat/msat/msatSolverIo.c
-abc-build/src/sat/msat/msatSolverSearch.c
-abc-build/src/sat/msat/msatSort.c
-abc-build/src/sat/msat/msatVec.c
-abc-build/src/sat/proof/pr.c
-abc-build/src/sat/proof/pr.h
-abc-build/src/sat/proof/stats.txt
-abc-build/src/sat/psat/m114p.h
-abc-build/src/sat/psat/m114p_types.h
-abc-build/src/sat/psat/module.make
-abc-build/src/starter.c
-abc-build/src/template.c
diff --git a/scripts/clean-abc.sh b/scripts/clean-abc.sh
--- a/scripts/clean-abc.sh
+++ b/scripts/clean-abc.sh
@@ -1,5 +1,3 @@
 #!/bin/sh
 rm -r abc-build
 rm galois-abcBridge.tar.bz2
-rm scripts/abc-sources.txt
-rm scripts/abc-incl-dirs.txt
diff --git a/scripts/setup-abc.sh b/scripts/setup-abc.sh
--- a/scripts/setup-abc.sh
+++ b/scripts/setup-abc.sh
@@ -9,6 +9,8 @@
 SRC_TARBALL="https://bitbucket.org/rdockins/abc/get/galois-abcBridge.tar.bz2"
 LOCAL_TARBALL="galois-abcBridge.tar.bz2"
 
+echo "Setting up ABC tree for abcBridge version ${PACKAGE_VERSION}..."
+
 # If the ABC source is not already fetched, download the galois-abcBridge
 # branch of the ABC project and unpack it in the "abc-build" subdirectory
 if [ ! -d abc-build ]; then
@@ -22,20 +24,43 @@
   mkdir -p abc-build && (cd abc-build; tar xfj "../$LOCAL_TARBALL" --strip-components=1)
 fi
 
+# Interrogate the expected version number of the ABC sources
+if [ -e abc-build/galois-abcBridge.version ]; then
+  ABC_VERSION=`cat abc-build/galois-abcBridge.version`
+else
+  ABC_VERSION="NONE"
+fi
+
+if [ $ABC_VERSION != $PACKAGE_VERSION ]; then
+  echo ""
+  echo "The ABC source version ${ABC_VERSION} does not match the abcBridge package version version ${PACKAGE_VERSION}."
+  echo ""
+  echo "This may cause problems with the build; it is recommended you cancel this build and check out matching ABC sources"
+  echo "into the abc-build directory and try again.  You can run scripts/clean_abc.sh to remove the current ABC sources;"
+  echo "this will cause latest development branch to be automatically downloaded on the next build."
+  echo ""
+  echo "Press [enter] to continue anyway, or press [^C] to abort (build will automatically abort in 15 seconds)."
+  read -t 15
+fi
+
 # Build a list of the files in the ABC subdirectory that we can feed into
-# the Cabal system so that "setup sdist" works correctly. Likewise, setup
-# a list of directories so we can include relevant *.h files
+# the Cabal system so that "setup sdist" works correctly.  Use sed to filter out
+# compiled object files and libraries. Likewise, set up a list of directories
+# so we can include relevant *.h files
 #
 # Note: fully-qualified 'find' is referenced to work around a problem building
 # under MinGW where unqualified 'find' refers to the Win32 utility of the same name
 
-if [ ! -e scripts/abc-sources.txt ]; then
-  /usr/bin/find abc-build -type f > scripts/abc-sources.txt
+if [ ! -e abc-build/abc-incl-dirs.txt ]; then
+  /usr/bin/find abc-build/src -type d > abc-build/abc-incl-dirs.txt
 fi
 
-if [ ! -e scripts/abc-incl-dirs.txt ]; then
-  /usr/bin/find abc-build/src -type d > scripts/abc-incl-dirs.txt
+if [ ! -e abc-build/abc-sources.txt ]; then
+  # touch the listing file we are about to produce so that it will appear in the file listing!
+  touch abc-build/abc-sources.txt
+  /usr/bin/find abc-build -type f | sed -e '/\/\.hg\//d' -e '/\.hgignore$/d' -e '/\.o$/d' -e '/\.a$/d' -e '/\.dll$/d' -e '/\.lib$/d' > abc-build/abc-sources.txt
 fi
+
 
 # Make sure the build scripts are executable
 chmod +x abc-build/depends.sh
diff --git a/src/Data/ABC/AIG.hs b/src/Data/ABC/AIG.hs
--- a/src/Data/ABC/AIG.hs
+++ b/src/Data/ABC/AIG.hs
@@ -56,8 +56,11 @@
 import qualified Data.Vector.Storable.Mutable as VM
 import System.IO
 import qualified System.IO.Unsafe as Unsafe
+import qualified Data.Map as Map
+import           Data.IORef
 
 
+
 import Data.ABC.Internal.ABC
 import Data.ABC.Internal.AIG
 import Data.ABC.Internal.CNF
@@ -70,12 +73,14 @@
 import Data.ABC.Internal.VecPtr
 
 import qualified Data.AIG as AIG
+import           Data.AIG.Interface (LitView(..))
+import qualified Data.AIG.Trace as Tr
 import Data.ABC.Util
 
 newtype AIG s = AIG { _ntkPtr :: ForeignPtr Abc_Ntk_t_ }
 
 newtype Lit s = Lit { unLit :: Abc_Obj_t }
-  deriving (Eq, Storable)
+  deriving (Eq, Storable, Ord)
 
 -- | Proxy for building AIG networks
 proxy :: AIG.Proxy Lit AIG
@@ -104,7 +109,10 @@
 
 -- | Delete all primary outputs.
 deletePos :: Abc_Ntk_t -> IO ()
-deletePos p = foreachPo_ p abcNtkDeleteObj
+deletePos p = do
+   foreachPo_ p abcNtkDeleteObjPo
+   clearVecPtr =<< abcNtkPos p
+   clearVecPtr =<< abcNtkCos p
 
 -- | Check that a file can be read.
 -- N.B. We should eventually modify abc to be safe.
@@ -125,9 +133,13 @@
     -- Delete all primary outputs.
     outputs <- foreachPo p $ \o -> do
       i <- vecIntEntry (abcObjFanins o) 0
-      abcNtkDeleteObj o
+      abcNtkDeleteObjPo o
       Lit <$> abcNtkObj p (fromIntegral i)
 
+    -- clear the PO and CO vector
+    clearVecPtr =<< abcNtkCos p
+    clearVecPtr =<< abcNtkPos p
+
     -- Return new pointer.
     fp <- newForeignPtr p_abcNtkDelete p
     return (AIG.Network (AIG fp) outputs)
@@ -171,6 +183,58 @@
           1 -> return AIG.Unsat
           _ -> error $ "Unrecognized return code " ++ show r ++ " from abcNtkIvyProve"
 
+memoFoldAIG :: AIG s -> (LitView a -> IO a) -> IO (Lit s -> IO a)
+memoFoldAIG g view = do
+    r <- newIORef Map.empty
+
+    let memo o t = do
+           m <- readIORef r
+           writeIORef r $! Map.insert o t m
+           return t
+
+        go (And x y)    = view =<< (pure And <*> objTerm x <*> objTerm y)
+        go (NotAnd x y) = view =<< (pure NotAnd <*> objTerm x <*> objTerm y)
+        go (Input i)    = view (Input i)
+        go (NotInput i) = view (NotInput i)
+        go TrueLit      = view TrueLit
+        go FalseLit     = view FalseLit
+
+        objTerm o = do
+           m <- readIORef r
+           case Map.lookup o m of
+              Just t -> return t
+              _ -> memo o =<< go =<< litView o
+
+    -- NB: Pin down the AIG foreign pointer, even though we don't explicitly use it
+    return $ (\l -> withAIGPtr g $ \_p -> objTerm l)
+
+-- Return a representation of how lit was constructed.
+-- NB: hold the AIG pointer to the graph to call this function...
+litView :: Lit s -> IO (LitView (Lit s))
+litView (Lit l) = do
+  let c = abcObjIsComplement l
+  let o = abcObjRegular l
+  i <- abcObjId o
+  ty <- abcObjType o
+  case ty of
+    AbcObjPi -> if c then return (NotInput (fromIntegral (i-1))) else return (Input (fromIntegral (i-1)))
+    AbcObjConst1 -> if c then return FalseLit else return TrueLit
+    AbcObjNode -> do
+     isand <- abcObjIsAnd o
+     if isand
+       then do
+         x <- abcObjLit0 o
+         y <- abcObjLit1 o
+         if c then return (NotAnd (Lit x) (Lit y))
+              else return (And (Lit x) (Lit y))
+       else fail "invalid AIG literal: non-and node"
+    _ -> fail ("invalid AIG literal: "++show ty++" "++show i++" "++show c)
+
+instance Tr.Traceable Lit where
+  compareLit x y = compare x y
+  showLit x = show (unLit x)
+
+
 instance AIG.IsAIG Lit AIG where
   newGraph _ = newAIG
   aigerNetwork _ = readAiger
@@ -199,7 +263,9 @@
   getInput a i = do
     withAIGPtr a $ \p -> do
       v <- abcNtkPis p
-      Lit . castPtr <$> vecPtrEntry v i
+      sz <- vecPtrSize v
+      assert (0 <= i && i < sz) $
+        Lit . castPtr <$> vecPtrEntry v i
 
   writeAiger path a = do
     withNetworkPtr a $ \p -> do
@@ -212,6 +278,8 @@
         flip finally (abcNtkDelete =<< peek pp) $ do
         checkSat' pp
 
+  abstractEvaluateAIG = memoFoldAIG
+
   cec x y = do
     ix <- networkInputCount x
     iy <- networkInputCount y
@@ -232,6 +300,7 @@
       var_count <- vecPtrSize objs
 
       v <- VM.new var_count
+
       -- Initialize constant literal value.
       VM.write v 0 True
 
@@ -241,13 +310,17 @@
       let inputs = V.fromList inputs_l
       when (V.length inputs /= pi_count) $
         fail "evaluate given unexpected number of inputs."
+
       forI_ pi_count $ \pi_idx -> do
         o <- vecPtrEntry pis pi_idx
         idx <- fromIntegral <$> abcObjId o
         VM.write v idx (inputs V.! pi_idx)
+
       -- Initialize and nodes.
       forI_ var_count $ \i -> do
         o <- vecPtrEntry objs i
+        -- skip deleted vars!
+        unless (o == nullPtr) $ do
         is_and <- abcObjIsAnd o
         when is_and $ do
           r0 <- evaluateFn v . Lit =<< abcObjLit0 o
@@ -303,6 +376,7 @@
 addPo p (Lit ptr) = do
   po <- abcNtkCreateObj p AbcObjPo
   abcObjAddFanin po ptr
+
 
 
 checkIsConstant :: Abc_Ntk_t -> IO (Maybe Bool)
diff --git a/src/Data/ABC/GIA.hs b/src/Data/ABC/GIA.hs
--- a/src/Data/ABC/GIA.hs
+++ b/src/Data/ABC/GIA.hs
@@ -3,6 +3,7 @@
 {-# LANGUAGE Rank2Types #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
 
 {- |
 Module      : Data.ABC.GIA
@@ -35,7 +36,7 @@
     , false
     , proxy
       -- * Inspection
-    , LitView(..)
+    , AIG.LitView(..)
     , litView
       -- * File IO
     , readAiger
@@ -53,11 +54,18 @@
     ) where
 
 import Prelude hiding (and, not, or)
+import qualified Prelude
 
+
 import Control.Exception hiding (evaluate)
 import Control.Monad
 import Control.Applicative
+import qualified Data.Map as Map
+import           Data.IORef
 import qualified Data.AIG as AIG
+import           Data.AIG.Interface (LitView(..))
+import qualified Data.AIG.Trace as Tr
+
 import qualified Data.Vector.Storable as SV
 import qualified Data.Vector.Unboxed as V
 import qualified Data.Vector.Unboxed.Mutable as VM
@@ -86,6 +94,7 @@
 newtype GIA s = GIA { _giaPtr :: ForeignPtr Gia_Man_t_ }
 
 newtype Lit s = L { _unLit :: GiaLit }
+  deriving (Eq, Storable, Ord)
 
 proxy :: AIG.Proxy Lit GIA
 proxy = AIG.Proxy id
@@ -140,6 +149,10 @@
 false :: Lit s
 false = L giaManConst0Lit
 
+instance Tr.Traceable Lit where
+  compareLit x y = compare x y
+  showLit x = show (unGiaLit (_unLit x))
+
 instance AIG.IsAIG Lit GIA where
 
   newGraph _ = newGIA
@@ -153,11 +166,16 @@
   mux g (L c) (L x) (L y) = withGIAPtr g $ \p -> L <$> giaManHashMux p c x y
 
   inputCount g = fromIntegral <$> withGIAPtr g giaManCiNum
-  getInput g i = withGIAPtr g $ \p ->
-    L . giaVarLit <$> giaManCiVar p (fromIntegral i)
+  getInput g i =
+    withGIAPtr g $ \p -> do
+        cnt <- giaManCiNum p
+        assert (0 <= i && i < fromIntegral cnt) $
+          L . giaVarLit <$> giaManCiVar p (fromIntegral i)
 
   aigerNetwork _ = readAiger
 
+  abstractEvaluateAIG (GIA fp) = litEvaluator fp
+
   writeAiger path g = do
     withNetworkPtr g $ \p -> do
       giaAigerWrite p path False False
@@ -173,6 +191,16 @@
   cec gx gy = do
     withNetworkPtr gx $ \x -> do
     withNetworkPtr gy $ \y -> do
+
+    input_count_x <- giaManCiNum x
+    input_count_y <- giaManCiNum y
+
+    output_count_x <- vecIntSize =<< giaManCos x
+    output_count_y <- vecIntSize =<< giaManCos y
+
+    assert (input_count_x == input_count_y) $ do
+    assert (output_count_x == output_count_y) $ do
+
     bracket (giaManMiter x y 0 True False False False) giaManStop $ \m -> do
     r <- cecManVerify m cecManCecDefaultParams
     case r of
@@ -229,22 +257,73 @@
 
 -- | Run computation with a Gia_Man_t containing the given network.
 withNetworkPtr :: AIG.Network Lit GIA -> (Gia_Man_t -> IO a) -> IO a
-withNetworkPtr (AIG.Network ntk out) m = do
+withNetworkPtr = withNetworkPtr_Munge
+
+-- A safer alternative...
+--withNetworkPtr = withNetworkPtr_Copy
+
+
+
+-- This is a safer method for implementing withNetworkPtr; it copies the
+-- entire graph before adding the required COs and disposes of the copied
+-- graph afterwards.  Obviously, this has substantial memory usage implications.
+_withNetworkPtr_Copy :: AIG.Network Lit GIA -> (Gia_Man_t -> IO a) -> IO a
+_withNetworkPtr_Copy (AIG.Network ntk out) m = do
   withGIAPtr ntk $ \p -> do
+     ncos <- vecIntSize =<< giaManCos p
+     assert( ncos == 0 ) $ do
+     bracket (giaManDupNormalize p) giaManStop 
+         (\p' -> mapM_ (\(L o) -> giaManAppendCo p' o) out >> m p')
+
+
+-- This is a somewhat risky method to build a Gia network containing
+-- the required output COs.  Initially, we assume the network has no COs.
+-- Then, we add enough COs to account for the list of "out" literals.
+-- We then run the given computation on the updated network; this computation
+-- is assumed not to change the structure of the graph.  Finally, we
+-- "deallocate" the COs we added.  This final step is a bit dubious; the Gia
+-- graph data was not designed with deallocation in mind, and we are abusing
+-- our ability to reach in and muck with the details.
+
+withNetworkPtr_Munge :: AIG.Network Lit GIA -> (Gia_Man_t -> IO a) -> IO a
+withNetworkPtr_Munge (AIG.Network ntk out) m = do
+  withGIAPtr ntk $ \p -> do
     -- Get original number of objects
     orig_oc <- readAt giaManNObjs p
+
     let reset = do
-          -- Reset object count.
+          n <- readAt giaManNObjs p
+
+          cov <- giaManCos p
+          ncos <- vecIntSize cov
+
+          -- it should be that the only new objects are the COs we add
+          assert (orig_oc == n - ncos) $ do
+
+          -- clear the objects for reuse
+          forN_ (fromIntegral ncos) $ \i -> do
+             var <- vecIntEntry cov (fromIntegral i)
+             -- Assert that all the objects we are clearing are above the old object count; that is,
+             -- they must have been allocated when we shoved in the new COs.
+             assert (var >= orig_oc) $ do
+             -- clear the memory assocaited with the GIA object
+             clearGiaObj =<< giaManObj p (GiaVar var)
+
+          -- empty the CO vector
+          clearVecInt cov
+
+          -- Reset object count, effectively deallocating the objects
           writeAt giaManNObjs p orig_oc
-          -- Clear Cos
-          clearVecInt =<< giaManCos p
+
     -- Run computation, then reset.
     flip finally reset $ do
       -- Add combinational outputs.
       mapM_ (\(L o) -> giaManAppendCo p o) out
+
       -- Run computation.
       m p
 
+
 -- | Run a computation with an AIG man created from a GIA netowrk.
 giaNetworkAsAIGMan :: AIG.Network Lit GIA
                    -> (Aig_Man_t -> IO a)
@@ -270,14 +349,43 @@
   c0 <- giaObjFaninC1 o
   return $ giaLitNotCond (giaVarLit v0) c0
 
--- | A representation of a lit's strcture.
-data LitView l
-   = And !l !l
-   | NotAnd !l !l
-   | Input !Int
-   | NotInput !Int
-   | TrueLit
-   | FalseLit
+
+litEvaluator :: ForeignPtr Gia_Man_t_ -> (LitView a -> IO a) -> IO (Lit s -> IO a)
+litEvaluator fp viewFn = do
+  let memo r o t = do
+        m <- readIORef r
+        writeIORef r $! Map.insert o t m
+        return t
+  r <- newIORef Map.empty
+  let objTerm o = do
+        --putStrLn $ "objTerm " ++ show o
+        m0 <- readIORef r
+        case Map.lookup o m0 of
+          Just t -> return t
+          _ -> do
+            let c = giaIsComplement o
+            let o' = if c then giaRegular o else o
+            isTerm <- giaObjIsTerm o'
+            d0 <- giaObjDiff0 o'
+            case () of
+              _ | Prelude.not isTerm && d0 /= gia_none -> do -- And gate
+                    x <- objTerm =<< giaObjChild0 o'
+                    y <- objTerm =<< giaObjChild1 o'
+                    let and_ = if c then NotAnd else And
+                    memo r o =<< viewFn (and_ x y)
+                | isTerm && d0 /= gia_none -> do -- Primary output
+                    -- This is a primary output, so we just get the lit
+                    -- for the gate that it is attached to.
+
+                    -- FIXME? is this the right thing to do WRT complement?
+                    objTerm =<< giaObjChild0 o'
+                | Prelude.not isTerm -> do -- Constant value
+                    memo r o =<< viewFn (if c then TrueLit else FalseLit)
+                | otherwise -> do -- Primary input
+                    memo r o =<< viewFn . (if c then NotInput else Input) . fromIntegral
+                              =<< giaObjDiff1 o'
+  return $ (\(L l) -> withForeignPtr fp $ \p -> objTerm =<< giaObjFromLit p l)
+
 
 -- | Return a representation of how lit was constructed.
 litView :: GIA s -> Lit s -> IO (LitView (Lit s))
diff --git a/src/Data/ABC/Internal/ABC.chs b/src/Data/ABC/Internal/ABC.chs
--- a/src/Data/ABC/Internal/ABC.chs
+++ b/src/Data/ABC/Internal/ABC.chs
@@ -36,6 +36,8 @@
     , abcNtkObjs
     , abcNtkPis
     , abcNtkPos
+    , abcNtkCos
+    , abcNtkCis
     , abcNtkObj
     , abcNtkManFunc
     , abcNtkModel
@@ -94,6 +96,7 @@
     -- ** abcObj.c
     -- | Functions for manipulating objects in networks.
     , abcNtkDeleteObj
+    , abcNtkDeleteObjPo
     -- ** abcProve.c
     -- | Functions for performing SAT solving.
     , abcNtkIvyProve
@@ -376,6 +379,10 @@
 -- abcObj.c
 
 {#fun Abc_NtkDeleteObj as ^
+    { id `Abc_Obj_t'
+    } -> `()' #}
+
+{#fun Abc_NtkDeleteObjPo as ^
     { id `Abc_Obj_t'
     } -> `()' #}
 
diff --git a/src/Data/ABC/Internal/GIA.chs b/src/Data/ABC/Internal/GIA.chs
--- a/src/Data/ABC/Internal/GIA.chs
+++ b/src/Data/ABC/Internal/GIA.chs
@@ -94,6 +94,7 @@
     -- ** giaDup.c
     , giaManMiter
     , giaDupLit
+    , giaManDupNormalize
     -- ** giaHash.c
     , giaManHashAlloc
     , giaManHashStart
@@ -107,6 +108,9 @@
     , p_giaManStop
     , giaManCleanup
     , giaManFillValue
+
+      -- ** misc
+    , clearGiaObj
     ) where
 
 import Control.Applicative
@@ -376,7 +380,7 @@
 -- | Return object associated with gia var.
 giaManObj :: Gia_Man_t -> GiaVar -> IO Gia_Obj_t
 giaManObj m (GiaVar v) = do
-  cnt <- giaManCiNum m
+  cnt <- giaManObjNum m
   assert (0 <= v && v < cnt) $ do
     (`incObjPtr` v) <$> giaManConst0 m
 
@@ -443,6 +447,9 @@
     , `Bool' -- fVerbose
     } -> `Gia_Man_t' id #}
 
+foreign import ccall unsafe "Gia_ManDupNormalize" giaManDupNormalize
+  :: Gia_Man_t -> IO Gia_Man_t
+
 -- | @giaManDupDfsLazyLit pNew p l@ copies a lit @l@ in @p@ to @pNew@
 -- and returns the lit in @pNew@.
 giaDupLit :: Gia_Man_t -> Gia_Man_t -> GiaLit -> IO GiaLit
@@ -485,6 +492,8 @@
 foreign import ccall unsafe "gia.h &Gia_ManStop"
     p_giaManStop :: FunPtr (Gia_Man_t -> IO ())
 
+foreign import ccall unsafe "AbcBridge_Gia_ClearGiaObj"
+    clearGiaObj :: Gia_Obj_t -> IO ()
 
 {#fun Gia_ManStart as ^ { id `CInt' } -> `Gia_Man_t' id #}
 
diff --git a/src/Data/ABC/Internal/VecPtr.chs b/src/Data/ABC/Internal/VecPtr.chs
--- a/src/Data/ABC/Internal/VecPtr.chs
+++ b/src/Data/ABC/Internal/VecPtr.chs
@@ -22,6 +22,7 @@
     , vecPtrSize
     , vecPtrArray
     , vecPtrEntry
+    , clearVecPtr
     ) where
 
 #include <stdio.h>
@@ -49,6 +50,9 @@
 
 vecPtrArray :: Vec_Ptr_t -> IO (Ptr (Ptr a))
 vecPtrArray v = castPtr `fmap` {#get Vec_Ptr_t->pArray #} v
+
+clearVecPtr :: Vec_Ptr_t -> IO ()
+clearVecPtr v = writeAt vecSizeField v 0
 
 vecPtrEntry :: Vec_Ptr_t -> Int -> IO (Ptr a)
 vecPtrEntry v i = do
diff --git a/src/Data/ABC/Util.hs b/src/Data/ABC/Util.hs
--- a/src/Data/ABC/Util.hs
+++ b/src/Data/ABC/Util.hs
@@ -18,5 +18,5 @@
 
 forN :: Monad m => Int -> (Int -> m a) -> m [a]
 forN i0 m = go [] i0
-  where go l i | i <= 0 = return (reverse l)
+  where go l i | i <= 0 = return l -- NB: don't reverse the list
                | otherwise = m (i-1) >>= \e -> go (e:l) (i-1)
diff --git a/tests/Tests/Basic.hs b/tests/Tests/Basic.hs
--- a/tests/Tests/Basic.hs
+++ b/tests/Tests/Basic.hs
@@ -7,18 +7,20 @@
 import Control.Monad
 import System.Directory
 import System.IO
-import Test.Framework
-import Test.Framework.Providers.HUnit
-import Test.Framework.Providers.QuickCheck2
-import Test.HUnit (assertEqual)
+
+import Test.Tasty
+import Test.Tasty.HUnit
+import Test.Tasty.QuickCheck
 import Test.QuickCheck
 
 import qualified Data.ABC as ABC
+import qualified Data.AIG.Trace as Tr
 
+
 tryIO :: IO a -> IO (Either IOException a)
 tryIO = try
 
-basic_tests :: ABC.Proxy l g -> [Test.Framework.Test]
+basic_tests :: Tr.Traceable l => ABC.Proxy l g -> [TestTree]
 basic_tests proxy@(ABC.Proxy f) = f $
   [ testCase "test_true" $ do
       ABC.SomeGraph g <- ABC.newGraph proxy
@@ -77,6 +79,40 @@
       n2 <- ABC.aigerNetwork proxy path
       assertEqual "test_aiger" ABC.Valid =<< ABC.cec n1 n2
       removeFile path
+
+  , testProperty "unfold_fold" $ \litForest -> ioProperty $ do
+      let maxInput = foldr max 0 $ map ABC.getMaxInput litForest
+
+      n1@(ABC.Network g ls) <- ABC.buildNetwork proxy litForest
+
+      litForest' <- ABC.toLitForest g ls
+
+      -- NB: we cannot just compare litForest and litForest' for syntactic equality
+      -- due to simplifications performed when building the AIG.  Also, the following
+      -- commented line does not work because references to inputs may also be removed
+      -- during simpification, resulting in a different number of inputs.
+      --n2 <- ABC.buildNetwork proxy litForest'
+
+      -- so do this instead...
+      (ABC.SomeGraph g') <- ABC.newGraph proxy
+      forM_ [0 .. maxInput] (\_ -> ABC.newInput g')
+      ls' <- ABC.fromLitForest g' litForest'
+      let n2 = ABC.Network g' ls'
+
+      result <- ABC.cec n1 n2
+      return $ result == ABC.Valid
+
+  , testCase "fold_unfold" $ do
+      (ABC.Network g l) <- cecNetwork proxy
+      inputs <- ABC.inputCount g
+      litForest <- ABC.toLitForest g l
+
+      (ABC.SomeGraph g') <- ABC.newGraph proxy
+      forM_ [0 .. inputs-1] (\_ -> ABC.newInput g')
+      l' <- ABC.fromLitForest g' litForest
+
+      assertEqual "fold_unfold" ABC.Valid =<< ABC.cec (ABC.Network g l) (ABC.Network g' l')
+
   , testCase "bad_aiger" $ do
       me <- tryIO $ ABC.aigerNetwork proxy "Nonexistent AIGER!"
       case me of
@@ -88,10 +124,59 @@
      case rt of
        ABC.Sat{} -> return ()
        ABC.Unsat{} -> fail "trueLit is unsat"
+       ABC.SatUnknown{} -> fail "trueLit is unknown"
      rf <- ABC.checkSat g (ABC.falseLit g)
      case rf of
        ABC.Sat{} -> fail "falseLit is sat"
        ABC.Unsat{} -> return ()
+       ABC.SatUnknown{} -> fail "falseLit is unknown"
+
+  , testCase "aiger_twice" $ do
+      ABC.SomeGraph g <- ABC.newGraph proxy
+
+      tmpdir <- getTemporaryDirectory
+      (path, hndl) <- openTempFile tmpdir "aiger.aig"
+      hClose hndl
+
+      x <- ABC.newInput g
+
+      ABC.writeAiger (path++"1") (ABC.Network g [ABC.falseLit g, ABC.falseLit g])
+
+      y <- ABC.newInput g
+      r <- ABC.and g x y
+
+      ABC.writeAiger (path++"2") (ABC.Network g [r])
+
+  , testCase "aiger_eval" $ do
+      ABC.SomeGraph g <- ABC.newGraph proxy
+
+      tmpdir <- getTemporaryDirectory
+      (path, hndl) <- openTempFile tmpdir "aiger.aig"
+      hClose hndl
+
+      x <- fmap ABC.bvFromList $ sequence $ replicate 32 (ABC.newInput g)
+      y <- ABC.zipWithM (ABC.lAnd' g) x (ABC.bvFromInteger g 32 0x12345678)
+
+      ABC.writeAiger path (ABC.Network g (ABC.bvToList y))
+
+      let tobool :: Int -> Bool
+          tobool i = if i == 0 then False else True
+
+      let inputs = map tobool $ reverse $
+                   [ 0,1,1,0,1,0,0,0,
+                     0,0,0,0,0,0,0,0,
+                     0,0,0,0,0,0,0,0,
+                     0,0,0,0,0,0,0,0 ]
+
+      let outputs = fmap tobool $ reverse $
+                    [ 0,0,0,0,1,0,0,0,
+                      0,0,0,0,0,0,0,0,
+                      0,0,0,0,0,0,0,0,
+                      0,0,0,0,0,0,0,0 ]
+
+      z <- ABC.evaluate (ABC.Network g (ABC.bvToList y)) inputs
+
+      assertEqual "aiger_eval" outputs z
   ]
 
 cecNetwork :: ABC.IsAIG l g => ABC.Proxy l g -> IO (ABC.Network l g)
diff --git a/tests/Tests/Operations.hs b/tests/Tests/Operations.hs
--- a/tests/Tests/Operations.hs
+++ b/tests/Tests/Operations.hs
@@ -4,8 +4,8 @@
   ) where
 
 import qualified Data.AIG as AIG
-import Test.Framework
-import Test.Framework.Providers.QuickCheck2
+import Test.Tasty
+import Test.Tasty.QuickCheck
 import Test.QuickCheck
 
 bv :: AIG.IsAIG l g => g s -> Int -> Integer -> AIG.BV (l s)
@@ -18,7 +18,7 @@
             -- ^ Bitvector operation
          -> (Integer -> Integer -> Integer)
             -- ^ Concrete op
-         -> Test.Framework.Test
+         -> TestTree
 bin_test nm proxy@(AIG.Proxy f) bv_op c_op = f $
   testProperty nm $ \u v -> ioProperty $ do
     let w = 10
@@ -27,7 +27,7 @@
     let expected = (c_op u v) `mod` (2^w)
     return $ Just expected == AIG.asUnsigned g z
 
-op_tests :: AIG.Proxy l g -> [Test.Framework.Test]
+op_tests :: AIG.Proxy l g -> [TestTree]
 op_tests proxy@(AIG.Proxy f) = f $
   [ testProperty "test_bv" $ \u -> ioProperty $ do
       AIG.SomeGraph g <- AIG.newGraph proxy
diff --git a/tests/Tests/QBF.hs b/tests/Tests/QBF.hs
--- a/tests/Tests/QBF.hs
+++ b/tests/Tests/QBF.hs
@@ -2,13 +2,13 @@
   ( qbf_tests
   ) where
 
-import Test.Framework
-import Test.Framework.Providers.HUnit
+import Test.Tasty
+import Test.Tasty.HUnit
 
 import qualified Data.ABC as ABC
 import qualified Data.ABC.GIA as GIA
 
-qbf_tests :: [Test.Framework.Test]
+qbf_tests :: [TestTree]
 qbf_tests =
   [ testCase "test_qbf_and" $ do
       ABC.SomeGraph g <- GIA.newGIA
diff --git a/tests/abc-test.hs b/tests/abc-test.hs
--- a/tests/abc-test.hs
+++ b/tests/abc-test.hs
@@ -1,7 +1,9 @@
 {-# LANGUAGE ScopedTypeVariables #-}
 module Main (main) where
 
-import Test.Framework
+import Test.Tasty
+import Test.Tasty.Ingredients
+import Test.Tasty.Runners.AntXML
 
 import qualified Data.ABC as ABC
 
@@ -16,166 +18,22 @@
 main :: IO ()
 main = do
   ABC.initialize
-  defaultMain tests
+  defaultMainWithIngredients ingrs tests
 
-tests :: [Test.Framework.Test]
+ingrs :: [Ingredient]
+ingrs =
+   [ antXMLRunner
+   ]
+   ++
+   defaultIngredients
+
+
+tests :: TestTree
 tests =
+    testGroup "ABC Bridge"
     [ testGroup "AIG basic" $ basic_tests ABC.aigNetwork
-    , testGroup "AIG operations" $ op_tests ABC.giaNetwork
+    , testGroup "AIG operations" $ op_tests ABC.aigNetwork
     , testGroup "GIA basic" $ basic_tests ABC.giaNetwork
     , testGroup "GIA operations" $ op_tests ABC.giaNetwork
     , testGroup "GIA QBF tests" $ qbf_tests
     ]
-
-{-
-tests :: [Test.Framework.Test]
-tests =
-    [ testGroup "AIG" $ do
-       basic_tests ABC.aigNetwork ++ aig_tests
-    , testGroup "GIA" $ basic_tests ABC.giaNetwork
-    ]
-
-cecNetwork :: ABC.IsAIG l g => ABC.Proxy l g -> IO (ABC.Network l g)
-cecNetwork proxy = do
-  ABC.SomeGraph g <- ABC.newGraph proxy
-  [n2, n3, n4, n5, n6, n7, n8] <- replicateM 7 $ ABC.newInput g
-
-  n14 <- ABC.ands g [ ABC.not n2
-                    , ABC.not n3
-                    , ABC.not n4
-                    , n5
-                    , ABC.not n6
-                    , ABC.not n7
-                    , ABC.not n8
-                    ]
-  let r = [n14] ++ replicate 6 (ABC.falseLit g)
-  return (ABC.Network g r)
-
-cecNetwork' :: ABC.IsAIG l g => ABC.Proxy l g -> IO (ABC.Network l g)
-cecNetwork' proxy = do
-  ABC.SomeGraph g <- ABC.newGraph proxy
-  replicateM_ 7 $ ABC.newInput g
-  let r = replicate 7 $ ABC.falseLit g
-  return (ABC.Network g r)
-
-basic_tests :: ABC.Proxy l g -> [Test.Framework.Test]
-basic_tests proxy@(ABC.Proxy f) = f $
-  [ testCase "test_true" $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      let n = ABC.Network g [ABC.trueLit g]
-      assertEqual "test_true" [True] =<< ABC.evaluate n []
-  , testCase "test_false" $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      let n = ABC.Network g [ABC.falseLit g]
-      assertEqual "test_false" [False] =<< ABC.evaluate n []
-  , testProperty "test_constant"$ \b -> ioProperty $do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      let n = ABC.Network g [ABC.constant g b]
-      (==[b]) <$> ABC.evaluate n []
-  , testProperty "test_not" $ \b0 -> ioProperty $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      i0 <- ABC.newInput g
-      let n = ABC.Network g [ABC.not i0]
-      r <- ABC.evaluate n [b0]
-      return $ r == [not b0]
-  , testProperty "test_and" $ \b1 b2 -> ioProperty $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      i0 <- ABC.newInput g
-      i1 <- ABC.newInput g
-      x <- ABC.and g i0 i1
-      let n = ABC.Network g [x]
-      r <- ABC.evaluate n [b1, b2]
-      return $ r == [b1 && b2]
-  , testProperty "test_xor" $ \b1 b2 -> ioProperty $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      i0 <- ABC.newInput g
-      i1 <- ABC.newInput g
-      x <- ABC.xor g i0 i1
-      let n = ABC.Network g [x]
-      r <- ABC.evaluate n [b1, b2]
-      return $ r == [b1 /= b2]
-  , testProperty "test_mux" $ \b0 b1 b2 -> ioProperty $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      i0 <- ABC.newInput g
-      i1 <- ABC.newInput g
-      i2 <- ABC.newInput g
-      o <- ABC.mux g i0 i1 i2
-      let n = ABC.Network g [o]
-      r <- ABC.evaluate n [b0, b1, b2]
-      return $ r == [if b0 then b1 else b2]
-  , testCase "test_cec" $ do
-     r <- join $ ABC.cec <$> cecNetwork proxy <*> cecNetwork' proxy
-     assertEqual "test_cec" (ABC.Invalid (toEnum <$> [0,0,0,1,0,0,0])) r
-  , testCase "test_aiger" $ do
-     -- XXX: cwd unfriendly
-     n1 <- ABC.aigerNetwork proxy "tests/eijk.S298.S.aig"
-     tmpdir <- getTemporaryDirectory
-     (path, hndl) <- openTempFile tmpdir "aiger.aig"
-     hClose hndl
-     ABC.writeAiger path n1
-     n2 <- ABC.aigerNetwork proxy path
-     assertEqual "test_aiger" ABC.Valid =<< ABC.cec n1 n2
-     removeFile path
-  , testCase "test_sat" $ do
-     ABC.SomeGraph g <- ABC.newGraph proxy
-     rt <- ABC.checkSat g (ABC.trueLit g)
-     case rt of
-       ABC.Sat{} -> return ()
-       ABC.Unsat{} -> fail "trueLit is unsat"
-     rf <- ABC.checkSat g (ABC.falseLit g)
-     case rf of
-       ABC.Sat{} -> fail "falseLit is sat"
-       ABC.Unsat{} -> return ()
-  , testProperty "test_add" $ \(i0 :: Int8) (i1 :: Int8) -> ioProperty $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      is0 <- replicateM 8 $ ABC.newInput g
-      is1 <- replicateM 8 $ ABC.newInput g
-      os <- Ops.add g (litsToBV is0) (litsToBV is1)
-      let n = ABC.Network g (Ops.bvToList os)
-      r <- ABC.evaluate n (bitsOfInt8 i0 ++ bitsOfInt8 i1)
-      return $ bitsToInt8 r == i0 + i1
-  , testProperty "test_sub" $ \(i0 :: Int8) (i1 :: Int8) -> ioProperty $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      is0 <- replicateM 8 $ ABC.newInput g
-      is1 <- replicateM 8 $ ABC.newInput g
-      os <- Ops.sub g (litsToBV is0) (litsToBV is1)
-      let n = ABC.Network g (Ops.bvToList os)
-      r <- ABC.evaluate n (bitsOfInt8 i0 ++ bitsOfInt8 i1)
-      return $ bitsToInt8 r == i0 - i1
-  , testProperty "test_neg" $ \(i0 :: Int8) -> ioProperty $ do
-      ABC.SomeGraph g <- ABC.newGraph proxy
-      is0 <- replicateM 8 $ ABC.newInput g
-      os <- Ops.neg g (litsToBV is0)
-      let n = ABC.Network g (Ops.bvToList os)
-      r <- ABC.evaluate n (bitsOfInt8 i0)
-      return $ bitsToInt8 r == (- i0)
-  ]
-
-singletonBV :: l -> Ops.BV l
-singletonBV = Ops.replicate 1
-
-litsToBV :: [l] -> Ops.BV l
-litsToBV = Ops.concat . map singletonBV
-
-bitsOfInt8 :: Int8 -> [Bool]
-bitsOfInt8 n = unfoldr f 7
-  where f i | i >= 0 = Just (testBit n i, i - 1)
-            | otherwise = Nothing
-
-bitsToInt8 :: [Bool] -> Int8
-bitsToInt8 = foldr f 0
-  where f b n = (shiftL n 1) .|. fromIntegral (fromEnum b)
-
-tryIO :: IO a -> IO (Either IOException a)
-tryIO = try
-
-aig_tests :: [Test.Framework.Test]
-aig_tests =
-  [ testCase "bad_aiger" $ do
-      me <- tryIO $ ABC.readAigerAsAIG "Nonexistent AIGER!"
-      case me of
-        Left{} -> return ()
-        Right{} -> fail "Expected error when opening AIGER"
-  ]
-
--}
