From 5cd21a91b74bdd2b32042735e6146bfb469c741d Mon Sep 17 00:00:00 2001 From: NoR8quoh1r <20768237+NoR8quoh1r@users.noreply.github.com> Date: Fri, 15 Nov 2024 13:45:14 +0100 Subject: [PATCH] default solver: add TODOS/FIXMES --- src/faebryk/core/defaultsolver.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/faebryk/core/defaultsolver.py b/src/faebryk/core/defaultsolver.py index 829cffe6..b2ed88a0 100644 --- a/src/faebryk/core/defaultsolver.py +++ b/src/faebryk/core/defaultsolver.py @@ -93,6 +93,7 @@ def get_params_for_expr(expr: Expression) -> set[Parameter]: return param_ops | {op for e in expr_ops for op in get_params_for_expr(e)} +# FIXME needs to handle logics also def get_constrained_predicates_involved_in( p: ParameterOperatable, ) -> set[Predicate]: @@ -375,10 +376,12 @@ def subset_of_literal( repr_map: dict[ParameterOperatable, ParameterOperatable] = {} for param in params: + # TODO we can also propagate is subset from other param: x sub y sub range is_subsets = [ e for e in param.get_operations() if isinstance(e, IsSubset) + # FIXME should just be constrained ones, then considere which ones can be removed and len(e.get_operations()) == 0 and not isinstance(e.get_other_operand(param), ParameterOperatable) ] @@ -588,6 +591,12 @@ def flatten_sub( return repr_map, dirty +def compress_logic_expressions( + G: Graph, +) -> tuple[dict[ParameterOperatable, ParameterOperatable], bool]: + pass + + def compress_arithmetic_expressions( G: Graph, ) -> tuple[dict[ParameterOperatable, ParameterOperatable], bool]: