Shin-Cheng Mu

dblp:05/4442 · DBLP profile ↗
← Back
27ranked-venue papers
15as first author
4since 2021 · last 2024
0000-0002-4755-601XORCID · corroborated

Domains — the database's venue-derived domains; a paper can count in several

Software engineering, systems software and programming languages · 22 · 11 first-author · 4 since 2021Theory of computation · 5 · 4 first-author
YearPublicationVenuePosition
2024 Bottom-up computation using trees of sublists
abstract
Abstract Some top-down problem specifications, if executed, may compute sub-problems repeatedly. Instead, we may want a bottom-up algorithm that stores solutions of sub-problems in a table to be reused. How the table can be represented and efficiently maintained, however, can be tricky. We study a special case: computing a function ${\mathit{h}}$ taking lists as inputs such that ${\mathit{h}\;\mathit{xs}}$ is defined in terms of all immediate sublists of ${\mathit{xs}}$ . Richard Bird studied this problem in 2008 and presented a concise but cryptic algorithm without much explanation. We give this algorithm a proper derivation and discovered a key property that allows it to work. The algorithm builds trees that have certain shapes—the sizes along the left spine is a prefix of a diagonal in Pascal’s triangle. The crucial function we derive transforms one diagonal to the next.
Shin-Cheng Mu
J. Funct. Program.1
2021 A greedy algorithm for dropping digits
abstract
Abstract Consider the following puzzle: given a number, remove k digits such that the resulting number is as large as possible. Various techniques are employed to derive a linear-time solution to the puzzle: we justify the structure of a greedy algorithm by predicate logic, give a constructive proof of the greedy condition using a dependently typed proof assistant and calculate the greedy step as well as the final, linear-time optimisation by equational reasoning.
Richard S. Bird, Shin-Cheng Mu
J. Funct. Program.2
2021 Not by equations alone: Reasoning with extensible effects
abstract
Abstract The challenge of reasoning about programs with (multiple) effects such as mutation, jumps, or IO dates back to the inception of program semantics in the works of Strachey and Landin. Using monads to represent individual effects and the associated equational laws to reason about them proved exceptionally effective. Even then it is not always clear what laws are to be associated with a monad—for a good reason, as we show for non-determinism. Combining expressions using different effects brings challenges not just for monads, which do not compose, but also for equational reasoning: the interaction of effects may invalidate their individual laws, as well as induce emerging properties that are not apparent in the semantics of individual effects. Overall, the problems are judging the adequacy of a law; determining if or when a law continues to hold upon addition of new effects; and obtaining and easily verifying emergent laws. We present a solution relying on the framework of (algebraic, extensible) effects, which already proved itself for writing programs with multiple effects. Equipped with a fairly conventional denotational semantics, this framework turns useful, as we demonstrate, also for reasoning about and optimizing programs with multiple interacting effects. Unlike the conventional approach, equational laws are not imposed on programs/effect handlers, but induced from them: our starting point hence is a program (model), whose denotational semantics, besides being used directly, suggests and justifies equational laws and clarifies side conditions. The main technical result is the introduction of the notion of equivalence modulo handlers (“modulo observation”) or a particular combination of handlers—and proving it to be a congruence . It is hence usable for reasoning in any context, not just evaluation contexts—provided particular conditions are met. Concretely, we describe several realistic handlers for non-determinism and elucidate their laws (some of which hold in the presence of any other effect). We demonstrate appropriate equational laws of non-determinism in the presence of global state, which have been a challenge to state and prove before.
Oleg Kiselyov, Shin-Cheng Mu, Amr Sabry
J. Funct. Program.2
2021 Longest segment of balanced parentheses: an exercise in program inversion in a segment problem
abstract
Abstract Given a string of parentheses, the task is to find the longest consecutive segment that is balanced, in linear time. We find this problem interesting because it involves a combination of techniques: the usual approach for solving segment problems and a theorem for constructing the inverse of a function—through which we derive an instance of shift-reduce parsing.
Shin-Cheng Mu, Tsung-Ju Chiang
J. Funct. Program.1
2019 Handling Local State with Global State
Koen Pauwels, Tom Schrijvers, Shin-Cheng Mu
MPC3
2016 Queueing and glueing for optimal partitioning (functional pearl)
abstract
The queueing-glueing algorithm is the nickname we give to an algorithmic pattern that provides amortised linear time solutions to a number of optimal list partition problems that have a peculiar property: at various moments we know that two of three candidate solutions could be optimal. The algorithm works by keeping a queue of lists, glueing them from one end, while chopping from the other end, hence the name. We give a formal derivation of the algorithm, and demonstrate it with several non-trivial examples.
Shin-Cheng Mu, Yu-Hsi Chiang, Yu-Han Lyu
ICFP1
2015 Modular reifiable matching: a list-of-functors approach to two-level types
abstract
This paper presents Modular Reifiable Matching (MRM): a new approach to two level types using a fixpoint of list-of-functors representation. MRM allows the modular definition of datatypes and functions by pattern matching, using a style similar to the widely popular Datatypes a la Carte (DTC) approach. However, unlike DTC, MRM uses a fixpoint of list-of-functors approach to two-level types. This approach has advantages that help with various aspects of extensibility, modularity and reuse. Firstly, modular pattern matching definitions are collected using a list of matches that is fully reifiable. This allows for extensible pattern matching definitions to be easily reused/inherited, and particular matches to be overridden. Such flexibility is used, among other things, to implement extensible generic traversals. Secondly, the subtyping relation between lists of functors is quite simple, does not require backtracking, and is easy to model in languages like Haskell. MRM is implemented as a Haskell library, and its use and applicability are illustrated through various examples in the paper.
Bruno C. d. S. Oliveira, Shin-Cheng Mu, Shu-Hung You
Haskell2
2015 Calculating a linear-time solution to the densest-segment problem
abstract
Abstract The problem of finding a densest segment of a list is similar to the well-known maximum segment sum problem, but its solution is surprisingly challenging. We give a general specification of such problems, and formally develop a linear-time online solution, using a sliding-window style algorithm. The development highlights some elegant properties of densities, involving partitions that are decreasing and all right-skew.
Sharon A. Curtis, Shin-Cheng Mu
J. Funct. Program.2
2015 Approximate by thinning: Deriving fully polynomial-time approximation schemes
Shin-Cheng Mu, Yu-Han Lyu, Akimasa Morihata
Sci. Comput. Program.1
2014 Functional Pearl: Nearest Shelters in Manhattan
Shin-Cheng Mu, Ting-Wei Chen
APLAS1
2014 Selected and extended papers from Partial Evaluation and Program Manipulation 2013
Elvira Albert, Shin-Cheng Mu
Sci. Comput. Program.2
2011 Programming from Galois Connections
Shin-Cheng Mu, José N. Oliveira
RAMiCS1
2011 Constructing List Homomorphisms from Proofs
Yun-Yan Chi, Shin-Cheng Mu
APLAS2
2011 Generalising and dualising the third list-homomorphism theorem: functional pearl
abstract
The third list-homomorphism theorem says that a function is a list homomorphism if it can be described as an instance of both a foldr and a foldl. We prove a dual theorem for unfolds and generalise both theorems to trees: if a function generating a list can be described both as an unfoldr and an unfoldl, the list can be generated from the middle, and a function that processes or builds a tree both upwards and downwards may independently process/build a subtree and its one-hole context. The point-free, relational formalism helps to reveal the beautiful symmetry hidden in the theorem.
Shin-Cheng Mu, Akimasa Morihata
ICFP1
2010 A Grammar-Based Approach to Invertible Programs
Kazutaka Matsuda, Shin-Cheng Mu, Zhenjiang Hu 0002, Masato Takeichi
ESOP2
2009 Algebra of programming in Agda: Dependent types for relational program derivation
abstract
Abstract Relational program derivation is the technique of stepwise refining a relational specification to a program by algebraic rules. The program thus obtained is correct by construction. Meanwhile, dependent type theory is rich enough to express various correctness properties to be verified by the type checker. We have developed a library, AoPA (Algebra of Programming in Agda), to encode relational derivations in the dependently typed programming language Agda. A program is coupled with an algebraic derivation whose correctness is guaranteed by the type system. Two non-trivial examples are presented: an optimisation problem and a derivation of quicksort in which well-founded recursion is used to model terminating hylomorphisms in a language with inductive types.
Shin-Cheng Mu, Hsiang-Shang Ko, Patrik Jansson
J. Funct. Program.1
2008 Algebra of Programming Using Dependent Types
Shin-Cheng Mu, Hsiang-Shang Ko, Patrik Jansson
MPC1
2008 Maximum segment sum is back: deriving algorithms for two segment problems with bounded lengths
abstract
It may be surprising that variations of the maximum segment sum (MSS) problem, a textbook example for the squiggolists, are still active topics for algorithm designers. In this paper we examine the new developments from the view of relational program calculation. It turns out that, while the classical MSS problem is solved by the Greedy Theorem, by applying the Thinning Theorem, we get a linear-time algorithm for MSS with upper bound on length. To derive a linear-time algorithm for the em maximum segment density problem, on the other hand, we purpose a variation of thinning based on an extended notion of monotonicity. The concepts of left-negative and right-screw segments emerge from the search for monotonicity conditions. The efficiency of the resulting algorithms crucially relies on exploiting properties of the set of partial solutions and design efficient data structures for them.
Shin-Cheng Mu
PEPM1
2006 A Pushdown Machine for Recursive XML Processing
Keisuke Nakano 0001, Shin-Cheng Mu
APLAS2
2005 Countdown: A case study in Origami programming
abstract
Countdown is the name of a game in which one is given a list of source numbers and a target number, with the aim of building an arithmetic expression out of the source numbers to get as close to the target as possible. Starting with a relational specification we derive a number of functional programs for solving Countdown. These programs are obtained by exploiting the properties of the folds and unfolds of various data types, a style of programming Gibbons has aptly called origami programming. Countdown is attractive as a case study in origami programming both as an illustration of how different algorithms can emerge from a single specification, as well as the space and time trade-offs that have to be taken into account in comparing functional programs.
Richard S. Bird, Shin-Cheng Mu
J. Funct. Program.2
2004 An Algebraic Approach to Bi-directional Updating
Shin-Cheng Mu, Zhenjiang Hu 0002, Masato Takeichi
APLAS1
2004 An Injective Language for Reversible Computation
Shin-Cheng Mu, Zhenjiang Hu 0002, Masato Takeichi
MPC1
2004 A programmable editor for developing structured documents based on bidirectional transformations
abstract
This paper presents a novel editor supporting interactive refinement in the development of structured documents. The user performs a sequence of editing operations on the document view, and the editor automatically derives an efficient and reliable document source and a transformation that produces the document view. The editor is unique in its programmability, in the sense that the transformation can be obtained through editing operations. The main tricks behind are the utilization of the view-updating technique developed in the database community, and a new bidirectional transformation language that cannot only describe the relationship between the document source and its view, but also data dependency in the view.
Zhenjiang Hu 0002, Shin-Cheng Mu, Masato Takeichi
PEPM2
2004 Inverting the Burrows-Wheeler transform
abstract
The Burrows–Wheeler Transform is a string-to-string transform which, when used as a preprocessing phase in compression, significantly enhances the compression rate. However, it often puzzles people how the inverse transform is carried out. In this pearl we to exploit simple equational reasoning to derive the inverse of the Burrows–Wheeler transform from its specification. We also outline how to derive the inverse of two more general versions of the transform, one proposed by Schindler and the other by Chapin and Tate.
Richard S. Bird, Shin-Cheng Mu
J. Funct. Program.2
2004 Theory and applications of inverting functions as folds
Shin-Cheng Mu, Richard S. Bird
Sci. Comput. Program.1
2003 Rebuilding a Tree from Its Traversals: A Case Study of Program Inversion
Shin-Cheng Mu, Richard S. Bird
APLAS1
2002 Inverting Functions as Folds
Shin-Cheng Mu, Richard S. Bird
MPC1