Commit da8af2b2 authored by Michele Volpato's avatar Michele Volpato

changed more specific definition

parent 3871d751
......@@ -725,6 +725,7 @@ class Table:
# Given two entries, check if the former is more specific than the latter
# entry1 ⊑ entry2 => entry2.first is subset of entry1.first and entry1.second is subset of entry2.second
# 2017-08-25: Definition of more specific is changed, inclusion of T_1 AND equality of T_2
def _moreSpecificEntry(self, entry1, entry2, plus):
if (entry1 not in self._entries.values() or entry2 not in self._entries.values()):
self._logger.warning("Checking relation between "+str(entry1)+ " and "+str(entry2)+": one or both are not in the table.")
......@@ -733,7 +734,8 @@ class Table:
#return entry2[0].issubset(entry1[0]) # inclusion
else:
return (self._outputPurpose.isIncluded(entry2[0], entry1[0]) and
self._outputPurpose.isIncluded(entry1[1], entry2[1]))
self._outputPurpose.isEqual(entry1[1], entry2[1]))
#self._outputPurpose.isIncluded(entry1[1], entry2[1])) # 2017-08-25 change
#return (entry2[0].issubset(entry1[0]) and entry1[1].issubset(entry2[1]))
# Given two rows, check if the former is more specific than the latter
......@@ -813,7 +815,7 @@ class Table:
return path
# Load a table that was printed previously, for testing Purpose
# Load a table that was printed previously, for testing
def _loadTable(self, path):
with open(path, 'r') as csvfile:
reader = csv.reader(csvfile, delimiter=',',
......
......@@ -32,3 +32,8 @@ class Purpose(metaclass=ABCMeta):
# used when we use a placeholder for all outputs
def isIncluded(self, set1, set2):
return set1.issubset(set2)
# Given two sets of outputs return True if the first is equal to the second.
# Can be changed when using placeholders
def isEqual(self, set1, set2):
return set1 == set2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment