From Users' Intentions to IF-THEN Rules in the Internet of Things