Ejemplo n.º 1
0
def find_011_se_conditions_non_same_rules():
    file = config.get_isc_results_file_path(*kmn_data["0-1-1"], "")
    conditions = iscu.load_iconditions_from_file(file)
    non_same_conditions = list()
    same_rule_isets = {8, 17, 35, 44}
    for ic in conditions:
        ne_isets = ic.ne_iset_ids
        if ne_isets.issubset(same_rule_isets):
            print(ic)
        else:
            non_same_conditions.append(ic)

    simplified_dnf, sim_dnf = iscu.simplify_iconditions(non_same_conditions)
    ne_isets = iscu.get_iconditions_ne_isets(non_same_conditions)
    print(ne_isets)
    print(simplified_dnf)
Ejemplo n.º 2
0
def check_isc_data(kmn_key, type, is_simplify=True):
    print(kmn_key, "iset conditions: ")
    file = config.get_isc_results_file_path(*kmn_data[kmn_key], type)
    conditions = iscu.load_iconditions_from_file(file)
    ne_isets = iscu.get_iconditions_ne_isets(conditions)
    print("ne isets: ", [i + 1 for i in ne_isets])
    ignore_ne_isets = iscu.find_common_ne_isets_from_iconditions(conditions)
    print("common ne isets: ", [i + 1 for i in ignore_ne_isets])
    ignore_ne_isets = set()
    ne_symbols = iscu.get_iconditions_ne_isets_logic_symbols(
        conditions, ignore_ne_isets)
    print("ne logic symbols: ", ne_symbols)

    # for c in conditions:
    #     print(c, " : ", iscu.convert_icondition_2_conjunctive_formula(c, ne_symbols))

    if is_simplify:
        dnf = iscu.convert_iconditions_2_disjunctive_formula(
            conditions, ne_symbols)
        print("dnf: ", dnf)
        simp, simp_dnf = iscu.simplify_iconditions(conditions, ignore_ne_isets)
        print("simplified: ", simp)
        print("simplified dnf: ", simp_dnf)