2 added 648 characters in body

A different Haskell variation, exactly the same size as @Paul Mutser's :)

import Data.List
f x=filter(\a->length a>1)$concatMap subsequences x g=nub.concat.f p l(x:y)=foldl(\(m,n)c->(c,n&&length c>2&&(not$any(isInfixOfc)(f l))&&last m==head c))(x,True)y
z l w=null(g l\\g w)&&null(g w\\g l)&&(snd$p l w)  Try it online! ### Ungolfed -- generate all invalid substrings f :: [String] -> [String] f xs = filter (\x -> length x > 1)$ concatMap subsequences xs

-- utility function to flatten and remove duplicates
g :: [String] -> String
g  = nub $concat$ f

-- verify that all conditions are satisfied along the list
p :: [String] -> [String] -> (String, Bool)
p l (x:xs) = foldl (\(m,n) c -> (c , n && length c > 2 && (not $any (isInfixOf c)(f l)) && last m == head c)) (x, True) xs -- put all the pieces together and consume input z :: [String] -> [String] -> Bool z l w = null (g l \\ g w) && null (g w \\ g l) && (snd$ p l w)


A different Haskell variation, exactly the same size as @Paul Mutser's :)

import Data.List
f x=filter(\a->length a>1)$concatMap subsequences x g=nub.concat.f p l(x:y)=foldl(\(m,n)c->(c,n&&length c>2&&(not$any(isInfixOfc)(f l))&&last m==head c))(x,True)y
z l w=null(g l\\g w)&&null(g w\\g l)&&(snd$p l w)  Try it online! # Haskell, 231 bytes A different Haskell variation, exactly the same size as @Paul Mutser's :) import Data.List f x=filter(\a->length a>1)$concatMap subsequences x
g=nub.concat.f
p l(x:y)=foldl(\(m,n)c->(c,n&&length c>2&&(not$any(isInfixOfc)(f l))&&last m==head c))(x,True)y z l w=null(g l\\g w)&&null(g w\\g l)&&(snd$p l w)


Try it online!

### Ungolfed

-- generate all invalid substrings
f :: [String] -> [String]
f xs = filter (\x -> length x > 1) $concatMap subsequences xs -- utility function to flatten and remove duplicates g :: [String] -> String g = nub$ concat $f -- verify that all conditions are satisfied along the list p :: [String] -> [String] -> (String, Bool) p l (x:xs) = foldl (\(m,n) c -> (c , n && length c > 2 && (not$ any (isInfixOf c)(f l)) && last m == head c)) (x, True) xs

-- put all the pieces together and consume input
z :: [String] -> [String] -> Bool
z l w = null (g l \\ g w) && null (g w \\ g l) && (snd $p l w)  1 # Haskell, 231 bytes A different Haskell variation, exactly the same size as @Paul Mutser's :) import Data.List f x=filter(\a->length a>1)$concatMap subsequences x
g=nub.concat.f
p l(x:y)=foldl(\(m,n)c->(c,n&&length c>2&&(not$any(isInfixOfc)(f l))&&last m==head c))(x,True)y z l w=null(g l\\g w)&&null(g w\\g l)&&(snd$p l w)


Try it online!