Hi Aswin,
KNITRO does not currently allow for semi-continuous variables (perhaps
in future releases).
The constraint you describe seems to be a "switch-off" constraint
which implies that the constraint is active if certain conditions
hold, otherwise it is inactive. These types of constraints can, I
think, almost always be formulated as complementarity constraints and
KNITRO does support the modeling of complementarity constraints. See
Section 10.5 of the KNITRO 6.0 User's Manual found at:
http://ziena.com/documentation.htm
A complementarity constraint is a constraint that represents a
disjunctive condition and has the form
0 <= z1 complements z2 >=0 (1)
where the condition above means EITHER z1=0 OR z2=0 and both z1 and z2
are non-negative variables. This can be expressed algebraically as
z1*z2=0 (2)
z1>=0, z2>=0.
However, these constraints are known to be degenerate and difficult so
they should not be modeled in the algebraic form (2). Rather they
should be identified as complementarity constraints and sent to KNITRO
in the form (1) so that KNITRO recognizes them as complementarity
constraints and can provide special treatment to them to try to handle
the degeneracy.
In your particular case I think you can model your condition as
z1-z2=A-B
0 <= z1 complements z2 >=0
and then the variable z1 is the variable you are interested in since
z1=A-B when A-B>=0 and z1=0 otherwise.
Hope this helps.
-Richard Waltz