BayEsian Network InterOperability Format Standard for Knowledge Interchange (BENIOFSKI) Wszedzie dopuszcze sie komentarz: od // do konca wiersza (czyli \r. \n, lub \r\n) od /* do */ Komentarzy nie zagniezdza sie 1. Siec` Bayesowska ::= < >^0:1 < >^0:n < ^0:n < ^0:n < >^0:n ogolnie: ::= <>^0:1 < ( ) >^0:1 { < <>^0:1 < is | = > ; >^0:n } ::= ::= | | ::= ::="" ::= pol | eng | deu | INNE JEZYKI ::= ::= | , w szczegolnosci: ::= network { format "BNFormat"; language is <, >^0:n ; } ::= ::= properties { < type < string | real | array of string | array of real | choice of [,] > , ^0:1 ; >^1:n < property ; >^0:n } ::= | ] | [ ] ::= | , ::= | , ::= node { type : discrete[] < choice of [ LISTA NAZW ]>^0:1; < ^0:1 name ; >^0:n < position (, ); >^0:1 < ^0:1 choice name []; >^0:n < >^0:1 } ::= ::= probability ( < >^0:1 ) { ; >^0:1 < (): ; >^0:1 < >^0:1 } ::= | , ::= | ::= window { < window_width ; >^0:n < window_height ; >^0:n < window_center_X_position ; >^0:n < window_center_Y_position ; >^0:n } --------------------------------------------------------------------------- PRZYKLAD: eins ^ | | zwei <------------- drei --------------------------------------------------------------------------- // pocztek network "Ale ci przyklad" { format is "BNFormat"; language is pol, deu; } properties {type Sensownosc is choice of [zsensem, bezsensu]; type Komentarz = string, "dodac do kazdego wezla"; property Komentarz is "wezel generowany automatycznie"; } // Zaczynamy wezly node drei { type : discrete[2] choice of [ja,nein]; pol name is "Numer trzy"; deu name = "Nummer Drei"; pol choice name is ["tak", "nie" ]; deu choice name is ["Ja", "Auf keinnen Fall" ]; position is (40,80); Sensownosc is zsensem; Komentarz is "boli mnie ucho"; } node zwei { type : discrete[2]; position = (20,50); Sensownosc is bezsensu; } node eins {type : discrete[2] choice of [fajny, nudny]; position = (40,10); } /* teraz prawdopodobienstwa warunkowe i bezwarunkowe */ // pr. bezwarunkkowe - czyli brzegowe probability (drei} { default: 0.4, 0.6; } // pr. warunkowe probability (zwei | drei) { (ja): 0.3, 0.7; (nein): 0.8, 0.2; } probability (eins | drei) { (1): 0.9, 0.1; (2): 0.2, 0.8; } // to byloby na tyle ------------------------------------------------------------------------------ DRZEWO MARKOWA ------------------------------------------------------------------------------ ::= < >^0:1 - jak wyzej < >^0:n - jak wyzej ale bez position < ^0:n < ^0:1 < ^0:n < >^0:n ::= network {format "MTreeFormat"; language is <, >^0:n ; } ::= hypernode ( <, >^0:1 ) { ; >^0:1 < (): ; >^0:1 < position (, ); >^0:1 < >^0:1 } ::= ::= join { < with ; >^0:n } ----------------------------------------------------------------------------- PRZYKLAD: eins,drei ------------ zwei,drei ----------------------------------------------------------------------------- // pocztek network "Ale ci markowy przyklad" { format is "MTreeFormat"; language is pol, deu; } properties {type Sensownosc is choice of [zsensem, bezsensu]; type Komentarz = string, "dodac do kazdego wezla"; property Komentarz is "wezel generowany automatycznie"; } // Zaczynamy wezly node drei { type : discrete[2] choice of [ja,nein]; pol name is "Numer trzy"; deu name = "Nummer Drei"; pol choice name is ["tak", "nie" ]; deu choice name is ["Ja", "Auf keinnen Fall" ]; Sensownosc is zsensem; Komentarz is "boli mnie ucho"; } node zwei { type : discrete[2]; Sensownosc is bezsensu; } node eins {type : discrete[2] choice of [fajny, nudny]; } /* teraz hip[erwezly hypernode prawy (zwei, drei) { (1, ja): 0.12; (2,ja): 0.28; (1,nein): 0.48, (2,nein): 0.12; position is (150,30); } hypernode lewy (eins, drei) { (fajny,ja): 0.9; (2,1): 0.1; (1,nein): 0.2; (nudny,2): 0.8; position = (20,30); } // polaczenia join {lewy with prawy;} // to byloby na tyle