Ket (software)

Last updated
Ket
Stable release
0.5.05 / March 22, 2015 (2015-03-22)
Written in Java
Operating system Cross-platform (multi-platform)
Type Computer algebra system
License GPL v2
Website sourceforge.net/projects/ket

Ket is an open source algebra editor. It is distinct from other editors which focus on automated computation such as integration or equation solving (Mathematica, Maple etc.) or on the presentation quality of the resulting document (e.g. LaTeX). The focus of Ket is to enable the user to perform algebra quickly and efficiently. It is therefore closer to a text editor, whiteboard or to the back of an envelope. However, it does provide a range of tools to automate the individual steps of algebra.

Contents

Overview


Ket breaks equation editing into a series of small edits performed by keyboard or mouse gestures. This is because equations contain a wide assortment of symbols and notations, but also contain a great deal of repetition. As a result, it is faster to reuse existing expressions than it is to re-write them. This becomes even more pronounced when performing algebra which consists of modifying and combining existing expressions adding further repetition.

Commands are built around abstract transformations of the structure of the equation. Some commands delete, reorganize and combine existing expressions and some add new content. Commands are all responsive enough to provide instantaneous updates. The user can therefore view an equation in conventional mathematical notation while interacting with a series of small fragments.

Representations


A representation of an equation as a tree data structure. This is the internal representation used both by Ket and by the various direction commands. A representation of an equation as a tree data structure.png
A representation of an equation as a tree data structure. This is the internal representation used both by Ket and by the various direction commands.

Ket maintains three distinct representations of an equation. Equations are displayed to the user and may be exported in images in conventional mathematical notation. Internally it is most efficient to represent the equation as a Tree structure which standardizes direction commands. But when writing equation fragments or saving them to file, a custom markdown language is used which merges markdown, LaTeX and plain text mathematical notations as applicable.

Conventional mathematical notation is represented by a series of boxes within boxes each containing letters and lines to denote what function, operation, variable or value they represent. After each edit, equations are converted to this form and rendered.

However, edit commands represent the equation differently and keyboard direction commands reflect this. Analogous to a filesystem hierarchy of files and folders within folders, each equation is represented as a Tree structure. Each equation in Ket is a tree of operations and functions (tree branches) and variables and values (tree leaves).

The file format consists of its own, non-standard markdown language. Also, when editing, any equation fragments are typed in plain text and converted to the tree. The equation is represented in memory and converted to a tree map in order to display it to the user. The file format is plain text which is converted to and from a tree when files are loaded and saved.

Interaction


Click-and-drag algebra via mouse gestures. KetMouseDemo.gif
Click-and-drag algebra via mouse gestures.

Various forms of interaction are possible. These include reorganizing the tree structure and performing simple algebraic operations. Mouse drags allow the user to change the order of arguments to a function. They can also add and remove fragments of an expression into another equation including substituting for a variable. While a plain text representation of pages of equations can quickly become unwieldy, working with small fragments of plain text are a quick way to replace, identify or update an existing selection. If good writing is rewriting then good algebra is reorganizing existing expressions.

Editing


The quickest form of editing is by mouse gestures to substitute one equation into another. Additionally, either through the right click menu or right-dragging in the menu items direction, arguments may be deleted, copied or added.

Ket is a modal editor which means that it changes how it displays information and how the user interacts with it depending on the mode it's in. By default, keyboard commands perform specific selection or transformation commands such as to delete the current selection, 'x'. Some commands must be followed with a direction, for example paste, 'p'. Other commands require a block of text such as to replace the selection with an equation fragment, 'r'. Editing lines of text The editor displays a list of lines of either text, equations, images or plots. In order to edit text, <Ctrl-r> starts editing text while <Esc> or <Ctrl-c> stops. Here <Enter> takes a new line and continues editing text.

All editing takes place relative to the current selection so a variety of commands to change the selection are provided. In order to move around, it is possible to use arrow keys, however it is quicker to keep your hands in the touch typing position so various keys signify directions. In addition to moving up, 'k', and down, 'j', between equations, it is possible to move in and out of each equation. That is, to select different parts of the tree. 'h' and 'l' select the previous and next expression while 'i' and 'o' select the left and right arguments of the tree. Lastly, <Space> moves back out.

After pressing a command that requires an equation fragment, the program changes mode. Here a plain text representation of an equation fragment may be typed. This mode also allows Readline commands familiar to Bash and Emacs users.

This is then converted to an equation fragment by pressing <Enter> (or cancelled with <Escape>). Transformation commands Editing can take place at different levels of meaning. Editing need not preserve the original meaning of an expression. So for example, a polynomial pattern could be reused by copying it and replacing all of the variables with new ones. Various syntactic and semantic transformations are also possible. Some are trivial such as replacing the current selection, 'r', with a new fragment. Others may be cycled through such as the Distributive property

using <Ctrl-n> and <Ctrl-p>.

Commands such as replace require fragments of an equation to be represented in plain text.

Often a text fragment has already been typed and may be referred to. If the fragment exists in the current equation then use "\address" (a backslash followed by an address without quotes). Here successive digits of an address refer to the nth argument.

Similarly, existing equations may be referred to as "#1" for equation 1 etc. And an address within another equation referred to as "1#234" for the 2nd argument's 3rd argument's 4th argument within equation 1.

Related Research Articles

Pico is a text editor for Unix and Unix-like computer systems. It is integrated with the Pine and Alpine email clients, which were initially designed by the Office of Computing and Communications at the University of Washington.

sed Standard UNIX utility for editing streams of data

sed is a Unix utility that parses and transforms text, using a simple, compact programming language. It was developed from 1973 to 1974 by Lee E. McMahon of Bell Labs, and is available today for most operating systems. sed was based on the scripting features of the interactive editor ed and the earlier qed. It was one of the earliest tools to support regular expressions, and remains in use for text processing, most notably with the substitution command. Popular alternative tools for plaintext string manipulation and "stream editing" include AWK and Perl.

<span class="mw-page-title-main">Text editor</span> Computer software used to edit plain text documents

A text editor is a type of computer program that edits plain text. Such programs are sometimes known as "notepad" software. Text editors are provided with operating systems and software development packages, and can be used to change files such as configuration files, documentation files and programming language source code.

In human–computer interaction and user interface design, cut, copy, and paste are related commands that offer an interprocess communication technique for transferring data through a computer's user interface. The cut command removes the selected data from its original position, while the copy command creates a duplicate; in both cases the selected data is kept in temporary storage. The data from the clipboard is later inserted wherever a paste command is issued. The data remains available to any application supporting the feature, thus allowing easy data transfer between applications.

<span class="mw-page-title-main">GNU TeXmacs</span> Open-source word processor

GNU TeXmacs is a scientific word processor and typesetting component of the GNU Project. It originated as a variant of GNU Emacs with TeX functionalities, though it shares no code with those programs, while using TeX fonts. It is written and maintained by Joris van der Hoeven and a group of developers. The program produces structured documents with a WYSIWYG user interface. New document styles can be created by the user. The editor provides high-quality typesetting algorithms and TeX and other fonts for publishing professional looking documents.

The plus–minus sign, ±, is a mathematical symbol with multiple meanings:

The backtick` is a typographical mark used mainly in computing. It is also known as backquote, grave, or grave accent.

TI-BASIC is the official name of a BASIC-like language built into Texas Instruments (TI)'s graphing calculators. TI-BASIC is a language family of three different and incompatible versions, released on different products:

In Unix-like and some other operating systems, find is a command-line utility that locates files based on some user-specified criteria and either prints the pathname of each matched object or, if another action is requested, performs that action on each matched object.

This article provides basic comparisons for notable text editors. More feature details for text editors are available from the Category of text editor features and from the individual products' articles. This article may not be up-to-date or necessarily all-inclusive.

GNU Readline is a software library that provides in-line editing and history capabilities for interactive programs with a command-line interface, such as Bash. It is currently maintained by Chet Ramey as part of the GNU Project.

<span class="mw-page-title-main">Markdown</span> Plain text markup language

Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber and Aaron Swartz created Markdown in 2004 as a markup language that is appealing to human readers in its source code form. Markdown is widely used in blogging, instant messaging, online forums, collaborative software, documentation pages, and readme files.

<span class="mw-page-title-main">Mathomatic</span> Computer algebra system

Mathomatic is a free, portable, general-purpose computer algebra system (CAS) that can symbolically solve, simplify, combine, and compare algebraic equations, and can perform complex number, modular, and polynomial arithmetic, along with standard arithmetic. It does some symbolic calculus (derivative, extrema, Taylor series, and polynomial integration and Laplace transforms), numerical integration, and handles all elementary algebra except logarithms. Trigonometric functions can be entered and manipulated using complex exponentials, with the GNU m4 preprocessor. Not currently implemented are general functions like f(x), arbitrary-precision and interval arithmetic, and matrices.

In mathematics, a basic algebraic operation is any one of the common operations of arithmetic, which include addition, subtraction, multiplication, division, raising to a whole number power, and taking roots. These operations may be performed on numbers, in which case they are often called arithmetic operations. They may also be performed, in a similar way, on variables, algebraic expressions, and more generally, on elements of algebraic structures, such as groups and fields. An algebraic operation may also be defined simply as a function from a Cartesian power of a set to the same set.

<span class="mw-page-title-main">Snippet (programming)</span> Small region of re-usable source code, machine code, or text

Snippet is a programming term for a small region of re-usable source code, machine code, or text. Ordinarily, these are formally defined operative units to incorporate into larger programming modules. Snippet management is a feature of some text editors, program source code editors, IDEs, and related software. It allows the user to avoid repetitive typing in the course of routine edit operations.

A mathematical markup language is a computer notation for representing mathematical formulae, based on mathematical notation. Specialized markup languages are necessary because computers normally deal with linear text and more limited character sets. A formally standardized syntax also allows a computer to interpret otherwise ambiguous content, for rendering or even evaluating. For computer-interpretable syntaxes, the most popular are TeX/LaTeX and MathML.

In mathematics, brackets of various typographical forms, such as parentheses ( ), square brackets [ ], braces { } and angle brackets ⟨ ⟩, are frequently used in mathematical notation. Generally, such bracketing denotes some form of grouping: in evaluating an expression containing a bracketed sub-expression, the operators in the sub-expression take precedence over those surrounding it. Sometimes, for the clarity of reading, different kinds of brackets are used to express the same meaning of precedence in a single expression with deep nesting of sub-expressions.

<span class="mw-page-title-main">HP 35s</span> Programmable scientific calculator produced by Hewlett-Packard

The HP 35s (F2215A) is a Hewlett-Packard non-graphing programmable scientific calculator. Although it is a successor to the HP 33s, it was introduced to commemorate the 35th anniversary of the HP-35, Hewlett-Packard's first pocket calculator. HP also released a limited production anniversary edition with shiny black overlay and engraving "Celebrating 35 years".

<span class="mw-page-title-main">Emacs</span> Family of text editors

Emacs, originally named EMACS, is a family of text editors that are characterized by their extensibility. The manual for the most widely used variant, GNU Emacs, describes it as "the extensible, customizable, self-documenting, real-time display editor". Development of the first Emacs began in the mid-1970s, and work on its direct descendant, GNU Emacs, continues actively; the latest version is 28.2, released in September 2022.

EDT is a character-based text editor from Digital Equipment Corporation (DEC) running on PDP-11, and later for its OpenVMS operating system. It can respond to single keystrokes, and uses function keys to implement commands to the editor. EDT was introduced originally as a line-mode editor. The screen mode was developed first as the Keyboard Editor (KED) on RT-11 as part of the FMS-11 project by Darrell Duffy; EDT on the other operating systems was then enhanced to be compatible with KED.