Modelling dialogues for optimal legislation