word access 是什么中InStr=5是什么意思,为什么

access中InStr作为文本值查询条件时,是什么意思_百度知道
access中InStr作为文本值查询条件时,是什么意思
InStr([start, ]string1, string2[, compare])  返指定字符串另字符串先现位置字符串string1start始找string2省略startstring1第1字符始找找函数返值0找则返所位置
其他类似问题
instr的相关知识
其他1条回答
查询数据表字段文本串某具体位置字符
您可能关注的推广
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁access中使用文本值作为查询条件的InStr和IhStr是什么意思?_百度知道
access中使用文本值作为查询条件的InStr和IhStr是什么意思?
我有更好的答案
按默认排序
INSTR(char1,char2,start,times):在char1字符串中搜索char2字符串,start为执行搜索的起始位置,times为搜索次数。
后面那个ihstr没听过
其他类似问题
instr的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁From Wikipedia, the free encyclopedia
(Redirected from )
the random-access stored-program (RASP) machine model is an
used for the purposes of
development and .
The RASP is a
(RAM) model that, unlike the RAM, has its
in its "registers" together with its input. The registers are unbounded (infinite in capacity); whether the number of registers is finite is model-specific. Thus the RASP is to the RAM as the
is to the . The RASP is an example of the
whereas the RAM is an example of the .
The RASP is closest of all the abstract models to the common notion of . But unlike actual computers the RASP model usually has a very simple instruction set, greatly reduced from those of
processors to the simplest arithmetic, register-to-register "moves", and "test/jump" instructions. Some models have a few extra registers such as an .
Together with the , the RAM, and the
the RASP makes up the four common
models, called this to distinguish them from the "parallel" models (e.g. ) [cf. van Emde Boas (1990)].
Nutshell description of a RASP:
The RASP is a
(UTM) built on a
RAM chassis.
The reader will remember that the UTM is a
with a "universal" finite-state table of instructions that can interpret any well-formed "program" written on the tape as a string of Turing 5-tuples, hence its universality. While the classical UTM model expects to find Turing 5-tuples on its tape, any program-set imaginable can be put there given that the Turing machine expects to find them -- given that its finite-state table can interpret them and convert them to the desired action. Along with the program, printed on the tape will be the input data/parameters/numbers (usually to the program's right), and eventually the output data/numbers (usually to the right of both, or intermingled with the input, or replacing it). The "user" must position the Turing machine's head over the first instruction, and the input must be placed in a specified place and format appropriate to both the program-on-tape and the finite-state machine's instruction-table.
The RASP mimics this construction: it places the "program" and "data" in the holes (registers). But unlike the UTM the RASP proceeds to "fetch" its instructions in a sequential manner, unless the conditional test sends it elsewhere.
A point of confusion: two sets of instructions: Unlike the UTM, the RASP model has two sets of instructions – the state machine table of instructions (the "interpreter") and the "program" in the holes. The two sets do not have to be drawn from the same set.
The following example of a program will move the contents of register (hole) #18 to register (hole) #19, erasing contents of #18 in the process. The program-instructions will be a simple set to keep the example short:
Target RASP program-instructions:
{ INC DEC JZ h,xxx }
To ease the example we will equip the state machine of the RAM-as-RASP with the primitive instructions drawn from the same set, but augmented with two indirect copy instructions:
RAM state machine instructions:
{ INC DEC JZ h, CPY &&ha&&,&ha&; CPY &ha&,&&ha&& }
As the RASP machine's state machine interprets the program in the registers, what exactly will the state machine be doing? The column containing the exclamation mark ! will list in time sequence the state machine's actions as it "interprets" -- converts to action -- the program:
program, parameters →
encoded program →
state machine instructions ↓
Tradition divides the state-machine's actions into two major "phases" called Fetch and Execute. We will observe below that there are "sub-phases" within these two major phases. There is no agreed- every model will require its own precise description.
The state machine has access to all the registers, both directly and indirectly. So it adopts #1 as "the program counter" PC. The role of the program counter will be to "keep the place" in the program' the state machine has its own state register for its private use.
Upon start, the state machine expects to find a number in the PC -- the first "Program-Instruction" in the program (i.e. at #5).
(Without the use of the indirect COPYs, the task of getting the pointed-to program-instruction into #2 is a bit arduous. The state machine would indirectly decrement the pointed-to register while directly incrementing (empty) register #2. During the "parse" phase it will restore the sacrificed contents of #5 by sacrificing the count in #2.)
The point of the above detour is to show that life is much easier when the state machine has access to two kinds of indirect copy:
copy indirect from i and direct to j: CPY &&hi&&,&hj&
copy direct from i and indirect to j: CPY &hi&,&&hj&&
The following example shows what happens during the state-machine's "fetch" phase. The state-machine's operations are listed on the column labelled "State machine instruction ↓". Observe that at the end of the fetch, register #2 contains the numerical value 3 of the "operation code" ("opcode") of the first instruction JZ:
program, parameters →
encoded program →
state machine instructions ↓
fetch_instr:
CPY &&1&&,&2&
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
Parse phase: Now that the number of the program-instruction (e.g. 3 = "JZ") is in register #2 -- the "Program-Instruction Register" PIR -- the state machine proceeds to decrement the number until the IR is empty:
If the IR were empty before decrement then the program-instruction would be 0 = HALT, and the machine would jump to its "HALT" routine. After the first decrement, if the hole were empty the instruction would be INC, and the machine would jump to instruction "inc_routine". After the second decrement, the empty IR would represent DEC, and the machine would jump to the "dec_routine". After the third decrement, the IR is indeed empty, and this causes a jump to the "JZ_routine" routine. If an unexpected number were still in the IR, then the machine would have detected an error and could HALT (for example).
program, parameters →
encoded program →
state machine instructions ↓
fetch_instr:
CPY &&1&&,&2&
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
parse_instr:
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
JZ 2,dec_routine:
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
JZ 2,inc_routine
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
JZ 2, JZ_routine
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
inc_routine:
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
dec_routine:
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
JZ_routine:
<td style="color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="font-weight:color:#
<td style="color:#
<td style="color:#
<td style="color:#
Now the state machine knows what program-in indeed it has jumped to the "JZ_routine" sequence of instructions. The JZ instruction has 2 operands -- (i) the number of the register to test, and (ii) the address to go to if the test is successful (the hole is empty).
(i) Operand fetch -- which register to test for empty?: Analogous to the fetch phase, the finite state machine moves the contents of the register pointed to by the PC, i.e. hole #6, into the Program-Instruction Register PIR #2. It then uses the contents of register #2 to point to the register to be tested for zero, i.e. register #18. Hole #18 contains a number "n". To do the test, now the state machine uses the contents of the PIR to indirectly copy the contents of register #18 into a spare register, #3. So there are two eventualities (ia), register #18 is empty, (ib) register #18 is not empty.
(ia): If register #3 is empty then the state machine jumps to (ii) Second operand fetch -- fetch the jump-to address.
(ib): If register #3 is not empty then the state machine can skip (ii) Second operand fetch. It simply increments twice the PC and then unconditionally jumps back to the instruction-fetch phase, where it fetches program-instruction #8 (DEC).
(ii) Operand fetch -- jump-to address. If register #3 is empty, the state machine proceeds to use the PC to indirectly copy the contents of the register it points to (#8) into itself. Now the PC holds the jump-to address 15. Then the state machine unconditionally goes back to the instruction fetch phase, where it fetches program-instruction #15 (HALT).
program, parameters →
encoded program →
state machine instructions ↓
JZ_routine
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
CPY &&1&&,&2&
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
test hole:
CPY &&2&&,&3&
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
test hole:
JZ 3, jump
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
J fetch_instr
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
fetch_instr:
CPY &&1&&,&2&
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
CPY &&1&&,&1&
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
J fetch_instr
fetch_instr:
CPY &&1&&,&2&
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
The following completes the RAM's state-machine interpretation of program-instructions, INC h, DEC h and thus completes the demonstration of how a RAM can "impersonate" a RASP:
Target program instruction set: { INC DEC JZ h,xxx, HALT }
Without indirect state-machine instructions INCi and DECi, to execute the INC and DEC program-instructions the state machine must use indirect copy to get the contents of the pointed-to register into spare register #3, DEC or INC it, and then use indirect copy to send it back to the pointed-to register.
program, parameters →
encoded program →
state machine instructions ↓
J fetch_instr
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
fetch_instr:
CPY &&1&&,&2&
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
JZ 2, inc_routine:
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
JZ 2, dec_routine:
dec_routine:
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
CPY &&1&&,&2&
CPY &&2&&,&3&
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
CPY &3&,&&2&&
J fetch_instr
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
fetch_instr:
CPY &&1&&,&2&
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
JZ 2,inc_routine:
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
inc_routine:
CPY &&1&&,&2&
CPY &&2&&,&3&
CPY &3&,&&2&&
J fetch_instr
fetch_instr:
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
<td style="color:#
Alternate instructions: Although the demonstration resulted in a primitive RASP of only four instructions, the reader might imagine how an additional instruction such as "ADD &h&" or "MULT &ha&,&&hb&might be done.
When a RAM is acting as a RASP, something new has been gained: unlike the RAM, the RASP has the capacity for self-modification of its program-instructions (the state-machine instructions are frozen, unmodifiable by the machine). Cook-Reckhow (1971) (p. 75) comment on this in their description of their RASP model, as does Hartmanis (1971) (pp. 239ff)
An early description of this notion can be found in Goldstine-von Neumann (1946):
"We need an order [instruction] that can substitute a number into a given order... By means of such an order the results of a computation can be introduced into the instructions governing that or a different computation" (p. 93)
Such an ability makes the following possible:
-- the calling routine (or perhaps the subroutine) stores the
"return_address" in the subroutine's last command, i.e. "JMP return_address"
In an influential paper
and Robert A. Reckhow define their version of a RASP:
"The Random Access Stored-Program Machine (RASP) described here is similar to the RASP's described by Hartmanis [1971]" (p. 74).
Their purpose was to compare execution-times of the various models: RAM, RASP and multi-tape Turing machine for use in the theory of .
The salient feature of their RASP model is no provision for indirect program-instructions (cf their discussion p. 75). This they achieve by requiring the program to modify itself: if necessary an instruction can modify the "parameter" (their word, i.e. "operand") of a particular instruction. They have designed their model so each "instruction" uses two consecutive registers, one for the "operation code" (their word) and the parameter "either an address or an integer constant".
Their RASP's registers are unbounded in capacity and likewise their accumulator AC and instruction counter IC are unbounded. The instruction set is the following:
operation code
description
load constant
put constant k into accumulator
add contents of register j to accumulator
subtract contents of register j from accumulator
copy contents of accumulator into register j
branch on positive accumulator
IF contents of accumulator & 0 THEN jump to xxx ELSE next instruction
next input into register j
output contents of register j
any other - or + integer
Often both the RAM and RASP machines are presented together in the same article. These have be with a few exceptions, these references are the same as those at .
(2002), Computability and Logic: Fourth Edition, Cambridge University Press, Cambridge, England. The original Boolos-Jeffrey text has been extensively revised by Burgess: more advanced than an introductory textbook. "Abacus machine" model is extensively developed in Chapter 5 Abacus Computability; it is one of three models extensively treated and compared -- the Turing machine (still in Boolos' original 4-tuple form) and recursion the other two.
(1946), Preliminary discussion of the logical design of an electronic computing instrument, reprinted pp. 92ff in
(1971), Computer Structures: Readings and Examples, mcGraw-Hill Book Company, New York.
and Robert A. Reckhow (1972), Time-bounded random access machines, Journal of Computer Systems Science 7 (1973), 354-375.
(1958), Computability & Unsolvability, McGraw-Hill Book Company, Inc. New York.
(1964), Random-Access Stored-Program Machines, an Approach to Programming Languages, Journal of the Association for Computing Machinery, Vol. 11, No. 4 (October, 1964), pp. 365-399.
(1971), "Computational Complexity of Random Access Stored Program Machines," Mathematical Systems Theory 5, 3 (1971) pp. 232-245.
(1979). Introduction to Automata Theory, Languages and Computation, 1st ed., Reading Mass: Addison-Wesley. . A difficult book centered around the issues of machine-interpretation of "languages", NP-Completeness, etc.
(1952), Introduction to Metamathematics, North-Holland Publishing Company, Amsterdam, Netherlands. .
(1968), The Art of Computer Programming, Second Edition 1973, Addison-Wesley, Reading, Massachusetts. Cf pages 462-463 where he defines "a new kind of abstract machine or 'automaton' which deals with linked structures."
(1961, received 15 June 1961), How to Program an Infinite Abacus, Mathematical Bulletin, vol. 4, no. 3. September 1961 pages 295-302. In his Appendix II, Lambek proposes a "formal definition of 'program'. He references Melzak (1961) and Kleene (1952) Introduction to Metamathematics.
(1961, received 15 May 1961), An informal Arthmetical Approach to Computability and Computation, Canadian Mathematical Bulletin, vol. 4, no. 3. September 1961 pages 279-293. Melzak offers no references but acknowledges "the benefit of conversations with Drs. R. Hamming, D. McIlroy and V. Vyssots of the Bell telephone Laborators and with Dr. H. Wang of Oxford University."
(1961, received August 15, 1960). "Recursive Unsolvability of Post's Problem of 'Tag' and Other Topics in Theory of Turing Machines". Annals of Math (Annals of Mathematics) 74 (3): 437–455. :. &#160;.
(1967). Computation: Finite and Infinite Machines (1st ed.). Englewood Cliffs, N. J.: Prentice-Hall, Inc. &#160;. In particular see chapter 11: Models Similar to Digital Computers and chapter 14: Very Simple Bases for Computability. In the former chapter he defines "Program machines" and in the later chapter he discusses "Universal Program machines with Two Registers" and "...with one register", etc.
(1961) received December 1961 Computability of Recursive Functions, Journal of the Association of Computing Machinery (JACM) 10:217-255, 1963. An extremely valuable reference paper. In their Appendix A the authors cite 4 others with reference to "Minimality of Instructions Used in 4.1: Comparison with Similar Systems".
Kaphengst, Heinz, Eine Abstrakte programmgesteuerte Rechenmaschine', Zeitschrift fur mathematische Logik und Grundlagen der Mathematik:5 (1959), 366-379.
On operator algorithms, (Russian) Dok. Akad. Nauk 122 (1958), 967-970. English translation, Automat. Express 1 (1959), 20-23.
Graphschemata und rekursive Funktionen, Dialectica 12 (1958), 373.
Hermes, Hans Die Universalit?t programmgesteuerter Rechenmaschinen. Math.-Phys. Semsterberichte (G?ttingen) 4 (1954), 42-53.
(1980), Storage Modification Machines, Society for Industrial and Applied Mathematics, SIAM J. Comput. Vol. 9, No. 3, August 1980. Wherein Schōnhage shows the equivalence of his SMM with the "successor RAM" (Random Access Machine), etc. resp. Storage Modification Machines, in Theoretical Computer Science (1979), pp. 36-37
, Machine Models and Simulations pp.3-66, appearing in: , ed. "Handbook of Theoretical Computer Science. Volume A: Algorithms and Complexity, The MIT PRESS/Elsevier, 1990.
(volume A). QA 76.H279 1990.
van Emde Boas' treatment of SMMs appears on pp. 32-35. This treatment clarifies Schōnhage 1980 -- it closely follows but expands slightly the Schōnhage treatment. Both references may be needed for effective understanding.
(1957), A Variant to Turing's Theory of Computing Machines, JACM (Journal of the Association for Computing Machinery) 4; 63-92. Presented at the meeting of the Association, June 23-25, 1954.
: Hidden categories:}

我要回帖

更多关于 access token是什么 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信