arrow
返回

Pattern Matching Based on Object Graphs

delete2021-01-01
delete1
delete
OA
AI
W
Wei Ke *
K
Ka‐Hou Chan
DOI:10.1109/ACCESS.2021.3128575delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Pattern matching has been widely adopted in functional programming languages, and is gradually getting popular in OO languages, from Scala to Python. The structural pattern matching currently in use has its foundation on algebraic data types from functional languages. To better reflect the pointer structures of OO programs, we propose a pattern matching extension to general statically typed OO languages based on object graphs. By this extension, we support patterns having aliasing and circular referencing, that are typically found in pointer structures. With the requirement of only an abstract subtyping preorder on types, our extension is not restricted to a particular hierarchical class model. We give the formal base of the graph model, that is able to handle aliases and cycles in patterns, together with the abstract syntax to construct the object graphs. More complex cases of conjunction and disjunction of multiple patterns are explored with resolution. We present the type checking rules and operational semantics to reason about the soundness by proving the type safety. We also discuss the design decisions, applicability and limitation of our pattern matching extension.
Keyword:
Pattern matching
Semantics
Syntactics
Safety
Libraries
C plus plus languages
Writing
Pattern matching
object graph
subtyping
type system
operational semantics
programming language

期刊

IEEE Access 封面图
IEEE Access
IF:
3.6
论文数:
9.8W
被引数:
29.4W

机构

M
Macao Polytechnic University
学者数:
1.6K
论文数: 1.5K
被引数: 805
引用论文

引用论文

Engineering quantum correlations to enhance transport in cold atoms
err2013-01-28
err0
PREAI
errMark Sadgrove; Torben Schell; Ken'ichi Nakagawa; Sandro Wimberger
err分享
err收藏
err分享
err收藏
A graph-based generic type system for object-oriented programs
err2013-01-09
err5
PREAI
errKe, Wei; Liu, Zhiming; Wang, Shuling; Zhao, Liang
err分享
err收藏
err分享
err收藏
Oxygen isotope dating of the Australian regolith
err1988-02-01
err0
PREAI
errMichael I. Bird; Allan R. Chivas
err分享
err收藏
没有更多内容