コード例 #1
0
ファイル: supported.py プロジェクト: lucastx/propagator.py
def _merge_supporteds(content, increment):
    merged_value = merge(content.value, increment.value)

    if merged_value == content.value:
        if implies(increment.value, merged_value):
            # Confirmation of existing information
            if increment.support.more_informative_than(content.support):
                return increment
            else:
                return content
        else:
            # New information is not interesting
            return content
    elif merged_value == increment.value:
        # New information overrides old information
        return increment
    else:
        # Interesting merge, need both provenances
        return Supported(merged_value, content.support | increment.support)
コード例 #2
0
def _merge_supporteds(content, increment):
    merged_value = merge(content.value, increment.value)

    if merged_value == content.value:
        if implies(increment.value, merged_value):
            # Confirmation of existing information
            if increment.support.more_informative_than(content.support):
                return increment
            else:
                return content
        else:
            # New information is not interesting
            return content
    elif merged_value == increment.value:
        # New information overrides old information
        return increment
    else:
        # Interesting merge, need both provenances
        return Supported(merged_value, content.support | increment.support)
コード例 #3
0
ファイル: supported.py プロジェクト: lucastx/propagator.py
 def subsumes(self, other):
     assert is_supported(other)
     return implies(self.value, other.value) and self.support.issubset(other.support)
コード例 #4
0
 def subsumes(self, other):
     assert is_supported(other)
     return implies(self.value, other.value) and self.support.issubset(
         other.support)