pr <- as.PowerRelation("12 > 2 ~ 1")
l <- elementLookup(pr, 1)
l
# (1,1), (2,2)
sapply(l, function(tuple) 1 %in% pr$eqs[[tuple[1]]][[tuple[2]]]) |> all() |> stopifnot()
# if element does not exist, it returns NULL
elementLookup(pr, 3) |> is.null() |> stopifnot()
Run the code above in your browser using DataLab