# User's Manual

## 1 Short Description

`APHzip` is a collection of tools to generate, manipulate, and compress acyclic phase-type representations. The toolsuite can generate simple exponential or Erlang distributions, and by using the disabling operator (`cox`) can even generate the whole acyclic phase-type representations. To manipulate acyclic phase-type representations, `APHzip` provides three stochastic operations: `con`volution, `max`imum, and `min`imum. `APHzip` also implements an algorithm that almost always reduces any given acyclic phase-type representation to its minimal representation.

## 2 Input

To invoke the tool a user must provide the following input information:

### 2.1 Expression

`APHzip` accepts as input any expression written in the following grammar:

 `P ::= exp(λ) | erl(n, λ) | con(P, P) | max(P, P) | min(P, P) | cox(μ, λ, P)`

`exp(λ)` represents a delay governed by an exponential distribution with rate `λ`. `erl(n, λ)` represents a delay governed by an Erlang distribution with rate `λ` and shape `n`. These two delays are the building blocks of more complex delays constructed by using operators `con, max, min,` and `cox`.

`cox(μ, λ, P)` is a disabling operator, where delay `μ` forces a preemptive termination, unless delay `λ` finishes first. Delay `λ.P` behaves as delay `P` after an exponentially distributed duration with rate `λ`. Delays `μ` and `λ.P` disable each other, in the sense that the termination of delay `μ` cancels delay `λ.P` and terminates, while the occurrence of delay `λ` cancels delay `μ` and continues with delay `P`.

`con(P, P)` is the convolution operator of two delays; namely putting two delays in sequence one after another. `min(P, P)` is the minimum operator, namely it produces the minimum of two delays. `max(P, P)` is the maximum operator, which produces the maximum of two delays.

### 2.2 Output Format

There are two output formats of model produced by the tool, namely as a simple list of transitions (similar to a .tra file format) and as a nested disabling (`cox`) operators. Using the latter format allows the user to cut and paste the output of the tool to build further and more complex expressions.

 `No` `Expression` `Original Size` `Reduced Size` `1` `min(min(max(max(exp(0.2),exp(0.2)),exp(0.2)),max(exp(0.3),exp(0.3))),exp(0.14))` `22` `7` `2` `min(con(min(exp(10),min(exp(6),min(exp(6),con(exp(6),min(exp(2),exp(6)))))),con(exp(200),con(exp(200),con(min(con(exp(0.002),con(exp(0.01),exp(0.1))),con(exp(0.01),exp(0.01))),exp(0.01))))),con(min(con(exp(0.002),con(exp(0.01),exp(0.1))),con(exp(0.01),exp(0.01))),min(con(min(exp(10),min(exp(6),min(exp(6),con(exp(6),min(exp(2),exp(6)))))),exp(10)),con(exp(6),exp(0.1)))))` `132` `108` `3` `max(min(exp(0.2),erl(19,0.2)),con(erl(5,0.2),exp(0.6)))` `140` `67` `4` `min(con(min(exp(10),min(exp(6),min(exp(6),con(exp(6),min(exp(2),exp(6)))))),min(exp(20),exp(0.01))),min(con(min(exp(10),min(exp(6),min(exp(6),con(exp(6),min(exp(2),exp(6)))))),con(exp(200),con(exp(200),con(min(con(exp(0.002),con(exp(0.01),exp(0.1))),con(exp(0.01),exp(0.01))),exp(0.01))))),con(min(con(exp(0.002),con(exp(0.01),exp(0.1))),con(exp(0.01),exp(0.01))),min(con(min(exp(10),min(exp(6),min(exp(6),con(exp(6),min(exp(2),exp(6)))))),exp(10)),con(exp(6),exp(0.1))))))` `396` `276` `5` `min(con(exp(0.5),min(con(exp(0.002),con(exp(0.01),exp(0.1))),con(exp(0.01),exp(0.01)))),min(con(exp(60),con(exp(30),con(min(exp(100),min(exp(2),exp(20))),con(min(exp(6),exp(6)),exp(20))))),min(min(con(min(exp(10),min(exp(6),min(exp(6),con(exp(6),min(exp(2),exp(6)))))),exp(10)),con(exp(2),exp(0.004))),min(con(min(exp(6),min(exp(6),con(exp(6),min(exp(2),exp(6))))),min(exp(20),con(exp(0.2),exp(100)))),con(exp(0.2),exp(120))))))` `1680` `1260` `6` `min(min(max(max(erl(5,1),erl(5,1)),erl(5,1)),max(erl(5,1.5),erl(5,1.5))),erl(5,0.7))` `37625` `114`