Struktura

start

definition
  let x1 be Θ1;
   .....
  let xn be Θn;
  struct1,...,Σn) Σ over a1,...,am
      (#
        σ1 -> Θ'1,
        ....
        σk -> Θ'k
      #);
end;

gdzie {a1,...,am} ⊆ {x1,...,xn-1} oraz domknięcie zbioru {a1,...,am} ze względu na zależność typów daje cały {x1,...,xn-1}.

Struktura Σ over a1,...,am słuźy do tworzenia typów strukturowych Σ over τ1,...,τm.

Przykład:

definition
  struct (addLoopStr,multLoopStr_0) doubleLoopStr
    (# carrier -> set,
        addF, multF -> BinOp of the carrier,
        OneF, ZeroF -> Element of the carrier
    #);
end;
gdzie addLoopStr obejmuje (carrier, addF, ZeroF?) a multLoopStr obejmuje (carrier, multF, OneF?).

Definicja struktury wprowadza drugi konstruktor - atrybut strict mówiący, że struktura nie ma innych pól poza zadeklarowanymi. Ponad to jest wprowadzana rejestracja egzystencjalna klastra: strict Σ over a1,...,am.

Definicja struktury wprowadza trzeci konstruktor - agregat. Agregat możnaby zdefiniować jako (takiej konstrukcji nie ma w Mizarze)


definition
  let x1 be Θ1;
   .....
  let xn be Θn;
  let y1 be Θ'1;
        ....
  let yk be Θ'k;
  aggr Σ(#y1,...,yk#) -> strict Σ over a1,...,am;
end;

Definicja struktury wprowadza też konstruktory termów selektorowych dla nowych pól (nieodziedziczonych z struktur prefiksowych). Patrz konstruktor selektora.

Przykłady:

MSAlgebra over S (gdzie S jest non empty ManySortedSign?), mmlquery:struct, mmlquery:aggr

WebForm
TopicClassification Select one...
ProjectGroup?

ImplementationDate? N/A
Topic revision: r2 - 2012-01-25 - 13:32:25 - GrzegorzBancerek
 
Mizar TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback