emplog2.gms : Test simple logical conditions

Description

Verify that 'b2 =e= 1' is accepted as logical condition. There is no need
to do it this way, but this corresponds to 'not b1 =e= 1' which is/was allowed.
Use both ways of defining a logic equation, via the keyword logic and the sign =B=.

Contributor: Jan-H. Jagla, February 2011

  Make sure that logic is accepted as keyword after empty data assignment


Small Model of Type : GAMS


Category : GAMS Test library


Main file : emplog2.gms

$Title Test simple logical conditions  (EMPLOG2,SEQ=510)

$ontext
Verify that 'b2 =e= 1' is accepted as logical condition. There is no need
to do it this way, but this corresponds to 'not b1 =e= 1' which is/was allowed.
Use both ways of defining a logic equation, via the keyword logic and the sign =B=.

Contributor: Jan-H. Jagla, February 2011
$offtext

* Make sure that logic is accepted as keyword after empty data assignment
$onempty
set dummy(*) / /;
$offempty

logic equation logic1
equation logic2;
binary variable b1,b2;

logic1..  not b1;
logic2..  b2 =b= 1;

model m /all/;

b1.l = 1;
b2.l = 0;

solve m using emp;
abort$(b1.l <> 0) 'b1 is not 0';
abort$(b2.l <> 1) 'b2 is not 1';