Deciding Monotone Duality and Identifying Frequent Itemsets in Quadratic Logspace