翻訳と辞書
Words near each other
・ Fractional-order system
・ Fractional-reserve banking
・ Fractionalism
・ Fractionalization
・ Fractionated spacecraft
・ Fractionating column
・ Fractionation
・ Fractionation Research Inc.
・ Fractionism
・ FractMus
・ Fractofusus misrai
・ Fractography
・ Fractolatirus
・ Fractolatirus normalis
・ Fracton
FRACTRAN
・ Fracture
・ Fracture (2004 film)
・ Fracture (2007 film)
・ Fracture (album)
・ Fracture (disambiguation)
・ Fracture (Fringe)
・ Fracture (geology)
・ Fracture (mineralogy)
・ Fracture (video game)
・ Fracture blister
・ Fracture in polymers
・ Fracture mechanics
・ Fracture sonography
・ Fracture toughness


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

FRACTRAN : ウィキペディア英語版
FRACTRAN
FRACTRAN is a Turing-complete esoteric programming language invented by the mathematician John Conway. A FRACTRAN program is an ordered list of positive fractions together with an initial positive integer input ''n''. The program is run by updating the integer ''n'' as follows:
#for the first fraction ''f'' in the list for which ''nf'' is an integer, replace ''n'' by ''nf''
#repeat this rule until no fraction in the list produces an integer when multiplied by ''n'', then halt.
In ''The Book of Numbers'', John Conway and Richard Guy gave a formula for primes in FRACTRAN:〔A slightly different but equivalent sequence from Conway (1987) is:
\left( \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac \right)

: \left( \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac, \frac \right)
Starting with ''n''=2, this FRACTRAN program generates the following sequence of integers:
:2, 15, 825, 725, 1925, 2275, 425, 390, 330, 290, 770, ...
After 2, this sequence contains the following powers of 2:
:2^2=4,\, 2^3=8,\, 2^5=32,\, 2^7=128,\, 2^=2048,\, 2^=8192,\, 2^=131072,\, 2^=524288,\, \dots
which are the prime powers of 2.
== Understanding a FRACTRAN program ==
A FRACTRAN program can be seen as a type of register machine where the registers are stored in prime exponents in the argument ''n''.
Using Gödel numbering, a positive integer ''n'' can encode an arbitrary number of arbitrarily large positive integer variables.〔Gödel numbering cannot be directly used for negative integers, floating point numbers or text strings, although conventions could be adopted to represent these data types indirectly. Proposed extensions to FRACTRAN include (FRACTRAN++ ) and (Bag ).〕 The value of each variable is encoded as the exponent of a prime number in the prime factorization of the integer. For example, the integer
:60 = 2^2 \times 3^1 \times 5^1
represents a register state in which one variable (which we will call v2) holds the value 2 and two other variables (v3 and v5) hold the value 1. All other variables hold the value 0.
A FRACTRAN program is an ordered list of positive fractions. Each fraction represents an instruction that tests one or more variables, represented by the prime factors of its denominator. For example:
:f_1 = \frac = \frac
tests v2 and v5. If v_2 \ge 2 and v_5 \ge 1, then it subtracts 2 from v2 and 1 from v5 and adds 1 to v3 and 1 to v7. For example:
:60 \cdot f_1 = 2^2 \times 3^1 \times 5^1 \cdot \frac = 3^2 \times 7^1
Since the FRACTRAN program is just a list of fractions, these test-decrement-increment instructions are the only allowed instructions in the FRACTRAN language. In addition the following restrictions apply:
:
*Each time an instruction is executed, the variables that are tested are also decremented.
:
*The same variable cannot be both decremented and incremented in a single instruction (otherwise the fraction representing that instruction would not be in its lowest terms). Therefore each FRACTRAN instruction consumes variables as it tests them.
:
*It is not possible for a FRACTRAN instruction to directly test if a variable is 0 (However, an indirect test can be implemented by creating a default instruction that is placed after other instructions that test a particular variable.).

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「FRACTRAN」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.