<commit_before>module Analysis.EssentialCriticalPairs
 ( namedEssentialCriticalPairs,
   findAllEssentialDeleteUse,
   findAllEssentialProduceForbid,
   findAllEssentialProduceDangling
   ) where

import           Abstract.Category.AdhesiveHLR      as RW
import           Abstract.Category.FinitaryCategory
import           Abstract.Rewriting.DPO             as RW
import           Analysis.CriticalPairs
import           Analysis.EpimorphicPairs

---- Essential Critical Pairs generation.
-- Warning: this algorithms are in development.

type NamedRule morph = (String, Production morph)
type NamedCriticalPairs morph = (String,String,[CriticalPair morph])

-- | Returns the Essential Critical Pairs with rule names
namedEssentialCriticalPairs :: (EpiPairs morph, DPO morph) =>
  MorphismsConfig -> [NamedRule morph] -> [NamedCriticalPairs morph]
namedEssentialCriticalPairs conf namedRules =
  map (uncurry getCPs) [(a,b) | a <- namedRules, b <- namedRules]
    where<commit_msg>TODO: experimental code shouldn't be in master<commit_after>module Analysis.EssentialCriticalPairs
 ( namedEssentialCriticalPairs,
   findAllEssentialDeleteUse,
   findAllEssentialProduceForbid,
   findAllEssentialProduceDangling
   ) where

import           Abstract.Category.AdhesiveHLR      as RW
import           Abstract.Category.FinitaryCategory
import           Abstract.Rewriting.DPO             as RW
import           Analysis.CriticalPairs
import           Analysis.EpimorphicPairs

-- TODO: Conclude this implementation or extract it to an experimental branch until it is ready
---- Essential Critical Pairs generation.
-- Warning: this algorithms are in development.

type NamedRule morph = (String, Production morph)
type NamedCriticalPairs morph = (String,String,[CriticalPair morph])

-- | Returns the Essential Critical Pairs with rule names
namedEssentialCriticalPairs :: (EpiPairs morph, DPO morph) =>
  MorphismsConfig -> [NamedRule morph] -> [NamedCriticalPairs morph]
namedEssentialCriticalPairs conf namedRules =
  map (uncurry getCPs) [(a,b) | a <- namedRules, b <- namedRules]
    where
{'fraction_non_alphanumeric': 0.06838833094213295, 'fraction_numerical': 0.0, 'mean_word_length': 3.8764568764568765, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '406230', 'n_tokens_mistral': 632, 'n_tokens_neox': 562, 'n_words': 164}