Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
abc
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
abc
Commits
401aa699
Commit
401aa699
authored
Jul 30, 2012
by
Alan Mishchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing a problem with printing out factored forms.
parent
216fc33a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/bool/dec/decPrint.c
+12
-12
No files found.
src/bool/dec/decPrint.c
View file @
401aa699
...
...
@@ -29,7 +29,7 @@ ABC_NAMESPACE_IMPL_START
static
void
Dec_GraphPrint_rec
(
FILE
*
pFile
,
Dec_Graph_t
*
pGraph
,
Dec_Node_t
*
pNode
,
int
fCompl
,
char
*
pNamesIn
[],
int
*
pPos
,
int
LitSizeMax
);
static
int
Dec_GraphPrintGetLeafName
(
FILE
*
pFile
,
int
iLeaf
,
int
fCompl
,
char
*
pNamesIn
[]
);
static
void
Dec_GraphPrintUpdatePos
(
FILE
*
pFile
,
int
*
pPos
,
int
LitSizeMax
);
static
int
Dec_GraphPrintOutputName
(
FILE
*
pFile
,
char
*
pNameOut
,
int
fCompl
);
static
int
Dec_GraphPrintOutputName
(
FILE
*
pFile
,
char
*
pNameOut
);
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
...
...
@@ -74,18 +74,18 @@ void Dec_GraphPrint( FILE * pFile, Dec_Graph_t * pGraph, char * pNamesIn[], char
// write the decomposition graph (factored form)
if
(
Dec_GraphIsConst
(
pGraph
)
)
// constant
{
Pos
=
Dec_GraphPrintOutputName
(
pFile
,
pNameOut
,
0
);
Pos
=
Dec_GraphPrintOutputName
(
pFile
,
pNameOut
);
fprintf
(
pFile
,
"Constant %d"
,
!
Dec_GraphIsComplement
(
pGraph
)
);
}
else
if
(
Dec_GraphIsVar
(
pGraph
)
)
// literal
{
Pos
=
Dec_GraphPrintOutputName
(
pFile
,
pNameOut
,
0
);
Pos
=
Dec_GraphPrintOutputName
(
pFile
,
pNameOut
);
Dec_GraphPrintGetLeafName
(
pFile
,
Dec_GraphVarInt
(
pGraph
),
Dec_GraphIsComplement
(
pGraph
),
pNamesIn
);
}
else
{
Pos
=
Dec_GraphPrintOutputName
(
pFile
,
pNameOut
,
Dec_GraphIsComplement
(
pGraph
)
);
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
Dec_GraphNodeLast
(
pGraph
),
0
,
pNamesIn
,
&
Pos
,
LitSizeMax
);
Pos
=
Dec_GraphPrintOutputName
(
pFile
,
pNameOut
);
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
Dec_GraphNodeLast
(
pGraph
),
Dec_GraphIsComplement
(
pGraph
)
,
pNamesIn
,
&
Pos
,
LitSizeMax
);
}
fprintf
(
pFile
,
"
\n
"
);
...
...
@@ -202,10 +202,10 @@ void Dec_GraphPrint_rec( FILE * pFile, Dec_Graph_t * pGraph, Dec_Node_t * pNode,
{
fprintf
(
pFile
,
"("
);
(
*
pPos
)
++
;
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
pNode0
,
!
pNode
->
fCompl0
,
pNamesIn
,
pPos
,
LitSizeMax
);
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
pNode0
,
!
pNode
->
eEdge0
.
fCompl
,
pNamesIn
,
pPos
,
LitSizeMax
);
fprintf
(
pFile
,
" + "
);
(
*
pPos
)
+=
3
;
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
pNode1
,
!
pNode
->
fCompl1
,
pNamesIn
,
pPos
,
LitSizeMax
);
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
pNode1
,
!
pNode
->
eEdge1
.
fCompl
,
pNamesIn
,
pPos
,
LitSizeMax
);
fprintf
(
pFile
,
")"
);
(
*
pPos
)
++
;
}
...
...
@@ -213,8 +213,8 @@ void Dec_GraphPrint_rec( FILE * pFile, Dec_Graph_t * pGraph, Dec_Node_t * pNode,
{
fprintf
(
pFile
,
"("
);
(
*
pPos
)
++
;
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
pNode0
,
pNode
->
fCompl0
,
pNamesIn
,
pPos
,
LitSizeMax
);
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
pNode1
,
pNode
->
fCompl1
,
pNamesIn
,
pPos
,
LitSizeMax
);
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
pNode0
,
pNode
->
eEdge0
.
fCompl
,
pNamesIn
,
pPos
,
LitSizeMax
);
Dec_GraphPrint_rec
(
pFile
,
pGraph
,
pNode1
,
pNode
->
eEdge1
.
fCompl
,
pNamesIn
,
pPos
,
LitSizeMax
);
fprintf
(
pFile
,
")"
);
(
*
pPos
)
++
;
}
...
...
@@ -234,7 +234,7 @@ void Dec_GraphPrint_rec( FILE * pFile, Dec_Graph_t * pGraph, Dec_Node_t * pNode,
int
Dec_GraphPrintGetLeafName
(
FILE
*
pFile
,
int
iLeaf
,
int
fCompl
,
char
*
pNamesIn
[]
)
{
static
char
Buffer
[
100
];
sprintf
(
Buffer
,
"%s%s"
,
pNamesIn
[
iLeaf
],
fCompl
?
"
\'
"
:
""
);
sprintf
(
Buffer
,
"%s%s"
,
fCompl
?
"!"
:
""
,
pNamesIn
[
iLeaf
]
);
fprintf
(
pFile
,
"%s"
,
Buffer
);
return
strlen
(
Buffer
);
}
...
...
@@ -272,11 +272,11 @@ void Dec_GraphPrintUpdatePos( FILE * pFile, int * pPos, int LitSizeMax )
SeeAlso []
***********************************************************************/
int
Dec_GraphPrintOutputName
(
FILE
*
pFile
,
char
*
pNameOut
,
int
fCompl
)
int
Dec_GraphPrintOutputName
(
FILE
*
pFile
,
char
*
pNameOut
)
{
if
(
pNameOut
==
NULL
)
return
0
;
fprintf
(
pFile
,
"%6s
%s = "
,
pNameOut
,
fCompl
?
"
\'
"
:
" "
);
fprintf
(
pFile
,
"%6s
= "
,
pNameOut
);
return
10
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment