Article CIRCUIT1, MML version 4.99.1005

:: CIRCUIT1:modenot 1
definition
  let a1 be non empty non void Circuit-like ManySortedSign;
  mode Circuit of a1 is locally-finite MSAlgebra over a1;
end;

:: CIRCUIT1:funcnot 1 => CIRCUIT1:func 1
definition
  let a1 be non empty non void Circuit-like ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  func Set-Constants A2 -> ManySortedSet of SortsWithConstants a1 means
    for b1 being Element of the carrier of a1
          st b1 in proj1 it
       holds it . b1 in Constants(a2,b1);
end;

:: CIRCUIT1:def 1
theorem
for b1 being non empty non void Circuit-like ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being ManySortedSet of SortsWithConstants b1 holds
      b3 = Set-Constants b2
   iff
      for b4 being Element of the carrier of b1
            st b4 in proj1 b3
         holds b3 . b4 in Constants(b2,b4);

:: CIRCUIT1:th 1
theorem
for b1 being non empty non void Circuit-like ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being Element of (the Sorts of b2) . b3
      st b3 in SortsWithConstants b1 & b4 in Constants(b2,b3)
   holds (Set-Constants b2) . b3 = b4;

:: CIRCUIT1:modenot 2
definition
  let a1 be non empty non void Circuit-like ManySortedSign;
  let a2 be locally-finite MSAlgebra over a1;
  mode InputFuncs of a2 is ManySortedFunction of (InputVertices a1) --> NAT,(the Sorts of a2) | InputVertices a1;
end;

:: CIRCUIT1:th 2
theorem
for b1 being non empty non void Circuit-like ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being ManySortedFunction of (InputVertices b1) --> NAT,(the Sorts of b2) | InputVertices b1
for b4 being Element of NAT
      st b1 is with_input_V
   holds (commute b3) . b4 is InputValues of b2;

:: CIRCUIT1:funcnot 2 => CIRCUIT1:func 2
definition
  let a1 be non empty non void Circuit-like ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  let a3 be ManySortedFunction of (InputVertices a1) --> NAT,(the Sorts of a2) | InputVertices a1;
  let a4 be Element of NAT;
  assume a1 is with_input_V;
  func A4 -th_InputValues A3 -> InputValues of a2 equals
    (commute a3) . a4;
end;

:: CIRCUIT1:def 2
theorem
for b1 being non empty non void Circuit-like ManySortedSign
   st b1 is with_input_V
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being ManySortedFunction of (InputVertices b1) --> NAT,(the Sorts of b2) | InputVertices b1
for b4 being Element of NAT holds
   b4 -th_InputValues b3 = (commute b3) . b4;

:: CIRCUIT1:modenot 3
definition
  let a1 be non empty non void Circuit-like ManySortedSign;
  let a2 be locally-finite MSAlgebra over a1;
  mode State of a2 is Element of product the Sorts of a2;
end;

:: CIRCUIT1:th 4
theorem
for b1 being non empty non void Circuit-like ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of product the Sorts of b2 holds
   proj1 b3 = the carrier of b1;

:: CIRCUIT1:th 5
theorem
for b1 being non empty non void Circuit-like ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of product the Sorts of b2
for b4 being Element of the carrier of b1 holds
   b3 . b4 in (the Sorts of b2) . b4;

:: CIRCUIT1:funcnot 3 => CIRCUIT1:func 3
definition
  let a1 be non empty non void Circuit-like ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  let a3 be Element of product the Sorts of a2;
  let a4 be Element of the OperSymbols of a1;
  func A4 depends_on_in A3 -> Element of Args(a4,a2) equals
    (the_arity_of a4) * a3;
end;

:: CIRCUIT1:def 3
theorem
for b1 being non empty non void Circuit-like ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of product the Sorts of b2
for b4 being Element of the OperSymbols of b1 holds
   b4 depends_on_in b3 = (the_arity_of b4) * b3;

:: CIRCUIT1:th 6
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3, b4 being Element of the carrier of b1
for b5 being Element of (the Sorts of FreeEnv b2) . b3
for b6 being Relation-like Function-like FinSequence-like DTree-yielding set
   st b3 in InnerVertices b1 &
      b5 = [action_at b3,the carrier of b1] -tree b6
for b7 being Element of NAT
      st b7 in dom b6 & b6 . b7 in (the Sorts of FreeEnv b2) . b4
   holds b4 = (the_arity_of action_at b3) /. b7;

:: CIRCUIT1:condreg 1
registration
  let a1 be non empty non void Circuit-like monotonic ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  let a3 be Element of the carrier of a1;
  cluster -> Relation-like Function-like non empty finite (Element of (the Sorts of FreeEnv a2) . a3);
end;

:: CIRCUIT1:condreg 2
registration
  let a1 be non empty non void Circuit-like monotonic ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  let a3 be Element of the carrier of a1;
  cluster -> DecoratedTree-like (Element of (the Sorts of FreeEnv a2) . a3);
end;

:: CIRCUIT1:th 7
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3, b4 being Element of the carrier of b1
for b5 being Element of (the Sorts of FreeEnv b2) . b3
for b6 being Element of (the Sorts of FreeEnv b2) . b4
for b7 being Relation-like Function-like FinSequence-like DTree-yielding set
for b8 being Element of NAT
      st b3 in (InnerVertices b1) \ SortsWithConstants b1 &
         b5 = [action_at b3,the carrier of b1] -tree b7 &
         b8 + 1 in dom b7 &
         b7 . (b8 + 1) in (the Sorts of FreeEnv b2) . b4
   holds b5 with-replacement(<*b8*>,b6) in (the Sorts of FreeEnv b2) . b3;

:: CIRCUIT1:th 8
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being Element of (the Sorts of FreeEnv b2) . b3
      st 1 < card b4
   holds ex b5 being Element of the OperSymbols of b1 st
      b4 . {} = [b5,the carrier of b1];

:: CIRCUIT1:th 9
theorem
for b1 being non empty non void Circuit-like ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of product the Sorts of b2
for b4 being Element of the OperSymbols of b1 holds
   (Den(b4,b2)) . (b4 depends_on_in b3) in (the Sorts of b2) . the_result_sort_of b4;

:: CIRCUIT1:th 10
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being Element of (the Sorts of FreeEnv b2) . b3
      st b4 . {} = [action_at b3,the carrier of b1]
   holds ex b5 being Relation-like Function-like FinSequence-like DTree-yielding set st
      b4 = [action_at b3,the carrier of b1] -tree b5;

:: CIRCUIT1:funcreg 1
registration
  let a1 be non empty non void monotonic ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  let a3 be Element of the carrier of a1;
  cluster (the Sorts of FreeEnv a2) . a3 -> finite;
end;

:: CIRCUIT1:funcnot 4 => CIRCUIT1:func 4
definition
  let a1 be non empty non void Circuit-like monotonic ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  let a3 be Element of the carrier of a1;
  func size(A3,A2) -> natural set means
    ex b1 being non empty finite Element of bool NAT st
       b1 = {card b2 where b2 is Element of (the Sorts of FreeEnv a2) . a3: TRUE} &
        it = max b1;
end;

:: CIRCUIT1:def 4
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being natural set holds
      b4 = size(b3,b2)
   iff
      ex b5 being non empty finite Element of bool NAT st
         b5 = {card b6 where b6 is Element of (the Sorts of FreeEnv b2) . b3: TRUE} &
          b4 = max b5;

:: CIRCUIT1:th 11
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1 holds
      size(b3,b2) = 1
   iff
      b3 in (InputVertices b1) \/ SortsWithConstants b1;

:: CIRCUIT1:th 12
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3, b4 being Element of the carrier of b1
for b5 being Element of (the Sorts of FreeEnv b2) . b3
for b6 being Element of (the Sorts of FreeEnv b2) . b4
for b7 being Relation-like Function-like FinSequence-like DTree-yielding set
      st b3 in (InnerVertices b1) \ SortsWithConstants b1 &
         card b5 = size(b3,b2) &
         b5 = [action_at b3,the carrier of b1] -tree b7 &
         b6 in proj2 b7
   holds card b6 = size(b4,b2);

:: CIRCUIT1:th 13
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being Element of (the Sorts of FreeEnv b2) . b3
      st b3 in (InnerVertices b1) \ SortsWithConstants b1 & card b4 = size(b3,b2)
   holds ex b5 being Relation-like Function-like FinSequence-like DTree-yielding set st
      b4 = [action_at b3,the carrier of b1] -tree b5;

:: CIRCUIT1:th 14
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being Element of (the Sorts of FreeEnv b2) . b3
      st b3 in (InnerVertices b1) \ SortsWithConstants b1 & card b4 = size(b3,b2)
   holds ex b5 being Element of the OperSymbols of b1 st
      b4 . {} = [b5,the carrier of b1];

:: CIRCUIT1:funcnot 5 => CIRCUIT1:func 5
definition
  let a1 be non empty non void ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  let a3 be Element of the carrier of a1;
  let a4 be Element of (the Sorts of FreeEnv a2) . a3;
  func depth A4 -> Element of NAT means
    ex b1 being Element of (the Sorts of FreeMSA the Sorts of a2) . a3 st
       a4 = b1 & it = depth b1;
end;

:: CIRCUIT1:def 5
theorem
for b1 being non empty non void ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being Element of (the Sorts of FreeEnv b2) . b3
for b5 being Element of NAT holds
      b5 = depth b4
   iff
      ex b6 being Element of (the Sorts of FreeMSA the Sorts of b2) . b3 st
         b4 = b6 & b5 = depth b6;

:: CIRCUIT1:th 15
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3, b4 being Element of the carrier of b1
      st b3 in InnerVertices b1 & b4 in rng the_arity_of action_at b3
   holds size(b4,b2) < size(b3,b2);

:: CIRCUIT1:th 16
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1 holds
   0 < size(b3,b2);

:: CIRCUIT1:th 17
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being Element of (the Sorts of FreeEnv b2) . b3
for b5 being Relation-like Function-like FinSequence-like DTree-yielding set
      st b3 in InnerVertices b1 &
         b4 = [action_at b3,the carrier of b1] -tree b5 &
         (for b6 being Element of NAT
               st b6 in dom b5
            holds ex b7 being Element of (the Sorts of FreeEnv b2) . ((the_arity_of action_at b3) /. b6) st
               b7 = b5 . b6 &
                card b7 = size((the_arity_of action_at b3) /. b6,b2))
   holds card b4 = size(b3,b2);

:: CIRCUIT1:funcnot 6 => CIRCUIT1:func 6
definition
  let a1 be non empty non void monotonic ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  let a3 be Element of the carrier of a1;
  func depth(A3,A2) -> natural set means
    ex b1 being non empty finite Element of bool NAT st
       b1 = {depth b2 where b2 is Element of (the Sorts of FreeEnv a2) . a3: TRUE} &
        it = max b1;
end;

:: CIRCUIT1:def 6
theorem
for b1 being non empty non void monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1
for b4 being natural set holds
      b4 = depth(b3,b2)
   iff
      ex b5 being non empty finite Element of bool NAT st
         b5 = {depth b6 where b6 is Element of (the Sorts of FreeEnv b2) . b3: TRUE} &
          b4 = max b5;

:: CIRCUIT1:funcnot 7 => CIRCUIT1:func 7
definition
  let a1 be non empty finite non void Circuit-like monotonic ManySortedSign;
  let a2 be non-empty locally-finite MSAlgebra over a1;
  func depth A2 -> natural set means
    ex b1 being non empty finite Element of bool NAT st
       b1 = {depth(b2,a2) where b2 is Element of the carrier of a1: b2 in the carrier of a1} &
        it = max b1;
end;

:: CIRCUIT1:def 7
theorem
for b1 being non empty finite non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being natural set holds
      b3 = depth b2
   iff
      ex b4 being non empty finite Element of bool NAT st
         b4 = {depth(b5,b2) where b5 is Element of the carrier of b1: b5 in the carrier of b1} &
          b3 = max b4;

:: CIRCUIT1:th 18
theorem
for b1 being non empty finite non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1 holds
   depth(b3,b2) <= depth b2;

:: CIRCUIT1:th 19
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3 being Element of the carrier of b1 holds
      depth(b3,b2) = 0
   iff
      (b3 in InputVertices b1 or b3 in SortsWithConstants b1);

:: CIRCUIT1:th 20
theorem
for b1 being non empty non void Circuit-like monotonic ManySortedSign
for b2 being non-empty locally-finite MSAlgebra over b1
for b3, b4 being Element of the carrier of b1
      st b3 in InnerVertices b1 & b4 in rng the_arity_of action_at b3
   holds depth(b4,b2) < depth(b3,b2);