Algebraic Graphs with Class (Functional Pearl)

被引:9
作者
Mokhov, Andrey [1 ]
机构
[1] Newcastle Univ, Newcastle Upon Tyne, Tyne & Wear, England
关键词
Haskell; algebra; graph theory;
D O I
10.1145/3156695.3122956
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
The paper presents a minimalistic and elegant approach to working with graphs in Haskell. It is built on a rigorous mathematical foundation - an algebra of graphs - that allows us to apply equational reasoning for proving the correctness of graph transformation algorithms. Algebraic graphs let us avoid partial functions typically caused by 'malformed graphs' that contain an edge referring to a non-existent vertex. This helps to liberate APIs of existing graph libraries from partial functions. The algebra of graphs can represent directed, undirected, reflexive and transitive graphs, as well as hypergraphs, by appropriately choosing the set of underlying axioms. The flexibility of the approach is demonstrated by developing a library for constructing and transforming polymorphic graphs.
引用
收藏
页码:2 / 13
页数:12
相关论文
共 20 条
[1]  
Alekseyev Arseniy, 2014, THESIS
[2]  
Beaumont J, 2015, 2015 ACM/IEEE INTERNATIONAL CONFERENCE ON FORMAL METHODS AND MODELS FOR CODESIGN (MEMOCODE), P118, DOI 10.1109/MEMCOD.2015.7340478
[3]  
Bonchi F, 2015, ACM SIGPLAN NOTICES, V50, P515, DOI [10.1145/2775051.2676993, 10.1145/2676726.2676993]
[4]   Associated type synonyms [J].
Chakravarty, MMT ;
Keller, G ;
Jones, SP .
ACM SIGPLAN NOTICES, 2005, 40 (09) :241-253
[5]   COMPLEMENT REDUCIBLE GRAPHS [J].
CORNEIL, DG ;
LERCHS, H ;
BURLINGHAM, LS .
DISCRETE APPLIED MATHEMATICS, 1981, 3 (03) :163-174
[6]   Inductive graphs and functional graph algorithms [J].
Erwig, M .
JOURNAL OF FUNCTIONAL PROGRAMMING, 2001, 11 :467-492
[7]  
Gibbons J., 1995, Mathematics of Program Construction. Third International Conference, MPC '95 Proceedings, P282
[8]  
Gibbons J, 2014, ACM SIGPLAN NOTICES, V49, P339, DOI 10.1145/2628136.2628138
[9]  
Golan J.S., 2010, SEMIRINGS THEIR APPL, DOI [10.1007/978-94-015-9333-5, DOI 10.1007/978-94-015-9333-5]
[10]  
Harary F., 1969, Graph theory