In Programming by Demonstration (PbD) systems, the problem of task segmentation and task decomposition has not been addressed with satisfactory attention. In this article we propose a method relying on psychological gestalt theories originally developed for visual perception and apply it to the domain of action segmentation. We propose a computational model for gestalt-based segmentation called Competitive Layer Model (CLM). The CLM relies on features mutually supporting or inhibiting each other to form segments by competition. We analyze how gestalt laws for actions can be learned from human demonstrations and how they can be beneficial to the CLM segmentation method. We validate our approach with two reported experiments on action sequences and present the results obtained from those experiments.