# ____________________________________________________________________________________
#
# Pyomo: Python Optimization Modeling Objects
# Copyright (c) 2008-2026 National Technology and Engineering Solutions of Sandia, LLC
# Under the terms of Contract DE-NA0003525 with National Technology and Engineering
# Solutions of Sandia, LLC, the U.S. Government retains certain rights in this
# software. This software is distributed under the 3-clause BSD License.
# ____________________________________________________________________________________
import logging
from collections import defaultdict
from pyomo.common.autoslots import AutoSlots
import pyomo.common.config as cfg
from pyomo.common import deprecated
from pyomo.common.collections import ComponentMap, ComponentSet, DefaultComponentMap
from pyomo.common.modeling import unique_component_name
from pyomo.core.expr.numvalue import ZeroConstant
import pyomo.core.expr as EXPR
from pyomo.core.base import TransformationFactory
from pyomo.core import (
Block,
BooleanVar,
Connector,
Constraint,
Param,
Set,
SetOf,
Suffix,
Var,
Expression,
SortComponents,
TraversalStrategy,
Any,
RangeSet,
Reals,
value,
NonNegativeIntegers,
Binary,
)
from pyomo.gdp import Disjunct, Disjunction, GDP_Error
from pyomo.gdp.disjunct import DisjunctData
from pyomo.gdp.plugins.gdp_to_mip_transformation import GDP_to_MIP_Transformation
from pyomo.gdp.transformed_disjunct import _TransformedDisjunct
from pyomo.gdp.util import (
clone_without_expression_components,
is_child_of,
_warn_for_active_disjunct,
)
from pyomo.core.util import target_list
from pyomo.util.vars_from_expressions import get_vars_from_components
from weakref import ref as weakref_ref
logger = logging.getLogger('pyomo.gdp.hull')
class _HullTransformationData(AutoSlots.Mixin):
__slots__ = (
'disaggregated_var_map',
'original_var_map',
'bigm_constraint_map',
'disaggregation_constraint_map',
)
def __init__(self):
self.disaggregated_var_map = DefaultComponentMap(ComponentMap)
self.original_var_map = ComponentMap()
self.bigm_constraint_map = DefaultComponentMap(ComponentMap)
self.disaggregation_constraint_map = DefaultComponentMap(ComponentMap)
Block.register_private_data_initializer(_HullTransformationData)
@TransformationFactory.register(
'gdp.chull',
doc="[DEPRECATED] please use 'gdp.hull' to get the Hull transformation.",
)
@deprecated(
"The 'gdp.chull' name is deprecated. "
"Please use the more apt 'gdp.hull' instead.",
logger='pyomo.gdp',
version="5.7",
)
class _Deprecated_Name_Hull(Hull_Reformulation):
def __init__(self):
super(_Deprecated_Name_Hull, self).__init__()