Tensor Factorization for logical relations