<commit_before>from abc import ABCMeta

from interfaces.solver_interface import SolverInterface
from synthesis.func_description import FuncDescription
import synthesis.smt_helper as smt_helper
from synthesis.smt_logic import Logic


class SmtSolverWithQueryStorageAbstract(SolverInterface, metaclass=ABCMeta):
    """
    Default implementation for most of the methods except
    die(), and solve()
    """

    def __init__(self, query_storage, logic:Logic):
        assert hasattr(query_storage, '__iadd__')

        self._query_storage = query_storage
        self._query_storage += smt_helper.make_headers()
        self._query_storage += smt_helper.make_set_logic(logic)
        self._logic = logic

    def declare_enum(self, enum_name:str, values):
        self._query_storage += smt_helper.declare_enum(enum_name, values)

    def declare_fun(self, func_desc:FuncDescription):
        self._query_storage += smt_helper.declare_fun(func_desc)

    def define_fun(self, func_desc:FuncDescription):
        self._query_storage += smt_helper.define_fun(func_desc)
<commit_msg>(since i moved define/declare into func_decl)<commit_after>from abc import ABCMeta

import interfaces.smt_helper as smt_helper
from interfaces.func_description import FuncDescription
from interfaces.solver_interface import SolverInterface
from synthesis.smt_logic import Logic


class SmtSolverWithQueryStorageAbstract(SolverInterface, metaclass=ABCMeta):
    """
    Default implementation for most of the methods except
    die(), and solve()
    """

    def __init__(self, query_storage, logic:Logic):
        assert hasattr(query_storage, '__iadd__')

        self._query_storage = query_storage
        self._query_storage += smt_helper.make_headers()
        self._query_storage += smt_helper.make_set_logic(logic)
        self._logic = logic

    def declare_enum(self, enum_name:str, values):
        self._query_storage += smt_helper.declare_enum(enum_name, values)

{'fraction_non_alphanumeric': 0.07719836400817996, 'fraction_numerical': 0.0, 'mean_word_length': 4.512676056338028, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4111623', 'n_tokens_mistral': 591, 'n_tokens_neox': 559, 'n_words': 127}