In this thesis, I propose to use user-defined rules together with the semantic information, to rearrange an environment with a humanoid robot. In this kind of environment, the robot does only know some information such as the number of items, categories of items, target location, and tentative goal positions. I propose first to use the semantic information of the items to infer the goal location. Then using rules with the semantic information, to define the states and position of the items during the rearrangement. Finally using rearranging skills together with motion skills to execute the rearrangement.