SCD Assignment

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

SOFTWARE

CONSTRUCTION &
DEVELOPMENT
PROJECT
SHAPE LANGUAGE

SUBMITTED TO:
MAM WAJEEHA
SUBMITTED BY:
MAHEERA AFTAB
(21-SE-07)
SUROOSH JAMSHEED
(21-SE-07)
HIBA
(21-SE-07)

DATE: 04-May-2024
Table of Contents
Descriptive definitions
Square........................................................................................................................3
Rectangle ...................................................................................................................3
Triangle .....................................................................................................................3
Pentagon ....................................................................................................................3
Hexagon.....................................................................................................................3
Octagon .....................................................................................................................3
Cube ...........................................................................................................................3
Recursive Definition
1. Square....................................................................................................................3
2. Rectangle ...............................................................................................................4
3. Triangle .................................................................................................................4
6. Pentagon: ..............................................................................................................4
7. Hexagon: ...............................................................................................................4
8. Octagon: ................................................................................................................4
11 Cube:.....................................................................................................................4
Regular expression
Square: ......................................................................................................................5
Rectangle:..................................................................................................................5
Triangle: ....................................................................................................................5
Pentagon: ..................................................................................................................5
Hexagon: ...................................................................................................................5
Octagon: ....................................................................................................................6
Cube: .........................................................................................................................6
DFA (Deterministic finite automata)
Square: ......................................................................................................................6
Rectangle:..................................................................................................................7
Triangle: ....................................................................................................................7
Pentagon: ..................................................................................................................8
Hexagon: ...................................................................................................................8
Octagon: ....................................................................................................................9
Cube: .........................................................................................................................9
CFG (Context free Grammar)
Square: ....................................................................................................................10
Rectangle:................................................................................................................10
Pentagon: ................................................................................................................ 11
Hexagon: ................................................................................................................. 11
Octagon: ..................................................................................................................12
Descriptive definitions
Square
A square is a four-sided shape with equal-length sides and right angles at each corner. Its symmetry
includes parallel opposite sides, equal diagonals, and rotational symmetry of order four. This
regular polygon stands out for its uniformity and balanced structure.

Rectangle
A rectangle is a four-sided shape with opposite sides of equal length, right angles at each corner,
and parallel sides. Its symmetry includes equal diagonals and rotational symmetry of order two.

Triangle
A triangle is a polygon with three sides and three angles. Its interior angles always add up to 180
degrees. Triangles come in different types based on their side lengths and angle measures, such as
equilateral, isosceles, and scalene triangles. They are fundamental shapes in geometry.

Pentagon
A pentagon is a polygon with five sides and angles. Its interior angle sum is 540 degrees. Pentagons
come in regular and irregular forms, with regular ones being symmetrical and commonly used in
geometry and architecture.

Hexagon
A hexagon is a polygon with six sides and six angles. It has six vertices labeled A, B, C, D, E, and
F, with each interior angle measuring 120 degrees.

Octagon
An octagon is an eight-sided polygon characterized by eight vertices, labeled A, B, C, D, E, F, G,
and H. Each interior angle measures 135 degrees.

Cube
A cube is a three-dimensional geometric shape with six square faces, all of which are congruent.
It is characterized by equal edge lengths and right angles between adjacent faces, making it a
regular polyhedron.

Recursive Definition
1. Square
1. A square is a special type of rectangle where all sides are equal.
2. Any shape formed by using any other rules than these is not a shape.
3. Alternatively, a square can be recursively defined as a quadrilateral with four sides of
equal length and four right angles, and each side is formed by connecting two points
equidistant from the square's center.

2. Rectangle
• A rectangle is a parallelogram with four right angles.
• Alternatively, a rectangle can be recursively defined as a quadrilateral with opposite sides
of equal length and each angle measuring 90 degrees.
• Any shape formed by using any other rules than these is not a shape.

3. Triangle
• A triangle is a polygon with three sides and three angles.
• Alternatively, a triangle can be recursively defined as a polygon formed by connecting three non-
collinear points, with each side defined by the line segment connecting two of these points.
• Any shape formed by using any other rules than these is not a shape.

6. Pentagon:
• A pentagon is a polygon with five sides and five angles.
• Alternatively, a pentagon can be recursively defined as a polygon formed by connecting five non-
collinear points, with each side defined by the line segment connecting two of these points.
• Any shape formed by using any other rules than these is not a shape.

7. Hexagon:
• Start with a line segment or a single point, representing the first side of the hexagon.
• Extend the current side to create the next side of the hexagon.
• Repeat the process five more times, connecting each new side to the previous one until all six sides
are formed.
• Any shape formed by using any other rules than these is not a shape.

8. Octagon:
• Begin with a line segment or a single point, representing the first side of the octagon.
• Extend the current side to create the next side of the octagon.
• Repeat the process six more times, connecting each new side to the previous one until all eight
sides are formed.
• Any shape formed by using any other rules than these is not a shape.

11 Cube:
• Start with a square, representing one of the faces of the cube.
• Duplicate the square and position it parallel to the first square to create another face.
• Repeat the process until all six faces are formed, ensuring each new face is connected to the
previous ones.
• Any shape formed by using any other rules than these is not a shape.
Regular expression
Square:
• Vertices: A, B, C, D
• Angles: 90 degrees at each vertex
• Other Properties: Side length
• Regular Expression: (𝐴𝐴+𝐴𝐵+𝐵𝐴+𝐵𝐵) ∗

Rectangle:
• Vertices: A, B, C, D
• Angles: 90 degrees at each vertex
• Other Properties: Length, Width
• Regular Expression:
((𝐴∗𝐿+𝐵∗𝑊)2+(𝐴∗𝑊+𝐵∗𝐿)2)∗((A∗L+B∗W)2+(A∗W+B∗L)2)∗

Triangle:
• Vertices: A, B, C
• Angles: α, β, γ
• Other Properties: Side lengths, Altitudes, Medians
• Regular Expression:
(𝐴𝐴𝐴+𝐴𝐴𝐵+𝐴𝐵𝐶+𝐴𝐴𝐶+𝐴𝐵𝐴+𝐴𝐵𝐵+𝐴𝐶𝐴+𝐴𝐶𝐵+𝐴𝐶𝐶+𝐵𝐴𝐴+𝐵𝐴𝐵+𝐵𝐴𝐶+𝐵𝐵𝐴+𝐵𝐵𝐵+𝐵
𝐵𝐶+𝐵𝐶𝐴+𝐵𝐶𝐵+𝐵𝐶𝐶+𝐶𝐴𝐴+𝐶𝐴𝐵+𝐶𝐴𝐶+𝐶𝐵𝐴+𝐶𝐵𝐵+𝐶𝐵𝐶+𝐶𝐶𝐴+𝐶𝐶𝐵+𝐶𝐶𝐶)∗×(𝑋𝑌𝑍)∗

Pentagon:
• Vertices: A, B, C, D, E
• Angles: Varying, but typically 108 degrees
• Other Properties: Side length
• Regular Expression: ((A∗B)+(B∗C)+(C∗D)+(D∗E)+(E∗A))2

Hexagon:
• Vertices: A, B, C, D, E, F
• Angles: 120 degrees at each vertex
• Other Properties: Side length
• Regular Expression: ((𝐴∗𝐵)+(𝐵∗𝐶)+(𝐶∗𝐷)+(𝐷∗𝐸)+(𝐸∗𝐹)+(𝐹∗𝐴))2

Octagon:
• Vertices: A, B, C, D, E, F, G, H
• Angles: 135 degrees at each vertex
• Other Properties: Side length
• Regular Expression:
((A∗B)+(B∗C)+(C∗D)+(D∗E)+(E∗F)+(F∗G)+(G∗H)+(H∗A))4

Cube:
• Vertices: A, B, C, D, E, F, G, H
• Angles: 90 degrees at each vertex
• Other Properties: Edge length
• Regular Expression:
((𝐴∗𝐵)+(𝐵∗𝐶)+(𝐶∗𝐷)+(𝐷∗𝐴)+(𝐸∗𝐹)+(𝐹∗𝐺)+(𝐺∗𝐻)+(𝐻∗𝐸)+(𝐴∗𝐸)+(𝐵∗𝐹)+(𝐶∗𝐺)+(𝐷∗𝐻))^3

DFA (Deterministic finite automata)


Square:
Rectangle:

Triangle:
Pentagon:

Hexagon:
Octagon:

Cube:
CFG (Context free Grammar)
Square:

Rectangle:
Pentagon:

Hexagon:
Octagon:

You might also like