---
title: "Construction of an SLP-Group and its Elements"
canonical: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/creation.html"
source: "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/creation.md"
part: "Finitely Presented Groups"
chapter: "Groups of Straight-Line Programs"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Finitely Presented Groups", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/index-finitely-presented-groups.md"}
  - {"title": "Groups of Straight-Line Programs", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/index-groups-of-straight-line-programs.md"}
prev: {"title": "Introduction", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/introduction.md"}
next: {"title": "Arithmetic with Elements", "source": "https://docs.magma-maths.org/v2.30-1/FinitelyPresentedGroups/GroupsOfStraightLinePrograms/operation.md"}
intrinsics:
  - {"name": "SLPGroup", "signature": "SLPGroup(n): RngIntElt -> GrpSLP"}
  - {"name": "Identity", "signature": "Identity(G): GrpSLP -> GrpSLPElt"}
  - {"name": "Id", "signature": "Id(G): GrpSLP -> GrpSLPElt"}
  - {"name": "!", "signature": "G ! 1: GrpSLP, RngIntElt -> GrpSLPElt"}
examples:
  - "ex-059102"
---

# Construction of an SLP-Group and its Elements

## Structure Constructors

<a id="function-slpgroup-rngintelt"></a>
### `SLPGroup(n): RngIntElt -> GrpSLP`

Construct the free group $F$ of straight-line programs on $n$ generators, where $n$ is a non-negative integer. The $i$-th generator may be referenced by the expression `F.i`, $i = 1, \ldots, n$.

<a id="example-ex-059102"></a>
### `Example: Creating an SLP-Group (ex-059102)`

The statement

```magma
> F := SLPGroup(2);
```

creates the free group on two generators. Here the generators may be referenced using the standard names, `F.1` and `F.2`. Group operations on the elements will be stored as part of the result.

## Construction of an Element

<a id="function-identity-grpslp"></a>
### `Identity(G): GrpSLP -> GrpSLPElt`

<a id="function-id-grpslp"></a>
### `Id(G): GrpSLP -> GrpSLPElt`

<a id="operation-op-grpslp-rngintelt"></a>
### `G ! 1: GrpSLP, RngIntElt -> GrpSLPElt`

Construct the identity element (the straight-line program $[]$ of length 0) for the SLP-group $G$.
