RosettaCodeData/Task/Longest-common-substring/Bracmat/longest-common-substring.bracmat
2023-07-01 13:44:08 -04:00

18 lines
337 B
Text

( lcs
= X a b x L
. !arg:(?a.?b)
& 0:?L
& :?X
& ( @( !a
: ?
( ?x
& @(!x:? [>!L)
& @(!b:? !x ?)
& @(!x:? [?L:?X)
)
(?&~)
)
| !X
)
)
& out$(lcs$(thisisatest.testing123testing))