Skip to content

Instantly share code, notes, and snippets.

@samuell
Created October 29, 2009 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuell/221649 to your computer and use it in GitHub Desktop.
Save samuell/221649 to your computer and use it in GitHub Desktop.
% *** Some facts about substances ***
hasHBondDonorsCount( substanceX, 3 ).
hasHBondDonorsCount( substanceY, 5 ).
hasHBondDonorsCount( substanceZ, 7 ).
hasHBondAcceptorsCount( substanceX, 7 ).
hasHBondAcceptorsCount( substanceY, 10 ).
hasHBondAcceptorsCount( substanceZ, 13 ).
hasMolecularWeight( substanceX, 320 ).
hasMolecularWeight( substanceY, 500 ).
hasMolecularWeight( substanceZ, 500 ).
% *** "Rule of Five" (simplified) àla Prolog ***
isDrugLike( Substance ) :-
hasHBondDonorsCount( Substance, HBDonors ),
HBDonors =< 5,
hasHBondAcceptorsCount( Substance, HBAcceptors ),
HBAcceptors =< 10,
hasMolecularWeight( Substance, MW ),
MW < 500.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment