Category:Bracmat
This programming language may be used to instruct a computer to perform a task.
Execution method: | Interpreted |
---|---|
Garbage collected: | Yes |
Parameter passing methods: | By value |
Type strength: | Untyped |
Type compatibility: | Duck |
Type expression: | Implicit |
Type checking: | Dynamic |
Lang tag(s): | bracmat |
See Also: |
|
Bracmat is an interpreted programming language for symbolic computation. Originally (in the eighties) it was designed as a Computer Algebra system, but it has shown its merits in natural language processing as well. Bracmat has been used in the field of General Relativity for the algebraic computation of Ricci tensors from given space-time metrics, for the implementation of a dialogue-manager in virtual world project that allowed a user to communicate with software agents in plain English and with gestures, for the analysis of texts in a "Controlled Language"-project and for automatic error correction of hundreds of HTML pages. Bracmat has also shown its utility in some real-world applications: for example to identify persons, companies etc. in pre-tagged texts that must be anonymised. The to date most advanced application of Bracmat is as workflow planner and executor. Instead of letting the user choose between software tools, which the user may not know very well, the planner asks the user to specify what kind of output she wants. With this information the planner computes all combinations of tools and their parameter settings that combine into workflows that produce the specified output from the given input.
Bracmat is inspired by SNOBOL4 (pattern matching, success/failure), by Lisp (lists and atoms), by Prolog (declarative programming, especially backtracking) and a little bit by object-oriented languages.
Both Bracmat and Lisp have expressions consisting of atoms and binary nodes.
Whereas a Lisp's binary nodes are all of the same type, Bracmat has about 15 different binary nodes, each with a different behaviour, such as addition, multiplication, symbolic differentiation, branching, pattern matching, assignment, function evaluation, and more.
Bracmat has a very powerful language construct for pattern matching, combining
- pattern matching in strings and in tree structures, using the same pattern syntax,
- associative pattern matching, and
- expression evaluation during a match operation.
The only other programming language supporting this combination of pattern matching features is Egison, as far as I currently know (2021).
The pattern matching language construct can be used where you otherwise would use SQL, regexp, XSLT, LINQ, and the much less powerful pattern matching seen in functional languages. Bracmat has been used to validate or transform gigabytes of XML and HTML data.
Bracmat is a homoiconic language: program code is data and data is program code. It is also reflective, which means that a Bracmat program can change its own behaviour, for example by evolving a match pattern based on observations of actual data.
The first implementation of Bracmat was for an ARM based computer. The ARM processor's 4-bit condition code selector on every instruction were the inspiration for Bracmat's flags ~ [ ! !! ` @ % > < # / ? that can be set on any node in an expression. For example, the ! and ? flags turn a symbol into a variable. When flags are combined, care has been taken that the semantics of a combination of flags is close to a combination of the semantics of each flag.
The Bracmat-interpreter is written in Standard C and can be compiled for many platforms, such as Epoc, Windows, Mac OS (including OS X), Linux and Unix. The compiled code measures about 130 KB (statically linked), depending on the platform. The runtime is not very memory hungry, as compared to e.g. Java. Bracmat can be compiled for 32 and 64 bit systems.
Subcategories
This category has the following 3 subcategories, out of 3 total.
@
- Bracmat examples needing attention (empty)
- Bracmat Implementations (empty)
- Bracmat User (3 P)
Pages in category "Bracmat"
The following 200 pages are in this category, out of 305 total.
(previous page) (next page)2
A
- A+B
- ABC problem
- Abundant, deficient and perfect number classifications
- Accumulator factory
- Ackermann function
- Add a variable to a class instance at runtime
- AKS test for primes
- Algebraic data types
- Amb
- Anagrams
- Anagrams/Deranged anagrams
- Anonymous recursion
- Apply a callback to an array
- Arbitrary-precision integers (included)
- Arithmetic/Complex
- Arithmetic/Integer
- Array concatenation
- Arrays
- Associative array/Creation
- Associative array/Iteration
- Averages/Arithmetic mean
- Averages/Median
- Averages/Simple moving average
C
- Calkin-Wilf sequence
- Call a function
- Call an object method
- Cartesian product of two or more lists
- Case-sensitivity of identifiers
- Catalan numbers
- Catamorphism
- Character codes
- Chinese remainder theorem
- Classes
- Closures/Value capture
- Combinations
- Combinations and permutations
- Combinations with repetitions
- Comma quibbling
- Command-line arguments
- Comments
- Compare a list of strings
- Compound data type
- Conditional structures
- Convert decimal number to rational
- Copy a string
- Count in octal
- Count occurrences of a substring
- Create a file
- Create an HTML table
- CSV to HTML translation
- Cuban primes
- Currency
D
E
F
- Factorial
- Factors of a Mersenne number
- Fibonacci n-step number sequences
- Fibonacci sequence
- File input/output
- File size
- Filter
- Find limit of recursion
- First class environments
- First-class functions
- FizzBuzz
- Flatten a list
- Flow-control structures
- Floyd's triangle
- Fractran
- Function composition
- Function definition
G
H
I
K
L
- Largest int from concatenated ints
- Last letter-first letter
- Leap year
- Least common multiple
- Left factorials
- Letter frequency
- Levenshtein distance
- Linear congruential generator
- List comprehensions
- Literals/Integer
- Literals/String
- Logical operations
- Longest common subsequence
- Longest common substring
- Look-and-say sequence
- Loops/Continue
- Loops/Downward for
- Loops/For
- Loops/Foreach
- Loops/Infinite
- Loops/N plus one half
- Loops/While
- Lucas-Lehmer test
- Luhn test of credit card numbers