# Path: parser/parsesolveroutput.py
# def getCharBoolectorOutput(output, cipher, rounds):
# def getCharSTPOutput(output, cipher, rounds):
# 
# Path: config.py
# PATH_STP = "../stp/build/stp"
# 
# PATH_BOOLECTOR = "../boolector/build/bin/boolector"
# 
# PATH_CRYPTOMINISAT = "../cryptominisat/build/cryptominisat5"
# 
# MAX_WEIGHT = 1000
# 
# MAX_CHARACTERISTICS = 10000000


from parser import parsesolveroutput
from config import (PATH_STP, PATH_BOOLECTOR, PATH_CRYPTOMINISAT, MAX_WEIGHT,
                    MAX_CHARACTERISTICS)
from fractions import gcd
import subprocess
import random
import math
import os
import time

        print("Weight: {} Time: {}s".format(parameters["sweight"],
                                            round(time.time() - start_time, 2)))

        # Construct problem instance for given parameters
        stp_file = "tmp/{}{}.stp".format(cipher.name,
                                         parameters["wordsize"])
        cipher.createSTP(stp_file, parameters)

        result = ""
        if parameters["boolector"]:
            result = solveBoolector(stp_file)
        else:
            result = solveSTP(stp_file)

        # Check if a characteristic was found
        if foundSolution(result):
            current_time = round(time.time() - start_time, 2)
            print("---")
            print(("Characteristic for {} - Rounds {} - Wordsize {} - "
                   "Weight {} - Time {}s".format(cipher.name,
                                                 parameters["rounds"],
                                                 parameters["wordsize"],
                                                 parameters["sweight"],
                                                 current_time)))
            characteristic = ""
            if parameters["boolector"]:
                characteristic = parsesolveroutput.getCharBoolectorOutput(
                    result, cipher, parameters["rounds"])
            else:

# Path: parser/parsesolveroutput.py
# def getCharBoolectorOutput(output, cipher, rounds):
# def getCharSTPOutput(output, cipher, rounds):
# 
# Path: config.py
# PATH_STP = "../stp/build/stp"
# 
# PATH_BOOLECTOR = "../boolector/build/bin/boolector"
# 
# PATH_CRYPTOMINISAT = "../cryptominisat/build/cryptominisat5"
# 
# MAX_WEIGHT = 1000
# 
# MAX_CHARACTERISTICS = 10000000


# Path: cryptanalysis/search.py
from parser import parsesolveroutput
from config import (PATH_STP, PATH_BOOLECTOR, PATH_CRYPTOMINISAT, MAX_WEIGHT,
                    MAX_CHARACTERISTICS)
from fractions import gcd
import subprocess
import random
import math
import os
import time


        print("Weight: {} Time: {}s".format(parameters["sweight"],
                                            round(time.time() - start_time, 2)))

        # Construct problem instance for given parameters
        stp_file = "tmp/{}{}.stp".format(cipher.name,
                                         parameters["wordsize"])
        cipher.createSTP(stp_file, parameters)

        result = ""
        if parameters["boolector"]:
            result = solveBoolector(stp_file)
        else:
            result = solveSTP(stp_file)

        # Check if a characteristic was found
        if foundSolution(result):
            current_time = round(time.time() - start_time, 2)
            print("---")
            print(("Characteristic for {} - Rounds {} - Wordsize {} - "
                   "Weight {} - Time {}s".format(cipher.name,
                                                 parameters["rounds"],
                                                 parameters["wordsize"],
                                                 parameters["sweight"],
                                                 current_time)))
            characteristic = ""
            if parameters["boolector"]:
                characteristic = parsesolveroutput.getCharBoolectorOutput(
                    result, cipher, parameters["rounds"])
            else:

                characteristic = parsesolveroutput.getCharSTPOutput(