Esempio n. 1
0
def implied_facts(premise, facts_to_check):
    """
    Return a list of facts from facts_to_check that are implied by
    theory
    """
    from z3_utils import z3_implies_batch
    axioms = _ivy_interp.background_theory()
    premise = normalize_quantifiers((and_clauses(axioms, premise)).to_formula())
    facts_to_check = [f.to_formula() if type(f) is Clauses else f for f in facts_to_check]
    result = z3_implies_batch(premise, facts_to_check, False)
    return [f for f, x in zip(facts_to_check, result) if x]
Esempio n. 2
0
def implied_facts(premise, facts_to_check):
    """
    Return a list of facts from facts_to_check that are implied by
    theory
    """
    from z3_utils import z3_implies_batch
    axioms = _ivy_interp.background_theory()
    premise = normalize_quantifiers((and_clauses(axioms,
                                                 premise)).to_formula())
    facts_to_check = [
        f.to_formula() if type(f) is Clauses else f for f in facts_to_check
    ]
    result = z3_implies_batch(premise, facts_to_check, False)
    return [f for f, x in zip(facts_to_check, result) if x]
Esempio n. 3
0
def _normalize_facts(facts):
    facts = normalize_quantifiers(And(*facts))
    assert type(facts) is And
    return [f for f in facts if not is_tautology_equality(f)]
Esempio n. 4
0
def _normalize_facts(facts):
    facts = normalize_quantifiers(And(*facts))
    assert type(facts) is And
    return [f for f in facts if not is_tautology_equality(f)]