/******************************************************************************
 * Copyright (c) 2000-2021 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
 *
 * Contributors:
 *   
 *   Balasko, Jeno
 *   Forstner, Matyas
 *   Raduly, Csaba
 *   Szabados, Kristof
 *   Szabo, Janos Zoltan – initial implementation
 *
 ******************************************************************************/
module TsetofMatch {
// Type definitions

type component my_comp {};
type enumerated my_enum {amstel, buckler, coronita, desperados};
type record of integer recordof_int;
//type union my_union {
//	int x1,
//	recordof_int x2
//};

type set of integer setof_int; // set of basic type
type set of my_enum setof_enum; // set of enum
//type set of my_union setof_union; // set of union
type set of recordof_int setof_recordof; // set of record of
type set of setof_int setof_setof; // recursive set of

// Constants

const recordof_int record_element1:={4,3,2};

const setof_int setof_const1:={1,2,3,4,5};
const setof_enum setof_const2:={amstel, coronita};
//const setof_union setof_const3:={{1,{1,2,3}}, {9,{4}}};
const setof_recordof setof_const4:={record_element1, {5,4,3}, {2}};
const setof_setof setof_const5:={{0,1}, setof_const1, {1}};

// Templates

template setof_int setof_temp1 := {1,2,3,4};
template setof_enum setof_temp2 := {amstel, buckler, ?};
template setof_enum setof_temp3 := {?, buckler, ?, buckler};
template setof_int setof_temp4 := {*};
template setof_int setof_temp5 := {1, *, 3};
template setof_recordof setof_temp6 := {*, {1,2}, {3}, *};
template setof_setof setof_temp7 := {{?,1}, {7,3}, ?, {5,*}};
template setof_setof setof_temp8 := {{1,*}, * length (4)};
template setof_int setof_temp9 := ({1},{2,?},{(3,4,5),?,?});
template setof_setof setof_temp10 := {* length(2), * length(3), *};

// Testcases - non-template part

testcase setofIntAssign() runs on my_comp {
var setof_int x1:= {25, 13, 37};
var setof_int x2, x3, x4;
x2:={32,12};
x3:={11};
x3:={11,22};
x4:={};

if (x1[0]==25) {setverdict(pass);} // at declaration
 else {setverdict(fail);}
if (x1[1]==13) {setverdict(pass);}
 else {setverdict(fail);}
if (x2[0]==32) {setverdict(pass);} // later
 else {setverdict(fail);}
if (x2[1]==12) {setverdict(pass);}
 else {setverdict(fail);}
if (x3[0]==11) {setverdict(pass);} // after changing size
 else {setverdict(fail);}
if (x3[1]==22) {setverdict(pass);}
 else {setverdict(fail);}
if (sizeof(x4)==0) {setverdict(pass);} // empty set of
 else {setverdict(fail);}
}

testcase setofIntEq() runs on my_comp {
// setof_int setof_const1:={1,2,3,4,5};
var setof_int x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
x1 := {1, 2, 3, 4, 5};
x2 := {1, 3, 2, 5, 4};
x3 := {4, 3, 2, 1, 5};
x4 := {5, 1, 4, 3, 2};
x5 := {3, 4, 5, 2, 1};
x6 := {1, 2, 3, 4, 4};
x7 := {1, 1, 1, 1, 1};
x8 := {1, 2, 3, 4, 5, 6};
x9:= {1, 4, 3, 2};
//equality - the same order
if (x1==setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
//equality - other order
if (x2==setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
if (x3==setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
if (x4==setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
if (x5==setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
//non-equality - unmatched elements
if (x6!=setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
if (x7!=setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
//non-equality - too many elements
if (x8!=setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
//non-equality - too few elements
if (x9!=setof_const1) {setverdict(pass);}
 else {setverdict(fail);}
}

testcase setofSetofEq() runs on my_comp {
var setof_setof x1, x2, x3, x4, x5, x6, x7;
x1 := {{1,2},{3,4}};
x2 := {{1,2},{3,4}};
x3 := {{3,4},{1,2}};
x4 := {{2,1},{4,3}};
x5 := {{2,1},{4,3},{1,2}};
x6 := {{4,1},{3,2}};
x7 := {{1},{2,4}};
//equality - in same order
if (x2==x1) {setverdict(pass);}
 else {setverdict(fail);}
//equality - different orders
if (x3==x1) {setverdict(pass);}
 else {setverdict(fail);}
if (x4==x1) {setverdict(pass);}
 else {setverdict(fail);}
//non-equality - too many elements
if (x5!=x1) {setverdict(pass);}
 else {setverdict(fail);}
//non-equality - elements not matching
if (x6!=x1) {setverdict(pass);}
 else {setverdict(fail);}
//non-equality - elements size not proper
if (x7!=x1) {setverdict(pass);}
 else {setverdict(fail);}
}

// Testcases - template part

testcase tsetofIntSpecValueMatch() runs on my_comp {
//template setof_int setof_temp1 := {1,2,3,4};
var setof_int x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
x1 := {1, 2, 3, 4}
x2 := {1, 3, 2, 4}
x3 := {4, 3, 2, 1}
x4 := {2, 1, 4, 3}
x5 := {3, 4, 1, 2}
x6 := {1, 2, 3}
x7 := {1, 2, 3, 4, 5}
x8 := {4, 3, 2, 2}
x9 := {1, 1, 4, 3}
x10 := {3, 5, 1, 2}
//match - in same order
if (match(x1,setof_temp1)) {setverdict(pass);}
 else {setverdict(fail);}
//match - in different orders
if (match(x2,setof_temp1)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x3,setof_temp1)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x4,setof_temp1)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x5,setof_temp1)) {setverdict(pass);}
 else {setverdict(fail);}
//no match: too few elements
if (not(match(x6,setof_temp1))) {setverdict(pass);}
 else {setverdict(fail);}
//no match: too many elements
if (not(match(x7,setof_temp1))) {setverdict(pass);}
 else {setverdict(fail);}
//no match: two different elements only match one
if (not(match(x8,setof_temp1))) {setverdict(pass);}
 else {setverdict(fail);}
if (not(match(x9,setof_temp1))) {setverdict(pass);}
 else {setverdict(fail);}
//no match: unmatched element
if (not(match(x10,setof_temp1))) {setverdict(pass);}
 else {setverdict(fail);}
}

testcase tsetofEnumAnyValueMatch() runs on my_comp {
//template setof_enum setof_temp2 := {amstel, buckler, ?};
//template setof_enum setof_temp3 := {?, buckler, ?, buckler};
var setof_enum x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12;
x1 := {amstel, buckler, coronita}
x2 := {buckler, coronita, amstel}
x3 := {buckler, buckler, amstel}
x4 := {buckler, amstel, amstel}
x5 := {buckler, amstel, desperados}
x6 := {amstel, amstel, buckler, buckler}
x7 := {buckler, coronita, buckler, amstel}
x8 := {amstel, buckler}
x9 := {buckler, coronita, buckler}
x10 := {buckler, buckler, buckler}
x11 := {coronita, amstel, amstel}
x12 := {amstel, buckler, coronita, desperados}
//match - in same order
if (match(x1,setof_temp2)) {setverdict(pass);}
 else {setverdict(fail);}
//match - in other orders
if (match(x2,setof_temp2)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x3,setof_temp2)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x4,setof_temp2)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x5,setof_temp2)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x6,setof_temp3)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x7,setof_temp3)) {setverdict(pass);}
 else {setverdict(fail);}
//no match - too many elements
if (match(x6,setof_temp2)) {setverdict(fail);}
 else {setverdict(pass);}
//no match - too few elements
if (match(x8,setof_temp2)) {setverdict(fail);}
 else {setverdict(pass);}
//no match - element unmatched
if (match(x9,setof_temp2)) {setverdict(fail);}
 else {setverdict(pass);}
if (match(x10,setof_temp2)) {setverdict(fail);}
 else {setverdict(pass);}
if (match(x11,setof_temp2)) {setverdict(fail);}
 else {setverdict(pass);}
if (match(x12,setof_temp3)) {setverdict(fail);}
 else {setverdict(pass);}
}

testcase tsetofIntAnyorNoneMatch() runs on my_comp {
//template setof_int setof_temp4 := {*};
//template setof_int setof_temp5 := {1, *, 3};
var setof_int x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
//x0 := {omit}
x1 := {}
x2 := {1}
x3 := {2}
x4 := {2, 1}
x5 := {3, 2, 1}
x6 := {1, 3}
x7 := {3, 1}
x8 := {1, 2, 3}
x9 := {3, 2, 1}
x10 := {4, 3, 2, 1}
  //match - matches everything
  /*
if (match(x0,setof_temp4)) {setverdict(pass);}
 else {setverdict(fail);}
  */
if (match(x1,setof_temp4)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x2,setof_temp4)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x3,setof_temp4)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x4,setof_temp4)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x5,setof_temp4)) {setverdict(pass);}
 else {setverdict(fail);}
//match - in same and reverse order
if (match(x6,setof_temp5)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x7,setof_temp5)) {setverdict(pass);}
 else {setverdict(fail);}
//match - with one or more anyvalues
if (match(x8,setof_temp5)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x9,setof_temp5)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x10,setof_temp5)) {setverdict(pass);}
 else {setverdict(fail);}
}

testcase tsetofRecordofAnyorNoneMatch() runs on my_comp {
// setof_recordof setof_temp6 := {*, {1,2}, {3}, *};
var setof_recordof x1, x2, x3, x4, x5, x6, x7;
x1 := {{1,2},{3}};
x2 := {{3},{1,2}};
x3 := {{2,1},{3}};
x4 := {{1,2},{3},{1,2}};
x5 := {{1,2,3},{1},{2},{3},{1,2},{2,3},{1,3}};
x6 := {{1,2,3},{3},{2,3},{1,3},{3,3}};
x7 := {{1,2}};
//match in both order
if (match(x1,setof_temp6)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x2,setof_temp6)) {setverdict(pass);}
 else {setverdict(fail);}
//no match - wrong order in the record
if (not(match(x3,setof_temp6))) {setverdict(pass);}
 else {setverdict(fail);}
//match - use anyornone values
if (match(x4,setof_temp6)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x5,setof_temp6)) {setverdict(pass);}
 else {setverdict(fail);}
//no match - no match for one of the elements
if (not(match(x6,setof_temp6))) {setverdict(pass);}
 else {setverdict(fail);}
if (not(match(x7,setof_temp6))) {setverdict(pass);}
 else {setverdict(fail);}
}

testcase tsetofSetofMatch() runs on my_comp {
// setof_setof setof_temp7 := {{?,1}, {7,3}, ?, {5,*}};
var setof_setof x1, x2, x3, x4, x5;
x1 := {{1,1},{7,3},{8,9},{5}};
x2 := {{7,6,5},{1,0},{3,7},{11}};
x3 := {{5,7,3},{7,3},{},{1,5}};
x4 := {{7,3},{1,2},{5}};
x5 := {{1,1,1},{3,7},{2,3},{5,5}};
//match - in the same order
if (match(x1,setof_temp7)) {setverdict(pass);}
 else {setverdict(fail);}
//match - in different order
if (match(x2,setof_temp7)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x3,setof_temp7)) {setverdict(pass);}
 else {setverdict(fail);}
//no match: too few elements
if (not(match(x4,setof_temp7))) {setverdict(pass);}
 else {setverdict(fail);}
//no match: first element unmatched
if (not(match(x5,setof_temp7))) {setverdict(pass);}
 else {setverdict(fail);}
}

testcase tsetofSetofLengthMatch1() runs on my_comp {
//template setof_setof setof_temp8 := {{1,*}, * length (4)};
// Note: the interpretation of the asterisk with length restriction is
// unspecified in the standard.
// In our interpretation the asterisk matches exactly one element if it has
// extra matching attributes (e.g. length restriction).
// That is, * length(4) and ? length(4) are treated as equivalents.
var setof_setof x1, x2, x3, x4, x5, x6, x7, x8;
x1 := {{1},{1,1,1,1}};
x2 := {{1,2,3,4},{5,1}};
x3 := {{1,2,3},{1,2,3,4},{4,3,2,1}};
x4 := {{5,1}};
x5 := {{2,3,4,5}};
x6 := {{1},{1,2},{1,2,3,4}};
x8 := {{1},{1,2,3,4},{1,2}};
x7 := {{1},{1,2}};
//match - in same order
if (match(x1,setof_temp8)) {setverdict(pass);}
 else {setverdict(fail);}
//match - in different order
if (match(x2,setof_temp8)) {setverdict(pass);}
 else {setverdict(fail);}
//no match - multiple fixed length elements
if (not match(x3,setof_temp8)) {setverdict(pass);}
 else {setverdict(fail);}
//no match - no fixed length elements
if (not match(x4,setof_temp8)) {setverdict(pass);}
 else {setverdict(fail);}
//no match: element unmatched
if (not match(x5,setof_temp8)) {setverdict(pass);}
 else {setverdict(fail);}
//no match - element of wrong length
if (not(match(x6,setof_temp8))) {setverdict(pass);}
 else {setverdict(fail);}
if (not(match(x8,setof_temp8))) {setverdict(pass);}
 else {setverdict(fail);}
if (not(match(x7,setof_temp8))) {setverdict(pass);}
 else {setverdict(fail);}
}

testcase tsetofIntValueListMatch() runs on my_comp {
//template setof_int setof_temp9 := ({1},{2,?},{3..5,?,?});
var setof_int x1, x2, x3, x4, x5, x6, x7, x8, x9, x10;
x1 := {1};
x2 := {2,5};
x3 := {3,3,3};
x4 := {1,2,3};
x5 := {2,1};
x6 := {2};
x7 := {1,2,6};
x8 := {1,3};
x9 := {1,2,2};
x10 := {1,2,3,4};
//match
if (match(x1,setof_temp9)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x2,setof_temp9)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x3,setof_temp9)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x4,setof_temp9)) {setverdict(pass);}
 else {setverdict(fail);}
if (match(x5,setof_temp9)) {setverdict(pass);}
 else {setverdict(fail);}
//no match
if (not(match(x6,setof_temp9))) {setverdict(pass);}
 else {setverdict(fail);}
if (not(match(x7,setof_temp9))) {setverdict(pass);}
 else {setverdict(fail);}
if (not(match(x8,setof_temp9))) {setverdict(pass);}
 else {setverdict(fail);}
if (not(match(x9,setof_temp9))) {setverdict(pass);}
 else {setverdict(fail);}
if (not(match(x10,setof_temp9))) {setverdict(pass);}
 else {setverdict(fail);}
}

testcase tsetofSetofLengthMatch2() runs on my_comp {
//template setof_setof setof_temp10 := {* length(2), * length(3), *};
// See the note for testcase tsetofSetofLengthMatch1
var setof_setof x1, x2, x3, x4, x5;
x1 := {};
x2 := {{1,2},{2,3},{1,2,3}};
x3 := {{1}, {1,2}};
x4 := {{1,2,3},{4,3}};
x5 := {{},{}};
//no match - empty set
if (not match(x1,setof_temp10)) {setverdict(pass);}
 else {setverdict(fail);}
//match - lengths are ok
if (match(x2,setof_temp10)) {setverdict(pass);}
 else {setverdict(fail);}
//no match: length too short
if (not(match(x3,setof_temp10))) {setverdict(pass);}
 else {setverdict(fail);}
//match: lengths are ok
if (match(x4,setof_temp10)) {setverdict(pass);}
 else {setverdict(fail);}
//no match: lengths are zero
if (not(match(x5,setof_temp10))) {setverdict(pass);}
 else {setverdict(fail);}
}

 testcase tsetofSuperset1() runs on my_comp {
   template setof_int t1 := superset(1, 2, 3);
   template setof_int t2 := superset(5, 4, 3, 2, 1);
   template setof_int t3 := superset(5, 4, 3, 2, 1, 6);
   template setof_int t4 := superset(5, 4, 3, 2, 1, ?);
   template setof_int t5 := superset(5, 4, 3, 2, ?);
   template setof_int t6 := superset(?, 5, 4, 3, 2);
   template setof_int t7 := superset(?, 5, 4, 3, 2, *);
   template setof_int t8 := superset(?, 5, 4, 3, *);
   template setof_int t9 := superset(5, 4, 3, 2, 1, ?, *);
   template setof_int t1a := superset(1, 7, 2, 3);
   template setof_int t2a := superset(5, 4, 7, 3, 2, 1);
   template setof_int t3a := superset(5, 4, 3, 7, 2, 1, 6);
   template setof_int t4a := superset(5, 7, 4, 3, 2, 1, ?);
   template setof_int t5a := superset(5, 4, 3, 2, ?, 7);
   template setof_int t6a := superset(?, 5, 7, 4, 3, 2);
   template setof_int t7a := superset(7, ?, 5, 4, 3, 2, *);
   template setof_int t8a := superset(?, 5, 4, 7, 3, *);
   template setof_int t9a := superset(5, 4, 3, 2, 7, 1, ?, *);
   template setof_int t10 := superset(?, ?, ?, ?, ?, ?);
   template setof_int t11 := superset(?, ?, ?, ?, ?);

   if(match(setof_const1, t1)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t2)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t3)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t4)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t5)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t6)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t7)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t8)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t9)) {setverdict(pass);}
   else {setverdict(fail);}

   if(not match(setof_const1, t1a)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t2a)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t3a)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t4a)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t5a)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t6a)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t7a)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t8a)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t9a)) {setverdict(pass);}
   else {setverdict(fail);}

   if(not match(setof_const1, t10)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t11)) {setverdict(pass);}
   else {setverdict(fail);}

   /* --- */

   template setof_setof tt1 := superset(t1);
   template setof_setof tt2 := superset(t2, superset(1));
   template setof_setof tt3 := superset(t5, superset(1), superset(1));
   template setof_setof tt4 := superset(t6, superset(1), superset(1, 0));
   template setof_setof tt5 := superset(t7, superset(1), superset(1, 2));
   template setof_setof tt6 := superset(t7, superset(1), t3);

   if(match(setof_const5, tt1)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const5, tt2)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const5, tt3)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const5, tt4)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const5, tt5)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const5, tt6)) {setverdict(pass);}
   else {setverdict(fail);}
 }

 testcase tsetofSuperset2() runs on my_comp {
   template setof_enum t1 := superset(buckler);
   template setof_enum t2 := superset(coronita);
   template setof_enum t3 := superset(coronita, buckler);
   template setof_enum t4 := superset(coronita, amstel);

   if(not match(setof_const2, t1)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const2, t2)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const2, t3)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const2, t4)) {setverdict(pass);}
   else {setverdict(fail);}
 }

 testcase tsetofSubset1() runs on my_comp {
   template setof_int t1 := subset(1, 2, 3);
   template setof_int t2 := subset(1, 2, 3, 4, 5, 6);
   template setof_int t3 := subset(6, 5, 4, 3, 2, 1);
   template setof_int t4 := subset(?);
   template setof_int t5 := subset(*);
   template setof_int t6 := subset(?, ?, ?, ?);
   template setof_int t7 := subset(?, ?, ?, ?, ?);
   template setof_int t8 := subset(?, ?, ?, ?, ?, ?);
   template setof_int t9 := subset(?, ?, ?, ?, *);
   template setof_int t10 := subset(2, 3, 4, 5, 6);
   template setof_int t11 := subset(2, 3, 4, 5, 6, ?);
   template setof_int t12 := subset(2, 3, 4, 5, 6, *);
   template setof_int t13 := subset(3, 4, 5, 6, ?);

   if(not match(setof_const1, t1)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t2)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t3)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t4)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t5)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t6)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t7)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t8)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t9)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t10)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t11)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const1, t12)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const1, t13)) {setverdict(pass);}
   else {setverdict(fail);}
 }

 testcase tsetofSubset2() runs on my_comp {
   template setof_enum t1 := subset(buckler);
   template setof_enum t2 := subset(coronita);
   template setof_enum t3 := subset(coronita, buckler);
   template setof_enum t4 := subset(coronita, amstel);
   template setof_enum t5 := subset(coronita, buckler, amstel);

   if(not match(setof_const2, t1)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const2, t2)) {setverdict(pass);}
   else {setverdict(fail);}
   if(not match(setof_const2, t3)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const2, t4)) {setverdict(pass);}
   else {setverdict(fail);}
   if(match(setof_const2, t5)) {setverdict(pass);}
   else {setverdict(fail);}
 }

control {
execute(setofIntAssign());
execute(setofIntEq());
execute(setofSetofEq());

execute(tsetofIntSpecValueMatch());
execute(tsetofEnumAnyValueMatch());
execute(tsetofIntAnyorNoneMatch());
execute(tsetofRecordofAnyorNoneMatch());
execute(tsetofSetofMatch());
execute(tsetofSetofLengthMatch1());
execute(tsetofIntValueListMatch());
execute(tsetofSetofLengthMatch2());
 execute(tsetofSuperset1());
 execute(tsetofSuperset2());
 execute(tsetofSubset1());
 execute(tsetofSubset2());
}
}
