Context Free Art – Tutorial 1 » Magic & Love Interactive After we can create different primitive shapes, we start to combine them together. We cannot simply put all the primitive shapes within one single shape rule, like: startshape MyShape rule MyShape { CIRCLE {} TRIANGLE {} SQUARE {} } Multiple shapes Every shape command comes with parameters. startshape MyShape rule MyShape { CIRCLE {x -2} TRIANGLE {} SQUARE {x 2} } startshape MyShape rule MyShape { CIRCLE {y 2} TRIANGLE {} SQUARE {y -2} } startshape MyShape rule MyShape { CIRCLE {x 2 y 2 size 0.8} TRIANGLE {size 2} SQUARE {x -2 y -2 size 0.5} } Size variation Backus–Naur Form In computer science, BNF (Backus Normal Form or Backus–Naur Form) is one of the two[1] main notation techniques for context-free grammars, often used to describe the syntax of languages used in computing, such as computer programming languages, document formats, instruction sets and communication protocols; the other main technique for writing context-free grammars is the van Wijngaarden form. They are applied wherever exact descriptions of languages are needed: for instance, in official language specifications, in manuals, and in textbooks on programming language theory. Many extensions and variants of the original Backus–Naur notation are used; some are exactly defined, including Extended Backus–Naur Form (EBNF) and Augmented Backus–Naur Form (ABNF). History[edit] The idea of describing the structure of language with rewriting rules can be traced back to at least the work of Pāṇini (about the 4th century BC), who used it in his description of Sanskrit word structure. Introduction[edit]
Mathematische Bilder erstellen mit Context Free | vismath In der Blogreihe „Wie erstellt man mathematische Bilder?“ stellen wir Werkzeuge vor, mit denen man einfach hochwertige mathematische Bilder erstellen kann. Dieser Artikel befasst sich mit dem Programm Context Free und zeigt, wie man damit Objekte visualisieren kann, die über gewisse Ersetzungsregeln definiert sind. Kontextfreie Grammatiken und Fraktale Context Free ist ein Programm, mit dem man Objekte zeichnen kann, die sich über gewisse Regelersetzungen beschreiben lassen. Ein Beispiel für ein mathematisches Objekt, das in ganz natürlicher Weise über solche Ersetzungsregeln erzeugt werden kann, ist das Sierpinski-Dreieck. Dann wendet man Rekursion an, also wiederholt die Regel für jedes der kleinen Dreiecke. Context Free Art Kennt man ein Objekt, das durch solche Ersetzungsregeln definiert ist, und möchte davon eine grafische Darstellung erzeugen, kann man nun das Programm Context Free nutzen.
Formal grammar A formal grammar is a set of rules for rewriting strings, along with a "start symbol" from which rewriting starts. Therefore, a grammar is usually thought of as a language generator. However, it can also sometimes be used as the basis for a "recognizer"—a function in computing that determines whether a given string belongs to the language or is grammatically incorrect. To describe such recognizers, formal language theory uses separate formalisms, known as automata theory. One of the interesting results of automata theory is that it is not possible to design a recognizer for certain formal languages. Parsing is the process of recognizing an utterance (a string in natural languages) by breaking it down to a set of symbols and analyzing each one against the grammar of the language. Introductory example[edit] For example, assume the alphabet consists of a and b, the start symbol is S, and we have the following production rules: then we start with S, and can choose a rule to apply to it. . is
Context Free Art Context Free Art Context Free is a program that generates images from written instructions called a grammar. This HSV color picker may be useful for color settings. Directives startshape shape A script must start with this directive . Indicates which rule or path is used as the starting point for the generated image. Primitive shapes Context Free knows how to draw squares, circles and triangles. Geometric adjustments A shape passes on its geometry to the shapes that replace it when a rule for the shape is executed. Color adjustments Color adjustments, based on the HSV color model , may also be applied to replacement shapes. Path operations
Formal language theory Structure of a syntactically well-formed, although nonsensical English sentence (historical example from Chomsky 1957). History[edit] The first formal language is thought be the one used by Gottlob Frege in his Begriffsschrift (1879), literally meaning "concept writing", and which Frege described as a "formal language of pure thought. Axel Thue's early Semi-Thue system which can be used for rewriting strings was influential on formal grammars. Words over an alphabet[edit] In some applications, especially in logic, the alphabet is also known as the vocabulary and words are known as formulas or sentences; this breaks the letter/word metaphor and replaces it by a word/sentence metaphor. Definition[edit] A formal language L over an alphabet Σ is a subset of Σ*, that is, a set of words over that alphabet. In computer science and mathematics, which do not usually deal with natural languages, the adjective "formal" is often omitted as redundant. Examples[edit] Constructions[edit] Applications[edit] and
CFDG HOWTO - Context Free Art Eine CFDG-Datei besteht im Wesentlichen aus Regeln für das Zeichnen von Figuren, die wiederum aus anderen Figuren bestehen. Dazu kommen einige optionale und eine obligatorische Komponente: Eine obligatorische startshape-Anweisung, die Context Free/CFDG mitteilt, mit welcher Form gestartet werden soll. Beispiel: /* Beispielhafte CFDG Datei Dies ist ein Block-Kommentar */ // Dies ist die eine Moeglichkeit eines Zeilenkommentars # Dies ist die Andere startshape Foo /* Es muss eine startshape-Anweisung geben. */ include kram.cfdg /* Bindet Regeln und path-Anweisungen von kram.cfdg ein. */ background { b -1 } /* Aendert den Hintergrund in Schwarz. */ tile { s 3 4 } /* kachelt das Design in ein Gitter.
Formal system Formal systems in mathematics consist of the following elements: A formal system is said to be recursive (i.e. effective) if the set of axioms and the set of inference rules are decidable sets or semidecidable sets, according to context. Some theorists use the term formalism as a rough synonym for formal system, but the term is also used to refer to a particular style of notation, for example, Paul Dirac's bra–ket notation. Related subjects[edit] Logical system[edit] Deductive system[edit] A deductive system (also called a deductive apparatus of a formal system) consists of the axioms (or axiom schemata) and rules of inference that can be used to derive the theorems of the system.[2] Formal proofs[edit] Main article: Formal proof Formal proofs are sequences of well-formed formulas. The point of view that generating formal proofs is all there is to mathematics is often called formalism. Formal language[edit] Formal grammar[edit] Main article: Formal grammar See also[edit] References[edit] Raymond M.
Automata theory An example of an automaton. The study of the mathematical properties of such automata is automata theory. Automata theory is the study of abstract machines and automata, as well as the computational problems that can be solved using them. Automata theory is also closely related to formal language theory. Automata play a major role in theory of computation, compiler design, artificial intelligence, parsing and formal verification. Automata[edit] Following is an introductory definition of one type of automaton, which attempts to help one grasp the essential concepts involved in automata theory(s). Informal description[edit] In short, an automaton is a mathematical object that takes a word as input and decides either to accept it or reject it. Formal definition[edit] Automaton Input word Run A sequence of states q0,q1,q2,...., qn, where qi ∈ Q such that q0 is the start state and qi = δ(qi-1,ai) for 0 < i ≤ n, is a run of the automaton on an input word w = a1,a2,...., an ∈ Σ*. Accepting word Input .