Average-case complexity Functions on three
variablesÈ

Straight-line Programs with conditional stop


Let P2(2) be the set of Boolean functions depending on two variables. Let X={x1,...,xn} be a set of independent variables, Y={y1,...,yl} be a set of inner variables, and Z={z1,...,zm} be a set of output variables. Assume that A is in YÈ Z and B, C belong to Y È Y È Z. Let f be a function from P2(2). An expression

p:    A = f(B, C)

is called a functional instruction. Here, A is called the output of the functional instruction p, and B, C are called inputs of this instruction. Let A be an element of Y È Y È Z. An expression  

p:    Stop(A)

is called a stop instruction. Here, A is called the input of stop instruction p.
A straight-line program is a sequence P = p1... pi...pL whose elements are instructions and each input of instruction pj, j {1,2,..., s}, is either an independent variable or the output of some functional instruction pi, i<j.
A straight-line program works at discrete moments of time t = 0,1,2,... and does not change the values of independent variables. Let us define the values of inner variables yi(x; t) and output variables zj(x; t) of P at any time on x = (x1,...,xn) by induction:

 

  • At the initial time, t = 0, the values of all inner and output variables are undefined;

     

  • If an inner variable yi (output variable zj) is not the output of an instruction pt, then we set

    yi(x; t) = yi(x; t-1),       zj(x; t) = zj(x; t-1);

     

  • If an inner variable yi (output variable zj) is the output of pt and the input values of pt equal B(x; t-1) and C(x; t-1) at the moment t-1, then we set


    The value of pt on the tuple x = (x1,...,xn) is the value of its output at t, which is denoted by pt(x).
    In each program P all stop instructions are assumed to be ordered. Denote by sj the jth stop instruction.
    An instruction pi (variable xl) is called a zero argument of stop instruction sj = pj' iff the output of pi (variable xl) is the input of sj. The zero argument of sj is denoted by qj.
    We say that kth stop instruction sk terminates the execution of P on the tuple x iff

    q1(x) =... = qk-1(x) = 0,    qk(x) = 1.


    The result of the execution of P on x is denoted by P(x) and its jth component Pj(x) is defined in the following way:

    e.g., Pj(x) equals the value of the jth output variable at the stop moment. It is easy to see that

    Let L(P) denote the number of instructions in P. L(P) is called the complexity of P. The execution time TP(x) of P on tuple x is the number of instructions executed before the endpoint of P, i.e., TP(x)=k iff the kth instruction of P = p1... pi...pL is the stop instruction st and for zero argument qt(x) we have qt(x) = 1 on x and qj(x) = 0 for all j<t. If qj(x) = 0 for all j, then all the instructions in P are executed and in this case TP(x) = L(P). The quantity

    (where summation is performed over all binary tuples of length n) is called the average execution time of P. If for a Boolean function (operator) f and any tuple x we have f(x) = P(x), then the program P is said to compute f. The quantity

    T(f) = min T(P)

    (where the minimum is taken over all programs computing f) is called the average execution time (average complexity) of f. A program P that computes f and is such that T(P) = T(f) is called a minimal program. The number of elements of a minimal Boolean circuit that realizes f over the basis of all two-place functions is called the complexity of f and is denoted by L(f).

    It is easy to see that Boolean circuits are a special case of straight-line programs with a conditional stop. Any circuit can be treated as a program with no stop instruction. Thus T(P) = L(f).


    Average-case complexity Functions on three
variables