arXiv.itsnick.co

an independent field guide to 23 million papers from arXiv & OpenAlex — not affiliated with arXiv.org

Author

Shin-Cheng Mu

42 papers · 1999–2026

1999: 12000: 02001: 22002: 02003: 12004: 32005: 02006: 02007: 32008: 52009: 22010: 22011: 22012: 12013: 22014: 02015: 42016: 12017: 22018: 02019: 02020: 02021: 72022: 02023: 12024: 12025: 12026: 1
1999peak 7 in 20212026

Frequent co-authors

Papers

showing 1–25 of 42 RSS

A programmable editor for developing structured documents based on bidirectional transformations

Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi

Artificial Intelligence · · cited 110× · DOI ↗ · more like this ·

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.

Algebra of programming in Agda: Dependent types for relational program derivation

Shin-Cheng Mu, Hsiang−Shang Ko, Patrik Jansson

Artificial Intelligence · Journal of Functional Programming · · cited 36× · DOI ↗ · more like this ·

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.

Functional Quantum Programming

Shin-Cheng Mu, Richard Bird

Artificial Intelligence · Oxford University Research Archive (ORA) (University of Oxford) · · cited 31× · OpenAlex ↗ · more like this ·

It has been shown that non-determinism, both angelic and demonic, can be encoded in a functional language in different representation of sets.In this paper we see quantum programming as a special kind of non-deterministic programming where negative probabilities are allowed.The point is demonstrated by coding two simple quantum algorithms in Haskell.A monadic style of quantum programming is also proposed.Programs are written in an imperative style but the programmer is encouraged to think in terms of values rather than quantum registers.

Programming from Galois connections

Shin-Cheng Mu, José N. Oliveira

Artificial Intelligence · The Journal of Logic and Algebraic Programming · · cited 26× · DOI ↗ · more like this ·

Problem statements often resort to superlatives such as in e.g. “… the smallest such number”, “… the best approximation”, “… the longest such list” which lead to specifications made of two parts: one defining a broad class of solutions (the easy part) and the other requesting one particular such solution, optimal in some sense (the hard part). This article introduces a binary relational combinator which mirrors this linguistic structure and exploits its potential for calculating programs by optimization. This applies in particular to specifications written in the form of Galois connections, in which one of the adjoints delivers the optimal solution. The framework encompasses re-factoring of results previously developed by Bird and de Moor for greedy and dynamic programming, in a way which makes them less technically involved and therefore easier to understand and play with.

Maximum segment sum is back

Shin-Cheng Mu

Artificial Intelligence · · cited 13× · DOI ↗ · more like this ·

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.

Modular reifiable matching: a list-of-functors approach to two-level types

Bruno C. d. S. Oliveira, Shin-Cheng Mu, Shu-Hung You

Artificial Intelligence · · cited 11× · DOI ↗ · more like this ·

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…

FUNCTIONAL PEARL <i>Inverting the Burrows–Wheeler transform</i>

Richard Bird, Shin-Cheng Mu

Artificial Intelligence · Journal of Functional Programming · · cited 10× · DOI ↗ · more like this ·

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.

Bidirectionalizing Tree Transformation Languages: A Case Study

Shin-Cheng Mu, Zhenjiang Hu, Masato Takeichi

Computer Networks and Communications · Journal of information processing · · cited 9× · DOI ↗ · more like this ·

A transformation from the source data to a target view is said to be bidirectional if, when the target is altered, the transformation somehow induces a way to reflect the changes back to the source, with the updated source satisfying certain healthiness conditions. Several bidirectional transformation languages have been proposed. In this paper, on the other hand, we aim at making existing transformations bidirectional. As a case study we chose the Haskell combinator library, HaXML, and embed it into Inv, a language the authors previously developed to deal with bidirectional updating. With the embedding, existing HaXML transformations gain bidirectionality.

A Calculational Approach to Program Inversion

Mao-Qian Chen, Shin-Cheng Mu

Artificial Intelligence · · cited 6× · OpenAlex ↗ · more like this ·

Many problems in computation can be specified in terms of computing the inverse of an easily constructed function. However, studies on how to derive an algorithm from a problem specification involving inverse functions are relatively rare. The aim of this thesis is to demonstrate, in an example-driven style, a number of techniques to do the job. The techniques are based on the framework of relational, algebraic program derivation. Simple program inversion can be performed by just taking the converse of the program, sometimes known as to “run a program backwards”. The approach, however, does not match the pattern of some more advanced algorithms. Previous results, due to Bird and de Moor, gave conditions under which the inverse of a total function can be written as a fold. In this thesis, a generalised theorem stating the conditions for the inverse of a partial function to be a…

Not by equations alone: Reasoning with extensible effects

Oleg Kiselyov, Shin-Cheng Mu, Amr Sabry

Artificial Intelligence · Journal of Functional Programming · · cited 5× · DOI ↗ · more like this ·

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…

Calculating a backtracking algorithm: an exercise in monadic program derivation

Shin-Cheng Mu

cs.PL · · cited 5× · arXiv ↗ · more like this ·

Equational reasoning is among the most important tools that functional programming provides us. Curiously, relatively less attention has been paid to reasoning about monadic programs. In this report we derive a backtracking algorithm for problem specifications that use a monadic unfold to generate possible solutions, which are filtered using a $\mathit{scanl}$-like predicate. We develop theorems that convert a variation of $\mathit{scanl}$ to a $\mathit{foldr}$ that uses the state monad, as well as theorems constructing hylomorphism. The algorithm is used to solve the $n$-queens puzzle, our running example. The aim is to develop theorems and patterns useful for the derivation of monadic programs, focusing on the intricate interaction between state and non-determinism.

Algebra of Programming using Dependent Types

Shin-Cheng Mu, Ko Hsiang-Shang, Patrik Jansson

Artificial Intelligence · Oxford University Research Archive (ORA) (University of Oxford) · · cited 5× · OpenAlex ↗ · more like this ·

Abstract. Dependent type theory is rich enough to express that a pro-gram satisfies an input/output relational specification, but it could be hard to construct the proof term. On the other hand, squiggolists know very well how to show that one relation is included in another by alge-braic reasoning. We demonstrate how to encode functional and relational derivations in a dependently typed programming language. A program is coupled with an algebraic derivation from a specification, whose cor-rectness is guaranteed by the type system. 1

Calculating a linear-time solution to the densest-segment problem

Sharon Curtis, Shin-Cheng Mu

Artificial Intelligence · Journal of Functional Programming · · cited 3× · DOI ↗ · more like this ·

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.

Constructing datatype-generic fully polynomial-time approximation schemes using generalised thinning

Shin-Cheng Mu, Yu-Han Lyu, Akimasa Morihata

Computational Theory and Mathematics · · cited 3× · DOI ↗ · more like this ·

The fully polynomial-time approximation scheme (FPTAS) is a class of approximation algorithms that is able to deliver an approximate solution within any chosen ratio in polynomial time. By generalising Bird and de Moor's Thinning Theorem to a property between three orderings, we come up with a datatype-generic strategy for constructing fold-based FPTASs. Greedy, thinning, and approximation algorithms can thus be seen as a series of generalisations. Components needed in constructing an FPTAS are often natural extensions of those in the thinning algorithm. Design of complex FPTASs is thus made easier, and some of the resulting algorithms turn out to be simpler than those in previous works.

Proceedings of the ACM SIGPLAN 2013 workshop on Partial evaluation and program manipulation

Elvira Albert, Shin-Cheng Mu

Information Systems · Symposium on Principles of Programming Languages · · cited 2× · OpenAlex ↗ · more like this ·

It is our great pleasure to welcome you to the ACM SIGPLAN 2013 Workshop on Partial Evaluation and Program Manipulation -- PEPM'13. The PEPM Symposium / Workshop series aims to bring together researchers and practitioners working in the broad area of program transformation, which spans from refactoring, partial evaluation, super-compilation, fusion and other meta-programming to model-driven development, program analyses including termination, inductive programming, program generation and applications of machine learning and probabilistic search. The call for papers has attracted 29 submissions from all over the world. The program committee has accepted 13 full papers, two short papers and two tool demonstrations. They cover theory and applications of various analysis and program manipulation techniques -- and, in the case of the tool papers -- show how this work is put into practice.…

Generalising and dualising the third list-homomorphism theorem

Shin-Cheng Mu, Akimasa Morihata

Artificial Intelligence · ACM SIGPLAN Notices · · cited 2× · DOI ↗ · more like this ·

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.

Functional Pearl: Maximally Dense Segments

Sharon Curtis, Shin-Cheng Mu

Computer Vision and Pattern Recognition · · cited 2× · OpenAlex ↗ · more like this ·

The problem of finding a maximally dense segment (MDS) of a list is a generalisation of the well-known maximum segment sum (MSS) problem, but its solution is more challenging. We extend and illuminate some recent work [2, 3, 7] on this problem with a formal development of a linear-time online algorithm, in the form of a sliding window zygomorphism. The development highlights some elegant properties of densities, involving partitions which are decreasing and all right-skew.

Equational reasoning for non-determinism monad: the case of Spark aggregation

Shin-Cheng Mu

cs.PL · · cited 1× · arXiv ↗ · more like this ·

As part of the author's studies on equational reasoning for monadic programs, this report focus on non-determinism monad. We discuss what properties this monad should satisfy, what additional operators and notations can be introduced to facilitate equational reasoning about non-determinism, and put them to the test by proving a number of properties in our example problem inspired by the author's previous work on proving properties of Spark aggregation.

A greedy algorithm for dropping digits

Richard Bird, Shin-Cheng Mu

Computational Theory and Mathematics · Journal of Functional Programming · · cited 1× · DOI ↗ · more like this ·

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.

Binomial Tabulation: A Short Story

Hsiang-Shang Ko, Shin-Cheng Mu, Jeremy Gibbons

cs.PL · · cited 0× · arXiv ↗ · more like this ·

We reconstruct some of the development in Richard Bird's [2008] paper Zippy Tabulations of Recursive Functions, using dependent types and string diagrams rather than mere simple types. This paper serves as an intuitive introduction to and demonstration of these concepts for the curious functional programmer, who ideally already has some exposure to dependent types and category theory, is not put off by basic concepts like indexed types and functors, and wants to see a more practical example. The paper is presented in the form of a short story, narrated from the perspective of a functional programmer trying to follow the development in Bird's paper. The first section recaps the original simply typed presentation. The second section explores a series of refinements that can be made using dependent types. The third section uses string diagrams to simplify arguments involving functors and…

Bottom-up computation using trees of sublists

Shin-Cheng Mu

Computational Theory and Mathematics · Journal of Functional Programming · · cited 0× · DOI ↗ · more like this ·

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.

Bottom-up computation using trees of sublists (Functional Pearl)

Shin-Cheng Mu

cs.PL · · cited 0× · arXiv ↗ · more like this ·

Some top-down problem specifications, if executed directly, 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. It can be tricky, however, to figure out how the table can be represented and efficiently maintained. We study a special case: computing a function $h$ taking lists as inputs such that $h~xs$ is defined in terms of all immediate sublists of $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 discover a key property that allows it to work. The algorithm builds trees that have certain shapes -- the sizes along the left spine is a diagonal in Pascal's triangle. The crucial function we derive transforms one diagonal to the next.

Deriving monadic quicksort (Declarative Pearl)

Shin-Cheng Mu, Tsung-Ju Chiang

cs.PL · · cited 0× · arXiv ↗ · more like this ·

To demonstrate derivation of monadic programs, we present a specification of sorting using the non-determinism monad, and derive pure quicksort on lists and state-monadic quicksort on arrays. In the derivation one may switch between point-free and pointwise styles, and deploy techniques familiar to functional programmers such as pattern matching and induction on structures or on sizes. Derivation of stateful programs resembles reasoning backwards from the postcondition.

A greedy algorithm for dropping digits (Functional Pearl)

Richard Bird, Shin-Cheng Mu

cs.PL · · cited 0× · arXiv ↗ · more like this ·

Consider the puzzle: given a number, remove $k$ digits such that the resulting number is as large as possible. Various techniques were employed to derive a linear-time solution to the puzzle: predicate logic was used to justify the structure of a greedy algorithm, a dependently-typed proof assistant was used to give a constructive proof of the greedy condition, and equational reasoning was used to calculate the greedy step as well as the final, linear-time optimisation.

Longest segment of balanced parentheses -- an exercise in program inversion in a segment problem (Functional Pearl)

Shin-Cheng Mu, Tsung-Ju Chiang

cs.PL · · cited 0× · arXiv ↗ · more like this ·

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.