src/HOL/Tools/Sledgehammer/MaSh/src/sparseNaiveBayes.py
changeset 54149 70456a8f5e6e
parent 53957 ce12e547e6bb
child 54432 68f8bd1641da
equal deleted inserted replaced
54148:c8cc5ab4a863 54149:70456a8f5e6e
    76         """
    76         """
    77         for dep in dependencies:
    77         for dep in dependencies:
    78             self.counts[dep][0] -= 1
    78             self.counts[dep][0] -= 1
    79             for f,_w in features.items():
    79             for f,_w in features.items():
    80                 self.counts[dep][1][f] -= 1
    80                 self.counts[dep][1][f] -= 1
       
    81                 if self.counts[dep][1][f] == 0:
       
    82                     del self.counts[dep][1][f]
    81 
    83 
    82 
    84 
    83     def overwrite(self,problemId,newDependencies,dicts):
    85     def overwrite(self,problemId,newDependencies,dicts):
    84         """
    86         """
    85         Deletes the old dependencies of problemId and replaces them with the new ones. Updates the model accordingly.
    87         Deletes the old dependencies of problemId and replaces them with the new ones. Updates the model accordingly.