rem Acceptable problem parts:
rem D      incidence matrix
rem Dm     output matrix
rem Dp     input matrix
rem MX     Transformation matrix from independent to dependent marking
rem L0     Initial marking constraint matrix
rem L      Marking constraint matrix.
rem Mask   An integer array, one element for each place of the Petri net. Serves
rem        as a mask on which places will be processed.
rem ipl    An array of the indices of independent places.
rem dpl    An array of the indices of dependent places.
rem As always, matrices are defined by the keyword followed by the matrix
rem dimensions followed by the elements of the matrix. Arrays are defined by the
rem keyword followed by the length of the array followed by the array elements.
rem If D is given Dm and Dp are ignored.

rem ----------------------------------------------------------------------------
echo Problem 1
echo Example 5.2 from the thesis.
echo The first three test problems are the problems of the original matlab test
echo file pn2acdem.m.
Dp 3 5
0	1	0	1	0
0	0	1	0	1
1	0	0	0	0

Dm 3 5
1	0	0	0	1
1	0	0	1	0
0	2	2	0	0

done

rem ----------------------------------------------------------------------------
echo Problem 2
echo Example 5.1 from the thesis.
Dm 4 5
1	0	1	0	1
0	0	0	1	0
0	1	0	0	1
1	0	1	0	0

Dp 4 5
0	0	0	1	0
0	0	2	0	1
3	0	0	0	0
0	1	0	0	0

done

rem ----------------------------------------------------------------------------
echo Problem 3
echo The solution matrix Df should be:
echo -1	0	0	0	0	0	-1	0	0	0
echo 0	-1	0	0	0	0	0	-1	0	0
echo 0	0	-1	0	0	0	0	0	-1	0
echo 0	0	0	0	-1	0	0	0	0	-1
echo 0	0	0	-1	0	-1	0	0	0	0
echo 0	-1	0	0	0	0	1	0	0	0
echo 0	0	-1	0	0	0	0	1	0	0
echo 0	0	0	-1	0	0	0	0	1	0
echo 0	0	0	-1	0	0	0	0	0	1

D 5 6
-1	-1	0		0		0		0
0		-1	-1	0		0		0
0		0		-1	-1	0		0
0		0		0		-1	-1	0
0		0		0		-1	0		-1

done

rem ----------------------------------------------------------------------------
echo New problems created for testing pn2acpn.c begin here.
echo Problem 4.
echo This problem duplicates problem 3 above but adds a mask disallowing 
echo operations on the fourth and fifth places, thus eliminated one row and and
echo column pair from the result as well as moving entries previously made in
echo the fourth and fifth places to other places.
D 5 6
-1	-1	0		0		0		0
0		-1	-1	0		0		0
0		0		-1	-1	0		0
0		0		0		-1	-1	0
0		0		0		-1	0		-1

Mask 5
1	1	1	0	0

done

rem ----------------------------------------------------------------------------
echo Problem 5.
echo This problem introduces an initial marking constraint L0.
echo The modified constraint should be:
echo LOF:	
echo 1	2	3	4	5	1	2	3	4
echo 5	4	3	2	1	5	4	3	2

D 5 6
-1	-1	0		0		0		0
0		-1	-1	0		0		0
0		0		-1	-1	0		0
0		0		0		-1	-1	0
0		0		0		-1	0		-1

L0 2 5
1	2	3	4	5
5	4	3	2	1

done

rem ----------------------------------------------------------------------------
echo Problem 6.
echo This problem keeps the initial marking constraint and introduces 
echo dependent places. The third and fifth places are set as dependent
echo Modified independent place list should be:
echo iplf:	0	1	3	5	6	7	8
echo The modified constraint should be:
echo LOF:	
echo 1	2	3	1	2	0	3
echo 4	3	2	4	3	0	2

D 5 6
-1	-1	0		0		0		0
0		-1	-1	0		0		0
0		0		-1	-1	0		0
0		0		0		-1	-1	0
0		0		0		-1	0		-1

L0 2 3
1	2	3	
4	3	2	

ipl 3
0	1	3

dpl 2
2	4

done

rem ----------------------------------------------------------------------------
echo Problem 7.
echo This problem keeps the initial marking constraind and dependent place
echo lists. It adds a marking constraint L. Final marking constraint should be:
echo 1	2	3	0	0	0	0
echo 3	2	1	0	0	0	0
echo 9	8	7	0	0	0	0

D 5 6
-1	-1	0		0		0		0
0		-1	-1	0		0		0
0		0		-1	-1	0		0
0		0		0		-1	-1	0
0		0		0		-1	0		-1

L0 2 3
1	2	3	
4	3	2	

L 3 3
1	2	3
3	2	1
9	8	7

ipl 3
0	1	3

dpl 2
2	4

done 

rem ----------------------------------------------------------------------------
echo Problem 8.
echo This problem is the same as the previous one but adds the independent-to-
echo dependent marking transformation MX.
echo the new MX should be:
echo 2	3	5	2	3	-1	5
echo 7	9	11	7	9	0	11

D 5 6
-1	-1	0		0		0		0
0		-1	-1	0		0		0
0		0		-1	-1	0		0
0		0		0		-1	-1	0
0		0		0		-1	0		-1

L0 2 3
1	2	3	
4	3	2	

L 3 3
1	2	3
3	2	1
9	8	7

ipl 3
0	1	3

dpl 2
2	4

MX 2 3
2	3	5
7	9	11

done

rem ----------------------------------------------------------------------------
echo Problem 9.
echo This problem is identical to problem 8 but changes one value
echo in the incidence matrix, which should yield a result matrix
echo with a -2 at row 8, column 3 (numbering rows and columns from
echo 0)
echo 2	3	5	2	3	-1	5
echo 7	9	11	7	9	0	11

D 5 6
-1	-1	0		0		0		0
0		-1	-1	0		0		0
0		0		-1	-1	0		0
0		0		0		-2	-1	0
0		0		0		-1	0		-1

L0 2 3
1	2	3	
4	3	2	

L 3 3
1	2	3
3	2	1
9	8	7

ipl 3
0	1	3

dpl 2
2	4

MX 2 3
2	3	5
7	9	11

done

quit


