Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article
Open access

Editing by example

Published: 01 October 1985 Publication History

Abstract

An editing by example system is an automatic program synthesis facility embedded in a text editor that can be used to solve repetitive text editing problems. The user provides the editor with a few examples of a text transformation. The system analyzes the examples and generalizes them into a program that can perform the transformation to the rest of the user's text. This paper presents an overview of the design, analysis, and implementation of a practical editing by example system. It studies the problem of synthesizing a text processing program that generalizes the transformation implicitly described by a small number of input/output examples. A class of text processing programs called gap programs is defined and the problems associated with synthesizing them from examples are examined, leading to an efficient heuristic that provably synthesizes a gap program from examples of its input/output behavior. The editing by example system derived from this analysis has been embedded in a production text editor. By developing an editing by example system that solves a useful class of text processing problems, this work demonstrates that program synthesis is feasible in the domain of text editing.

References

[1]
AHO, A. V., KERNIGHAN, B. W., AND WEINBERGER, P.J. AWK--A pattern matching and scanning language. Softw. Pract. Exper. 9, 4 (April 1979), 267-280.
[2]
ANGLUIN, D. Finding patterns common to a set of strings. J. Comput. Syst. Sci. 21 (1980), 46-62.
[3]
ANGLUIN, D., AND SMITH, C. A survey of inductive inference: theory and methods. Res. Rep. 250, Dep. Computer Science, Yale University, Oct. 1982.
[4]
BIERMANN, A. W., AND FELDMAN, J. A. A survey of results in grammatical inference. In Frontiers of Pattern Recognition, Academic Press, New York, 1972.
[5]
CURRY, G. Programming by abstract demonstration. Ph.D. dissertation, University of Washington, 1977; also appeared as Computer Science Department Tech. Rep. 77-08-02.
[6]
ELLIS, J. R., MISHKIN, N. W., NIX, R. P., AND WOOD, S.R. A BLISS programming environment. Res. Rep. 231, Dep. Computer Science, Yale University, June 1982.
[7]
ELLIS, J. R., MISHKIN, N. W., VAN LEUNEN, M.-C., AND WOOD, S.R. Tools: An environment for timeshared computing and programming. Softw. Pract. Exper. (Oct. 1983).
[8]
Fu, K. S., AND BOOTH, T.L. Grammatical inference: Introduction and survey, parts I and 2. IEEE Trans. Syst. Man, Cybern. SMC-5 (1975), 95-111 and 409-423.
[9]
GOLD, E.M. Language identification in the limit. Inf. Control 10 (1967), 447-474.
[10]
HALBERT, D.C. An example of programming by example. M.S. thesis, Dep. Electrical Engi-} neering and Computer Sciences, University of California at Berkeley, 1981; also an internal report of Xerox Office Products Division, Palo Alto, Calif., 1981.
[11]
HIRSCHBERG, D. A linear space algorithm for computing maximal common subsequences. Commun. ACM 18, 6 (June 1975), 341-343.
[12]
HOPCROFT, J. E., AND ULLMAN, J. D. Introduction to Automata Theory, Languages, and Computation. Addison-Wesley, Reading, Mass., 1979.
[13]
HU~T, J. W., AND SZYMANSKI, T.G. A fast algorithm for computing longest common subsequences. Commun. ACM 20, 5 (May 1977), 350-353.
[14]
IRONS, E. T., AND DJORUP, F.M. A CRT editing system. Commun. ACM 15, 1 (Jan. 1972), 16-20.
[15]
KNUTH, D.E. The Texbook. Addison-Wesley, Reading, Mass., 1984.
[16]
LIEBERMAN, H., AND HEWITT, C. A session with Tinker: Interleaving program testing with program design. In Conf. Rec. 1980 LISP Conf. (Stanford University, 1980), 90-99.
[17]
MAIER, D. The complexity of some problems on subsequences and supersequences. J. ACM 25 (1978), 322-336.
[18]
MEYROWlTZ, N., AND VAN DAM, A. Interactive editing systems: Part II. ACM Comput. Surv. 14, 3 (1982), 353-415.
[19]
MORRIS, J. H., SCHMIDT, E., AND WALDER, P. Experience with an applicative string processing language. In Proc. 7th ACM Conf. Principles of Programming Languages (Jan. 1980), 32-46.
[20]
NIx, R.P. Editing by example. Ph.D. dissertation, Dep. Computer Science, Yale University, 1983; also appeared as Yale University Dep. Computer Science Res. Rep. 280.
[21]
NIX, R.P. Editing by example. In Proc. 11thACMSymp. Principles of Programming Languages (Salt Lake City, Jan. 1984), 186-195.
[22]
NIX, R. P., AND MISHKIN, N.W. U Editor user's and programmer's manual. Internal memo., Dep. Computer Science, Yale University, 1983.
[23]
REES, J. A., AND ADAMS, N.I. T: A dialect of Lisp or, lambda: the ultimate software tool. In Proc. 1982 ACM Symp. Lisp and Functional Programming (Aug. 1982).
[24]
REES, J. A., AND ADAMS, N.I. T user's manual. Internal memo., Dep. Computer Science, Yale University, 1982.
[25]
REID, B. K. A high-level approach to computer document formatting. In 7th ACM Syrup. Principles of Programming Languages (Jan. 1980), 24-31.
[26]
SHINOHARA, T. Polynomial time inference of extended regular pattern languages. In Proc. Software Science and Engineering of Computer Science (Kyoto, Japan, 1982).
[27]
SHINOHARA, T. Polynomial time inference of pattern languages and its application. In Proc. 7th IBM Syrup. Mathematical Foundations of Computer Science, 1982.
[28]
SMITH, D.C. Pygmalion: A computer program to model and stimulate creative thought. Ph.D. dissertation, Computer Science Dep., Stanford University, 1975; also appeared as AIM-260, June 1975, and as a book from Birkbauser Verlag, 1977.
[29]
STALLMAN, R. M. EMACS, the extensible, customizable, self-documenting display editor. In Proc. ACM SIGPLAN/SIGOA Symp. Text Manipulation (Portland, Ore., June 1981), 147-160. The conference proceedings appeared as SIGPLAN Notices, vol. 16, no. 6, June 1981.
[30]
WAGNER, R. A., AND FISCHER, M.J. The string-to-string correction problem. J. ACM21 (1974), 168-173.
[31]
WOOD, S. R. Z: The 95% program editor. In Proc. ACM SIGPLAN/SIGOA Syrup. Text Manipulation (Portland, Ore., June 1981), 1-7. The conference proceedings appeared as SIGPLAN Notices, vol. 16, no. 6, June 1981.

Cited By

View all
  • (2024)Positive Characteristic Sets for Relational Pattern LanguagesSOFSEM 2024: Theory and Practice of Computer Science10.1007/978-3-031-52113-3_28(398-412)Online publication date: 19-Feb-2024
  • (2023)Interactive Collaborative Learning with Explainable Artificial IntelligenceLearning in the Age of Digital and Green Transition10.1007/978-3-031-26876-2_2(13-24)Online publication date: 22-Mar-2023
  • (2021)reCode : A Lightweight Find-and-Replace Interaction in the IDE for Transforming Code by ExampleThe 34th Annual ACM Symposium on User Interface Software and Technology10.1145/3472749.3474748(258-269)Online publication date: 10-Oct-2021
  • Show More Cited By

Recommendations

Reviews

Hans J. Schneider

An editing by example system is an automatic program synthesis facility, embedded in a text editor, that can be used to solve repetitive text editing problems. The system analyzes a few examples the user provides it with and generalizes them into a program transforming the rest of the text. In order to get a running system, the author focused his attention on gap pattern replacement. A gap pattern is a sequence of strings separated by gaps, i.e., formal parameters. This approach has the advantage that a program can be synthesized after the user has provided two or three examples. After presenting some typical text transformations, the author outlines the theoretical background of his algorithm without proofs and discusses its performance. Finally, he mentions some heuristics used to improve the realized system. A weakness of the gap pattern approach is that many text processing problems can't be expressed in this way and decision problems are NP-hard. This is a well-written paper. Its primary contribution is in demonstrating the feasibility of program synthesis in text processing without hiding the limits of the approach. The paper is worth reading by anyone interested in augmenting editor facilities.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.

Comments

Information & Contributors

Information

Published In

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 01 October 1985
Published in TOPLAS Volume 7, Issue 4

Permissions

Request permissions for this article.

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)118
  • Downloads (Last 6 weeks)37
Reflects downloads up to 15 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Positive Characteristic Sets for Relational Pattern LanguagesSOFSEM 2024: Theory and Practice of Computer Science10.1007/978-3-031-52113-3_28(398-412)Online publication date: 19-Feb-2024
  • (2023)Interactive Collaborative Learning with Explainable Artificial IntelligenceLearning in the Age of Digital and Green Transition10.1007/978-3-031-26876-2_2(13-24)Online publication date: 22-Mar-2023
  • (2021)reCode : A Lightweight Find-and-Replace Interaction in the IDE for Transforming Code by ExampleThe 34th Annual ACM Symposium on User Interface Software and Technology10.1145/3472749.3474748(258-269)Online publication date: 10-Oct-2021
  • (2020)Trace2TAPProceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies10.1145/34118384:3(1-26)Online publication date: 4-Sep-2020
  • (2017)Distinguishing pattern languages with membership examplesInformation and Computation10.1016/j.ic.2017.08.003256(348-371)Online publication date: Oct-2017
  • (2016)Transforming spreadsheet data types using examplesACM SIGPLAN Notices10.1145/2914770.283766851:1(343-356)Online publication date: 11-Jan-2016
  • (2016)Transforming spreadsheet data types using examplesProceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages10.1145/2837614.2837668(343-356)Online publication date: 11-Jan-2016
  • (2016)Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesundefinedOnline publication date: 11-Jan-2016
  • (2014)Distinguishing Pattern Languages with Membership ExamplesProceedings of the 8th International Conference on Language and Automata Theory and Applications - Volume 837010.1007/978-3-319-04921-2_43(528-540)Online publication date: 10-Mar-2014
  • (2013)A colorful approach to text processing by exampleProceedings of the 26th annual ACM symposium on User interface software and technology10.1145/2501988.2502040(495-504)Online publication date: 8-Oct-2013
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media