File: define.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 (59 lines) | stat: -rw-r--r-- 2,243 bytes parent folder | download | duplicates (2)
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
48
49
50
51
52
53
54
55
56
57
58
59
# $Id: define.zpl,v 1.3 2006/09/09 10:00:21 bzfkocht Exp $
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#*                                                                           */
#*   File....: define.zpl                                                    */
#*   Name....: Define 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 I := { 1..5 } * { 4..7};
var x[I];

defnumb dist(a,b) := a*a + b*b;

subto c1: sum <i,j> in I do dist(i,j) * x[i,j] >= 0;

defnumb ack(i,j) := 
   if i == 0 then j + 1 
             else if j == 0 then ack(i - 1, 1)
                            else ack(i - 1, ack(i, j - 1))
                  end
   end;

subto c2: ack(3,3) * x[ack(1,3),ack(2,2)] >= 0;            

set K := { 1..10 };
var y[K];

defbool goodone(a,b) := a > b; 
defset  bigger(i) := { <j> in K with goodone(j,i) };

subto c3: sum <i> in bigger(5) : y[i] >= 0;

set G := { 1..3 };
set H := { "hallo", "tach", "moin" };
param greet[G] := <1> "hallo", <2> "tach", <3> "moin";
var z[H]; 
defstrg greeting(m) := greet[(m + 1) mod card(G)];

subto c4: z[greeting(1)] + z[greeting(3)] >= 0;