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
3c358912
Commit
3c358912
authored
Dec 07, 2013
by
Baruch Sterin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixes for simple_livness
parent
549cd2c6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
28 deletions
+42
-28
Makefile
+2
-0
scripts/new_abc_commands.py
+15
-12
scripts/niklas.py
+25
-16
No files found.
Makefile
View file @
3c358912
ABC_PYTHON
=
/usr/bin/python
CC
:=
gcc
CC
:=
gcc
CXX
:=
g++
CXX
:=
g++
LD
:=
$(CXX)
LD
:=
$(CXX)
...
...
scripts/new_abc_commands.py
View file @
3c358912
...
@@ -214,23 +214,26 @@ proof_command_wrapper(par.simple_bip, 'HWMCC13', '/simple_bip_aiger', 0)
...
@@ -214,23 +214,26 @@ proof_command_wrapper(par.simple_bip, 'HWMCC13', '/simple_bip_aiger', 0)
proof_command_wrapper
(
par
.
simple_sat
,
'HWMCC13'
,
'/simple_sat_aiger'
,
0
)
proof_command_wrapper
(
par
.
simple_sat
,
'HWMCC13'
,
'/simple_sat_aiger'
,
0
)
proof_command_wrapper
(
par
.
mp
,
'HWMCC13'
,
'/multi_prove_aiger'
,
0
,
multi
=
True
)
proof_command_wrapper
(
par
.
mp
,
'HWMCC13'
,
'/multi_prove_aiger'
,
0
,
multi
=
True
)
from
niklas
import
run_niklas_multi
def
simple_liveness_prooffunc
(
aig_filename
):
def
simple_liveness_prooffunc
(
aig_filename
):
import
niklas
from
pyaig
import
utils
def
simplify
(
aiger_in
,
aiger_out
):
def
simplify
(
aiger_in
,
aiger_out
):
saved
=
utils
.
save_po_info
(
aiger_in
,
tmp
[
0
])
with
niklas
.
temp_file_names
(
2
,
suffix
=
'.aig'
)
as
tmp
:
par
.
read_file_quiet
(
tmp
[
0
])
par
.
pre_simp
()
pyabc
.
run_command
(
'write_aiger
%
s'
%
tmp
[
1
]
)
#~ pyabc.run_command( 'read_aiger %s'%tmp[0] )
saved
=
utils
.
save_po_info
(
aiger_in
,
tmp
[
0
])
#~ pyabc.run_command( 'dc2 ; dc2 ; dc2 ; dc2' )
#~ pyabc.run_command( 'write_aiger %s'%tmp[1] )
par
.
read_file_quiet
(
tmp
[
0
])
par
.
pre_simp
()
pyabc
.
run_command
(
'write_aiger
%
s'
%
tmp
[
1
]
)
utils
.
restore_po_info
(
saved
,
tmp
[
1
],
aiger_out
)
utils
.
restore_po_info
(
saved
,
tmp
[
1
],
aiger_out
)
return
True
def
report_result
(
id
,
res
):
def
report_result
(
id
,
res
):
...
@@ -246,7 +249,7 @@ def simple_liveness_prooffunc(aig_filename):
...
@@ -246,7 +249,7 @@ def simple_liveness_prooffunc(aig_filename):
return
False
return
False
try
:
try
:
run_niklas_multi
(
aig_filename
,
simplify
=
simplify
,
report_result
=
report_result
)
niklas
.
run_niklas_multi
(
aig_filename
,
simplify
=
simplify
,
report_result
=
report_result
)
except
:
except
:
import
traceback
import
traceback
traceback
.
print_exc
()
traceback
.
print_exc
()
...
...
scripts/niklas.py
View file @
3c358912
...
@@ -47,21 +47,24 @@ def parse_bip_status(status):
...
@@ -47,21 +47,24 @@ def parse_bip_status(status):
def
run_bip
(
args
,
aiger
):
def
run_bip
(
args
,
aiger
):
with
temp_file_names
(
1
)
as
tmpnames
:
import
redirect
with
redirect
.
redirect
():
args
=
[
'bip'
,
with
temp_file_names
(
1
)
as
tmpnames
:
'-abc'
,
'-input=
%
s'
%
aiger
,
args
=
[
'-output=
%
s'
%
tmpnames
[
0
],
'bip'
,
]
+
args
;
'-abc'
,
'-input=
%
s'
%
aiger
,
rc
=
subprocess
.
call
(
args
,
preexec_fn
=
pyabc
.
_set_death_signal
)
'-output=
%
s'
%
tmpnames
[
0
],
]
+
args
;
if
rc
!=
0
:
return
None
return
parse_bip_status
(
tmpnames
[
0
])
rc
=
subprocess
.
call
(
args
,
preexec_fn
=
pyabc
.
_set_death_signal
)
if
rc
!=
0
:
return
None
return
parse_bip_status
(
tmpnames
[
0
])
from
pyaig
import
AIG
,
read_aiger
,
write_aiger
,
utils
from
pyaig
import
AIG
,
read_aiger
,
write_aiger
,
utils
...
@@ -95,17 +98,23 @@ def run_niklas_single(aiger, simplify, report_result, timeout=None):
...
@@ -95,17 +98,23 @@ def run_niklas_single(aiger, simplify, report_result, timeout=None):
for
id
,
res
in
splitter
:
for
id
,
res
in
splitter
:
print
'NIKLAS: process
%
d finished with'
%
id
,
res
if
id
==
sleep_id
:
if
id
==
sleep_id
:
print
'NIKLAS: timeout'
return
False
return
False
if
id
==
simplifier_id
:
elif
id
==
simplifier_id
:
print
'NIKLAS: simplify ended'
if
not
res
:
if
not
res
:
continue
continue
print
'NIKLAS: killing'
splitter
.
kill
(
kill_if_simplified
)
splitter
.
kill
(
kill_if_simplified
)
splitter
.
fork_all
(
simplified_funcs
)
splitter
.
fork_all
(
simplified_funcs
)
continue
continue
if
report_result
(
res
):
elif
report_result
(
res
):
print
'NIKLAS: RESULT'
return
True
return
True
return
False
return
False
...
...
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