# create a partially ordered semigroup
arr <- round( replace( array(runif(18), c(3,3,2)), array(runif(18),
c(3,3,2))>.5, 1 ) )
# semigroup of relations
S <- semigroup(arr)
# string relations and partial order
P <- strings(arr) |>
partial.order()
# perform the factorisation of PO S
fact(S, P)
Run the code above in your browser using DataLab