File: bool.zpl

package info (click to toggle)
zimpl 2.05.ds2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,644 kB
  • ctags: 2,404
  • sloc: ansic: 16,953; yacc: 814; lex: 304; sh: 182; makefile: 181
file content (47 lines) | stat: -rw-r--r-- 1,911 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# $Id: bool.zpl,v 1.3 2006/09/09 10:00:20 bzfkocht Exp $
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#*                                                                           */
#*   File....: bool.zpl                                                      */
#*   Name....: bool test                                                     */
#*   Author..: Thorsten Koch                                                 */
#*   Copyright by Author, All rights reserved                                */
#*                                                                           */
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#*
#* Copyright (C) 2001-2006 by Thorsten Koch <koch@zib.de>
#* 
#* This program is free software; you can redistribute it and/or
#* modify it under the terms of the GNU General Public License
#* as published by the Free Software Foundation; either version 2
#* of the License, or (at your option) any later version.
#* 
#* This program is distributed in the hope that it will be useful,
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#* GNU General Public License for more details.
#* 
#* You should have received a copy of the GNU General Public License
#* along with this program; if not, write to the Free Software
#* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#*
set A := { 1 .. 10 };
set B := { 5 .. 15 };

param a1 := if A == B or A <= B then 1 else 2 end;
param a2 := if A != B and A < B then 1 else 2 end;
param a3 := if not A > B and not A < B then 1 else 2 end;
param a4 := if a1 < a2 or a2 != a3 then 1 else 2 end;
param a5 := if if a1 != a2 then a3 < a4 else a3 > a4 end then 1 else 2 end;

var x[A];

maximize c1: a1 * x[1] + a2 * x[2] + a3 * x[3] + a4 * x[4] + a5 * x[5];