<commit_before>-- | Some auxiliary functions for property inference.
module Database.DSH.Optimizer.TA.Properties.Aux where

import Database.Algebra.Pathfinder.Data.Algebra

import qualified Data.Set.Monad as S

(∪) :: Ord a => S.Set a -> S.Set a -> S.Set a
(∪) = S.union

(∩) :: Ord a => S.Set a -> S.Set a -> S.Set a
(∩) = S.intersection

(∖) :: Ord a => S.Set a -> S.Set a -> S.Set a
(∖) = S.difference

(∈) :: Ord a => a -> S.Set a -> Bool
(∈) = S.member

(⊆) :: Ord a => S.Set a -> S.Set a -> Bool
(⊆) = S.isSubsetOf

-- | Singleton set abbreviation
ss :: Ord a => a -> S.Set a
ss = S.singleton

-- | List set abbreviation
ls :: Ord a => [a] -> S.Set a
ls = S.fromList

unionss :: Ord a => S.Set (S.Set a) -> S.Set a
unionss = S.foldr (∪) S.empty

exprCols :: Expr -> S.Set AttrName
exprCols (BinAppE _ e1 e2) = (exprCols e1) ∪ (exprCols e2)<commit_msg>Missing case in match on VL expressions.<commit_after>-- | Some auxiliary functions for property inference.
module Database.DSH.Optimizer.TA.Properties.Aux where

import Database.Algebra.Pathfinder.Data.Algebra

import qualified Data.Set.Monad as S

(∪) :: Ord a => S.Set a -> S.Set a -> S.Set a
(∪) = S.union

(∩) :: Ord a => S.Set a -> S.Set a -> S.Set a
(∩) = S.intersection

(∖) :: Ord a => S.Set a -> S.Set a -> S.Set a
(∖) = S.difference

(∈) :: Ord a => a -> S.Set a -> Bool
(∈) = S.member

(⊆) :: Ord a => S.Set a -> S.Set a -> Bool
(⊆) = S.isSubsetOf

-- | Singleton set abbreviation
ss :: Ord a => a -> S.Set a
ss = S.singleton

-- | List set abbreviation
ls :: Ord a => [a] -> S.Set a
ls = S.fromList

unionss :: Ord a => S.Set (S.Set a) -> S.Set a
unionss = S.foldr (∪) S.empty

exprCols :: Expr -> S.Set AttrName
exprCols (BinAppE _ e1 e2) = exprCols e1 ∪ exprCols e2
exprCols (IfE c t e)       = exprCols c ∪ exprCols t ∪ exprCols e
{'fraction_non_alphanumeric': 0.18524681087077094, 'fraction_numerical': 0.004437049362174155, 'mean_word_length': 2.6816326530612247, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2268972', 'n_tokens_mistral': 781, 'n_tokens_neox': 762, 'n_words': 250}