File: condit.zpl

package info (click to toggle)
zimpl 3.7.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,772 kB
  • sloc: ansic: 21,719; yacc: 993; lex: 370; sh: 349; makefile: 278
file content (69 lines) | stat: -rw-r--r-- 2,271 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
60
61
62
63
64
65
66
67
68
69
# $Id: condit.zpl,v 1.2 2011/09/16 09:11:49 bzfkocht Exp $
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#*                                                                           */
#*   File....: condit.zpl                                                    */
#*   Name....: Condition test                                                */
#*   Author..: Thorsten Koch                                                 */
#*   Copyright by Author, All rights reserved                                */
#*                                                                           */
#* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#*
#* Copyright (C) 2011-2025 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 to 5 };

var x;
var y;
var z[<i> in I] >= if (i >= 3) then -infinity else 10 end <= 100 ;

subto c1: forall <i> in I do
   if i > 2 then 
      if i > 4 then 
         i * x <= 5 and i * 2 * y <= 10 
      else
         i * z[i] <= 7 
      end
   end;

subto c2: forall <i> in I do
   if i > 2 then 
      if i > 4 then 
         i * x <= 5 and i * 2 * y <= 10 
      end
   else
       i * z[i] <= 7 
   end;


subto c3: forall <i> in I:
  if (i > 3)
  then 
     if (i == 4) 
        then z[1] + z[2] == i
        else z[2] + z[3] == i
     end and
     z[3] + z[4] == i and
     z[4] + z[5] == i
  else
     if (i == 2) 
        then z[1] + z[2] == i + 10
        else z[2] + z[3] == i + 10
     end and
     z[3] + z[4] == i + 10 and
     z[4] + z[5] == i + 10
  end;