Elliptic curve primality proving: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
title and external link
en>Syed Ahsan Kamal
m There is a content mistake, I correct days into hours.
 
Line 1: Line 1:
{{Refimprove|date=July 2013}}The name '''Janus''' refers to at least two computer programming languages or partial descriptions of possible computer programming languages:
The individual who wrote the article is called Jayson Hirano and he completely digs that title. My [http://fashionlinked.com/index.php?do=/profile-13453/info/ psychic phone readings] spouse and I reside in Mississippi but now I'm considering other choices. For years she's been operating as a journey agent. To  [http://www.prayerarmor.com/uncategorized/dont-know-which-kind-of-hobby-to-take-up-read-the-following-tips/ tarot card readings] play lacross is something I really appreciate doing.<br><br>Here is my webpage - best psychic - [http://www.herandkingscounty.com/content/information-and-facts-you-must-know-about-hobbies click through the up coming page] -
 
==Concurrent Constraint Programming==
 
{{Infobox programming language
| name                  = Janus
| logo                  =
| year                  = 1990
| designer              = [[Ken Kahn]] and [[Vijay A. Saraswat]]
| developer              =
| paradigm              = [[Concurrent constraint logic programming|concurrent constraint logic]]
| latest release version =
| latest release date    =
| latest test version    =
| latest test date      =
| turing-complete        = Yes
| implementations        = (none available)
| typing                =
| versions              =
| influenced_by          =
| dialects  =
| platform  =
| license    =
| website    =
| file_ext  =
}}
 
'''Janus''' is a computer programming language partially described by K. Kahn and Vijay A. Saraswat in [http://doi.acm.org/10.1145/97946.97955 "Actors as a special case of concurrent constraint (logic) programming"], in SIGPLAN ''Notices'', October 1990. Janus is a [[Concurrent constraint logic programming|concurrent constraint]] language without backtracking.
 
Janus models concurrency through the use of ''bag channels''.  Code that needs to send a message to a process does so by constraining a bag to be the union of another bag and the singleton bag of the message. The other bag is then available to be constrained for sending subsequent messages.
 
The process receives the message by matching the bag to a pattern that says it is the union of some singleton and some other bag. The logic of the bag channels produces a property shared by the [[actor model]], namely that the order of arrival of the messages is not guaranteed.  However, unlike actors in the actor model, processes in Janus can pass around their "mailboxes" so to speak, in the form of
bags, and can hold more than one.  This ability to pass mailboxes around and hold more than one is inherited in computer programming language [[ToonTalk computer programming language|ToonTalk]], which is influenced by Janus.
 
Janus, the programming language, is named after [[Janus (mythology)|Janus]], the two-faced Roman god, because every logical variable in Janus has as its two "faces", two aspects that can be passed as arguments.  These are called the ''asker'' and the ''teller''.  These represent, respectively, the right to ask the value of the variable (or some characteristic of the value) and the right to tell the value (or to tell some constraint on what the value can be).  The asker and teller aspects can be passed around as arguments independently of each otherNeither right implies the other right.  The syntax of the language prevents copying a teller or exercising it more than once. Logical contradiction is statically prevented, according to Kahn and Saraswat.
 
==Time-reversible Computing==
 
{{Infobox programming language
| name                  = Janus
| logo                  =
| year                  = 1982, 2007
| designer              = Christopher Lutz, Howard Derby, Tetsuo Yokoyama, and Robert Glück
| developer              =
| paradigm              = [[Imperative programming|imperative]]([[Procedural programming|procedural]]), [[Reversible computing|reversible]]
| latest release version =
| latest release date    =
| latest test version    =
| latest test date      =
| turing-complete        = Yes
| implementations        = http://topps.diku.dk/pirc/janus/
| typing                =  
| versions              =
| influenced_by          =
| dialects  =
| platform  =
| license    =
| website    = http://tetsuo.jp/ref/janus.html
| file_ext  =
}}
 
'''Janus''' is also the name of a [[Reversible computing|time-reversible]] programming language written at [[Caltech]] in 1982.<ref>Christopher Lutz. Janus: a time-reversible language. 1986. ''Letter to R. Landauer''. http://tetsuo.jp/ref/janus.html.</ref> The [[operational semantics]] of the language were formally specified, together with a program inverter and an invertible [[self-interpreter]], in 2007 by Tetsuo Yokoyama and Robert Glück.<ref name="diku">Tetsuo Yokoyama and Robert Glück. 2007. A reversible programming language and its invertible self-interpreter. In ''Proceedings of the 2007 ACM SIGPLAN symposium on Partial evaluation and semantics-based program manipulation'' (PEPM '07). ACM, New York, NY, USA, 144-153. http://doi.acm.org/10.1145/1244381.1244404</ref> A Janus inverter and interpreter is made freely available by the [[TOPPS (research group)|TOPPS research group]] at [[DIKU]].<ref name="interpreter">http://topps.diku.dk/pirc/janus/</ref> The below summarises the language presented in the 2007 paper.
 
Janus is an imperative programming language with a global store (there is no stack or heap allocation). Janus is a reversible programming language, i.e. it supports deterministic forward and backward computation by local inversion.
 
=== Syntax ===
 
We specify the syntax of Janus using [[Backus-Naur Form]].
 
A Janus program is a sequence of one or more variable declarations, followed by a sequence of one or more procedure declarations:
 
<source lang=bnf>
<program> ::= <v-decl> <v-decls> <p-decl> <p-decls>
<v-decls> ::= <v-decl> <v-decls> | ""
<p-decls> ::= <p-decl> <p-decls> | ""
</source>
 
Note, Janus as specified in the 2007 paper,<ref name="diku"/> allows zero or more variables, but a program that starts with an empty store, produces an empty store. A program that does nothing is trivially invertible, and not interesting in practice.
 
A variable declaration defines either a variable or a one-dimensional array:
 
<source lang=bnf>
<v-decl> ::= <v> | <v> "[" <c> "]"
</source>
 
Note, variable declarations carry no type information. This is because all values (and all constants) in Janus are non-negative 32-bit integers, so all values are between 0 and 2<sup>32</sup>-1=4294967295. Note however, that the Janus interpreter hosted by [[TOPPS (research group)|TOPPS]] uses regular [[two's complement]] 32-bit integers, so all values there are between -2<sup>31</sup>=-2147483648 and 2<sup>31</sup>-1=2147483647. All variables are initialized to the value 0.
 
There are no theoretical bounds to the sizes of arrays, but the said interpreter demands a size of at least 1, and at most 4000.<ref>http://topps.diku.dk/pirc/janus/errors.html</ref>
 
A procedure declaration consists of the keyword <code>procedure</code>, followed by a unique procedure identifier and a statement:
 
<source lang=bnf>
<p-decl> ::= "procedure" <id> <s>
</source>
 
The entry point of a Janus program is a procedure named <tt>main</tt>. If no such procedure exists, the last procedure in the program text is the entry point.
 
A statement is either an assignment, a swap, an if-then-else, a loop, a procedure call, a procedure uncall, a skip, or a sequence of statements:
 
<source lang=bnf>
<s> := <x> <mod-op> "=" <e> | <x> "[" <e> "]" <mod-op> <e>
    | <x> "<=>" <x>
    | "if" <e> "then" <s> "else" <s> "fi" <e>
    | "from" <e> "do" <s> "loop" <s> "until" <e>
    | "call" <id> | "uncall" <id>
    | "skip"
    | <s> <s>
</source>
 
For assignments to be reversible, it is demanded that the variable on the left-hand side does not appear in the expressions on either side of the assignment. (Note, array cell assignment has an expression on both sides of the assignment.)
 
A swap is trivially reversible.
 
For conditionals to be reversible, we provide both a ''test'' (the <code><e></code> after <code>"if"</code>) and an ''assertion'' (the <code><e></code> after <code>"fi"</code>). The semantics is that the test ''must'' hold before the execution of the then-branch, and the assertion ''must'' hold after it. Conversely, the test ''must not'' hold before the execution of the else-branch, and the assertion ''must not'' hold after it. In the inverted program, the assertion becomes the test, and the test becomes the assertion. (Note, Since all values in Janus are integers, the usual C-semantics that 0 indicates false are employed.)
 
For loops to be reversible, we similarly provide an assertion (the <code><e></code> after <code>"from"</code>) and a test (the <code><e></code> after <code>"until"</code>). The semantics is that the assertion must hold ''only on entry'' to the loop, and the test must hold ''only on exit'' from the loop. In the inverted program, the assertion becomes the test, and the test becomes the assertion. An additional <code><e></code> after <code>"loop"</code> allows to perform work after the test is evaluated to false. The work should ensure that the assertion is false subsequently.
 
A procedure ''call'' executes the statements of a procedure in a forward direction. A procedure ''uncall'' executes the statements of a procedure in the backward direction. There are no parameters to procedures, so all variable passing is done by side-effects on the global store.
 
An expression is a constant (integer), a variable, an indexed variable, or an application of a binary operation:
 
<source lang=bnf>
<e> ::= <c> | <x> | <x> "[" <e> "]" | <e> <bin-op> <e>
</source>
 
The constants in Janus (and the Janus interpreter hosted by [[TOPPS (research group)|TOPPS]]) have already been discussed above.
 
A binary operator is one of the following, having semantics similar to their C counterparts:
 
<source lang=bnf>
<bin-op> ::= "+" | "-" | "^" | "+" | "-" | "/" | "%" | "&" | "|" | "&&" | "||" | ">" | "<" | "=" | "!=" | "<=" | ">="
</source>
 
The modification operators are a subset of the binary operators such that for all v, <math>\lambda v'.\oplus\left(v',v\right)</math> is a bijective function, and hence invertible, where <math>\oplus</math> is a modification operator:
 
<source lang=bnf>
<mod-op> ::= "+" | "-" | "^"
</source>
 
The inverse functions are <code>"-"</code>, <code>"+"</code>, and <code>"^"</code>, respectively.
 
The restriction that the variable assigned to does not appear in an expression on either side of the assignment allows us to prove that the inference system of Janus is forward and backward deterministic.
 
===Example===
 
We write a Janus procedure <tt>fib</tt> to find the n<sup>th</sup> [[Fibonacci sequence|Fibonacci number]], for n>2, i=n, x1=1, and x2=1:
 
<pre>
procedure fib
  from i = n
  do
    x1 += x2
    x1 <=> x2
    i -= 1
  until i = 2
</pre>
 
Upon termination, <tt>x1</tt> is the (n-1)<sup>th</sup> Fibonacci number and <tt>x2</tt> is the n<sup>th</sup> Fibonacci number. <tt>i</tt> is an iterator variable that goes from n to 2. As <tt>i</tt> is decremented in every iteration, the assumption (<code>i = n</code>) is only true prior to the first iteration. The test is (<code>i = 2</code>) is only true after the last iteration of the loop (assuming i > 2).
 
Assuming the following prelude to the procedure, we end up with the 4<sup>th</sup> Fibonacci number in <tt>x2</tt>:
 
<pre>
i n x1 x2
procedure main
    n += 4
    i += n
    x1 += 1
    x2 += 1
    call fib
</pre>
 
Note, our main would have to do a bit more work if we were to make it handle n≤2, especially negative integers.
 
The inverse of <tt>fib</tt> is:
 
<pre>
procedure fib
    from  i = 2
    do
        i += 1
        x1 <=> x2
        x1 -= x2
    loop
    until i = n
</pre>
 
As you can see, Janus performs local inversion, where the loop test and assertion are swapped, the order of statements is reversed, and every statement in the loop is itself reversed. The reverse program can be used to find n when x1 is the (n-1)<sup>th</sup> and x2 is the n<sup>th</sup> Fibonacci number.
 
==References==
{{Reflist}}
 
[[Category:Concurrent programming languages]]
[[Category:Logic programming languages]]

Latest revision as of 19:25, 20 February 2014

The individual who wrote the article is called Jayson Hirano and he completely digs that title. My psychic phone readings spouse and I reside in Mississippi but now I'm considering other choices. For years she's been operating as a journey agent. To tarot card readings play lacross is something I really appreciate doing.

Here is my webpage - best psychic - click through the up coming page -