Gap: Constructing group from power commutator presentation without supplying trivial relations Suppose I have a p-group and I want to investigate it in GAP and that I have a power commutator presentation written down for the group on paper, then what is the best way for me to construct this within GAP? 
In particular as all but a few of the commutator relations are trivial, I do not want to have to type in all these trivial relations if I can avoid it (this is what I have done in the past when the group has been small, but I am sure there is a better way).
To make the question more concrete, suppose I have a presentation:
$a_{1}^{p}=1$
$a_{2}^{p}=a_{1}$
$a_{3}^{p}=a_{2}$
$a_{4}^{p}=1$
$[a_{2},a_{3}]=a_{1}, [a_{3},a_{4}]=a_{2}$
with all other commutator relations trivial.
How could I investigate this in GAP?
Thank you
 A: If you create a PC group from scratch (not as quotient from an fp group, but via a collector) in fact you do not need to give the trivial relations. This is decribed in the manual section Constructing PC Groups,
http://www.gap-system.org/Manuals/doc/ref/chap46.html#X8581887880556E0C
but the easiest way to see how to do this is is probably by taking a Pc group g and looking at the output of Print(GapInputPcGroup(g,"G"));  For example, for $S_3$ you get (essentially)
f:=FreeGroup(IsSyllableWordsFamily,2);
g:=GeneratorsOfGroup(f);g1:=g[1];g2:=g[2];
rws:=SingleCollector(f,[ 2, 3 ]);
r:=[];
for x in r do SetPower(rws,x[1],x[2]);od;
r:=[[2,1,g2]];
for x in r do SetCommutator(rws,x[1],x[2],x[3]);od;
return GroupByRwsNC(rws);

That is only one nontrivial SetCommutator.
A: Using the answer above by ahulpkhe, I thought I would answer this question for the concrete example I posted in the original question.
In the original question I arbitrarily wrote down a presentation, and asked how to construct this group in GAP without having to list all the trivial relations. 
Step 1:
The presentation was not in the standard power commutator form, so first write it as such. We get:
$g_{1}^{3}=1 \:$,    $g_{2}^{3}=g_{3}\:$,    $g_{3}^{3}=g_{4}\:$,   $g_{4}^{p}=1$
$[g_{3},g_{2}]=g_{4}, [g_{2},g_{1}]=g_{3}$
Step 2:
Using the post by ahulpke and the suggestion to use Print(GapInputPcGroup(g,"G")); as a guide/template to apply to this example, I get the code:
      G:=function()
        local g1,g2,g3,g4,r,f,g,rws,x;
        f:=FreeGroup(IsSyllableWordsFamily,4);
        g:=GeneratorsOfGroup(f);g1:=g[1];g2:=g[2];  g3:=g[3]; g4:=g[4];
#This is a 3-group and I am writing 
#down a power commutator presentation, so we write down the pth powers of each
#generator
        rws:=SingleCollector(f,[ 3, 3, 3, 3 ]); 

#The non trivial power relations
        r:=[
        [2,g3],
        [3,g4] ,
        ];


        for x in r do SetPower(rws,x[1],x[2]);od;

#The non trivial commutator relations
        r:=[[3,2,g4],
        [2,1,g3],
        ];

        for x in r do SetCommutator(rws,x[1],x[2],x[3]);od;
        return GroupByRws(rws);

        end;

Note I am using GroupByRws rather than GroupByRwsNC because we need to check whether the rewriting system is confluent. (I arbitrarily wrote down this example and made no checks the presentation was consistent).
Executing the code, GAP then gives us an error, telling us the RWS must be confluent. Hence, perhaps unsurprisingly, we deduce that the presentation is not consistent/confluent. If the presentation had of been consistent/confluent, then this function would have returned the group defined by this presentation.
Thank you ahulpke and Alexander Konovalov for your answer/comments.
