def super_prove_aiger_cmd(args):

    noisy = len(args)==2 and args[1]=='-n'

    if not noisy:
        pyabc.run_command('/pushredirect')
        pyabc.run_command('/pushdtemp')
    
    try:
        result = abc_common.super_prove()
    except:
        result = None
    
    if not noisy:
        pyabc.run_command('/popdtemp')
        pyabc.run_command('/popredirect')
            
    if result=="SAT":
        print 1
    elif result=="UNSAT":
        print 0
    else:
        print 2

    return 0
Beispiel #2
0
def super_prove_aiger_cmd(args):
    pyabc.run_command('/pushredirect')
    pyabc.run_command('/pushdtemp')
    
    try:
        result = abc_common.super_prove()
    except:
        result = None
    
    pyabc.run_command('/popdtemp')
    pyabc.run_command('/popredirect')
            
    if result=="SAT":
        print 1
    elif result=="UNSAT":
        print 0
    else:
        print 2

    return 0
def prove_one_by_one_cmd(args):
    
    noisy = len(args)==2 and args[1]=='-n'

    # switch to a temporary directory
    pyabc.run_command('/pushdtemp')
    
    # write a copy of the original file in the temporary directory
    pyabc.run_command('w original_aig_file.aig')
    
    # iterate through the ouptus
    for po in range(0, pyabc.n_pos()):
        
        if not noisy:
            pyabc.run_command('/pushredirect')

        # replace the nework with the cone of the current PO
        pyabc.run_command( 'cone -O %d -s'%po )

        # run super_prove
        try:
            result = abc_common.super_prove()
        except:
            result = 'UNKNOWN'

        if not noisy:
            pyabc.run_command('/popredirect')

        print 'PO %d is %s'%(po, result)
        
        # stop if the result is not UNSAT
        if result != "UNSAT":
            break

        # read the original file for the next iteration
        pyabc.run_command('r original_aig_file.aig')
        
    # go back to the original directory
    pyabc.run_command('/popdtemp')

    return 0