, Y), soed (Xs, Y, Z). ([X | Xs], Y, Z): - contrar (X, Y), udalit ($ X, Y, D), soed (Xs, D, Z) . ([$ X | Xs], Y, [$ X | Z]): - not (vhodit ($ X, Y)), not (contrar ($ X, Y)), soed (Xs, Y, Z) . ([$ X | Xs], Y, Z): - vhodit ($ X, Y), soed (Xs, Y, Z). ([$ X | Xs], Y, Z): - contrar ($ X , Y), udalit (X, Y, D), soed (Xs, D, Z). ([X | Xs]): - prov (X, Xs). ([], _). (X, [Y | Ys]): - soed (X, Y, Z), prov (Z, Ys). (X): - perestanovka (X, Z), nachprov (Z).
Додаток Б
Лістинг програми на мові Haskell
cont :: String -> Stringx
| (head x == '~') = tail x
| otherwise = "~" + + x :: String -> String -> Boolx y = if (("~" + + x == y) | | ( "~" + + y == x)) then True else False :: String -> [String] -> Boolx [] = Falsex y = if (srav x (head y) == True) then True else contrar x (tail y) :: Eq (a) => [a] -> [[a]] [] = [[]] (x: xs) = scep x (perestanovka xs) :: Eq ( a) => a-> [[a]] -> [[a]] x [[]] = [[x]] x [] = [] x (h: t) = (rev xh) + + (scep xt) :: a-> [a] -> [[a]] x [] = [] xh = [(x: h), (reverse (x: h))] :: [ String] -> [String] -> [String] [] x = xx y
| (x == []) = x
| (not (elem (head x) y)) && (not (contrar (head x) y))
= (head x): soed (tail x) y
| contrar (head x) y = soed (tail x) (delete (cont (head x)) y)
| otherwise = soed (tail x) y :: [[String]] -> [String] [] = True (x: xs) = pr x xsx (y: ys) p>
| x == [] = True
| ys == [] = if (soed xy) == [] then True else False
| otherwise = pr (soed xy) ys [] = Falsex
| nachprov (head x) = True
| otherwise = prov (tail x) x = prov (perestanovka x)