Computer Algebra Programs
There are many good computer algebra programs, for instance I have used Axiom as explained on these pages. However Axiom 'hard codes' algebras as program code (algorithms). Here we want algebras to be dynamically created and 'operated on' in various ways, so here I will use a program called UACalc which is available from this site: http://www.uacalc.org/.
So what structure can we use to store a general algebra? Here we use the following elements:
subelements  attributes  

algebra  either: powerAlgebra, productAlgebra, quotientAlgebra, subalgebra, freeAlgebra, bigProductAlgebra, subProductAlgebra or basicAlgebra.  
basicAlgebra  algName, desc, cardinality, universe, operations  
productAlgebra  algName, desc, cardinality, factors  
powerAlgebra  algName, desc, cardinality, powers, root  
superAlgebra  algebra  
quotientAlgebra  algName, desc, cardinality, algebra, congruence 

subAlgebra  algName, desc, cardinality, algebra, subUniverse 

subProductAlgebra  algName, desc, cardinality, generators, universe  
freeAlgebra  algName, desc, cardinality, generators, universe  
bigProductAlgebra  algName, desc, powers, rootFactors  
algName  
desc  
cardinality  
universe  subUniverse  
subUniverse  
operations  op  
op  opSymbol,opName,arity,opSymbol,opTable 

opName  
opTable  
opSymbol  
arity  
elem  
root  algebra  
factor  
factors  
rootFactors  
powers  
power  
intArray  
stringArray  
congruence  
partition  
generators  
productElem 
Example
<?xml version="1.0"?>
<algebra>
<basicAlgebra>
<algName>m3</algName>
<desc>the diamond</desc>
<cardinality>5</cardinality>
<operations>
<op>
<opSymbol>
<opName>meet</opName>
<arity>2</arity>
</opSymbol>
<opTable>
<intArray>
<row r="[0]">0,0,0,0,0</row>
<row r="[1]">0,1,0,0,1</row>
<row r="[2]">0,0,2,0,2</row>
<row r="[3]">0,0,0,3,3</row>
<row r="[4]">0,1,2,3,4</row>
</intArray>
</opTable>
</op>
<op>
<opSymbol>
<opName>join</opName>
<arity>2</arity>
</opSymbol>
<opTable>
<intArray>
<row r="[0]">0,1,2,3,4</row>
<row r="[1]">1,1,4,4,4</row>
<row r="[2]">2,4,2,4,4</row>
<row r="[3]">3,4,4,3,4</row>
<row r="[4]">4,4,4,4,4</row>
</intArray>
</opTable>
</op>
</operations>
</basicAlgebra>
</algebra>