Googol: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>ClueBot NG
m Reverting possible vandalism by 218.186.29.133 to version by Jim1138. False positive? Report it. Thanks, ClueBot NG. (1177500) (Bot)
 
en>Gilliam
m Reverted edits by 24.100.92.194 (talk) to last version by 46.13.248.62
Line 1: Line 1:
What all will you currently incorporate into the bodybuilding regimen? A lot of people build muscle themselves, and even though it is possible, sometimes it can be frustrating. You will probably find some valuable advice contained in this particular article you never thought of trying.<br><br>Vegetables offer numerous advantages if you are as essential to muscle building as any other nutrient. Vegetables provide valuable nutrients which you cannot find in most carb and carbohydrates generally lack. An extra benefit is that vegetables are typical great causes of fiber.Fiber allows the body to use protein far better in utilizing protein.<br><br>A frequent mistake people neglect to use proper technique when exercising is working on speed. Performing your workouts slower takes more control and sheer strength, provides you with far better results than quickly churning out sets in bad form.<br><br>You need to consume enough protein you eat whenever you set about a muscle development program. Protein supplements and protein shakes and powdered supplements are an easy way to get in your body's source of this vital nutrient. These protein-rich goods are important after hitting the gym or before heading to bed. You should only drink one shake per day. When your goal is usually to also boost your mass, drink approximately three each day.<br><br>Lots of people start upping their protein consumption as soon as they take up a muscle development regimen.<br><br>Don't try to build muscles when you find yourself getting involved in a marathon or participating in extreme cardio exercises. Cardio is very important, but an excessive amount of cardio may cancel your attempts at bulking up through weight training. If building up muscle is your focus, focus the majority of your efforts of your own strength-training regimen.<br><br>Switch increase your routine.Like everything else, in case your routine becomes boring, which could prevent you from doing them. Make sure you keep your exercise routine regularly through the use of different exercises and workout different muscles every time you exercise.<br><br>Eat good food enough around the days you need to build muscle. Consume many calories about an hour or so before starting your exercise routine. That doesn't mean you can eat whatever you want, but just be sure to eat a little more on those times and less about the days you aren't likely to be weight lifting.<br><br>Compound workouts are a crucial part associated with a muscle mass building muscle. These specific exercises which are meant to work multiple muscles within a movement. A fantastic instance of a compound move is actually a shoulder press from a squat position, which utilizes both muscles in your legs plus your core muscles for just one movement.<br><br>Carefully determine which moves you use in your routine certain ones might actually ensure it is harder to construct muscle. You may risk injuring yourself seriously when you have a lot of weight in your joints in neck work, neck work and dips because they involve difficult joint positions.<br><br>You may educate your strength training routine by its capability to cause you to are becoming stronger from week to week. You ought to see a steady increase the volume of weight you lift over time. If you are beginning to lift weights, you need to see a 5 percent rise in the sum you can lift after every other session. For those who have not been achieving your goals, it may be necessary to rethink your current strategy. In the event that you might be weaker than your last session, it really is possible you are not entirely recovered through your last session.<br><br>Eat well enough around the days you want to build muscle. Consume protein along with other calories about 60 minutes before exercising. This does not always mean that you need to eat an excessive amount of, however, you should eat more than you need to do on days that you aren't at the gym.<br><br>Muscle building isn't just something that can be done by "winging it." You should know which techniques work and which don't. This article includes several smart recommendations for enhancing your weight lifting routine. You are able to achieve your bodybuilding goals with all the right blend of information, technique, and perseverance.<br><br>If you liked this article therefore you would like to obtain more info pertaining to [http://54.88.180.178/mediawiki/index.php?title=Take_A_Look_At_These_Muscle_Building_Tips http://54.88.180.178/] i implore you to visit our site.
In [[computer science]], a '''loop variant''' is a [[function (mathematics)|mathematical function]] defined on the [[State (computer science)|state space]] of a computer program whose value is monotonically decreased with respect to a (strict) [[well-founded relation]] by the iteration of a [[while loop]] under some [[Loop invariant|invariant conditions]], thereby [[Termination analysis|ensuring its termination]].  A loop variant whose range is restricted to the non-negative integers is also known as a '''bound function''', because in this case it provides a trivial upper bound on the number of iterations of a loop before it terminates. However, a loop variant may be [[Transfinite number|transfinite]], and thus is not necessarily restricted to integer values.
 
A well-founded relation is characterized by the existence of a minimal element of every non-empty subset of its domain. The existence of a variant proves the termination of a [[while loop]] in a computer program by '''[[Transfinite induction|well-founded descent]]'''.<ref>{{cite book|last=Winskel|first=Glynn|title=The Formal Semantics of Programming Languages: An Introduction|year=1993|publisher=Massachusetts Institute of Technology|pages=32–33, 174–176}}</ref> A basic property of a well-founded relation is that it has no [[infinite descending chain]]s.  Therefore a loop possessing a variant will terminate after a finite number of iterations, as long as its body terminates each time.
 
A [[while loop]], or, more generally, a computer program that may contain while loops, is said to be '''totally correct''' if it is [[Partial correctness|partially correct]] and it terminates.
 
==Rule of inference for total correctness==
In order to formally state the rule of inference for the termination of a while loop we have demonstrated above, recall that in [[Floyd–Hoare logic]], the rule for expressing the partial correctness of a while loop is:
:<math>\frac{\{I \land C\}\;S\;\{I\}} {\{I\}\;\mathbf{while}\;C\; \mathbf{do}\; S \;\{I\land\lnot C\}},</math>
where ''I'' is the ''[[loop invariant|invariant]]'', ''C'' is the ''condition'', and ''S'' is the ''body'' of the loop. To express total correctness, we write instead:
:<math>\frac{< \textrm{\ is\ well-founded},\;[I \land C \land V=z ]\;S\;[I \land V < z]}
            {[I]\;\mathbf{while}\;C\; \mathbf{do}\; S \;[I\land\lnot C]},</math>
where, in addition, ''V'' is the ''variant'', and by convention the unbound symbol ''z'' is taken to be [[Universal quantification|universally quantified]].
 
==Every loop that terminates has a variant==
The existence of a variant implies that a while loop terminates. It may seem surprising, but the converse is true, as well, as long as we assume the [[axiom of choice]]: every while loop that terminates (given its invariant) has a variant. To prove this, assume that the loop
:<math>\mathbf{while}\;C\; \mathbf{do} \; S</math>
terminates given the invariant ''I'' where we have the total correctness assertion
:<math>[I \land C ]\;S\;[I].</math>
Consider the "successor" relation on the state space <math>\Sigma</math> induced by the execution of the statement ''S'' from a state satisfying both the invariant ''I'' and the condition ''C''. That is, we say that a state <math>\sigma'</math> is a "successor" of <math>\sigma</math> if and only if
* ''I'' and ''C'' are both true in the state <math>\sigma,</math> and
* <math>\sigma'</math> is the state that results from the execution of the statement ''S'' in the state <math>\sigma.</math>
We note that <math>\sigma' \neq \sigma,</math> for otherwise the loop would fail to terminate.
 
Next consider the reflexive, transitive closure of the "successor" relation. Call this ''iteration'': we say that a state <math>\sigma'</math> is an ''iterate'' of <math>\sigma</math> if either  <math>\sigma' = \sigma,</math> or there is a finite chain <math>\sigma_0, \sigma_1,\,\dots\,,\sigma_n</math> such that <math>\sigma_0 = \sigma,</math> <math>\sigma_n = \sigma'</math> and <math>\sigma_{i+1}</math> is a "successor" of <math>\sigma_i</math> for all ''i'', <math>0 \le i < n.</math>
 
We note that if <math>\sigma</math> and <math>\sigma'</math> are two distinct states, and <math>\sigma'</math> is an iterate of <math>\sigma</math>, then <math>\sigma</math> cannot be an iterate of <math>\sigma',</math> for again, otherwise the loop would fail to terminate.  In other words, iteration is antisymmetric, and thus, a [[partial order]].
 
Now, since the while loop terminates after a finite number of steps given the invariant ''I'', and no state has a successor unless ''I'' is true in that state, we conclude that every state has only finitely many iterates, every descending chain with respect to iteration has only finitely many distinct values, and thus there is no [[infinite descending chain]], i.e. loop iteration satisfies the [[descending chain condition]].
 
Therefore—assuming the [[axiom of choice]]—the "successor" relation we originally defined for the loop is [[Well-founded relation|well-founded]] on the state space <math>\Sigma,</math> since it is strict (irreflexive) and contained in the "iterate" relation. Thus the identity function on this state space is a variant for the while loop, as we have shown that the state must strictly decrease—as a "successor" and an "iterate"—each time the body ''S'' is executed given the invariant ''I'' and the condition ''C''.
 
Moreover, we can show by a counting argument that the existence of any variant implies the existence of a variant in '''ω<sub>1</sub>''', the [[first uncountable ordinal]], i.e.,
:<math>V:\Sigma\rightarrow\omega_1.</math>
This is because the collection of all states reachable by a finite computer program in a finite number of steps from a finite input is countably infinite, and '''ω<sub>1</sub>''' is the enumeration of all [[well-order]] [[Order type|types]] on countable sets.
 
==Practical considerations==
In practice, loop variants are often taken to be non-negative [[integer]]s, or even required to be so,<ref>{{cite web|url=http://archive.eiffel.com/doc/faq/variant.html|title=Why loop variants are integers|last=Bertrand Meyer|first=Michael Schweitzer|date=27 July 1995|work=The Eiffel Support Pages|publisher=Eiffel Software|accessdate=2012-02-23}}</ref> but the requirement that every loop have an integer variant removes the expressive power of '''[[μ operator|unbounded iteration]]''' from a programming language. Unless such a (formally verified) language allows a transfinite proof of termination for some other equally powerful construct such as a [[Recursion (computer science)|recursive function call]], it is no longer capable of full '''[[μ-recursive function|μ-recursion]]''', but only '''[[Primitive recursive function|primitive recursion]]'''.  [[Ackermann's function]] is the canonical example of a recursive function that cannot be computed in a [[For loop|loop with an integer variant]].
 
In terms of their [[computational complexity]], however, functions that are not primitive recursive lie far beyond the realm of what is usually considered [[tractable]].  Considering even the simple case of exponentiation as a primitive recursive function, and that the composition of primitive recursive functions is primitive recursive, one can begin to see how quickly a primitive recursive function can grow.  And any function that can be computed by a [[Turing machine]] in a running time bounded by a primitive recursive function is itself primitive recursive. So it is difficult to imagine a practical use for full μ-recursion where primitive recursion will not do, especially since the former can be simulated by the latter up to exceedingly long running times.
 
And in any case, [[Kurt Gödel]]'s first [[Gödel's incompleteness theorems|incompleteness theorem]] and the [[halting problem]] imply that there are while loops that always terminate but cannot be proven to do so; thus it is unavoidable that any requirement for a formal proof of termination must reduce the expressive power of a programming language. While we have shown that every loop that terminates has a variant, this does not mean that the well-foundedness of the loop iteration can be proven.
 
===Example===
Here is an example, in [[C_(programming_language)|C]]-like [[pseudocode]], of an integer variant computed from some upper bound on the number of iterations remaining in a while loop.  However, [[C_(programming_language)|C]] allows side effects in the evaluation of expressions, which is unacceptable from the point of view of formally verifying a computer program.
<source lang="c">
unsigned int B(); /* computes a loop iteration bound without side effects */
unsigned int V = B(); /* set variant equal to bound */
assert(I); /* loop invariant */
while (C) {
    assert(V > 0); /* this assertion is the variant's raison d'être (reason of existance) */
    S(); /* body of loop must not alter V */
    V = min(B(), V - 1); /* variant must decrease by at least one */
}
assert(I && !C); /* invariant is still true and condition is false */
</source>
 
===Why even consider a non-integer variant?===
Why even consider a non-integer or transfinite variant?  This question has been raised because in all practical instances where we want to prove that a program terminates, we also want to prove that it terminates in a reasonable amount of time. There are at least two possibilities:
 
* An upper bound on the number of iterations of a loop may be conditional on proving termination in the first place.  It may be desirable to separately (or progressively) prove the three properties of
** partial correctness,
** termination, and
** running time.
* Generality: considering transfinite variants allows all possible proofs of termination for a while loop to be seen in terms of the existence of a variant.
 
==See also==
* [[While loop]]
* [[Loop invariant]]
* [[Transfinite induction]]
* [[Descending chain condition]]
* [[Large countable ordinal]]
* [[Correctness (computer science)]]
* [[Predicate_transformer_semantics#While_loop | Weakest-preconditions of While loop]]
 
==References==
{{reflist}}
 
[[Category:Formal methods]]
[[Category:Control flow]]

Revision as of 05:01, 3 February 2014

In computer science, a loop variant is a mathematical function defined on the state space of a computer program whose value is monotonically decreased with respect to a (strict) well-founded relation by the iteration of a while loop under some invariant conditions, thereby ensuring its termination. A loop variant whose range is restricted to the non-negative integers is also known as a bound function, because in this case it provides a trivial upper bound on the number of iterations of a loop before it terminates. However, a loop variant may be transfinite, and thus is not necessarily restricted to integer values.

A well-founded relation is characterized by the existence of a minimal element of every non-empty subset of its domain. The existence of a variant proves the termination of a while loop in a computer program by well-founded descent.[1] A basic property of a well-founded relation is that it has no infinite descending chains. Therefore a loop possessing a variant will terminate after a finite number of iterations, as long as its body terminates each time.

A while loop, or, more generally, a computer program that may contain while loops, is said to be totally correct if it is partially correct and it terminates.

Rule of inference for total correctness

In order to formally state the rule of inference for the termination of a while loop we have demonstrated above, recall that in Floyd–Hoare logic, the rule for expressing the partial correctness of a while loop is:

{IC}S{I}{I}whileCdoS{I¬C},

where I is the invariant, C is the condition, and S is the body of the loop. To express total correctness, we write instead:

<iswellfounded,[ICV=z]S[IV<z][I]whileCdoS[I¬C],

where, in addition, V is the variant, and by convention the unbound symbol z is taken to be universally quantified.

Every loop that terminates has a variant

The existence of a variant implies that a while loop terminates. It may seem surprising, but the converse is true, as well, as long as we assume the axiom of choice: every while loop that terminates (given its invariant) has a variant. To prove this, assume that the loop

whileCdoS

terminates given the invariant I where we have the total correctness assertion

[IC]S[I].

Consider the "successor" relation on the state space Σ induced by the execution of the statement S from a state satisfying both the invariant I and the condition C. That is, we say that a state σ is a "successor" of σ if and only if

  • I and C are both true in the state σ, and
  • σ is the state that results from the execution of the statement S in the state σ.

We note that σσ, for otherwise the loop would fail to terminate.

Next consider the reflexive, transitive closure of the "successor" relation. Call this iteration: we say that a state σ is an iterate of σ if either σ=σ, or there is a finite chain σ0,σ1,,σn such that σ0=σ, σn=σ and σi+1 is a "successor" of σi for all i, 0i<n.

We note that if σ and σ are two distinct states, and σ is an iterate of σ, then σ cannot be an iterate of σ, for again, otherwise the loop would fail to terminate. In other words, iteration is antisymmetric, and thus, a partial order.

Now, since the while loop terminates after a finite number of steps given the invariant I, and no state has a successor unless I is true in that state, we conclude that every state has only finitely many iterates, every descending chain with respect to iteration has only finitely many distinct values, and thus there is no infinite descending chain, i.e. loop iteration satisfies the descending chain condition.

Therefore—assuming the axiom of choice—the "successor" relation we originally defined for the loop is well-founded on the state space Σ, since it is strict (irreflexive) and contained in the "iterate" relation. Thus the identity function on this state space is a variant for the while loop, as we have shown that the state must strictly decrease—as a "successor" and an "iterate"—each time the body S is executed given the invariant I and the condition C.

Moreover, we can show by a counting argument that the existence of any variant implies the existence of a variant in ω1, the first uncountable ordinal, i.e.,

V:Σω1.

This is because the collection of all states reachable by a finite computer program in a finite number of steps from a finite input is countably infinite, and ω1 is the enumeration of all well-order types on countable sets.

Practical considerations

In practice, loop variants are often taken to be non-negative integers, or even required to be so,[2] but the requirement that every loop have an integer variant removes the expressive power of unbounded iteration from a programming language. Unless such a (formally verified) language allows a transfinite proof of termination for some other equally powerful construct such as a recursive function call, it is no longer capable of full μ-recursion, but only primitive recursion. Ackermann's function is the canonical example of a recursive function that cannot be computed in a loop with an integer variant.

In terms of their computational complexity, however, functions that are not primitive recursive lie far beyond the realm of what is usually considered tractable. Considering even the simple case of exponentiation as a primitive recursive function, and that the composition of primitive recursive functions is primitive recursive, one can begin to see how quickly a primitive recursive function can grow. And any function that can be computed by a Turing machine in a running time bounded by a primitive recursive function is itself primitive recursive. So it is difficult to imagine a practical use for full μ-recursion where primitive recursion will not do, especially since the former can be simulated by the latter up to exceedingly long running times.

And in any case, Kurt Gödel's first incompleteness theorem and the halting problem imply that there are while loops that always terminate but cannot be proven to do so; thus it is unavoidable that any requirement for a formal proof of termination must reduce the expressive power of a programming language. While we have shown that every loop that terminates has a variant, this does not mean that the well-foundedness of the loop iteration can be proven.

Example

Here is an example, in C-like pseudocode, of an integer variant computed from some upper bound on the number of iterations remaining in a while loop. However, C allows side effects in the evaluation of expressions, which is unacceptable from the point of view of formally verifying a computer program.

unsigned int B(); /* computes a loop iteration bound without side effects */
unsigned int V = B(); /* set variant equal to bound */
assert(I); /* loop invariant */
while (C) {
    assert(V > 0); /* this assertion is the variant's raison d'être (reason of existance) */
    S(); /* body of loop must not alter V */
    V = min(B(), V - 1); /* variant must decrease by at least one */
}
assert(I && !C); /* invariant is still true and condition is false */

Why even consider a non-integer variant?

Why even consider a non-integer or transfinite variant? This question has been raised because in all practical instances where we want to prove that a program terminates, we also want to prove that it terminates in a reasonable amount of time. There are at least two possibilities:

  • An upper bound on the number of iterations of a loop may be conditional on proving termination in the first place. It may be desirable to separately (or progressively) prove the three properties of
    • partial correctness,
    • termination, and
    • running time.
  • Generality: considering transfinite variants allows all possible proofs of termination for a while loop to be seen in terms of the existence of a variant.

See also

References

43 year old Petroleum Engineer Harry from Deep River, usually spends time with hobbies and interests like renting movies, property developers in singapore new condominium and vehicle racing. Constantly enjoys going to destinations like Camino Real de Tierra Adentro.

  1. 20 year-old Real Estate Agent Rusty from Saint-Paul, has hobbies and interests which includes monopoly, property developers in singapore and poker. Will soon undertake a contiki trip that may include going to the Lower Valley of the Omo.

    My blog: http://www.primaboinca.com/view_profile.php?userid=5889534
  2. Template:Cite web