simp_ineq {lazy.tree}R Documentation

Simplify the Conjunction of Inequalities

Description

Simplify the Conjunction of Inequalities

Usage

simp_ineq(ineq, debug = 0)

Arguments

ineq

a string containing a conjunction of inequalities

print

= 1 to print the result

Details

The inequality of the form aL < x aR must precede the & sign as
simp_ineq("1 <= x < 5 & x <= 3").
It is assumed that the inequalities are valid. Therefore, the order of the boundaries are not checked.

Value

A list of

condc A string consisting of inequalities: the first term is the variable.
condl A vector consisting of aR, op1, x, op2, aL

Examples

res <- simp_ineq("x >= 1  &  x < 5")
res2 <- simp_ineq(paste(res$condc, "x < 3", sep=" & ") )
res3 <- simp_ineq(paste(res2$condc, "x > 2", sep=" & ") )
Print(res,res2,res3)



[Package lazy.tree version 0.1.5 ]