rem Problem parts:
rem matrix Dm, matrix Dp, matrix D, arrayi mask, matrix M, matrix L0, matrix L,
rem	arrayi ipl, arrayi dpl, arrayic TD, arrayi TDCount"
rem ----------------------------------------------------------------------------
echo Problem 1.A
echo Splitting transitions even though the Petri net is already PT-ordinary.

D 2 2
1		-1
-1	1

mask 2
1 1

done

rem ----------------------------------------------------------------------------
echo Problem 1.B
echo Provide no mask - default behavior.
D 2 2
1		-1
-1	1

done

rem ----------------------------------------------------------------------------
echo Problem 1.C
echo Split only the first transition.

D 2 2
1		-1
-1	1

mask 2
1 0

done

rem ----------------------------------------------------------------------------
echo Problem 2
echo Expected Result (Incidence Matrix):
echo [-1	5	-1	0	0]
echo [1	-1	0	-1	-1]
echo [-1	0	1	0	0]
echo [0	-1	0	1	0]
echo [0	0	0	-1	1]

D 2 2
-2	5
1		-3

mask 2
1	1

done

rem ----------------------------------------------------------------------------
echo Problem 3
echo This is a case with a self-loop.
echo All the new parts of the net matrices should be the same as in Problem 2.
Dp 2 2
0	5
1	2

Dm 2 2
2	0
0	3

mask 2
1 1
done

rem ----------------------------------------------------------------------------
echo Problem 4
echo Adding a new input arc from p0 to t1.
Dp 2 2
0	5
1	2

Dm 2 2
2	2
0	3

mask 2
1 1

done

rem ----------------------------------------------------------------------------
echo Problem 5
echo Use non-square nets. Use a net that is a copy of that from 4, concatenated
echo to itself left-to-right.
Dp 2 4
0	5	0	5
1	2	1	2

Dm 2 4
2	2	2	2
0	3	0	3

mask 2 1 1

done

rem ----------------------------------------------------------------------------
echo Problem 6
echo Like problem 5 but without the mask.
Dp 2 4
0	5	0	5
1	2	1	2

Dm 2 4
2	2	2	2
0	3	0	3

done

rem ----------------------------------------------------------------------------
echo Problem 7
echo Introduce an i-to-d marking transformation matrix M and an initial
echo marking constraint L0.
Dm 3 2
0	5
1	2
1	1

Dp 3 2
2	2
0	3
0	0

ipl 2
0 1

dpl 1
2

L0 1 2
1 4

M 1 2
1 1

done

rem ----------------------------------------------------------------------------
echo Problem 8
echo Provide lists of independent and dependent transitions and provide the
echo independent-to-dependent marking transformation matrix M.
Dp 3 2
0	5
1	2
0	4

Dm 3 2
3	0
0	3
2	0

M 1 2
1	1

ipl 2
0 1

dpl 1
2

done
echo ---------------------------------------------------------------------------
echo Problems of my creation begin here.
echo
echo Problem 9
echo This problem is specifically created to deal with L0.
echo The result should have L0f:
echo 1	2	0	1	2	0	0	
echo 2	3	4	2	3	8	4

D 3 3
-2	2		0
2		-2	1
-1	0		-3

ipl 3
0 1 2

L0 2 3
1		2		0
2		3		4

done

echo Problem 10
echo This uses the unraisable transition lists (TD).
echo New TD should be:
echo 0	1
echo 1
echo 0	1	2
echo 1	3
echo 1	4	5
echo Yielding a TD vector:
echo 0	1	1	0	1	2	1	3	1	3	4
echo New TDCount should be:
echo 2	1	3	2	3

D 2	2
-2	1
0		-3

TD 3
0 1 1

TDCount 2
2 1

done

rem ----------------------------------------------------------------------------
echo Problem 11
echo Use everything: ipl, dpl, L0, L, M, and TD.
Dm 3 2
0	5
1	2
1	1

Dp 3 2
2	2
0	3
0	0

ipl 2
0 1

dpl 1
2

L0 1 2
1 4

M 1 2
1 1

TDCount 2
1 1

TD 2
0	1
done

quit