:-use_module(library(pascal)). :- if(current_predicate(use_rendering/1)). :- use_rendering(c3). :- use_rendering(pic). :- endif. greaterAct(_,A,B):- activity(_,A), activity(_,B), A>=B. :-pascal. :-set_pascal(examples,keys(active)). :-set_pascal(default_parameters,[-2,-2]). :-set_pascal(learning_algorithm,gradient_descent). :-set_pascal(gd_iter,1000). :-set_pascal(fixed_parameters,no). :-set_pascal(verbosity,2). :- begin_in. rule(([]:-[six_ring(_)]), 0.5). rule(([]:-[methyl(_)]), 0.5). :- end_in. :-begin_bg. atm(ID):- atm_as(ID,_AT,_C). atm(ID):- atm_ba(ID,_AT,_C). atm(ID):- atm_br(ID,_AT,_C). atm(ID):- atm_c(ID,_AT,_C). atm(ID):- atm_ca(ID,_AT,_C). atm(ID):- atm_cl(ID,_AT,_C). atm(ID):- atm_cu(ID,_AT,_C). atm(ID):- atm_f(ID,_AT,_C). atm(ID):- atm_h(ID,_AT,_C). atm(ID):- atm_hg(ID,_AT,_C). atm(ID):- atm_i(ID,_AT,_C). atm(ID):- atm_k(ID,_AT,_C). atm(ID):- atm_mn(ID,_AT,_C). atm(ID):- atm_n(ID,_AT,_C). atm(ID):- atm_na(ID,_AT,_C). atm(ID):- atm_o(ID,_AT,_C). atm(ID):- atm_p(ID,_AT,_C). atm(ID):- atm_pb(ID,_AT,_C). atm(ID):- atm_s(ID,_AT,_C). atm(ID):- atm_se(ID,_AT,_C). atm(ID):- atm_sn(ID,_AT,_C). atm(ID):- atm_te(ID,_AT,_C). atm(ID):- atm_ti(ID,_AT,_C). atm(ID):- atm_zn(ID,_AT,_C). atm_charge(ID,C):- atm_as(ID,_AT,C). atm_charge(ID,C):- atm_ba(ID,_AT,C). atm_charge(ID,C):- atm_br(ID,_AT,C). atm_charge(ID,C):- atm_c(ID,_AT,C). atm_charge(ID,C):- atm_ca(ID,_AT,C). atm_charge(ID,C):- atm_cl(ID,_AT,C). atm_charge(ID,C):- atm_cu(ID,_AT,C). atm_charge(ID,C):- atm_f(ID,_AT,C). atm_charge(ID,C):- atm_h(ID,_AT,C). atm_charge(ID,C):- atm_hg(ID,_AT,C). atm_charge(ID,C):- atm_i(ID,_AT,C). atm_charge(ID,C):- atm_k(ID,_AT,C). atm_charge(ID,C):- atm_mn(ID,_AT,C). atm_charge(ID,C):- atm_n(ID,_AT,C). atm_charge(ID,C):- atm_na(ID,_AT,C). atm_charge(ID,C):- atm_o(ID,_AT,C). atm_charge(ID,C):- atm_p(ID,_AT,C). atm_charge(ID,C):- atm_pb(ID,_AT,C). atm_charge(ID,C):- atm_s(ID,_AT,C). atm_charge(ID,C):- atm_se(ID,_AT,C). atm_charge(ID,C):- atm_sn(ID,_AT,C). atm_charge(ID,C):- atm_te(ID,_AT,C). atm_charge(ID,C):- atm_ti(ID,_AT,C). atm_charge(ID,C):- atm_zn(ID,_AT,C). atm_type(ID,T):- atm_as(ID,T,_C). atm_type(ID,T):- atm_ba(ID,T,_C). atm_type(ID,T):- atm_br(ID,T,_C). atm_type(ID,T):- atm_c(ID,T,_C). atm_type(ID,T):- atm_ca(ID,T,_C). atm_type(ID,T):- atm_cl(ID,T,_C). atm_type(ID,T):- atm_cu(ID,T,_C). atm_type(ID,T):- atm_f(ID,T,_C). atm_type(ID,T):- atm_h(ID,T,_C). atm_type(ID,T):- atm_hg(ID,T,_C). atm_type(ID,T):- atm_i(ID,T,_C). atm_type(ID,T):- atm_k(ID,T,_C). atm_type(ID,T):- atm_mn(ID,T,_C). atm_type(ID,T):- atm_n(ID,T,_C). atm_type(ID,T):- atm_na(ID,T,_C). atm_type(ID,T):- atm_o(ID,T,_C). atm_type(ID,T):- atm_p(ID,T,_C). atm_type(ID,T):- atm_pb(ID,T,_C). atm_type(ID,T):- atm_s(ID,T,_C). atm_type(ID,T):- atm_se(ID,T,_C). atm_type(ID,T):- atm_sn(ID,T,_C). atm_type(ID,T):- atm_te(ID,T,_C). atm_type(ID,T):- atm_ti(ID,T,_C). atm_type(ID,T):- atm_zn(ID,T,_C). :-end_bg. :-set_pascal(examples,keys(canc_d)). %:-set_pascal(default_parameters,[-2,-2,-2]). fold(train,[d92,d308,d196,d330,d197,d306,d45,d145,d243,d244,d138,d275,d39,d5,d23_2,d14,d305,d85_1,d25,d47,d13,d38, d17,d41,d29,d227,d96,d192,d198,d46,d9,d51,d316,d6,d254,d231,d103,d97,d273,d307,d240,d140,d58,d31,d331,d141, d230,d253,d101,d56,d248,d274,d245,d249,d323,d2,d229,d336,d19,d193,d204,d143,d98,d35,d40,d1,d239,d10,d109, d12,d191,d288,d85_2,d100,d142,d95,d290,d205,d90,d4,d281,d315,d272,d33,d144,d255,d235,d54,d314,d104,d34,d3, d286,d146,d337,d53,d252,d107,d291,d30,d206,d236,d247,d203,d99,d48,d234,d148,d237,d139,d26,d102,d333,d279, d277,d147,d7,d106,d238,d251,d246,d292,d11,d134,d89,d36,d8,d195,d49,d332,d32,d325,d296,d93,d202,d105,d27, d20,d37,d44,d283,d108,d232,d86,d88,d43,d87,d200,d233,d18,d311,d136,d23_1,d50,d250,d15,d320,d57,d84,d135, d228,d242,d199,d329,d208_2,d303,d183,d77,d300,d190,d304,d159,d75,d318,d67,d207,d267,d269,d149,d176,d150, d258,d185,d68,d171,d164,d79,d65,d74,d113,d265,d122,d282,d268,d117,d163,d324,d287,d294,d173,d285,d128,d83, d62,d132,d317,d271,d120,d71,d208_1,d126,d160,d261,d61,d124,d151,d221,d328,d127,d133,d155,d73,d256,d66,d223, d174,d224,d59,d212,d175,d121,d313,d299,d180,d295,d298,d170,d280,d112,d309,d168,d78,d156,d218,d81,d116,d276, d259,d219,d70,d131,d172,d129,d125,d118,d64,d179,d114,d181,d293,d214,d80,d209,d216,d210,d186,d162,d319,d152, d161,d270,d169,d177,d264,d215,d335,d211,d297,d217,d184,d60,d263,d72,d111,d63,d166,d165,d213,d302,d123,d130, d167,d76,d82,d189,d257,d153] ). fold(test, [d94,d55,d284,d16,d201,d322,d22,d289,d52,d137,d91,d241,d226,d42,d21,d278,d24,d28,d69,d225,d220,d334, d260,d119,d110,d187,d266,d182,d188,d222,d157,d326,d154] ). %usa il file .bg %MODEH modeh(1,atm_charge(+atomid1,-#charge3)). modeh(1,atm_type(+atomid1,-#atomtype1)). modeh(1,atm_as(+atomid1,+atomtype2,+charge3)). modeh(1,atm_ba(+atomid1,+atomtype2,+charge3)). modeh(1,atm_br(+atomid1,+atomtype2,+charge3)). modeh(1,atm_c(+atomid1,+atomtype2,+charge3)). modeh(1,atm_ca(+atomid1,+atomtype2,+charge3)). modeh(1,atm_cl(+atomid1,+atomtype2,+charge3)). modeh(1,atm_cu(+atomid1,+atomtype2,+charge3)). modeh(1,atm_f(+atomid1,+atomtype2,+charge3)). modeh(1,atm_h(+atomid1,+atomtype2,+charge3)). modeh(1,atm_hg(+atomid1,+atomtype2,+charge3)). modeh(1,atm_i(+atomid1,+atomtype2,+charge3)). modeh(1,atm_k(+atomid1,+atomtype2,+charge3)). modeh(1,atm_mn(+atomid1,+atomtype2,+charge3)). modeh(1,atm_n(+atomid1,+atomtype2,+charge3)). modeh(1,atm_na(+atomid1,+atomtype2,+charge3)). modeh(1,atm_o(+atomid1,+atomtype2,+charge3)). modeh(1,atm_p(+atomid1,+atomtype2,+charge3)). modeh(1,atm_pb(+atomid1,+atomtype2,+charge3)). modeh(1,atm_s(+atomid1,+atomtype2,+charge3)). modeh(1,atm_se(+atomid1,+atomtype2,+charge3)). modeh(1,atm_sn(+atomid1,+atomtype2,+charge3)). modeh(1,atm_te(+atomid1,+atomtype2,+charge3)). modeh(1,atm_ti(+atomid1,+atomtype2,+charge3)). modeh(1,atm_zn(+atomid1,+atomtype2,+charge3)). modeh(1,sbond_1(+atomid1,+atomid2)). modeh(1,sbond_2(+atomid1,+atomid2)). modeh(1,sbond_3(+atomid1,+atomid2)). modeh(1,sbond_7(+atomid1,+atomid2)). %MODEB /* modeb(1,atm(-atomid1)). modeb(1,atm_charge(+atomid1,-#charge3)). modeb(1,atm_type(+atomid1,-#atomtype1)). */ modeb(1,atm_as(-atomid1,-atomtype2,-charge3)). modeb(1,atm_ba(-atomid1,-atomtype2,-charge3)). modeb(1,atm_br(-atomid1,-atomtype2,-charge3)). modeb(1,atm_c(-atomid1,-atomtype2,-charge3)). modeb(1,atm_ca(-atomid1,-atomtype2,-charge3)). modeb(1,atm_cl(-atomid1,-atomtype2,-charge3)). modeb(1,atm_cu(-atomid1,-atomtype2,-charge3)). modeb(1,atm_f(-atomid1,-atomtype2,-charge3)). modeb(1,atm_h(-atomid1,-atomtype2,-charge3)). modeb(1,atm_hg(-atomid1,-atomtype2,-charge3)). modeb(1,atm_i(-atomid1,-atomtype2,-charge3)). modeb(1,atm_k(-atomid1,-atomtype2,-charge3)). modeb(1,atm_mn(-atomid1,-atomtype2,-charge3)). modeb(1,atm_n(-atomid1,-atomtype2,-charge3)). modeb(1,atm_na(-atomid1,-atomtype2,-charge3)). modeb(1,atm_o(-atomid1,-atomtype2,-charge3)). modeb(1,atm_p(-atomid1,-atomtype2,-charge3)). modeb(1,atm_pb(-atomid1,-atomtype2,-charge3)). modeb(1,atm_s(-atomid1,-atomtype2,-charge3)). modeb(1,atm_se(-atomid1,-atomtype2,-charge3)). modeb(1,atm_sn(-atomid1,-atomtype2,-charge3)). modeb(1,atm_te(-atomid1,-atomtype2,-charge3)). modeb(1,atm_ti(-atomid1,-atomtype2,-charge3)). modeb(1,atm_zn(-atomid1,-atomtype2,-charge3)). modeb(1,sbond_1(+atomid1,+atomid2)). modeb(1,sbond_2(+atomid1,+atomid2)). modeb(1,sbond_3(+atomid1,+atomid2)). modeb(1,sbond_7(+atomid1,+atomid2)). canc_d(d92,pos). canc_d(d308,pos). canc_d(d196,pos). canc_d(d330,pos). canc_d(d197,pos). canc_d(d306,pos). canc_d(d45,pos). canc_d(d145,pos). canc_d(d243,pos). canc_d(d244,pos). canc_d(d138,pos). canc_d(d275,pos). canc_d(d39,pos). canc_d(d5,pos). canc_d(d23_2,pos). canc_d(d14,pos). canc_d(d305,pos). canc_d(d85_1,pos). canc_d(d25,pos). canc_d(d47,pos). canc_d(d13,pos). canc_d(d38,pos). canc_d(d17,pos). canc_d(d41,pos). canc_d(d29,pos). canc_d(d227,pos). canc_d(d96,pos). canc_d(d192,pos). canc_d(d198,pos). canc_d(d46,pos). canc_d(d9,pos). canc_d(d51,pos). canc_d(d316,pos). canc_d(d6,pos). canc_d(d254,pos). canc_d(d231,pos). canc_d(d103,pos). canc_d(d97,pos). canc_d(d273,pos). canc_d(d307,pos). canc_d(d240,pos). canc_d(d140,pos). canc_d(d58,pos). canc_d(d31,pos). canc_d(d331,pos). canc_d(d141,pos). canc_d(d230,pos). canc_d(d253,pos). canc_d(d101,pos). canc_d(d56,pos). canc_d(d248,pos). canc_d(d274,pos). canc_d(d245,pos). canc_d(d249,pos). canc_d(d323,pos). canc_d(d2,pos). canc_d(d229,pos). canc_d(d336,pos). canc_d(d19,pos). canc_d(d193,pos). canc_d(d204,pos). canc_d(d143,pos). canc_d(d98,pos). canc_d(d35,pos). canc_d(d40,pos). canc_d(d1,pos). canc_d(d239,pos). canc_d(d10,pos). canc_d(d109,pos). canc_d(d12,pos). canc_d(d191,pos). canc_d(d288,pos). canc_d(d85_2,pos). canc_d(d100,pos). canc_d(d142,pos). canc_d(d95,pos). canc_d(d290,pos). canc_d(d205,pos). canc_d(d90,pos). canc_d(d4,pos). canc_d(d281,pos). canc_d(d315,pos). canc_d(d272,pos). canc_d(d33,pos). canc_d(d144,pos). canc_d(d255,pos). canc_d(d235,pos). canc_d(d54,pos). canc_d(d314,pos). canc_d(d104,pos). canc_d(d34,pos). canc_d(d3,pos). canc_d(d286,pos). canc_d(d146,pos). canc_d(d337,pos). canc_d(d53,pos). canc_d(d252,pos). canc_d(d107,pos). canc_d(d291,pos). canc_d(d30,pos). canc_d(d206,pos). canc_d(d236,pos). canc_d(d247,pos). canc_d(d203,pos). canc_d(d99,pos). canc_d(d48,pos). canc_d(d234,pos). canc_d(d148,pos). canc_d(d237,pos). canc_d(d139,pos). canc_d(d26,pos). canc_d(d102,pos). canc_d(d333,pos). canc_d(d279,pos). canc_d(d277,pos). canc_d(d147,pos). canc_d(d7,pos). canc_d(d106,pos). canc_d(d238,pos). canc_d(d251,pos). canc_d(d246,pos). canc_d(d292,pos). canc_d(d11,pos). canc_d(d134,pos). canc_d(d89,pos). canc_d(d36,pos). canc_d(d8,pos). canc_d(d195,pos). canc_d(d49,pos). canc_d(d332,pos). canc_d(d32,pos). canc_d(d325,pos). canc_d(d296,pos). canc_d(d93,pos). canc_d(d202,pos). canc_d(d105,pos). canc_d(d27,pos). canc_d(d20,pos). canc_d(d37,pos). canc_d(d44,pos). canc_d(d283,pos). canc_d(d108,pos). canc_d(d232,pos). canc_d(d86,pos). canc_d(d88,pos). canc_d(d43,pos). canc_d(d87,pos). canc_d(d200,pos). canc_d(d233,pos). canc_d(d18,pos). canc_d(d311,pos). canc_d(d136,pos). canc_d(d23_1,pos). canc_d(d50,pos). canc_d(d250,pos). canc_d(d15,pos). canc_d(d320,pos). canc_d(d57,pos). canc_d(d84,pos). canc_d(d135,pos). canc_d(d228,pos). canc_d(d242,pos). canc_d(d199,pos). canc_d(d329,pos). canc_d(d208_2,neg). canc_d(d303,neg). canc_d(d183,neg). canc_d(d77,neg). canc_d(d300,neg). canc_d(d190,neg). canc_d(d304,neg). canc_d(d159,neg). canc_d(d75,neg). canc_d(d318,neg). canc_d(d67,neg). canc_d(d207,neg). canc_d(d267,neg). canc_d(d269,neg). canc_d(d149,neg). canc_d(d176,neg). canc_d(d150,neg). canc_d(d258,neg). canc_d(d185,neg). canc_d(d68,neg). canc_d(d171,neg). canc_d(d164,neg). canc_d(d79,neg). canc_d(d65,neg). canc_d(d74,neg). canc_d(d113,neg). canc_d(d265,neg). canc_d(d122,neg). canc_d(d282,neg). canc_d(d268,neg). canc_d(d117,neg). canc_d(d163,neg). canc_d(d324,neg). canc_d(d287,neg). canc_d(d294,neg). canc_d(d173,neg). canc_d(d285,neg). canc_d(d128,neg). canc_d(d83,neg). canc_d(d62,neg). canc_d(d132,neg). canc_d(d317,neg). canc_d(d271,neg). canc_d(d120,neg). canc_d(d71,neg). canc_d(d208_1,neg). canc_d(d126,neg). canc_d(d160,neg). canc_d(d261,neg). canc_d(d61,neg). canc_d(d124,neg). canc_d(d151,neg). canc_d(d221,neg). canc_d(d328,neg). canc_d(d127,neg). canc_d(d133,neg). canc_d(d155,neg). canc_d(d73,neg). canc_d(d256,neg). canc_d(d66,neg). canc_d(d223,neg). canc_d(d174,neg). canc_d(d224,neg). canc_d(d59,neg). canc_d(d212,neg). canc_d(d175,neg). canc_d(d121,neg). canc_d(d313,neg). canc_d(d299,neg). canc_d(d180,neg). canc_d(d295,neg). canc_d(d298,neg). canc_d(d170,neg). canc_d(d280,neg). canc_d(d112,neg). canc_d(d309,neg). canc_d(d168,neg). canc_d(d78,neg). canc_d(d156,neg). canc_d(d218,neg). canc_d(d81,neg). canc_d(d116,neg). canc_d(d276,neg). canc_d(d259,neg). canc_d(d219,neg). canc_d(d70,neg). canc_d(d131,neg). canc_d(d172,neg). canc_d(d129,neg). canc_d(d125,neg). canc_d(d118,neg). canc_d(d64,neg). canc_d(d179,neg). canc_d(d114,neg). canc_d(d181,neg). canc_d(d293,neg). canc_d(d214,neg). canc_d(d80,neg). canc_d(d209,neg). canc_d(d216,neg). canc_d(d210,neg). canc_d(d186,neg). canc_d(d162,neg). canc_d(d319,neg). canc_d(d152,neg). canc_d(d161,neg). canc_d(d270,neg). canc_d(d169,neg). canc_d(d177,neg). canc_d(d264,neg). canc_d(d215,neg). canc_d(d335,neg). canc_d(d211,neg). canc_d(d297,neg). canc_d(d217,neg). canc_d(d184,neg). canc_d(d60,neg). canc_d(d263,neg). canc_d(d72,neg). canc_d(d111,neg). canc_d(d63,neg). canc_d(d166,neg). canc_d(d165,neg). canc_d(d213,neg). canc_d(d302,neg). canc_d(d123,neg). canc_d(d130,neg). canc_d(d167,neg). canc_d(d76,neg). canc_d(d82,neg). canc_d(d189,neg). canc_d(d257,neg). canc_d(d153,neg). atm_as(d65,d65_12,101,'a0=0_1375