rule generation(incomplete)