diff --git a/clorm/orm/_typing.py b/clorm/orm/_typing.py
index f896f8a..473272a 100644
--- a/clorm/orm/_typing.py
+++ b/clorm/orm/_typing.py
@@ -1,5 +1,5 @@
 import sys
-from typing import Any, Optional, Tuple, Type, TypeVar, Union, cast
+from typing import Any, Dict, ForwardRef, Optional, Tuple, Type, TypeVar, Union, _eval_type, cast
 
 from clingo import Symbol
 
@@ -58,3 +58,37 @@ elif sys.version_info < (3, 8):
                 res = (list(res[:-1]), res[-1])
             return res
         return getattr(t, "__args__", ())
+
+
+def resolve_annotations(
+    raw_annotations: Dict[str, Type[Any]], module_name: Optional[str] = None
+) -> Dict[str, Type[Any]]:
+    """
+    Taken from https://github.com/pydantic/pydantic/blob/1.10.X-fixes/pydantic/typing.py#L376
+
+    Resolve string or ForwardRef annotations into type objects if possible.
+    """
+    base_globals: Optional[Dict[str, Any]] = None
+    if module_name:
+        try:
+            module = sys.modules[module_name]
+        except KeyError:
+            # happens occasionally, see https://github.com/pydantic/pydantic/issues/2363
+            pass
+        else:
+            base_globals = module.__dict__
+
+    annotations = {}
+    for name, value in raw_annotations.items():
+        if isinstance(value, str):
+            if (3, 10) > sys.version_info >= (3, 9, 8) or sys.version_info >= (3, 10, 1):
+                value = ForwardRef(value, is_argument=False, is_class=True)
+            else:
+                value = ForwardRef(value, is_argument=False)
+        try:
+            value = _eval_type(value, base_globals, None)
+        except NameError:
+            # this is ok, it can be fixed with update_forward_refs
+            pass
+        annotations[name] = value
+    return annotations
diff --git a/clorm/orm/atsyntax.py b/clorm/orm/atsyntax.py
index 1e1b910..97d3eff 100644
--- a/clorm/orm/atsyntax.py
+++ b/clorm/orm/atsyntax.py
@@ -6,9 +6,9 @@
 import collections.abc as cabc
 import functools
 import inspect
-from typing import Any, Callable, List, Sequence, Tuple, Type
+from typing import Any, Callable, List, Sequence, Tuple, Type, Union
 
-from .core import BaseField, get_field_definition, infer_field_definition
+from .core import BaseField, get_field_definition, infer_field_definition, resolve_annotations
 
 __all__ = [
     "TypeCastSignature",
@@ -36,6 +36,7 @@ class TypeCastSignature(object):
     r"""Defines a signature for converting to/from Clingo data types.
 
      Args:
+       module: Name of the module where the signature is defined
        sigs(\*sigs): A list of signature elements.
 
        - Inputs. Match the sub-elements [:-1] define the input signature while
@@ -54,9 +55,9 @@ class TypeCastSignature(object):
                       pytocl = lambda dt: dt.strftime("%Y%m%d")
                       cltopy = lambda s: datetime.datetime.strptime(s,"%Y%m%d").date()
 
-            drsig = TypeCastSignature(DateField, DateField, [DateField])
+            drsig = TypeCastSignature(DateField, DateField, [DateField], module = "__main__")
 
-            @drsig.make_clingo_wrapper
+            @drsig.wrap_function
             def date_range(start, end):
                 return [ start + timedelta(days=x) for x in range(0,end-start) ]
 
@@ -97,24 +98,29 @@ class TypeCastSignature(object):
             return _is_output_field(se[0])
         return _is_output_field(se)
 
-    def __init__(self, *sigs: Any) -> None:
+    def __init__(self, *sigs: Any, module: Union[str, None] = None) -> None:
+        module = self.__module__ if module is None else module
+
         def _validate_basic_sig(sig):
             if TypeCastSignature._is_input_element(sig):
                 return True
             raise TypeError(
-                ("TypeCastSignature element {} must be a BaseField " "subclass".format(sig))
+                "TypeCastSignature element {} must be a BaseField subclass".format(sig)
             )
 
         insigs: List[Type[BaseField]] = []
         for s in sigs[:-1]:
             field = None
             try:
-                field = infer_field_definition(s, "")
+                resolved = resolve_annotations({"__tmp__": s}, module)["__tmp__"]
+                field = infer_field_definition(resolved, "")
             except Exception:
                 pass
             insigs.append(field if field else type(get_field_definition(s)))
         try:
-            self._outsig = infer_field_definition(sigs[-1], "") or sigs[-1]
+            outsig = sigs[-1]
+            outsig = resolve_annotations({"__tmp__": outsig}, module)["__tmp__"]
+            self._outsig = infer_field_definition(outsig, "") or outsig
         except Exception:
             self._outsig = sigs[-1]
 
@@ -327,7 +333,7 @@ def make_function_asp_callable(*args: Any) -> _AnyCallable:
 
     # A decorator function that adjusts for the given signature
     def _sig_decorate(func):
-        s = TypeCastSignature(*sigs)
+        s = TypeCastSignature(*sigs, module=func.__module__)
         return s.wrap_function(func)
 
     # If no function and sig then called as a decorator with arguments
@@ -372,7 +378,7 @@ def make_method_asp_callable(*args: Any) -> _AnyCallable:
 
     # A decorator function that adjusts for the given signature
     def _sig_decorate(func):
-        s = TypeCastSignature(*sigs)
+        s = TypeCastSignature(*sigs, module=func.__module__)
         return s.wrap_method(func)
 
     # If no function and sig then called as a decorator with arguments
@@ -479,7 +485,7 @@ class ContextBuilder(object):
                 args = sigargs
             else:
                 args = _get_annotations(fn)
-            s = TypeCastSignature(*args)
+            s = TypeCastSignature(*args, module=fn.__module__)
             self._add_function(fname, s, fn)
             return fn
 
diff --git a/clorm/orm/core.py b/clorm/orm/core.py
index b034dad..cec0826 100644
--- a/clorm/orm/core.py
+++ b/clorm/orm/core.py
@@ -47,7 +47,7 @@ from clorm.orm.types import (
     TailListReversed,
 )
 
-from ._typing import AnySymbol, get_args, get_origin
+from ._typing import AnySymbol, get_args, get_origin, resolve_annotations
 from .noclingo import (
     Function,
     Number,
@@ -2866,6 +2866,9 @@ def infer_field_definition(type_: Type[Any], module: str) -> Optional[Type[BaseF
                 tuple(infer_field_definition(arg, module) for arg in args), module
             )
         )
+    if not isinstance(type_, type):
+        return None
+    # from here on only check for subclass
     if issubclass(type_, enum.Enum):
         # if type_ just inherits from Enum is IntegerField, otherwise find appropriate Field
         field = (
@@ -3000,13 +3003,11 @@ def _make_predicatedefn(
 
     fields_from_annotations = {}
     module = namespace.get("__module__", None)
-    for name, type_ in namespace.get("__annotations__", {}).items():
+    for name, type_ in resolve_annotations(namespace.get("__annotations__", {}), module).items():
         if name in fields_from_dct:  # first check if FieldDefinition was assigned
             fields_from_annotations[name] = fields_from_dct[name]
-        else:
-            fdefn = infer_field_definition(
-                type_, module
-            )  # if not try to infer the definition based on the type
+        else:  # if not try to infer the definition based on the type
+            fdefn = infer_field_definition(type_, module)
             if fdefn:
                 fields_from_annotations[name] = fdefn
             elif inspect.isclass(type_):

diff --git a/tests/__init__.py b/tests/__init__.py
index 59808ff..ee924d0 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -8,6 +8,7 @@ import os
 os.environ["CLORM_NOCLINGO"] = "True"
 
 from .test_clingo import *
+from .test_forward_ref import *
 from .test_json import *
 from .test_libdate import LibDateTestCase
 from .test_libtimeslot import *
diff --git a/tests/test_forward_ref.py b/tests/test_forward_ref.py
new file mode 100644
index 0000000..979898a
--- /dev/null
+++ b/tests/test_forward_ref.py
@@ -0,0 +1,167 @@
+import importlib
+import inspect
+import secrets
+import sys
+import tempfile
+import textwrap
+import unittest
+from contextlib import contextmanager
+from pathlib import Path
+from types import FunctionType
+
+from clingo import Number, String
+
+__all__ = [
+    "ForwardRefTestCase",
+]
+
+
+def _extract_source_code_from_function(function):
+    if function.__code__.co_argcount:
+        raise RuntimeError(f"function {function.__qualname__} cannot have any arguments")
+
+    code_lines = ""
+    body_started = False
+    for line in textwrap.dedent(inspect.getsource(function)).split("\n"):
+        if line.startswith("def "):
+            body_started = True
+            continue
+        elif body_started:
+            code_lines += f"{line}\n"
+
+    return textwrap.dedent(code_lines)
+
+
+def _create_module_file(code, tmp_path, name):
+    name = f"{name}_{secrets.token_hex(5)}"
+    path = Path(tmp_path, f"{name}.py")
+    path.write_text(code)
+    return name, str(path)
+
+
+def create_module(tmp_path, method_name):
+    def run(source_code_or_function):
+        """
+        Create module object, execute it and return
+
+        :param source_code_or_function string or function with body as a source code for created module
+
+        """
+        if isinstance(source_code_or_function, FunctionType):
+            source_code = _extract_source_code_from_function(source_code_or_function)
+        else:
+            source_code = source_code_or_function
+
+        module_name, filename = _create_module_file(source_code, tmp_path, method_name)
+
+        spec = importlib.util.spec_from_file_location(module_name, filename, loader=None)
+        sys.modules[module_name] = module = importlib.util.module_from_spec(spec)
+        spec.loader.exec_module(module)
+        return module
+
+    return run
+
+
+class ForwardRefTestCase(unittest.TestCase):
+    def setUp(self):
+        @contextmanager
+        def f(source_code_or_function):
+            with tempfile.TemporaryDirectory() as tmp_path:
+                yield create_module(tmp_path, self._testMethodName)(source_code_or_function)
+
+        self._create_module = f
+
+    def test_postponed_annotations(self):
+        code = """
+from __future__ import annotations
+from clorm import Predicate
+
+class P1(Predicate):
+    a: int
+    b: str
+"""
+        with self._create_module(code) as module:
+            p = module.P1(a=3, b="42")
+            self.assertEqual(str(p), 'p1(3,"42")')
+
+    def test_postponed_annotations_complex(self):
+        code = """
+from clorm import Predicate
+from typing import Union
+
+class P1(Predicate):
+    a: int
+    b: str
+
+class P2(Predicate):
+    a: int
+
+class P3(Predicate):
+    a: 'Union[P1, P2]'
+"""
+        with self._create_module(code) as module:
+            p = module.P3(a=module.P1(a=3, b="42"))
+            self.assertEqual(str(p), 'p3(p1(3,"42"))')
+            p = module.P3(a=module.P2(a=42))
+            self.assertEqual(str(p), "p3(p2(42))")
+
+    def test_forward_ref(self):
+        def module_():
+            from typing import ForwardRef
+
+            from clorm import Predicate
+
+            class A(Predicate):
+                a: int
+
+            ARef = ForwardRef("A")
+
+            class B(Predicate):
+                a: ARef
+
+        with self._create_module(module_) as module:
+            b = module.B(a=module.A(a=42))
+            self.assertEqual(str(b), "b(a(42))")
+
+    def test_forward_ref_list(self):
+        def module_():
+            from typing import ForwardRef
+
+            from clorm import HeadList, Predicate
+
+            class A(Predicate):
+                a: int
+
+            ARef = ForwardRef("A")
+
+            class B(Predicate):
+                a: HeadList[ARef]
+
+        with self._create_module(module_) as module:
+            b = module.B(a=[module.A(a=41), module.A(a=42)])
+            self.assertEqual(str(b), "b((a(41),(a(42),())))")
+
+    def test_forward_ref_asp_callable(self):
+        code = """
+from __future__ import annotations
+from clorm import Predicate, make_function_asp_callable, make_method_asp_callable
+
+class P1(Predicate):
+    a: int
+    b: str
+
+@make_function_asp_callable
+def f(a: int, b: str) -> P1:
+    return P1(a,b)
+
+class Context:
+    @make_method_asp_callable
+    def f(self, a: int, b: str) -> P1:
+        return P1(a,b)
+"""
+        with self._create_module(code) as module:
+            p = module.f(Number(2), String("2"))
+            self.assertEqual(str(p), 'p1(2,"2")')
+            ctx = module.Context()
+            p = ctx.f(Number(2), String("2"))
+            self.assertEqual(str(p), 'p1(2,"2")')

Dealing with postponed evaluation of annotations
Postponed evaluation of annotations is documented in PEP 563 https://peps.python.org/pep-0563/

Postponed evaluation of annotations can be enabled with `from __future__ import annotations` and will become mandatory in some future version of Python.

The basic idea is that when the annotation is evaluated at runtime, it will appear as a string and not as the types that the strings represent. Because of this, using annotations for defining `Predicate` sub-classes or using annotations with function signature to define '@' ASP functions breaks when postponed evaluation of annotations is enabled.

Dealing with this in Clorm may not be straightforward. See this Pydantic issue for some discussion: https://github.com/pydantic/pydantic/issues/2678. I think some of the issues raised could also apply to Clorm.



tests/__init__.py::ForwardRefTestCase::test_forward_ref tests/__init__.py::ForwardRefTestCase::test_forward_ref_asp_callable tests/__init__.py::ForwardRefTestCase::test_forward_ref_list tests/__init__.py::ForwardRefTestCase::test_postponed_annotations tests/__init__.py::ForwardRefTestCase::test_postponed_annotations_complex tests/test_forward_ref.py::ForwardRefTestCase::test_forward_ref tests/test_forward_ref.py::ForwardRefTestCase::test_forward_ref_asp_callable tests/test_forward_ref.py::ForwardRefTestCase::test_forward_ref_list tests/test_forward_ref.py::ForwardRefTestCase::test_postponed_annotations tests/test_forward_ref.py::ForwardRefTestCase::test_postponed_annotations_complex
tests/__init__.py::ClingoTestCase::test_basic_clingo_connection tests/__init__.py::ClingoTestCase::test_class_defs_are_equal tests/__init__.py::ClingoTestCase::test_control_and_model_wrapper tests/__init__.py::ClingoTestCase::test_control_model_integration tests/__init__.py::JSONSymbolTestCase::test_symbol_decoder tests/__init__.py::JSONSymbolTestCase::test_symbol_encoder tests/__init__.py::JSONPredicateTestCase::test_factbase_coder tests/__init__.py::JSONPredicateTestCase::test_predicate_coder tests/__init__.py::LibDateTestCase::test_datefield tests/__init__.py::LibDateTestCase::test_dates tests/__init__.py::LibDateTestCase::test_docstrings tests/__init__.py::LibDateTestCase::test_enumdate tests/__init__.py::LibDateTestCase::test_enumdates tests/__init__.py::LibTimeSlotTimeFieldTestCase::test_timefield tests/__init__.py::LibTimeSlotGranularityTestCase::test_granularity_15min tests/__init__.py::LibTimeSlotGranularityTestCase::test_granularity_75min tests/__init__.py::LibTimeSlotGranularityTestCase::test_granularity_bad tests/__init__.py::LibTimeSlotTestCase::test_round_ceil_and_floor tests/__init__.py::LibTimeSlotTestCase::test_timeslotrange_init tests/__init__.py::ClingoPatchTestCase::test_monkey tests/__init__.py::TypeCastSignatureTestCase::test_get_annotations_errors tests/__init__.py::TypeCastSignatureTestCase::test_input_signature tests/__init__.py::TypeCastSignatureTestCase::test_make_function_asp_callable tests/__init__.py::TypeCastSignatureTestCase::test_make_function_asp_callable_error_feedback tests/__init__.py::TypeCastSignatureTestCase::test_make_function_asp_callable_with_tuples tests/__init__.py::TypeCastSignatureTestCase::test_make_method_asp_callable_error_feedback tests/__init__.py::TypeCastSignatureTestCase::test_signature tests/__init__.py::TypeCastSignatureTestCase::test_signature_with_tuples tests/__init__.py::ContextBuilderTestCase::test_register tests/__init__.py::ContextBuilderTestCase::test_register_name tests/__init__.py::FieldTestCase::test_api_basefield_bad_instantiation tests/__init__.py::FieldTestCase::test_api_catch_bad_field_instantiation tests/__init__.py::FieldTestCase::test_api_clingo_pytocl_and_cltopy tests/__init__.py::FieldTestCase::test_api_combine_fields tests/__init__.py::FieldTestCase::test_api_define_enum_field tests/__init__.py::FieldTestCase::test_api_field_defaults tests/__init__.py::FieldTestCase::test_api_field_function tests/__init__.py::FieldTestCase::test_api_field_function_illegal_arguments tests/__init__.py::FieldTestCase::test_api_field_index tests/__init__.py::FieldTestCase::test_api_flat_list_field tests/__init__.py::FieldTestCase::test_api_nested_list_field tests/__init__.py::FieldTestCase::test_api_nested_list_field_alt tests/__init__.py::FieldTestCase::test_api_noclingo_pytocl_and_cltopy tests/__init__.py::FieldTestCase::test_api_primitive_field_conversion tests/__init__.py::FieldTestCase::test_api_raw_class tests/__init__.py::FieldTestCase::test_api_raw_pickling tests/__init__.py::FieldTestCase::test_api_refine_field_by_functor tests/__init__.py::FieldTestCase::test_api_refine_field_by_values tests/__init__.py::FieldTestCase::test_api_simplefield tests/__init__.py::FieldTestCase::test_api_user_defined_subclass tests/__init__.py::FieldTestCase::test_instantiate_BaseField tests/__init__.py::FieldTestCase::test_nonapi_combine_fields tests/__init__.py::PredicateTestCase::test_anon_nonlogicalsymbol tests/__init__.py::PredicateTestCase::test_api_subfield_access tests/__init__.py::PredicateTestCase::test_arity_len_nonlogicalsymbol tests/__init__.py::PredicateTestCase::test_bad_predicate_defn tests/__init__.py::PredicateTestCase::test_bad_predicate_instantiation tests/__init__.py::PredicateTestCase::test_complex_term_field_tuple_pytocl tests/__init__.py::PredicateTestCase::test_field_complex_class_property tests/__init__.py::PredicateTestCase::test_get_field_definition tests/__init__.py::PredicateTestCase::test_iter_bool_nonlogicalsymbol tests/__init__.py::PredicateTestCase::test_predicate_annotated_fields_union_StrictBool_int tests/__init__.py::PredicateTestCase::test_predicate_annotated_fields_union_bool_int tests/__init__.py::PredicateTestCase::test_predicate_anonymous_field_with_default tests/__init__.py::PredicateTestCase::test_predicate_cant_infer_field_from_annotation tests/__init__.py::PredicateTestCase::test_predicate_default_predicate_names tests/__init__.py::PredicateTestCase::test_predicate_defn_containing_indexed_fields tests/__init__.py::PredicateTestCase::test_predicate_kwargs_meta tests/__init__.py::PredicateTestCase::test_predicate_meta_kwargs_class_conflict tests/__init__.py::PredicateTestCase::test_predicate_with_default_field tests/__init__.py::PredicateTestCase::test_predicate_with_multi_field tests/__init__.py::PredicateTestCase::test_predicate_with_nested_list_field tests/__init__.py::PredicateTestCase::test_predicate_with_tuple_comparison tests/__init__.py::PredicateTestCase::test_predicate_with_wrong_mixed_annotations_and_Fields tests/__init__.py::PredicateTestCase::test_predicates_with_annotated_fields tests/__init__.py::PredicateTestCase::test_simple_predicate_defn tests/__init__.py::PredicateTestCase::test_subclassing_nonlogicalsymbol tests/__init__.py::PredicateTestCase::test_tuple_nonlogicalsymbol tests/__init__.py::FactPicklingTestCase::test_basic_predicate_pickling tests/__init__.py::FactPicklingTestCase::test_complex_predicate_pickling_global tests/__init__.py::PredicateInternalUnifyTestCase::test_clone tests/__init__.py::PredicateInternalUnifyTestCase::test_comparison_operator_overloads_complex tests/__init__.py::PredicateInternalUnifyTestCase::test_complex_predicate_defn tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_comparison_operator_overload_signed tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_comparison_operator_overloads tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_init_basic tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_init_named tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_init_neg_literals_signed_predicates tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_init_neg_literals_simple tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_init_positional tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_iterable tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_positional_access tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_value_by_index tests/__init__.py::PredicateInternalUnifyTestCase::test_predicate_with_function_default tests/__init__.py::PredicateInternalUnifyTestCase::test_simple_predicate_function tests/__init__.py::PredicateInternalUnifyTestCase::test_unifying_symbol_and_complex_predicate tests/__init__.py::PredicateInternalUnifyTestCase::test_unifying_symbol_and_predicate tests/__init__.py::PredicateInternalUnifyTestCase::test_using_slots_for_predicates tests/__init__.py::PredicatePathTestCase::test_api_comparison_operator_overloads tests/__init__.py::PredicatePathTestCase::test_api_path_and_hashable_path_bad_inputs tests/__init__.py::PredicatePathTestCase::test_api_path_and_hashable_path_inputs tests/__init__.py::PredicatePathTestCase::test_api_path_instance tests/__init__.py::PredicatePathTestCase::test_api_predicate_path_alias tests/__init__.py::PredicatePathTestCase::test_dealised_path_none tests/__init__.py::PredicatePathTestCase::test_dealised_path_predicate tests/__init__.py::PredicatePathTestCase::test_dealised_path_predicate_path tests/__init__.py::PredicatePathTestCase::test_dealised_raise_type_error tests/__init__.py::PredicatePathTestCase::test_nonapi_path_class tests/__init__.py::PredicatePathTestCase::test_nonapi_predicate_path_root tests/__init__.py::PredicatePathTestCase::test_resolve_fact_wrt_path tests/__init__.py::QConditionTestCase::test_api_boolean_operator_overloads tests/__init__.py::QConditionTestCase::test_api_formatting tests/__init__.py::QConditionTestCase::test_api_misc_functions tests/__init__.py::QConditionTestCase::test_nonapi_args_and_operator_access tests/__init__.py::QConditionTestCase::test_nonapi_explicit_and_implicit_creation tests/__init__.py::QConditionTestCase::test_nonapi_qcondition_creation tests/__init__.py::FactBaseTestCase::test_comparison_ops tests/__init__.py::FactBaseTestCase::test_container_ops tests/__init__.py::FactBaseTestCase::test_delayed_init tests/__init__.py::FactBaseTestCase::test_equality_fb_different_order tests/__init__.py::FactBaseTestCase::test_factbase_aspstr_signature tests/__init__.py::FactBaseTestCase::test_factbase_aspstr_sorted tests/__init__.py::FactBaseTestCase::test_factbase_aspstr_width tests/__init__.py::FactBaseTestCase::test_factbase_copy tests/__init__.py::FactBaseTestCase::test_factbase_iteration tests/__init__.py::FactBaseTestCase::test_factbase_normal_init tests/__init__.py::FactBaseTestCase::test_set_comparison_ops tests/__init__.py::FactBaseTestCase::test_set_ops tests/__init__.py::QueryAPI1TestCase::test_api_factbase_select_complex_term_placeholders tests/__init__.py::QueryAPI1TestCase::test_api_factbase_select_indexing tests/__init__.py::QueryAPI1TestCase::test_api_factbase_select_multi_placeholder tests/__init__.py::QueryAPI1TestCase::test_api_factbase_select_order_by tests/__init__.py::QueryAPI1TestCase::test_api_factbase_select_order_by_complex_term tests/__init__.py::QueryAPI1TestCase::test_api_factbase_select_placeholders_with_lambda tests/__init__.py::QueryAPI1TestCase::test_api_select_additional tests/__init__.py::QueryAPI1TestCase::test_api_select_factbase2 tests/__init__.py::QueryAPI1TestCase::test_bad_factbase_select_delete_statements tests/__init__.py::QueryAPI1TestCase::test_factbase_delete tests/__init__.py::QueryAPI1TestCase::test_factbase_select tests/__init__.py::QueryAPI1TestCase::test_factbase_select_complex_where tests/__init__.py::QueryAPI1TestCase::test_factbase_select_with_subfields tests/__init__.py::QueryAPI1TestCase::test_select_by_predicate tests/__init__.py::QueryAPI2TestCase::test_api_bad_join_statement tests/__init__.py::QueryAPI2TestCase::test_api_complex_query_join_order_output tests/__init__.py::QueryAPI2TestCase::test_api_complex_query_join_ordered tests/__init__.py::QueryAPI2TestCase::test_api_nonselect_single_table tests/__init__.py::QueryAPI2TestCase::test_api_select_multi_table tests/__init__.py::QueryAPI2TestCase::test_api_select_multi_table_functor_select tests/__init__.py::QueryAPI2TestCase::test_api_select_multi_table_functor_where tests/__init__.py::QueryAPI2TestCase::test_api_select_single_table tests/__init__.py::QueryAPI2TestCase::test_api_select_single_table_bad tests/__init__.py::SelectJoinTestCase::test_api_select_self_join tests/__init__.py::MembershipQueriesTestCase::test_basic_membership tests/__init__.py::MembershipQueriesTestCase::test_membership_subquery tests/__init__.py::FactBasePicklingTestCase::test_factbase_pickling tests/__init__.py::FactBasePicklingTestCase::test_pickle_anonTuple tests/__init__.py::FactBasePicklingTestCase::test_pickled_factbase_querying tests/__init__.py::FactIndexTestCase::test_add tests/__init__.py::FactIndexTestCase::test_clear tests/__init__.py::FactIndexTestCase::test_create tests/__init__.py::FactIndexTestCase::test_find tests/__init__.py::FactIndexTestCase::test_find_ordering tests/__init__.py::FactIndexTestCase::test_remove tests/__init__.py::FactIndexTestCase::test_subfields tests/__init__.py::FactMapTestCase::test_factmap_basics tests/__init__.py::FactMapTestCase::test_factmap_copy tests/__init__.py::FactMapTestCase::test_set_ops tests/__init__.py::NoClingoTestCase::test_clingo_to_noclingo tests/__init__.py::NoClingoTestCase::test_comparison_nosymbol_and_symbol tests/__init__.py::NoClingoTestCase::test_comparison_ops tests/__init__.py::NoClingoTestCase::test_function tests/__init__.py::NoClingoTestCase::test_hash_and_equality_comparison_ops tests/__init__.py::NoClingoTestCase::test_infimum_supremum tests/__init__.py::NoClingoTestCase::test_invalid_values tests/__init__.py::NoClingoTestCase::test_number tests/__init__.py::NoClingoTestCase::test_same_error_messages tests/__init__.py::NoClingoTestCase::test_string tests/__init__.py::NoClingoTestCase::test_symbol_modes tests/__init__.py::NoClingoTestCase::test_tuple tests/__init__.py::NoClingoDisabledTestCase::test_noclingo_switch_disabled tests/__init__.py::PlaceholderTestCase::test_NamedPlaceholder tests/__init__.py::PlaceholderTestCase::test_PositionalPlaceholder tests/__init__.py::PlaceholderTestCase::test_placeholder_instantiation tests/__init__.py::QQConditionTestCase::test_complex_comparison_conditional tests/__init__.py::QQConditionTestCase::test_nonapi_not_bool_not_comparison_condition tests/__init__.py::QQConditionTestCase::test_simple_comparison_conditional tests/__init__.py::ComparatorTestCase::test_api_func tests/__init__.py::ComparatorTestCase::test_nonapi_FunctionComparator tests/__init__.py::ComparatorTestCase::test_nonapi_FunctionComparator_with_args tests/__init__.py::ComparatorTestCase::test_nonapi_StandardComparator tests/__init__.py::ComparatorTestCase::test_nonapi_StandardComparator_keyable tests/__init__.py::ComparatorTestCase::test_nonapi_StandardComparator_make_callable_with_tuples tests/__init__.py::ComparatorTestCase::test_nonapi_comparison_callables tests/__init__.py::ComparatorTestCase::test_nonapi_make_input_alignment_functor tests/__init__.py::ComparatorTestCase::test_nonapi_make_input_alignment_functor_complex tests/__init__.py::WhereExpressionTestCase::test_nonapi_Clause tests/__init__.py::WhereExpressionTestCase::test_nonapi_ClauseBlock tests/__init__.py::WhereExpressionTestCase::test_nonapi_negate_where_expression tests/__init__.py::WhereExpressionTestCase::test_nonapi_normalise_where_expression tests/__init__.py::WhereExpressionTestCase::test_nonapi_partition_clauses tests/__init__.py::WhereExpressionTestCase::test_nonapi_validate_where_expression tests/__init__.py::WhereExpressionTestCase::test_nonapi_where_expression_to_cnf tests/__init__.py::WhereExpressionTestCase::test_nonapi_where_expression_to_nnf tests/__init__.py::JoinExpressionTestCase::test_nonapi_validate_join_expression tests/__init__.py::OrderByTestCase::test_api_asc_desc tests/__init__.py::OrderByTestCase::test_nonapi_OrderByBlock tests/__init__.py::OrderByTestCase::test_nonapi_OrderBy_1d tests/__init__.py::OrderByTestCase::test_nonapi_validate_orderby_expression tests/__init__.py::QueryPlanTestCase::test_make_query_plan tests/__init__.py::QueryPlanTestCase::test_make_query_plan_membership tests/__init__.py::QueryPlanTestCase::test_nonapi_JoinQueryPlan tests/__init__.py::QueryPlanTestCase::test_nonapi_JoinQueryPlan_with_complex_prejoin_key_clause tests/__init__.py::QueryPlanTestCase::test_nonapi_QueryPlan tests/__init__.py::QueryPlanTestCase::test_nonapi_basic_join_order tests/__init__.py::QueryPlanTestCase::test_nonapi_fixed_join_order tests/__init__.py::QueryPlanTestCase::test_nonapi_make_join_pair tests/__init__.py::QueryPlanTestCase::test_nonapi_make_prejoin_pair tests/__init__.py::QueryPlanTestCase::test_nonapi_make_prejoin_pair_simple tests/__init__.py::QueryPlanTestCase::test_nonapi_make_query_plan_preordered_roots tests/__init__.py::QueryPlanTestCase::test_nonapi_oppref_join_order tests/__init__.py::QueryPlanTestCase::test_nonapi_partition_orderbys tests/__init__.py::InQuerySorterTestCase::test_InQuerySorter_bad tests/__init__.py::InQuerySorterTestCase::test_InQuerySorter_facttuples tests/__init__.py::InQuerySorterTestCase::test_InQuerySorter_singlefacts tests/__init__.py::QueryTestCase::test_make_first_join_query tests/__init__.py::QueryTestCase::test_make_first_prejoin_query tests/__init__.py::QueryTestCase::test_make_query tests/__init__.py::QueryTestCase::test_nonapi_make_chained_join_query tests/__init__.py::QueryTestCase::test_nonapi_make_prejoin_query_source tests/__init__.py::QueryTestCase::test_nonapi_make_query_sort_order tests/__init__.py::QueryExecutorTestCase::test_api_QueryExecutor_delete tests/__init__.py::QueryExecutorTestCase::test_api_QueryExecutor_delete_nowhere_clause tests/__init__.py::QueryExecutorTestCase::test_api_QueryExecutor_modify tests/__init__.py::QueryExecutorTestCase::test_api_QueryExecutor_output_alignment tests/__init__.py::QueryExecutorTestCase::test_api_QueryExecutor_replace tests/__init__.py::QueryExecutorTestCase::test_nonapi_QueryExecutor tests/__init__.py::QueryExecutorTestCase::test_nonapi_QueryExecutor_contains tests/__init__.py::QueryExecutorTestCase::test_nonapi_QueryExecutor_contains_indexed tests/__init__.py::QueryExecutorTestCase::test_nonapi_QueryExecutor_order tests/__init__.py::QueryExecutorTestCase::test_nonapi_QueryExecutor_sort_order tests/__init__.py::QueryExecutorTestCase::test_nonapi_basic_tests tests/__init__.py::QueryExecutorTestCase::test_nonapi_default_output_spec tests/__init__.py::QueryExecutorTestCase::test_nonapi_group_by tests/__init__.py::QueryExecutorTestCase::test_nonapi_inequality_join_tests tests/__init__.py::UnifyTestCase::test_predicate_instance_raw_term tests/__init__.py::UnifyTestCase::test_symbolpredicateunifier tests/__init__.py::UnifyTestCase::test_symbolpredicateunifier_symbols tests/__init__.py::UnifyTestCase::test_symbolpredicateunifier_with_subfields tests/__init__.py::UnifyTestCase::test_unify tests/__init__.py::UnifyTestCase::test_unify_catch_exceptions tests/__init__.py::UnifyTestCase::test_unify_nullary tests/__init__.py::UnifyTestCase::test_unify_same_sig tests/__init__.py::UnifyTestCase::test_unify_same_sig2 tests/__init__.py::UnifyTestCase::test_unify_signed_literals tests/__init__.py::ClingoControlConvTestCase::test_control_add_facts tests/__init__.py::ClingoControlConvTestCase::test_symbolic_atoms_to_facts tests/__init__.py::ParseTestCase::test_lark_parse_facts tests/__init__.py::ParseTestCase::test_lark_parse_nested_facts tests/__init__.py::ParseTestCase::test_lark_parse_non_simple_facts tests/__init__.py::ParseTestCase::test_parse_facts tests/__init__.py::ParseTestCase::test_parse_nested_facts tests/__init__.py::ParseTestCase::test_parse_non_simple_facts tests/__init__.py::OrderedSetTestCase::test_basic_creation_iteration tests/__init__.py::OrderedSetTestCase::test_basic_ops tests/__init__.py::OrderedSetTestCase::test_bool_len_contains tests/__init__.py::OrderedSetTestCase::test_bool_ops tests/__init__.py::OrderedSetTestCase::test_copy_equality tests/__init__.py::OrderedSetTestCase::test_set_union_intersection_functions tests/__init__.py::OrderedSetTestCase::test_set_union_intersection_operators tests/__init__.py::OrderedSetTestCase::test_str_repr tests/__init__.py::OrderedSetTestCase::test_update_set_union_intersection_functions tests/__init__.py::ToolsTestCase::test_nonapi_all_equal tests/__init__.py::WrapperMetaClassTestCase::test_bad_wrapper tests/__init__.py::WrapperMetaClassTestCase::test_simple_wrapper tests/__init__.py::WrapperMetaClassTestCase::test_wrapper_diff_type tests/__init__.py::WrapperMetaClassTestCase::test_wrapper_of_wrapper tests/__init__.py::WrapperMetaClassTestCase::test_wrapper_with_overrides tests/__init__.py::WrapperFunctionTestCase::test_bad_wrapper tests/__init__.py::WrapperFunctionTestCase::test_simple_wrapper tests/__init__.py::WrapperFunctionTestCase::test_wrapper_diff_type tests/__init__.py::WrapperFunctionTestCase::test_wrapper_of_wrapper tests/__init__.py::WrapperFunctionTestCase::test_wrapper_with_overrides