ImpSimple Imperative Programs
Z ::= X;;
Y ::= 1;;
WHILE not (Z = 0) DO
Y ::= Y * Z;;
Z ::= Z - 1
END
Y ::= 1;;
WHILE not (Z = 0) DO
Y ::= Y * Z;;
Z ::= Z - 1
END
(* IMPORTS *)
Set Warnings "-notation-overridden,-parsing".
Require Import Coq.Bool.Bool.
Require Import Coq.Arith.Arith.
Require Import Coq.Arith.EqNat.
Require Import Coq.omega.Omega.
Require Import Coq.Lists.List.
Require Import Coq.omega.Omega.
Import ListNotations.
Require Import Maps.
(* /IMPORTS *)
Arithmetic and Boolean Expressions
Module AExp.
These two definitions specify the abstract syntax of
arithmetic and boolean expressions.
Inductive aexp : Type :=
| ANum : nat → aexp
| APlus : aexp → aexp → aexp
| AMinus : aexp → aexp → aexp
| AMult : aexp → aexp → aexp.
Inductive bexp : Type :=
| BTrue : bexp
| BFalse : bexp
| BEq : aexp → aexp → bexp
| BLe : aexp → aexp → bexp
| BNot : bexp → bexp
| BAnd : bexp → bexp → bexp.
In this chapter, we'll elide the translation from the
concrete syntax that a programmer would actually write to these
abstract syntax trees — the process that, for example, would
translate the string "1+2*3" to the AST
For comparison, here's a conventional BNF (Backus-Naur Form)
grammar defining the same abstract syntax:
Compared to the Coq version above...
It's good to be comfortable with both sorts of notations: informal
ones for communicating between humans and formal ones for carrying
out implementations and proofs.
APlus (ANum 1) (AMult (ANum 2) (ANum 3)).
The optional chapter ImpParser develops a simple
implementation of a lexical analyzer and parser that can perform
this translation. You do not need to understand that chapter to
understand this one, but if you haven't taken a course where these
techniques are covered (e.g., a compilers course) you may want to
skim it.
a ::= nat
| a + a
| a - a
| a * a
b ::= true
| false
| a = a
| a ≤ a
| not b
| b and b
| a + a
| a - a
| a * a
b ::= true
| false
| a = a
| a ≤ a
| not b
| b and b
- The BNF is more informal — for example, it gives some
suggestions about the surface syntax of expressions (like the
fact that the addition operation is written + and is an
infix symbol) while leaving other aspects of lexical analysis
and parsing (like the relative precedence of +, -, and
*, the use of parens to explicitly group subexpressions,
etc.) unspecified. Some additional information (and human
intelligence) would be required to turn this description into
a formal definition, for example when implementing a
compiler.
The Coq version consistently omits all this information and concentrates on the abstract syntax only.
- On the other hand, the BNF version is lighter and easier to
read. Its informality makes it flexible, a big advantage in
situations like discussions at the blackboard, where
conveying general ideas is more important than getting every
detail nailed down precisely.
Indeed, there are dozens of BNF-like notations and people switch freely among them, usually without bothering to say which form of BNF they're using because there is no need to: a rough-and-ready informal understanding is all that's important.
Fixpoint aeval (a : aexp) : nat :=
match a with
| ANum n ⇒ n
| APlus a1 a2 ⇒ (aeval a1) + (aeval a2)
| AMinus a1 a2 ⇒ (aeval a1) - (aeval a2)
| AMult a1 a2 ⇒ (aeval a1) * (aeval a2)
end.
Example test_aeval1:
aeval (APlus (ANum 2) (ANum 2)) = 4.
Proof. reflexivity. Qed.
Similarly, evaluating a boolean expression yields a boolean.
Fixpoint beval (b : bexp) : bool :=
match b with
| BTrue ⇒ true
| BFalse ⇒ false
| BEq a1 a2 ⇒ beq_nat (aeval a1) (aeval a2)
| BLe a1 a2 ⇒ leb (aeval a1) (aeval a2)
| BNot b1 ⇒ negb (beval b1)
| BAnd b1 b2 ⇒ andb (beval b1) (beval b2)
end.
Optimization
Fixpoint optimize_0plus (a:aexp) : aexp :=
match a with
| ANum n ⇒
ANum n
| APlus (ANum 0) e2 ⇒
optimize_0plus e2
| APlus e1 e2 ⇒
APlus (optimize_0plus e1) (optimize_0plus e2)
| AMinus e1 e2 ⇒
AMinus (optimize_0plus e1) (optimize_0plus e2)
| AMult e1 e2 ⇒
AMult (optimize_0plus e1) (optimize_0plus e2)
end.
To make sure our optimization is doing the right thing we
can test it on some examples and see if the output looks OK.
Example test_optimize_0plus:
optimize_0plus (APlus (ANum 2)
(APlus (ANum 0)
(APlus (ANum 0) (ANum 1))))
= APlus (ANum 2) (ANum 1).
Proof. reflexivity. Qed.
But if we want to be sure the optimization is correct —
i.e., that evaluating an optimized expression gives the same
result as the original — we should prove it.
Theorem optimize_0plus_sound: ∀ a,
aeval (optimize_0plus a) = aeval a.
Proof.
intros a. induction a.
- (* ANum *) reflexivity.
- (* APlus *) destruct a1.
+ (* a1 = ANum n *) destruct n.
* (* n = 0 *) simpl. apply IHa2.
* (* n <> 0 *) simpl. rewrite IHa2. reflexivity.
+ (* a1 = APlus a1_1 a1_2 *)
simpl. simpl in IHa1. rewrite IHa1.
rewrite IHa2. reflexivity.
+ (* a1 = AMinus a1_1 a1_2 *)
simpl. simpl in IHa1. rewrite IHa1.
rewrite IHa2. reflexivity.
+ (* a1 = AMult a1_1 a1_2 *)
simpl. simpl in IHa1. rewrite IHa1.
rewrite IHa2. reflexivity.
- (* AMinus *)
simpl. rewrite IHa1. rewrite IHa2. reflexivity.
- (* AMult *)
simpl. rewrite IHa1. rewrite IHa2. reflexivity. Qed.
Coq Automation
Tacticals
The try Tactical
Theorem silly1 : ∀ ae, aeval ae = aeval ae.
Proof. try reflexivity. (* this just does reflexivity *) Qed.
Theorem silly2 : ∀ (P : Prop), P → P.
Proof.
intros P HP.
try reflexivity. (* just reflexivity would have failed *)
apply HP. (* we can still finish the proof in some other way *)
Qed.
There is no real reason to use try in completely manual
proofs like these, but it is very useful for doing automated
proofs in conjunction with the ; tactical, which we show
next.
The ; Tactical (Simple Form)
Lemma foo : ∀ n, leb 0 n = true.
Proof.
intros.
destruct n.
(* Leaves two subgoals, which are discharged identically... *)
- (* n=0 *) simpl. reflexivity.
- (* n=Sn' *) simpl. reflexivity.
Qed.
We can simplify this proof using the ; tactical:
Lemma foo' : ∀ n, leb 0 n = true.
Proof.
intros.
(* destruct the current goal *)
destruct n;
(* then simpl each resulting subgoal *)
simpl;
(* and do reflexivity on each resulting subgoal *)
reflexivity.
Qed.
Using try and ; together, we can get rid of the repetition in
the proof that was bothering us a little while ago.
Theorem optimize_0plus_sound': ∀ a,
aeval (optimize_0plus a) = aeval a.
Proof.
intros a.
induction a;
(* Most cases follow directly by the IH... *)
try (simpl; rewrite IHa1; rewrite IHa2; reflexivity).
(* ... but the remaining cases -- ANum and APlus --
are different: *)
- (* ANum *) reflexivity.
- (* APlus *)
destruct a1;
(* Again, most cases follow directly by the IH: *)
try (simpl; simpl in IHa1; rewrite IHa1;
rewrite IHa2; reflexivity).
(* The interesting case, on which the try...
does nothing, is when e1 = ANum n. In this
case, we have to destruct n (to see whether
the optimization applies) and rewrite with the
induction hypothesis. *)
+ (* a1 = ANum n *) destruct n;
simpl; rewrite IHa2; reflexivity. Qed.
Coq experts often use this "...; try... " idiom after a tactic
like induction to take care of many similar cases all at once.
Naturally, this practice has an analog in informal proofs. For
example, here is an informal proof of the optimization theorem
that matches the structure of the formal one:
Theorem: For all arithmetic expressions a,
However, this proof can still be improved: the first case (for
a = ANum n) is very trivial — even more trivial than the cases
that we said simply followed from the IH — yet we have chosen to
write it out in full. It would be better and clearer to drop it
and just say, at the top, "Most cases are either immediate or
direct from the IH. The only interesting case is the one for
APlus..." We can make the same improvement in our formal proof
too. Here's how it looks:
aeval (optimize_0plus a) = aeval a.
Proof: By induction on a. Most cases follow directly from the
IH. The remaining cases are as follows:
- Suppose a = ANum n for some n. We must show
aeval (optimize_0plus (ANum n)) = aeval (ANum n).This is immediate from the definition of optimize_0plus.
- Suppose a = APlus a1 a2 for some a1 and a2. We must
show
aeval (optimize_0plus (APlus a1 a2)) = aeval (APlus a1 a2).Consider the possible forms of a1. For most of them, optimize_0plus simply calls itself recursively for the subexpressions and rebuilds a new expression of the same form as a1; in these cases, the result follows directly from the IH.The interesting case is when a1 = ANum n for some n. If n = ANum 0, thenoptimize_0plus (APlus a1 a2) = optimize_0plus a2and the IH for a2 is exactly what we need. On the other hand, if n = S n' for some n', then again optimize_0plus simply calls itself recursively, and the result follows from the IH. ☐
Theorem optimize_0plus_sound'': ∀ a,
aeval (optimize_0plus a) = aeval a.
Proof.
intros a.
induction a;
(* Most cases follow directly by the IH *)
try (simpl; rewrite IHa1; rewrite IHa2; reflexivity);
(* ... or are immediate by definition *)
try reflexivity.
(* The interesting case is when a = APlus a1 a2. *)
- (* APlus *)
destruct a1; try (simpl; simpl in IHa1; rewrite IHa1;
rewrite IHa2; reflexivity).
+ (* a1 = ANum n *) destruct n;
simpl; rewrite IHa2; reflexivity. Qed.
The ; Tactical (General Form)
T; [T1 | T2 | ... | Tn]
is a tactic that first performs T and then performs T1 on the
first subgoal generated by T, performs T2 on the second
subgoal, etc.
T; [T' | T' | ... | T']
The repeat Tactical
Theorem In10 : In 10 [1;2;3;4;5;6;7;8;9;10].
Proof.
repeat (try (left; reflexivity); right).
Qed.
The tactic repeat T never fails: if the tactic T doesn't apply
to the original goal, then repeat still succeeds without changing
the original goal (i.e., it repeats zero times).
Theorem In10' : In 10 [1;2;3;4;5;6;7;8;9;10].
Proof.
repeat (left; reflexivity).
repeat (right; try (left; reflexivity)).
Qed.
The tactic repeat T also does not have any upper bound on the
number of times it applies T. If T is a tactic that always
succeeds, then repeat T will loop forever (e.g., repeat simpl
loops forever, since simpl always succeeds). While evaluation
in Coq's term language, Gallina, is guaranteed to terminate,
tactic evaluation is not! This does not affect Coq's logical
consistency, however, since the job of repeat and other tactics
is to guide Coq in constructing proofs; if the construction
process diverges, this simply means that we have failed to
construct a proof, not that we have constructed a wrong one.
Exercise: 3 stars (optimize_0plus_b)
Since the optimize_0plus transformation doesn't change the value of aexps, we should be able to apply it to all the aexps that appear in a bexp without changing the bexp's value. Write a function which performs that transformation on bexps, and prove it is sound. Use the tacticals we've just seen to make the proof as elegant as possible.Fixpoint optimize_0plus_b (b : bexp) : bexp
(* REPLACE THIS LINE WITH ":= _your_definition_ ." *). Admitted.
Theorem optimize_0plus_b_sound : ∀ b,
beval (optimize_0plus_b b) = beval b.
Proof.
(* FILL IN HERE *) Admitted.
Exercise: 4 stars, optional (optimizer)
Design exercise: The optimization implemented by our optimize_0plus function is only one of many possible optimizations on arithmetic and boolean expressions. Write a more sophisticated optimizer and prove it correct. (You will probably find it easiest to start small — add just a single, simple optimization and prove it correct — and build up to something more interesting incrementially.)☐
Defining New Tactic Notations
- The Tactic Notation idiom illustrated below gives a handy way
to define "shorthand tactics" that bundle several tactics into a
single command.
- For more sophisticated programming, Coq offers a built-in
language called Ltac with primitives that can examine and
modify the proof state. The details are a bit too complicated
to get into here (and it is generally agreed that Ltac is not
the most beautiful part of Coq's design!), but they can be found
in the reference manual and other books on Coq, and there are
many examples of Ltac definitions in the Coq standard library
that you can use as examples.
- There is also an OCaml API, which can be used to build tactics that access Coq's internal structures at a lower level, but this is seldom worth the trouble for ordinary Coq users.
Tactic Notation "simpl_and_try" tactic(c) :=
simpl;
try c.
This defines a new tactical called simpl_and_try that takes one
tactic c as an argument and is defined to be equivalent to the
tactic simpl; try c. Now writing "simpl_and_try reflexivity."
in a proof will be the same as writing "simpl; try
reflexivity."
The omega Tactic
- numeric constants, addition (+ and S), subtraction (-
and pred), and multiplication by constants (this is what
makes it Presburger arithmetic),
- equality (= and ≠) and inequality (≤), and
- the logical connectives ∧, ∨, ¬, and →,
Example silly_presburger_example : ∀ m n o p,
m + n ≤ n + o ∧ o + 3 = p + 3 →
m ≤ p.
Proof.
intros. omega.
Qed.
(Note the Require Import Coq.omega.Omega. at the top of the file.)
A Few More Handy Tactics
- clear H: Delete hypothesis H from the context.
- subst x: Find an assumption x = e or e = x in the
context, replace x with e throughout the context and
current goal, and clear the assumption.
- subst: Substitute away all assumptions of the form x = e
or e = x.
- rename... into...: Change the name of a hypothesis in the
proof context. For example, if the context includes a variable
named x, then rename x into y will change all occurrences
of x to y.
- assumption: Try to find a hypothesis H in the context that
exactly matches the goal; if one is found, behave like apply
H.
- contradiction: Try to find a hypothesis H in the current
context that is logically equivalent to False. If one is
found, solve the goal.
- constructor: Try to find a constructor c (from some Inductive definition in the current environment) that can be applied to solve the current goal. If one is found, behave like apply c.
Evaluation as a Relation
Module aevalR_first_try.
Inductive aevalR : aexp → nat → Prop :=
| E_ANum : ∀ (n: nat),
aevalR (ANum n) n
| E_APlus : ∀ (e1 e2: aexp) (n1 n2: nat),
aevalR e1 n1 →
aevalR e2 n2 →
aevalR (APlus e1 e2) (n1 + n2)
| E_AMinus: ∀ (e1 e2: aexp) (n1 n2: nat),
aevalR e1 n1 →
aevalR e2 n2 →
aevalR (AMinus e1 e2) (n1 - n2)
| E_AMult : ∀ (e1 e2: aexp) (n1 n2: nat),
aevalR e1 n1 →
aevalR e2 n2 →
aevalR (AMult e1 e2) (n1 * n2).
It will be convenient to have an infix notation for
aevalR. We'll write e \\ n to mean that arithmetic expression
e evaluates to value n.
Notation "e '\\' n"
:= (aevalR e n)
(at level 50, left associativity)
: type_scope.
End aevalR_first_try.
In fact, Coq provides a way to use this notation in the
definition of aevalR itself. This reduces confusion by avoiding
situations where we're working on a proof involving statements in
the form e \\ n but we have to refer back to a definition
written using the form aevalR e n.
We do this by first "reserving" the notation, then giving the
definition together with a declaration of what the notation
means.
Reserved Notation "e '\\' n" (at level 50, left associativity).
Inductive aevalR : aexp → nat → Prop :=
| E_ANum : ∀ (n:nat),
(ANum n) \\ n
| E_APlus : ∀ (e1 e2: aexp) (n1 n2 : nat),
(e1 \\ n1) → (e2 \\ n2) → (APlus e1 e2) \\ (n1 + n2)
| E_AMinus : ∀ (e1 e2: aexp) (n1 n2 : nat),
(e1 \\ n1) → (e2 \\ n2) → (AMinus e1 e2) \\ (n1 - n2)
| E_AMult : ∀ (e1 e2: aexp) (n1 n2 : nat),
(e1 \\ n1) → (e2 \\ n2) → (AMult e1 e2) \\ (n1 * n2)
where "e '\\' n" := (aevalR e n) : type_scope.
Inference Rule Notation
| E_APlus : ∀ (e1 e2: aexp) (n1 n2: nat),
aevalR e1 n1 →
aevalR e2 n2 →
aevalR (APlus e1 e2) (n1 + n2)
...would be written like this as an inference rule:
aevalR e1 n1 →
aevalR e2 n2 →
aevalR (APlus e1 e2) (n1 + n2)
| e1 \\ n1 | |
| e2 \\ n2 | (E_APlus) |
| APlus e1 e2 \\ n1+n2 |
| (E_ANum) | |
| ANum n \\ n |
| e1 \\ n1 | |
| e2 \\ n2 | (E_APlus) |
| APlus e1 e2 \\ n1+n2 |
| e1 \\ n1 | |
| e2 \\ n2 | (E_AMinus) |
| AMinus e1 e2 \\ n1-n2 |
| e1 \\ n1 | |
| e2 \\ n2 | (E_AMult) |
| AMult e1 e2 \\ n1*n2 |
Equivalence of the Definitions
Theorem aeval_iff_aevalR : ∀ a n,
(a \\ n) ↔ aeval a = n.
Proof.
split.
- (* -> *)
intros H.
induction H; simpl.
+ (* E_ANum *)
reflexivity.
+ (* E_APlus *)
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
+ (* E_AMinus *)
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
+ (* E_AMult *)
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
- (* <- *)
generalize dependent n.
induction a;
simpl; intros; subst.
+ (* ANum *)
apply E_ANum.
+ (* APlus *)
apply E_APlus.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
+ (* AMinus *)
apply E_AMinus.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
+ (* AMult *)
apply E_AMult.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
Qed.
split.
- (* -> *)
intros H.
induction H; simpl.
+ (* E_ANum *)
reflexivity.
+ (* E_APlus *)
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
+ (* E_AMinus *)
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
+ (* E_AMult *)
rewrite IHaevalR1. rewrite IHaevalR2. reflexivity.
- (* <- *)
generalize dependent n.
induction a;
simpl; intros; subst.
+ (* ANum *)
apply E_ANum.
+ (* APlus *)
apply E_APlus.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
+ (* AMinus *)
apply E_AMinus.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
+ (* AMult *)
apply E_AMult.
apply IHa1. reflexivity.
apply IHa2. reflexivity.
Qed.
We can make the proof quite a bit shorter by making more
use of tacticals.
Theorem aeval_iff_aevalR' : ∀ a n,
(a \\ n) ↔ aeval a = n.
Proof.
(* WORKED IN CLASS *)
split.
- (* -> *)
intros H; induction H; subst; reflexivity.
- (* <- *)
generalize dependent n.
induction a; simpl; intros; subst; constructor;
try apply IHa1; try apply IHa2; reflexivity.
Qed.
Exercise: 3 stars (bevalR)
Write a relation bevalR in the same style as aevalR, and prove that it is equivalent to beval.Inductive bevalR: bexp → bool → Prop :=
(* FILL IN HERE *)
.
Lemma beval_iff_bevalR : ∀ b bv,
bevalR b bv ↔ beval b = bv.
Proof.
(* FILL IN HERE *) Admitted.
End AExp.
Computational vs. Relational Definitions
Module aevalR_division.
For example, suppose that we wanted to extend the arithmetic
operations by considering also a division operation:
Inductive aexp : Type :=
| ANum : nat → aexp
| APlus : aexp → aexp → aexp
| AMinus : aexp → aexp → aexp
| AMult : aexp → aexp → aexp
| ADiv : aexp → aexp → aexp. (* <--- new *)
Extending the definition of aeval to handle this new operation
would not be straightforward (what should we return as the result
of ADiv (ANum 5) (ANum 0)?). But extending aevalR is
straightforward.
Reserved Notation "e '\\' n"
(at level 50, left associativity).
Inductive aevalR : aexp → nat → Prop :=
| E_ANum : ∀ (n:nat),
(ANum n) \\ n
| E_APlus : ∀ (a1 a2: aexp) (n1 n2 : nat),
(a1 \\ n1) → (a2 \\ n2) → (APlus a1 a2) \\ (n1 + n2)
| E_AMinus : ∀ (a1 a2: aexp) (n1 n2 : nat),
(a1 \\ n1) → (a2 \\ n2) → (AMinus a1 a2) \\ (n1 - n2)
| E_AMult : ∀ (a1 a2: aexp) (n1 n2 : nat),
(a1 \\ n1) → (a2 \\ n2) → (AMult a1 a2) \\ (n1 * n2)
| E_ADiv : ∀ (a1 a2: aexp) (n1 n2 n3: nat),
(a1 \\ n1) → (a2 \\ n2) → (n2 > 0) →
(mult n2 n3 = n1) → (ADiv a1 a2) \\ n3
where "a '\\' n" := (aevalR a n) : type_scope.
End aevalR_division.
Module aevalR_extended.
Suppose, instead, that we want to extend the arithmetic operations
by a nondeterministic number generator any that, when evaluated,
may yield any number. (Note that this is not the same as making a
probabilistic choice among all possible numbers — we're not
specifying any particular distribution of results, but just saying
what results are possible.)
Reserved Notation "e '\\' n" (at level 50, left associativity).
Inductive aexp : Type :=
| AAny : aexp (* <--- NEW *)
| ANum : nat → aexp
| APlus : aexp → aexp → aexp
| AMinus : aexp → aexp → aexp
| AMult : aexp → aexp → aexp.
Again, extending aeval would be tricky, since now evaluation is
not a deterministic function from expressions to numbers, but
extending aevalR is no problem:
Inductive aevalR : aexp → nat → Prop :=
| E_Any : ∀ (n:nat),
AAny \\ n (* <--- new *)
| E_ANum : ∀ (n:nat),
(ANum n) \\ n
| E_APlus : ∀ (a1 a2: aexp) (n1 n2 : nat),
(a1 \\ n1) → (a2 \\ n2) → (APlus a1 a2) \\ (n1 + n2)
| E_AMinus : ∀ (a1 a2: aexp) (n1 n2 : nat),
(a1 \\ n1) → (a2 \\ n2) → (AMinus a1 a2) \\ (n1 - n2)
| E_AMult : ∀ (a1 a2: aexp) (n1 n2 : nat),
(a1 \\ n1) → (a2 \\ n2) → (AMult a1 a2) \\ (n1 * n2)
where "a '\\' n" := (aevalR a n) : type_scope.
End aevalR_extended.
At this point you maybe wondering: which style should I use by
default? The examples above show that relational definitions are
fundamentally more powerful than functional ones. For situations
like these, where the thing being defined is not easy to express
as a function, or indeed where it is not a function, there is no
choice. But what about when both styles are workable?
One point in favor of relational definitions is that some people
feel they are more elegant and easier to understand. Another is
that Coq automatically generates nice inversion and induction
principles from Inductive definitions.
On the other hand, functional definitions can often be more
convenient:
Furthermore, functions can be directly "extracted" to executable
code in OCaml or Haskell.
Ultimately, the choice often comes down to either the specifics of
a particular situation or simply a question of taste. Indeed, in
large Coq developments it is common to see a definition given in
both functional and relational styles, plus a lemma stating that
the two coincide, allowing further proofs to switch from one point
of view to the other at will.
- Functions are by definition deterministic and defined on all arguments; for a relation we have to show these properties explicitly if we need them.
- With functions we can also take advantage of Coq's computation mechanism to simplify expressions during proofs.
Expressions With Variables
States
Definition state := total_map nat.
Definition empty_state : state :=
t_empty 0.
Syntax
Inductive aexp : Type :=
| ANum : nat → aexp
| AId : id → aexp (* <----- NEW *)
| APlus : aexp → aexp → aexp
| AMinus : aexp → aexp → aexp
| AMult : aexp → aexp → aexp.
Defining a few variable names as notational shorthands will make
examples easier to read:
Definition W : id := Id "W".
Definition X : id := Id "X".
Definition Y : id := Id "Y".
Definition Z : id := Id "Z".
(This convention for naming program variables (X, Y,
Z) clashes a bit with our earlier use of uppercase letters for
types. Since we're not using polymorphism heavily in the chapters
devoped to Imp, this overloading should not cause confusion.)
The definition of bexps is unchanged (except for using the new
aexps):
Inductive bexp : Type :=
| BTrue : bexp
| BFalse : bexp
| BEq : aexp → aexp → bexp
| BLe : aexp → aexp → bexp
| BNot : bexp → bexp
| BAnd : bexp → bexp → bexp.
Evaluation
Fixpoint aeval (st : state) (a : aexp) : nat :=
match a with
| ANum n ⇒ n
| AId x ⇒ st x (* <----- NEW *)
| APlus a1 a2 ⇒ (aeval st a1) + (aeval st a2)
| AMinus a1 a2 ⇒ (aeval st a1) - (aeval st a2)
| AMult a1 a2 ⇒ (aeval st a1) * (aeval st a2)
end.
Fixpoint beval (st : state) (b : bexp) : bool :=
match b with
| BTrue ⇒ true
| BFalse ⇒ false
| BEq a1 a2 ⇒ beq_nat (aeval st a1) (aeval st a2)
| BLe a1 a2 ⇒ leb (aeval st a1) (aeval st a2)
| BNot b1 ⇒ negb (beval st b1)
| BAnd b1 b2 ⇒ andb (beval st b1) (beval st b2)
end.
Example aexp1 :
aeval (t_update empty_state X 5)
(APlus (ANum 3) (AMult (AId X) (ANum 2)))
= 13.
Proof. reflexivity. Qed.
Example bexp1 :
beval (t_update empty_state X 5)
(BAnd BTrue (BNot (BLe (AId X) (ANum 4))))
= true.
Proof. reflexivity. Qed.
Commands
Syntax
c ::= SKIP | x ::= a | c ;; c | IFB b THEN c ELSE c FI
| WHILE b DO c END
| WHILE b DO c END
Z ::= X;;
Y ::= 1;;
WHILE not (Z = 0) DO
Y ::= Y * Z;;
Z ::= Z - 1
END
When this command terminates, the variable Y will contain the
factorial of the initial value of X.
Y ::= 1;;
WHILE not (Z = 0) DO
Y ::= Y * Z;;
Z ::= Z - 1
END
Inductive com : Type :=
| CSkip : com
| CAss : id → aexp → com
| CSeq : com → com → com
| CIf : bexp → com → com → com
| CWhile : bexp → com → com.
As usual, we can use a few Notation declarations to make things
more readable. To avoid conflicts with Coq's built-in notations,
we keep this light — in particular, we don't introduce any
notations for aexps and bexps to avoid confusion with the
numeric and boolean operators we've already defined.
Notation "'SKIP'" :=
CSkip.
Notation "x '::=' a" :=
(CAss x a) (at level 60).
Notation "c1 ;; c2" :=
(CSeq c1 c2) (at level 80, right associativity).
Notation "'WHILE' b 'DO' c 'END'" :=
(CWhile b c) (at level 80, right associativity).
Notation "'IFB' c1 'THEN' c2 'ELSE' c3 'FI'" :=
(CIf c1 c2 c3) (at level 80, right associativity).
For example, here is the factorial function again, written as a
formal definition to Coq:
Definition fact_in_coq : com :=
Z ::= AId X;;
Y ::= ANum 1;;
WHILE BNot (BEq (AId Z) (ANum 0)) DO
Y ::= AMult (AId Y) (AId Z);;
Z ::= AMinus (AId Z) (ANum 1)
END.
Definition plus2 : com :=
X ::= (APlus (AId X) (ANum 2)).
Definition XtimesYinZ : com :=
Z ::= (AMult (AId X) (AId Y)).
Definition subtract_slowly_body : com :=
Z ::= AMinus (AId Z) (ANum 1) ;;
X ::= AMinus (AId X) (ANum 1).
Definition subtract_slowly : com :=
WHILE BNot (BEq (AId X) (ANum 0)) DO
subtract_slowly_body
END.
Definition subtract_3_from_5_slowly : com :=
X ::= ANum 3 ;;
Z ::= ANum 5 ;;
subtract_slowly.
Definition loop : com :=
WHILE BTrue DO
SKIP
END.
Evaluating Commands
Evaluation as a Function (Failed Attempt)
Fixpoint ceval_fun_no_while (st : state) (c : com)
: state :=
match c with
| SKIP ⇒
st
| x ::= a1 ⇒
t_update st x (aeval st a1)
| c1 ;; c2 ⇒
let st' := ceval_fun_no_while st c1 in
ceval_fun_no_while st' c2
| IFB b THEN c1 ELSE c2 FI ⇒
if (beval st b)
then ceval_fun_no_while st c1
else ceval_fun_no_while st c2
| WHILE b DO c END ⇒
st (* bogus *)
end.
In a traditional functional programming language like OCaml or
Haskell we could add the WHILE case as follows:
Thus, because it doesn't terminate on all inputs,
of ceval_fun cannot be written in Coq — at least not without
additional tricks and workarounds (see chapter ImpCEvalFun
if you're curious about what those might be).
Fixpoint ceval_fun (st : state) (c : com) : state := match c with ... | WHILE b DO c END => if (beval st b) then ceval_fun st (c; WHILE b DO c END) else st end.Coq doesn't accept such a definition ("Error: Cannot guess decreasing argument of fix") because the function we want to define is not guaranteed to terminate. Indeed, it doesn't always terminate: for example, the full version of the ceval_fun function applied to the loop program above would never terminate. Since Coq is not just a functional programming language but also a consistent logic, any potentially non-terminating function needs to be rejected. Here is an (invalid!) program showing what would go wrong if Coq allowed non-terminating recursive functions:
Fixpoint loop_false (n : nat) : False := loop_false n.That is, propositions like False would become provable (loop_false 0 would be a proof of False), which would be a disaster for Coq's logical consistency.
Evaluation as a Relation
Operational Semantics
| (E_Skip) | |
| SKIP / st \\ st |
| aeval st a1 = n | (E_Ass) |
| x := a1 / st \\ (t_update st x n) |
| c1 / st \\ st' | |
| c2 / st' \\ st'' | (E_Seq) |
| c1;;c2 / st \\ st'' |
| beval st b1 = true | |
| c1 / st \\ st' | (E_IfTrue) |
| IF b1 THEN c1 ELSE c2 FI / st \\ st' |
| beval st b1 = false | |
| c2 / st \\ st' | (E_IfFalse) |
| IF b1 THEN c1 ELSE c2 FI / st \\ st' |
| beval st b = false | (E_WhileFalse) |
| WHILE b DO c END / st \\ st |
| beval st b = true | |
| c / st \\ st' | |
| WHILE b DO c END / st' \\ st'' | (E_WhileTrue) |
| WHILE b DO c END / st \\ st'' |
Reserved Notation "c1 '/' st '\\' st'"
(at level 40, st at level 39).
Inductive ceval : com → state → state → Prop :=
| E_Skip : ∀ st,
SKIP / st \\ st
| E_Ass : ∀ st a1 n x,
aeval st a1 = n →
(x ::= a1) / st \\ (t_update st x n)
| E_Seq : ∀ c1 c2 st st' st'',
c1 / st \\ st' →
c2 / st' \\ st'' →
(c1 ;; c2) / st \\ st''
| E_IfTrue : ∀ st st' b c1 c2,
beval st b = true →
c1 / st \\ st' →
(IFB b THEN c1 ELSE c2 FI) / st \\ st'
| E_IfFalse : ∀ st st' b c1 c2,
beval st b = false →
c2 / st \\ st' →
(IFB b THEN c1 ELSE c2 FI) / st \\ st'
| E_WhileFalse : ∀ b st c,
beval st b = false →
(WHILE b DO c END) / st \\ st
| E_WhileTrue : ∀ st st' st'' b c,
beval st b = true →
c / st \\ st' →
(WHILE b DO c END) / st' \\ st'' →
(WHILE b DO c END) / st \\ st''
where "c1 '/' st '\\' st'" := (ceval c1 st st').
The cost of defining evaluation as a relation instead of a
function is that we now need to construct proofs that some
program evaluates to some result state, rather than just letting
Coq's computation mechanism do it for us.
Example ceval_example1:
(X ::= ANum 2;;
IFB BLe (AId X) (ANum 1)
THEN Y ::= ANum 3
ELSE Z ::= ANum 4
FI)
/ empty_state
\\ (t_update (t_update empty_state X 2) Z 4).
Proof.
(* We must supply the intermediate state *)
apply E_Seq with (t_update empty_state X 2).
- (* assignment command *)
apply E_Ass. reflexivity.
- (* if command *)
apply E_IfFalse.
reflexivity.
apply E_Ass. reflexivity. Qed.
Example ceval_example2:
(X ::= ANum 0;; Y ::= ANum 1;; Z ::= ANum 2) / empty_state \\
(t_update (t_update (t_update empty_state X 0) Y 1) Z 2).
Proof.
(* FILL IN HERE *) Admitted.
☐
(X ::= ANum 0;; Y ::= ANum 1;; Z ::= ANum 2) / empty_state \\
(t_update (t_update (t_update empty_state X 0) Y 1) Z 2).
Proof.
(* FILL IN HERE *) Admitted.
Exercise: 3 stars, advanced (pup_to_n)
Write an Imp program that sums the numbers from 1 to X (inclusive: 1 + 2 + ... + X) in the variable Y. Prove that this program executes as intended for X = 2 (this is trickier than you might expect).Definition pup_to_n : com
(* REPLACE THIS LINE WITH ":= _your_definition_ ." *). Admitted.
Theorem pup_to_2_ceval :
pup_to_n / (t_update empty_state X 2) \\
t_update (t_update (t_update (t_update (t_update (t_update empty_state
X 2) Y 0) Y 2) X 1) Y 3) X 0.
Proof.
(* FILL IN HERE *) Admitted.
Determinism of Evaluation
Theorem ceval_deterministic: ∀ c st st1 st2,
c / st \\ st1 →
c / st \\ st2 →
st1 = st2.
Proof.
intros c st st1 st2 E1 E2.
generalize dependent st2.
induction E1;
intros st2 E2; inversion E2; subst.
- (* E_Skip *) reflexivity.
- (* E_Ass *) reflexivity.
- (* E_Seq *)
assert (st' = st'0) as EQ1.
{ (* Proof of assertion *) apply IHE1_1; assumption. }
subst st'0.
apply IHE1_2. assumption.
- (* E_IfTrue, b1 evaluates to true *)
apply IHE1. assumption.
- (* E_IfTrue, b1 evaluates to false (contradiction) *)
rewrite H in H5. inversion H5.
- (* E_IfFalse, b1 evaluates to true (contradiction) *)
rewrite H in H5. inversion H5.
- (* E_IfFalse, b1 evaluates to false *)
apply IHE1. assumption.
- (* E_WhileFalse, b1 evaluates to false *)
reflexivity.
- (* E_WhileFalse, b1 evaluates to true (contradiction) *)
rewrite H in H2. inversion H2.
- (* E_WhileTrue, b1 evaluates to false (contradiction) *)
rewrite H in H4. inversion H4.
- (* E_WhileTrue, b1 evaluates to true *)
assert (st' = st'0) as EQ1.
{ (* Proof of assertion *) apply IHE1_1; assumption. }
subst st'0.
apply IHE1_2. assumption. Qed.
intros c st st1 st2 E1 E2.
generalize dependent st2.
induction E1;
intros st2 E2; inversion E2; subst.
- (* E_Skip *) reflexivity.
- (* E_Ass *) reflexivity.
- (* E_Seq *)
assert (st' = st'0) as EQ1.
{ (* Proof of assertion *) apply IHE1_1; assumption. }
subst st'0.
apply IHE1_2. assumption.
- (* E_IfTrue, b1 evaluates to true *)
apply IHE1. assumption.
- (* E_IfTrue, b1 evaluates to false (contradiction) *)
rewrite H in H5. inversion H5.
- (* E_IfFalse, b1 evaluates to true (contradiction) *)
rewrite H in H5. inversion H5.
- (* E_IfFalse, b1 evaluates to false *)
apply IHE1. assumption.
- (* E_WhileFalse, b1 evaluates to false *)
reflexivity.
- (* E_WhileFalse, b1 evaluates to true (contradiction) *)
rewrite H in H2. inversion H2.
- (* E_WhileTrue, b1 evaluates to false (contradiction) *)
rewrite H in H4. inversion H4.
- (* E_WhileTrue, b1 evaluates to true *)
assert (st' = st'0) as EQ1.
{ (* Proof of assertion *) apply IHE1_1; assumption. }
subst st'0.
apply IHE1_2. assumption. Qed.
Reasoning About Imp Programs
Theorem plus2_spec : ∀ st n st',
st X = n →
plus2 / st \\ st' →
st' X = n + 2.
Proof.
intros st n st' HX Heval.
Inverting Heval essentially forces Coq to expand one step of
the ceval computation — in this case revealing that st'
must be st extended with the new value of X, since plus2
is an assignment
inversion Heval. subst. clear Heval. simpl.
apply t_update_eq. Qed.
(* FILL IN HERE *)
Theorem loop_never_stops : ∀ st st',
~(loop / st \\ st').
Proof.
intros st st' contra. unfold loop in contra.
remember (WHILE BTrue DO SKIP END) as loopdef
eqn:Heqloopdef.
~(loop / st \\ st').
Proof.
intros st st' contra. unfold loop in contra.
remember (WHILE BTrue DO SKIP END) as loopdef
eqn:Heqloopdef.
Proceed by induction on the assumed derivation showing that
loopdef terminates. Most of the cases are immediately
contradictory (and so can be solved in one step with
inversion).
(* FILL IN HERE *) Admitted.
Fixpoint no_whiles (c : com) : bool :=
match c with
| SKIP ⇒
true
| _ ::= _ ⇒
true
| c1 ;; c2 ⇒
andb (no_whiles c1) (no_whiles c2)
| IFB _ THEN ct ELSE cf FI ⇒
andb (no_whiles ct) (no_whiles cf)
| WHILE _ DO _ END ⇒
false
end.
This predicate yields true just on programs that have no while
loops. Using Inductive, write a property no_whilesR such that
no_whilesR c is provable exactly when c is a program with no
while loops. Then prove its equivalence with no_whiles.
Inductive no_whilesR: com → Prop :=
(* FILL IN HERE *)
.
Theorem no_whiles_eqv:
∀ c, no_whiles c = true ↔ no_whilesR c.
Proof.
(* FILL IN HERE *) Admitted.
Exercise: 4 starsM (no_whiles_terminating)
Imp programs that don't involve while loops always terminate. State and prove a theorem no_whiles_terminating that says this. Use either no_whiles or no_whilesR, as you prefer.(* FILL IN HERE *)
Additional Exercises
Exercise: 3 stars (stack_compiler)
HP Calculators, programming languages like Forth and Postscript and abstract machines like the Java Virtual Machine all evaluate arithmetic expressions using a stack. For instance, the expression(2*3)+(3*(4-2))would be entered as
2 3 * 3 4 2 - * +and evaluated like this (where we show the program being evaluated on the right and the contents of the stack on the left):
[ ] | 2 3 * 3 4 2 - * + [2] | 3 * 3 4 2 - * + [3, 2] | * 3 4 2 - * + [6] | 3 4 2 - * + [3, 6] | 4 2 - * + [4, 3, 6] | 2 - * + [2, 4, 3, 6] | - * + [2, 3, 6] | * + [6, 6] | + [12] |The task of this exercise is to write a small compiler that translates aexps into stack machine instructions.
- SPush n: Push the number n on the stack.
- SLoad x: Load the identifier x from the store and push it on the stack
- SPlus: Pop the two top numbers from the stack, add them, and push the result onto the stack.
- SMinus: Similar, but subtract.
- SMult: Similar, but multiply.
Inductive sinstr : Type :=
| SPush : nat → sinstr
| SLoad : id → sinstr
| SPlus : sinstr
| SMinus : sinstr
| SMult : sinstr.
Write a function to evaluate programs in the stack language. It
should take as input a state, a stack represented as a list of
numbers (top stack item is the head of the list), and a program
represented as a list of instructions, and it should return the
stack after executing the program. Test your function on the
examples below.
Note that the specification leaves unspecified what to do when
encountering an SPlus, SMinus, or SMult instruction if the
stack contains less than two elements. In a sense, it is
immaterial what we do, since our compiler will never emit such a
malformed program.
Fixpoint s_execute (st : state) (stack : list nat)
(prog : list sinstr)
: list nat
(* REPLACE THIS LINE WITH ":= _your_definition_ ." *). Admitted.
Example s_execute1 :
s_execute empty_state []
[SPush 5; SPush 3; SPush 1; SMinus]
= [2; 5].
(* FILL IN HERE *) Admitted.
Example s_execute2 :
s_execute (t_update empty_state X 3) [3;4]
[SPush 4; SLoad X; SMult; SPlus]
= [15; 4].
(* FILL IN HERE *) Admitted.
Next, write a function that compiles an aexp into a stack
machine program. The effect of running the program should be the
same as pushing the value of the expression on the stack.
Fixpoint s_compile (e : aexp) : list sinstr
(* REPLACE THIS LINE WITH ":= _your_definition_ ." *). Admitted.
After you've defined s_compile, prove the following to test
that it works.
Example s_compile1 :
s_compile (AMinus (AId X) (AMult (ANum 2) (AId Y)))
= [SLoad X; SPush 2; SLoad Y; SMult; SMinus].
(* FILL IN HERE *) Admitted.
Exercise: 4 stars, advanced (stack_compiler_correct)
Now we'll prove the correctness of the compiler implemented in the previous exercise. Remember that the specification left unspecified what to do when encountering an SPlus, SMinus, or SMult instruction if the stack contains less than two elements. (In order to make your correctness proof easier you might find it helpful to go back and change your implementation!)Theorem s_compile_correct : ∀ (st : state) (e : aexp),
s_execute st [] (s_compile e) = [ aeval st e ].
Proof.
(* FILL IN HERE *) Admitted.
Exercise: 3 stars, optional (short_circuit)
Most modern programming languages use a "short-circuit" evaluation rule for boolean and: to evaluate BAnd b1 b2, first evaluate b1. If it evaluates to false, then the entire BAnd expression evaluates to false immediately, without evaluating b2. Otherwise, b2 is evaluated to determine the result of the BAnd expression.(* FILL IN HERE *)
Module BreakImp.
Exercise: 4 stars, advanced (break_imp)
Inductive com : Type :=
| CSkip : com
| CBreak : com (* <-- new *)
| CAss : id → aexp → com
| CSeq : com → com → com
| CIf : bexp → com → com → com
| CWhile : bexp → com → com.
Notation "'SKIP'" :=
CSkip.
Notation "'BREAK'" :=
CBreak.
Notation "x '::=' a" :=
(CAss x a) (at level 60).
Notation "c1 ;; c2" :=
(CSeq c1 c2) (at level 80, right associativity).
Notation "'WHILE' b 'DO' c 'END'" :=
(CWhile b c) (at level 80, right associativity).
Notation "'IFB' c1 'THEN' c2 'ELSE' c3 'FI'" :=
(CIf c1 c2 c3) (at level 80, right associativity).
Next, we need to define the behavior of BREAK. Informally,
whenever BREAK is executed in a sequence of commands, it stops
the execution of that sequence and signals that the innermost
enclosing loop should terminate. (If there aren't any
enclosing loops, then the whole program simply terminates.) The
final state should be the same as the one in which the BREAK
statement was executed.
One important point is what to do when there are multiple loops
enclosing a given BREAK. In those cases, BREAK should only
terminate the innermost loop. Thus, after executing the
following...
One way of expressing this behavior is to add another parameter to
the evaluation relation that specifies whether evaluation of a
command executes a BREAK statement:
X ::= 0;;
Y ::= 1;;
WHILE 0 ≠ Y DO
WHILE TRUE DO
BREAK
END;;
X ::= 1;;
Y ::= Y - 1
END
... the value of X should be 1, and not 0.
Y ::= 1;;
WHILE 0 ≠ Y DO
WHILE TRUE DO
BREAK
END;;
X ::= 1;;
Y ::= Y - 1
END
Inductive result : Type :=
| SContinue : result
| SBreak : result.
Reserved Notation "c1 '/' st '\\' s '/' st'"
(at level 40, st, s at level 39).
Intuitively, c / st \\ s / st' means that, if c is started in
state st, then it terminates in state st' and either signals
that the innermost surrounding loop (or the whole program) should
exit immediately (s = SBreak) or that execution should continue
normally (s = SContinue).
The definition of the "c / st \\ s / st'" relation is very
similar to the one we gave above for the regular evaluation
relation (c / st \\ st') — we just need to handle the
termination signals appropriately:
Based on the above description, complete the definition of the
ceval relation.
- If the command is SKIP, then the state doesn't change and
execution of any enclosing loop can continue normally.
- If the command is BREAK, the state stays unchanged but we
signal a SBreak.
- If the command is an assignment, then we update the binding for
that variable in the state accordingly and signal that execution
can continue normally.
- If the command is of the form IFB b THEN c1 ELSE c2 FI, then
the state is updated as in the original semantics of Imp, except
that we also propagate the signal from the execution of
whichever branch was taken.
- If the command is a sequence c1 ;; c2, we first execute
c1. If this yields a SBreak, we skip the execution of c2
and propagate the SBreak signal to the surrounding context;
the resulting state is the same as the one obtained by
executing c1 alone. Otherwise, we execute c2 on the state
obtained after executing c1, and propagate the signal
generated there.
- Finally, for a loop of the form WHILE b DO c END, the semantics is almost the same as before. The only difference is that, when b evaluates to true, we execute c and check the signal that it raises. If that signal is SContinue, then the execution proceeds as in the original semantics. Otherwise, we stop the execution of the loop, and the resulting state is the same as the one resulting from the execution of the current iteration. In either case, since BREAK only terminates the innermost loop, WHILE signals SContinue.
Inductive ceval : com → state → result → state → Prop :=
| E_Skip : ∀ st,
CSkip / st \\ SContinue / st
(* FILL IN HERE *)
where "c1 '/' st '\\' s '/' st'" := (ceval c1 st s st').
Now prove the following properties of your definition of ceval:
Theorem break_ignore : ∀ c st st' s,
(BREAK;; c) / st \\ s / st' →
st = st'.
Proof.
(* FILL IN HERE *) Admitted.
Theorem while_continue : ∀ b c st st' s,
(WHILE b DO c END) / st \\ s / st' →
s = SContinue.
Proof.
(* FILL IN HERE *) Admitted.
Theorem while_stops_on_break : ∀ b c st st',
beval st b = true →
c / st \\ SBreak / st' →
(WHILE b DO c END) / st \\ SContinue / st'.
Proof.
(* FILL IN HERE *) Admitted.
Theorem while_break_true : ∀ b c st st',
(WHILE b DO c END) / st \\ SContinue / st' →
beval st' b = true →
∃ st'', c / st'' \\ SBreak / st'.
Proof.
(* FILL IN HERE *) Admitted.
☐
(WHILE b DO c END) / st \\ SContinue / st' →
beval st' b = true →
∃ st'', c / st'' \\ SBreak / st'.
Proof.
(* FILL IN HERE *) Admitted.
Theorem ceval_deterministic: ∀ (c:com) st st1 st2 s1 s2,
c / st \\ s1 / st1 →
c / st \\ s2 / st2 →
st1 = st2 ∧ s1 = s2.
Proof.
(* FILL IN HERE *) Admitted.
☐
c / st \\ s1 / st1 →
c / st \\ s2 / st2 →
st1 = st2 ∧ s1 = s2.
Proof.
(* FILL IN HERE *) Admitted.
End BreakImp.
Exercise: 4 stars, optional (add_for_loop)
Add C-style for loops to the language of commands, update the ceval definition to define the semantics of for loops, and add cases for for loops as needed so that all the proofs in this file are accepted by Coq.(* FILL IN HERE *)
(* $Date: 2017-07-15 12:37:05 -0400 (Sat, 15 Jul 2017) $ *)


Learning Plan v2
What is your long term goal and/or career pathway?
Same answer as previously. My long term goal is to improve my skills as a Product Designer/Developer and to gain the ability to self-publish projects. Ultimately I would like to build my own products.
What do you think your biggest strengths and limitations will be in Bootcamp?
My strengths remain my curiosity, analytical thought and creativity. After completing Foundations, I think I’m also relatively self aware and can course correct quickly which helps me overcome challenging problems and reevaluate my learning approach. I have a passion for problem solving at every level so even if I’m frustrated, I enjoy the process once I am doing it.
I can also be a terrible procrastinator, and a perfectionist, which makes it worse. During Foundations, I have tried to not over polish some of my work and let “good enough” be enough. I also can feel some background anxiety can cause me to rush through learning exercises and I have to force myself to work more methodically to make sure I am gaining the learning competencies and to make fewer time wasting errors.
What do you think your biggest non-technical challenge at Bootcamp will be?
A core component of my lesson plan will be front loading the course work as much as possible to best stay on top of the course work and not put undue time pressure on myself. This will also let me balance my health to the best of my ability.
What non-technical skills - human skills - would you like to see developed in yourself while at Dev Academy?
I would like to work on my leadership skills and also the giving and receiving feedback, which is such an important part of the development process.
What are your expectations from the Bootcamp team?
To provide a good learning environment for the cohort and to help cultivate a great culture.
What are your expectations of yourself on Bootcamp
To keep on top of my course work by front loading work and identifying blockers as early as possible. To review leaning competencies along the way and to note weaknesses in my understanding to address. If I am blocked or struggling, to reach out to member of my cohort or if necessary, a facilitator. If I’m worried about how I am handling the Bootcamp at a personal level I can discuss this with my Human Skills facilitator at our 1:1.


{% extends 'base.html' %} {% block content %} Welcome to Vaishali Enterprises Est. in '97 We provide Reliable Construction and Renovation solutions. Check out our work {% endblock %}


In Battlegrounds you can purchase crates with your Battle Points (Points you earn after the match). Battle points are given whenever a match ends. The amount of BP gains depends on how far you managed to survive as well as the number of kills and shots that hit another player. Once each crate has been opened, the price of the next crate increases. The crates reset every Sundays at 8pm EST (9pm GMT - 1am IST).


Hoxy: Introduction
Hoxy is a completely free, open source HTTP hacking API for Node.js.
It operates in the same ballpark as Charles or Fiddler.
A few key features:
- Intercept requests and/or responses.
- Observe and alter all aspects of requests/responses.
- Simulate network slowness and latency.
- Supports both direct and reverse proxying.
- Built-in helpers for replacing remote files with local ones.
- Request/response body types: JSON, string, jQuery, buffer, etc.
- Supports both HTTP and HTTPS.
Here are a few ideas for things you could do.
- Replace your Facebook frineds with pictures of unicorns.
- Add bizarre HTTP request headers to confuse server admins.
- Remove ads from web pages for personal browsing.
- Fuzz test your site's load sequence by adding random amounts of latency.
- Test changes in production, without pushing to production.
These docs are for Hoxy 3.x.
See the incantations section for code samples.
How it works
Hoxy functions as a normal proxy standing between the client and server.
You intercept traffic during either the request or response phase, or both.
The phase lifecycle section contains a more complete description, but here's a simplified illustration.
time ==>
-----------------------
server: 3
-------------/-\-------
hoxy: 2 4
-----------/-----\-----
client: 1 5
- Client sends request.
- Hoxy intercepts the request.
- Server receives request and sends response.
- Hoxy intercepts the response.
- Client receives response.


ATTN:Sir/Madam, My name is Mr Michael eze the Manager, Credit and Foreign bills of trust bank of africa limited. I am writing in respect of a foreign customer of my bank with account number 14-255-2004/utb/t whose name is Joung Heasook, Korea who perished in a plane crash[Korean Air Flight 801] with the whole passengers aboard on August 6,1997.And for your perusal you can view thisweb site http://www.cnn.com/WORLD/9708/06/guam.passenger.list Since the demise of this our customer, I personally has watched with keen interest to see the next of kin but all has proved abortive as no one has come to claim his funds of US$25.5M (Twenty Five Million Five Hundred Thoudsand United States Dollars) which has been with my branch for a very long time. On this note, I decided to seek for whom his name shall be used as the Next of Kin as no one has come up to be the next of kin. And the banking ethics here does not allow such money to stay more than eight years, because money will be recalled to the bank treasury as unclaimed after this period. In view of this i will give you 30% of the total. Upon the receipt of your response, I will send you by fax or e-mail the application, bank's fax number and the next step to take.I will not fail to bring to your notice that this business is hitch free and that you should not entertain any fear as all modalities for fund transfer can be finalized within five banking days, after you apply to the bank as a relation to the deceased. When you receive this letter. Kindly send me an e-mail signifying your decision including your private Tel/Fax numbers for quick communication. Yours Sincerely, Mr. Michael eze.


{{ define "title" }}Import Race Weekend{{ end }} {{ define "content" }}
Here you can import Race Weekends in a JSON format (this format matches the format given when you export a Race Weekend). We do not recommend attempting to manually create this data, as the format is quite complex. However if you want to move Race Weekends across servers but don't have file access then you can use this feature!
{{ end }}


|
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Attributes | |
| lazy_init_lock_ | |
| has_peer_ip_ | |
Static Public Attributes | |
| int | has_peer_ip_ = 0 |
| peer_ip_ = None | |
| int | kpeer_ip = 2 |


1. What is Samantha's middle name?
2. What is Maya's lucky number?
3. What is Samantha's favorite T.V show?
4. Who is the shortest one?
5. What is Samantha's favorite snack?
6. How old was Maya when she learned how to swim?
7. Who's Samatha's favorite doctor from Doctor Who?
8. What is Maya's favorite candy?
9. What is Samantha's favorite Michael Jackson song?
10. Who is Maya's favorite person/artist(alive/dead)in the world
Question 1: The correct answer is None.
Question 2: The correct answer is 8.
Question 3: The correct answer is Doctor Who.
Question 4: The correct answer is Maya.
Question 5: The correct answer is Doritos.
Question 6: The correct answer is 12.
Question 7: The correct answer is 10th Doctor.
Question 8: The correct answer is Starburst.
Question 9: The correct answer is Lady in My Life.
Question 10: The correct answer is Michael Jackson.
You answered them all right!


You are currently holding enough tokens to run a Masternode! You receive 33% of the fee someone would otherwise pay into the contract when buying in!
Unit = Tokens.
Unit = Tokens: Be aware that sending tokens immediately withdraws your dividends so they're not lost!


What is it?
Tuesday Hack Night
is New Orleans' premier weekly gathering for programmers, designers,
hardware hackers, and other technically minded folks. It's an
aggressively unstructured way to hack amongst peers, converse about
the vagaries of this or that methodology of developmental arts, or
simply to partake of delicious libations in delightful company.
There's no agenda, no presentations, no requirements, and hackers and
the hacker-curious of all levels are welcome to attend. However, we
do partner with other tech groups every week to expose attendees to a
variety of tech knowledge in the city.
Check out our partners as they present on a monthly rotation in
Ace Hotel's 3 Keys Room!
| Tuesday | Partner |
|---|---|
| 1st | NoFUN |
| 2nd | NOLASec |
| 3rd | GDG New Orleans |
| 4th | #FrontEndParty |
When and Where?
Our soirée happens
every week, on Tuesday, at 6pm!
We have found a permanent home at the
Ace Hotel New Orleans, located at 600 Carondelet St., New Orleans, LA 70130
There are occasional
special events
and
sponsored hack nights.
If you'd like to ensure your punctual notification of such occasions,
please join
the meetup or
register for carrier pigeon message service
so that we might send you telegrams.
It's my first time! What can I expect?
Naught but merriment, hacking, and chatter from 20-40 of your
favorite kind of people, milling about between some handy desks, a
comfortable sofa, and the libation-purveying establishment next door.
You should feel welcome to come, sit down, and
hack quietly amongst peers,
or just as welcome to come, sit down, and
argue about type systems.
Some of our most frequent members had a great experience when they
first arrived with
a question to ask:
"What kind of database should I use for this project?", or "Why should I care about type
systems?", or "I hear about this Ruby on Rails thing: how's it better
than PHP?" These questions, and many more, can be answered for you by
many of our attendees, often vigorously.
If you're shy, one of our fine greeters will be happy to introduce
you to like-minded wizards of analytical enginery, or non-like
minded, for the more pugnacious of you. Just walk up to one of these
fine people and say hello!


tcl-hwloc - Tcl Hwloc Binding
This package is a binding to the Portable Hardware Locality library (short: hwloc), making its functionality available to Tcl scripts.
Information about most of the concepts needed to handle hwloc can be found at its website, in particular at http://www.open-mpi.org/projects/hwloc/doc/v1.2.1/modules.php and equivalent urls for other versions of the underlying package.
Because of this only an abridged summary is provided here, with the expectation that searchers for deeper knowledge will go to the above site.
At the heart of the package is the topology, an object which encapsulates a whole system and its configuration, i.e. the elements it consists of, and their relationships. The latter is modeled as a tree, with the relation of "X is child of Y" meaning "X is (conceptually) contained in Y". This puts the whole system at the top, as the root of the tree, and the most basic processing elements at the bottom, contained in a hierarchy of caches, cpus, sockets, and the like.
This same tree can also be viewed as a matrix, with each row representing a layer of the system, from the processing elements up to the whole system. This second view is especially useful for identifying and adressing each of the elements in the topology, as two numbers are sufficient for this, the depth in the hierachy (counting up while going down from the top), and an index in the layer (counting up from the left).
An important side note here is that all elements in a layer are of the same type, which also allows addressing by type, with the depth implied by it. At least for elements usually existing only in a single layer. A good counter example are caches, which may occupy more than one layer, representing the hierarchy of cache levels in the system.
Beyond simple introspection of the system's configuration the package also enables its user to pin processes and threads to specific parts of the system, either in terms of logical processors, or in terms of memory. The former is more relevant for multi-macore machines, and the latter for NUMA machines. The central concepts there are cpu and (memory) node sets, both of which are represented by (possibly infinite) bitmaps. Conversion between both types is possible, as is going from topology elements to cpu sets.
The main API provides three methods, to retrive version information, create topology instances, and manipulate bitmaps.
This ensemble provides a set of methods for the manipulation of hwloc bitmaps. More details about the individual submethods are available in section Bitmap API.
This method creates a new topology object whose associated instance command has the name object. The creation process can be influenced by a number of options:
This method returns a list containing the names of all valid element types.
This method returns HWloc's API version as its result.
After the creation of a topology instance via hwloc create (see section Class API) the instance command provides the following API and methods:
This method converts from bitmaps representing node sets to cpu sets, and vice versa. The returned result is again a bitmap, in the other domain.
If the -strict option is specified the conversion will punt if the topology describes a non-NUMA system without NUMA nodes, and return an empty CPU or node, respectively.
Otherwise, the default, the conversion will treat the system as a single memory node and use the following heuristics:
If the input set is empty, the result will be emptied as well.
Otherwise the result will be entirely filled.
This method returns the currently set CPU bindings for the current process. The behaviour can be modified by specifying one or more of the options below:
This method returns the CPU where the current thread or process was run last time it executed. Note that the may be outdated, i.e. not be the CPU it is currently running on, as the OS may have shifted it around already according to their binding, as it saw fit. The behaviour can be modified by specifying one or more of the options below:
By default this method binds the current process, assumed to be single-threaded, to the specified cpuset. This is the most portable way of using this method. The behaviour can be modified by specifying one or more of the options below:
This method returns a bitmap describing various types of CPU sets, i.e. subsets of the whole set of logical processors found in the topology.
All allowed processors.
All processors.
All online (aka active processors.
All processors of the system.
This method returns the depth of the topology as an integer value, or the depth at which the elements of the specified type are found. An error is thrown if an invalid type is specified. A negative value, -1 to be precise, is returned if the type is valid but the topology does not contain elements of that type.
This method destroys the topology instance and underlying structures. The result of the method is the empty string.
This method converts the topology into a XML description and stores it in the file path. This description can be loaded into a new topology via
hwloc create X -xml path
The result of the method is the empty string.
This method checks if the instance is a representation of the local system and returns a boolean value, true if the test suceeded, and false otherwise. Related parts in the class API are the option -flags with flag this_system, option -fsroot and option -xml.
This method returns a 2-element list containing the currently set default NUMA bindings and policies for a process and/or thread, in this order. The bindings are represented by a bitmap representing either a nodeset (default) or a cpuset. Its behaviour can be modified by specifying one or more of the options below:
This method sets the default memory binding policy and to prefer the NUMA node(s) specified by the nodeset. This determines which NUMA modes to use when allocating memory. Its behaviour can be modified by specifying one or more of the options below:
The following policies are accepted as legal. Remember however that not all systems support all policies, and attempting an unsupported policy causes errors to be thrown.
Allocate memory on the specified NUMA nodes.
Reset the memory allocation policy to the system default. This is the only policy which is fully portable across systems.
Allocated memory is not immediately bound to a specific locality. Each page in the allocation is individually bound to the local NUMA node of the first thread that touches it, at the time of this touch.
Allocate the memory on the specified nodes in an interleaved / round-robin manner. The precise layout of the memory across multiple NUMA nodes is OS/system specific. Interleaving can be useful when threads distributed across the specified NUMA nodes will all be accessing the whole memory range concurrently, since the interleave will then balance the memory references.
This policy is returned when multiple threads or parts of a memory area have differing memory binding policies. It is not usable for setting a policy.
For each page bound with this policy, the next time it is touched (and next time only), it is moved from its current location to the local NUMA node of the thread where the memory reference occurred (if it needs to be moved at all).
Replicate memory on the given nodes; reads from this memory will attempt to be serviced from the NUMA node local to the reading thread. Replicating can be useful when multiple threads from the specified NUMA nodes will be sharing the same read-only data.
This method returns a bitmap describing various types of numa node sets, i.e. subsets of the whole set of logical memory found in the topology.
All allowed numa nodes.
All numa nodes.
All numa nodes of the system.
This method provides an ensemble of sub-commands enabling navigation in the tree of elements contained in the topology, relative to the element specified by the id. See also method root. Please see section Element Identifiers for details of the syntax used here. Errors are thrown for identifiers not following this syntax, or refering to elements not existing in the topology.
This method returns an integer number, the number of children for the element.
This method, and info below return similar information, this one more human-readable, the other machine-readable, and with a few keys excluded. The result here is a string shell variable assignments, separated by a single space.
This method returns a list of element identifiers, the children of the element. If the element hs no children the result is the empty list.
This method returns a bitmap, one of several CPU sets associated with the element.
All allowed processors.
All processors.
All online (aka active processors.
All processors of the system.
This method returns the depth the element is at. This is, in essence, the first element of its element identifier.
This method returns the element identifier of the first, leftmost child of the element. An error is thrown if the element has no children.
This method, and attributes above return similar information, this one machine-readable, the other more human-readable, and with a few keys more. The result here is a list of pairs, with each pair containing key and vaue, in this order.
This method returns the element identifier of the last, rightmost child of the element. An error is thrown if the element has no children.
This method returns the index of the element in its layer. This is, in essence, the second element of its element identifier.
This method returns a string, the name of the element.
This method returns the identifier of the right sibling of the element, if there is any, or the first child in the next sibling of its parent element. In essence it navigates to the right in its layer without being bound to the children of the current parent. The method throws an error if and only if the element is the last element in its layer.
This method returns the identifier of the right sibling of the element. The method throws an error if the element is the last child in its parent, i.e. does not have a right sibling.
This method returns a bitmap, one of several NUMA node sets associated with the element.
All allowed numa nodes.
All numa nodes.
All numa nodes of the system.
This method returns the identifier of the parent of the element. The method throws an error if the element is the root of the topology.
This method returns the identifier of the left sibling of the element, if there is any, or the last child in the previous sibling of its parent element. In essence it navigates to the left in its layer without being bound to the children of the current parent. The method throws an error if and only if the element is the first element in its layer.
This method returns the identifier of the left sibling of the element. The method throws an error if the element is the first child in its parent, i.e. does not have a left sibling.
This method returns an integer number, the index of the element among the children of its parent.
This method returns a string, the type of the element.
This method is a constructor for element identifiers. Either directly from depth and index, or the depth specified indirectly through the element type. An error is thrown if the intended element does not exist in the topology.
This method returns the identifier for the root element of the topology tree.
This method returns a string, the type of the elements at the specified depth of the topology. An error is thrown if an invalid depth is specified, i.e. either a value less than zero, or greater than the value returned by
topology depth
This method returns an integer value, the number of elements contained in the topology which are of either the named type, or found at the specified depth.
An error is thrown if an invalid depth is specified, i.e. either a value less than zero, or greater than the value returned by
topology depth
Alternatively, an error is also thrown if an invalid type is specified. The value 0 is returned if the type is valid but the topology does not contain elements of that type.
The methods in this section all deal with hwloc bitmaps, which are used to represent sets of nodes, cpus, etc. An important thing to note is that such bitmaps can be infinite, in the sense that a finite header may be followed by an infinite trailer of 1-bits (with no 0-bits anymore).
These two methods return the empty (No bits set) and full (All bits set, infinite) bitmaps, respectively.
These two methods return bitmaps with a single bit unset (allbut) or set (only). The result of allbut is an infinite bitmap. The methods throw an error if a negative id is specified.
This method returns the id of the first set bit found in the bitmap, counting up from bit 0. The method will throw an error if the bitmap is empty, i.e. has no bit set at all.
This method returns the id of the last set bit found in the bitmap, counting up from bit 0. The method will throw an error if the bitmap is either empty, i.e. has no bit set at all, or infinite, i.e. has no defined "last" bit.
This method, like first, returns the id of the first set bit found in the bitmap, however all bits up to and including bit prev are ignored. Negative values for prev are allowed.
The method will throw an error if the bitmap is empty, i.e. has no bit set at all, or if it is empty after bit prev.
The method first is, in essence, the same as next called with "prev == -1", i.e.
[first bitmap] == [next bitmap -1]
This method takes an unsigned integer and converts it into a bitmap, based on the integer's binary representation. The LSB is mapped to bit 0 of the bitmap.
This method is the complement to from_ulong, converting the bitmap into an unsigned integer value represented by the bits of the map.
These two methods test if the specified bitmap is either the empty or the full bitmap, i.e. no bits sets vs. all bits set, respectively. The result of the methods is a boolean value, true if the test succeeds, and false otherwise.
This method takes the bitmap, inverts all bits, and returns this as its result.
This method is similar to first, except that its result is a bitmap, not a bit number, and it accepts the empty bitmap. In the resulting bitmap all bits but the first set bit of the input are unset. If the input is empty the output is simply empty as well.
This method counts the number of set bits in the specified bitmap and returns this as its result. The method will throw an error if the bitmap is infinite, i.e. has not a bounded weight.
These four methods perform standard bitwise operations on the two bitmaps, returning the operations' result. See the following mapping to C expressions:
and A B == A & B andnot A B == A & ~B or A B == A | B xor A B == A ^ B
This method tests if the two specified bitmaps are equal in all respects. The result of the method is a boolean value, true if the bitmaps are equal, and false otherwise.
This method tests if bitmapsub is a subset of bitmapsuper. The result of the method is a boolean value, true if the bitmap is a subset, and false otherwise.
These two method compare the two bitmaps by comparing the last and first set bits respectively. The result of the methods are the difference between the ids of these bits. The empty bitmap is treated as if it had bit -1 set.
This method tests if the two specified bitmaps intersect with each other, i.e if the result of and'ing them together is not empty. The result of the method is a boolean value, true if the bitmaps have a non-empty intersection, and false otherwise.
These three methods set, unset, and test the bits in a bitmap. The first two methods return the modified bitmap as result, whereas the last returns a boolean value, true if the bit is set, and false otherwise. The methods throw an error if a negative id is specified.
These two methods are extensions of the modifiers in the previous group from single bits to bit ranges. The range of bits to set or clear is specified by two bit ids. The methods return the modified bitmap as their result. The methods throw an error if a negative id is specified, for either begin or end. Specifying an end < begin is acceptable however, this specifies an empty range and the method will return the unmodified bitmap.
As explained in section Concepts in more detail, the elements of a topology instance are organized in a combination of tree and matrix, with the tree structure providing the information about nesting (containment), and the matrix providing direct addressability.
The element identifiers used by the package are based on the latter, identifying each element by depth and index in that layer. A valid element identifier follows the rules below:
It is a list containing exactly two elements.
Each element is an integer number.
The first element is the depth of the element in the topology, counted from 0, with 0 refering to the topmost layer, the root layer, and increasing as we move deeper down. The maximum allowed value is one less than the result of the instance method depth (without arguments).
The second element is the index of the element in its layer, counted from 0, with 0 refering to the leftmost element, and increasing as we move to the right. The maximum allowed value is one less than the result of the instance method width for the specified depth.
beowulf, binding cpu, binding memory, cache, cpu binding, hardware Locality, hwloc, memory binding, multi-core, numa, parallel, portable hardware locality, process, processing unit, thread
Copyright © 2011 George Andreou, Andreas Kupries
Copyright © 2011 Documentation, Andreas Kupries


Tonight's meetup is kindly sponsored by:
Europe's largest music festival platform, and UK's 6th fastest growing private tech start up.
Transforming the way music fans discover, book tickets and travel packages for festivals around the world.
We help people to feel happier and more self-confident, by making it easy to dress well, using stylists and data science. Dedicated to maintaining a great working environment, minimising politics and maximising impact.
The trusted global platform that inspires and enables people to experience the best of the city. Operating in 107 cities, across 39 countries, it has an average monthly global audience reach of over 111 million across all platforms.
We turn word of mouth into your best sales channel.
2.1.2 fixes a password hash disclosure
https://www.djangoproject.com/weblog/
David Seddon —
“Lint Your Architecture”
Charalampos Papaloizou —
“My Experience on Using Postgresql in Production for a Data Heavy Project”
The Space Bar until ~20:45
Migrate to the Red Lion Pub (opposite)
Please come and chat with us!
Come and grab a sticker after the talks.
Pink: I want to hire
Yellow: the shining sun of availability
Website: https://djangolondon.com
Twitter: @djangolondon
Github: https://github.com/djangolondon/


Hello, my name is Aarón Ojeda and I am a computer engineer. After some data mining projects, I decided to focus on the field I love the most: video games.
I started by making my Computer Science Engineer's Degree thesis about 2D platformers. In the meantime I worked as a teacher imparting GameMaker workshops and out of school activities.
I graduated in 2017 and after that I got a job in a game development company where I was working in two different projects. Right now I am looking for new opportunities in the industry.
CV


24 hours service.
Create Job
Take care of patients with patience.
Solution no matter what
New invention of era
We create lives
Neat and tidy organizers


--- title: Create Proper HTML Link | URL Tools layout: post ---
{% include common-meta %}This is a free online tool to create simple HTML link code from an existing URL. The input to this tool is a valid url and optional link text. Output of this tool is an updated HTML code that can be used as valid HTML.
A HTML link is simple way to add a web page URL on a website.
The link text field is optional.
If you do not provide the link text we will default it to 'click here'
Yes, you can select the link type option to create dofollow and nofollow links.
The default value for link is dofollow, this will not be added in the code since it is
default browser behavior when rel
is not present.
To create a link that opens in new window you need to select the 'Link Open' option value of
'New Window/Tab' that corresponds to html attribute target='_blank'
You can use these links to share on social media, blog or in emails. You can also add them to your website or in blog comments.
There are many affiliate websites that may pay you for sharing a web page.


@* * Copyright 2023 HM Revenue & Customs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *@ @import uk.gov.hmrc.thirdpartydeveloperfrontend.domain.models.developers.DeveloperSession @import uk.gov.hmrc.thirdpartydeveloperfrontend.domain.models.views.BackButtonWithJavaScript @import uk.gov.hmrc.apiplatform.modules.submissions.controllers.TermsOfUseResponsesController.TermsOfUseResponsesViewModel @import uk.gov.hmrc.apiplatform.modules.submissions.views.html.includes.answersFragment @import include._ @this(devMain: DevMain) @(model: TermsOfUseResponsesViewModel, error: Option[String])(implicit request: play.api.mvc.Request[Any], loggedIn: DeveloperSession, messagesProvider: MessagesProvider, appConfig: ApplicationConfig) @title = @{"Terms of use responses"} @devMain( title = title, userFullName = loggedIn.loggedInName, back = BackButtonWithJavaScript, developerSession = Some(loggedIn) ) {


Below you'll find the changes each version brings. Feel free to report bugs or suggest changes through a Pull request. If you are already using Headstart but plan on upgrading, check out the Upgrading page. If you want to know where this project is heading, visit the Roadmap page.
1.1.3
- Fixed installation bug.
- Reintroduced conditional comments.
- IE scripts now get separated based on where they need to be used (header or end of body).
1.1.2
- Fixed the bug that prevented the live-reloading after a Sass error occurred.
1.1.1
- Made Uncss optional as it usually needs configuration to work correctly.
1.1.0
- Uncss was added to the production mode
- Image optimization was moved to production mode
- New documentation
- Better templating through Handlebars
1.0.0
Initial release.


Today i will build this website.I might make 2 websites .It might take many days to make 3 websites.
Look around .Anything might happen.


Unlimited Features, How does YourDriver work?
First, you must download our YourDriver application on IOS or Android cell phones, then,
once register you will be able to request a driver with a click, your App displays an estimated
time of arrival and you will be able to see the cost of the service; the nearest driver will
receive your request and go to the place where you are. At the time of the meeting the driver
will proceed to show you his/her license to identify him/herself.


Folders
<parent>
3-terrarium
6-space-game
quiz-app
1-getting...essons
4-typing-game
7-bank-project
sketchnotes
2-js-basics
5-browser...ension
lesson-template
Folders: 11


reposync
Section: (1)Updated: 27 April 2007
Index Return to Main Contents
NAME
reposync - synchronize yum repositories to a local directorySYNOPSIS
reposync [options]DESCRIPTION
reposync is used to synchronize a remote yum repository to a local directory, using yum to retrieve the packages.OPTIONS
- -h, --help
- Display a help message, and then quit.
- -c CONFIG, --config=CONFIG
- Config file to use (defaults to /etc/yum.conf).
- -a ARCH, --arch=ARCH
- Act as if running the specified arch (default: current arch, note: does not override $releasever).
- --source
- Also download .src.rpm files.
- -r REPOID, --repoid=REPOID
- Specify repo ids to query, can be specified multiple times (default is all enabled).
- -t, --tempcache
- Use a temp dir for storing/accessing yum-cache.
- -p DESTDIR, --download_path=DESTDIR
- Path to download packages to: defaults to current directory.
- -g, --gpgcheck
- Remove packages that fail GPG signature checking after downloading.
- -u, --urls
- Just list urls of what would be downloaded, don't download.
- -n, --newest-only
- Download only newest packages per-repo.
- -q, --quiet
- Output as little information as possible.
EXAMPLES
- Sync all packages from the 'updates' repo to the current directory:
- reposync --repoid=updates
- Sync only the newest packages from the 'updates' repo to the current directory:
- reposync -n --repoid=updates
- Sync packages from the 'updates' and 'extras' repos to the current directory:
- reposync --repoid=updates --repoid=extras
- Sync all packages from the 'updates' repo to the repos directory:
- reposync -p repos --repoid=updates
FILES
reposync uses the yum libraries for retrieving information and packages. If no configuration file is specified, the default yum configuration will be used.
/etc/yum.conf /etc/yum/repos.d/
SEE ALSO
yum.conf (5) http://yum.baseurl.org/
AUTHORS
See the Authors file included with this program.
BUGS
There are of course no bugs, but should you find any, you should first consult the FAQ section on http://yum.baseurl.org/wiki/Faq and if unsuccessful in finding a resolution contact the mailing list<EMAIL_ADDRESS>To file a bug use http://bugzilla.redhat.com for Fedora/RHEL/Centos related bugs and http://yum.baseurl.org/report for all other bugs.
Index
This document was created by man2html, using the manual pages.
Time: 05:29:10 GMT, December 24, 2015


Don't mess with Max. Forget about a sense of humor. He's nothing but business all the way and will do whatever it takes to get the job done. He takes his catnip very seriously and never EVER shares.
Zorum doesn't know what patience is. He wants what he wants, when he wants it. Get in his way and you could be in for a healthy dose of trouble. He never cuts his claws, so what out.
She's just as bad the the boys. Don't get on her bad side. It would be the biggest mistake of your life. Treat her with respect and you'll be golden; watch out if you decide otherwise...
The look says it all. You know at first site when you've crossed paths with a badass feline. Without the look, the rest means nothing.
Attitude is everything. It backs up the look and defines how truly badass a feline you are.
If you don't have the guts then the rest doesn't matter. Having the guts isn't easy, but nothing worth doing ever is.
A Fierce Competitor
Has a real dark side
Don't cross his path
Nothing is going to get in the way of these soon-to-be, badass felines. They've worked very hard to reach the top, so stay clear of their paths or you could feel their rath.


There are kids today in this country who go without student lunches. This app allows schools to broadcast the needs of their students by declaring an amount of donations that they would need to be fullfilled in order to provide lunches for those that go without.
Luncher provides a unique opprotunity to help, not just children from all over the world but those in schools on your block too. Luncher seeks to address the issue of child hunger directly, by allowing users to donate to a school in need. This means you can donate to any school, in any state, at any time. Our schools have kids that need your help, sign up or log in today and help make a difference.
Create an account, and in seconds you could provide a meal to a child in need, its free and easy to use! were accesible on phones, tablets, and regular desktop so theres no reason not to start making a difference today! We promise 100% of funds you donate will go directly to the school you chose to sponser, Luncher is a non-profit organization and our mission is to make a difference not a profit!


Templates are .txt Files inside the Templates Folder
Custom Script Templates -> Settings -> Templates
The most important tag is #SCRIPTNAME#.
This is the placeholder for the name you give the File.
The #NAMESPACE#-tag is optional.
When you put it in the Template, it will insert your Projects root Namespace at that line,
Edit -> Project Settings -> Editor -> Root namespace
or the Namespace of the next Assembly Definition File in your Project.
(Aseembly Definition Reference also works)
If your Project or the Assembly Definition File doesn't have a root Namespace set, the tag will be removed on File creation.
So you can just leave the Tag in the Template, it won't break anything.
You can also set a custom Namespace, regardless if you have a root Namespace set.
#NAMESPACE#CustomNamespace#
Just write the name of the Namespace after the #NAMESPACE#-tag and end the line with a #
Both tags, #SCRIPTNAME# and #NAMESPACE# have to be upper case and be in between 2 #
You can write anything inside a Template, from using statements to Methods, everything works!


View the demo of the state machine: state machine of order
View the demo of making an order: Make order
View the complete demo of making an order, together with states of commodities: Make order
View a more complete demo of the order system: Make order


Welcome to Mister Rogers Neighborhood.
(It's a beautiful day in the neighborhood)
Enter a number below and see the result:
Show me!


Answer the opinion poll:
Poll
Is jQuery UI the greatest JavaScript extensions library in the universe?
Yes!
No!


In March 2020, UC Berkeley implemented a universal pass/no pass, or P/NP, policy for the semester, setting a campus precedent for an adjusted grading system during remote schooling. Adjustments were extended through fall 2020 and spring 2021, with various differences between colleges. Despite the worsening pandemic, grading policies for Summer 2020 and part of Fall 2020 continued as usual until campus administrators adjusted to student concerns.


Air cabin crew Flight attendant
Air cabin crew help make sure that airline passengers have a comfortable, safe and pleasant flight.
1. How to become air cabin crew
To work as air cabin crew you'll usually need:
- to be at least 18, or 21 for some airlines
- GCSEs at grades 9 to 4 (A* to C) in maths and English, or an equivalent level of qualification
- a good level of fitness
- colour-normal vision
- a smart appearance
- a valid passport with no restrictions for the countries the airline travels to
- to pass a medical
Many airlines also ask that you’re able to swim up to 25 metres.
There are rules about height and weight, which vary between airlines. As a general guide, many look for people between 5ft 2in (157cm) and 6ft 2in (188cm).
Entry is very competitive but it’ll help if you:
- speak a second language
- have customer service experience
- have either health, food technology or care qualifications
You could do a college course in aviation or air cabin crew.
You may be able to get financial help to do a college course.
2. Skills
You'll need:
- excellent communication skills
- a polite but firm approach
- the ability to be calm under pressure
- number skills for handling money
- team-working skills
3. What you'll do
You day-to-day work will vary, but will usually include the following.
Before a flight:
- going to a meeting about the flight and its schedule
- checking that there are enough supplies on the plane and that emergency equipment is working properly
- greeting passengers
- demonstrating emergency equipment and procedures
During a flight:
- making sure passengers are comfortable
- serving food and drinks, and selling duty-free items
- making announcements
- reassuring passengers in the event of an emergency, and making sure they follow safety procedures
At the end of a flight:
- making sure passengers leave the plane safely
- writing a flight report, including about any unusual incidents
- adding up and recording food and drink orders, and duty-free sales
4. Salary
Starter: £12,000 to £14,000
Experienced: £15,000 to £21,000
Highly Experienced: £30,000
Your salary could increase with overtime and flight allowances.
Some airlines offer free or discounted flights to cabin crew staff and their families.
These figures are a guide.
5. Working hours, patterns and environment
You'll work shifts that include weekends, nights and public holidays. The amount of time you'll spend away from home will depend on the flight routes you choose to work on.
The work can be physically demanding, and you'll spend time working in small spaces like the kitchen galley.
The airline will provide you with a uniform.
6. Career path and progression
With experience, you could progress to cabin crew supervisor or a senior air cabin crew role.
You could also work in a ground-based role like cabin crew training, recruitment, passenger services, marketing or sales.
Related careers
You may be interested in:
7. Current opportunities
Apprenticeships In England
There are no apprenticeships for air cabin crew available at the moment.
Find other apprenticeships near youTraining courses In England
Level 2 Diploma in Air Cabin Crew
- Provider: WAKEFIELD COLLEGE
- Start date: 01 September 2016
- Location: Liverpool
Air Cabin Crew, Diploma - City & Guilds
- Provider: CITY COLLEGE PLYMOUTH
- Start date: 01 September 2017
- Location: Preston
Last updated: 23 March 2016


2.5 hello?---[help_!] Looks like somehting went wrong in the simulation..5Look around with your mouse or device..5Just don't get lost,you may not come back \\


{{projectTitle}}
{{uploadTime}}
view:{{viewCount}} like:{{likeCount}}
{{like_text}}
{{bookmark_text}}
Tag
{{tag}}
Description
{{section.title}}
Related File
{{fileName}}
Leave a Comment:
Submit
{{comment.user}}
{{comment.content}}
{{comment.time}}
{{authorName}}
{{follow_text}}
You may also like
{{project.projectName}}
Views: {{project.views}}
No Project Found
Table of Content
Tags
Description
Related Files
Comments
>
{{comment.user}}
{{comment.content}}
{{comment.time}}


{% extends 'newsroom/article_list.html' %}
{% block title %}
GroundUp: South African news that matters
{% endblock %}
{% block article-list %}
{% include 'blocks/blocks.html' with blocks=topblocks%}
{% if page_obj.has_previous or article_list.0.stickiness == 0 %}
{% include 'newsroom/list.html' with articles=article_list include_image="1" include_summary="1" md_size="12" %}
{% else %}
{% with article_list.0 as article %}
{% with article_list|slice:"1:" as articlelist %}
{% include 'newsroom/list.html' with articles=articlelist include_image="1" include_summary="1" md_size="12" %}
{% endwith %}
{% endif %}
{% include 'paginator.html' %}


|
| | Timers () |
| | Nothing to do for the constructor. More...
|
| |
| std::map< std::string, timeval > & | GetAllTimers () |
| | Returns a copy of all the timers used via this interface. More...
|
| |
| timeval | GetTimer (const std::string &timerName) |
| | Returns a copy of the timer specified. More...
|
| |
| void | PrintTimer (const std::string &timerName) |
| | Prints the specified timer. More...
|
| |
| void | StartTimer (const std::string &timerName) |
| | * Initializes a timer, available like a normal value specified on * the command line. More...
|
| |
| void | StopTimer (const std::string &timerName) |
| | * Halts the timer, and replaces it's value with * the delta time from it's start * *. More...
|
| |
|
| std::map< std::string, timeval > | timers |
| |
Definition at line 97 of file timers.hpp.
| mlpack::Timers::Timers |
( |
| ) |
|
|
inline |
Nothing to do for the constructor.
Definition at line 101 of file timers.hpp.
| void mlpack::Timers::FileTimeToTimeVal |
( |
timeval * |
tv | ) |
|
|
private |
| std::map<std::string, timeval>& mlpack::Timers::GetAllTimers |
( |
| ) |
|
Returns a copy of all the timers used via this interface.
| void mlpack::Timers::GetTime |
( |
timeval * |
tv | ) |
|
|
private |
| timeval mlpack::Timers::GetTimer |
( |
const std::string & |
timerName | ) |
|
Returns a copy of the timer specified.
- Parameters
-
| timerName | The name of the timer in question. |
| void mlpack::Timers::PrintTimer |
( |
const std::string & |
timerName | ) |
|
Prints the specified timer.
If it took longer than a minute to complete the timer will be displayed in days, hours, and minutes as well.
- Parameters
-
| timerName | The name of the timer in question. |
| void mlpack::Timers::StartTimer |
( |
const std::string & |
timerName | ) |
|
* Initializes a timer, available like a normal value specified on * the command line.
Timers are of type timeval. If a timer is started, then stopped, then re-started, then stopped, the final timer value will be the length of both runs of the timer. * *
- Parameters
-
| timerName | The name of the timer in question. |
| void mlpack::Timers::StopTimer |
( |
const std::string & |
timerName | ) |
|
* Halts the timer, and replaces it's value with * the delta time from it's start * *.
- Parameters
-
| timerName | The name of the timer in question. |
| std::map<std::string, timeval> mlpack::Timers::timers |
|
private |
The documentation for this class was generated from the following file:


| LLVM 1.0 Release Notes |
Written by Chris Lattner
| Introduction |
For more information about LLVM, including information about potentially more current releases, please check out the main web site. If you have questions or comments, the LLVM developer's mailing list is a good place to send them.
| What's New? |
The default optimizer sequence used by the C/C++ front-ends is:
At link-time, the following optimizations are run:
At this time, LLVM is known to work properly with SPEC CPU 2000, the Olden benchmarks, and the Ptrdist benchmarks among many other programs. Note however that the Sparc and X86 backends do not currently support exception throwing or long jumping (including 253.perlbmk in SPEC). For these programs you must use the C backend.
| Portability and Supported Platforms |
| Known Problems |
for (i = 0; i != 1000000; ++i) { int X[n]; foo(X); }
The following GCC extensions are partially supported. An ignored attribute means that the LLVM compiler ignores the presence of the attribute, but the code should still work. An unsupported attribute is one which is ignored by the LLVM compiler, which will cause a different interpretation of the program.
The following extensions are known to be supported:
typeof
: referring to the type of an expression.
?:
, ",
" and casts in lvalues.
?:
expression.
void
-pointers and function pointers.
\e
stands for the character <ESC>.
__const__
, __asm__
, etc., for header files.
enum foo;
, with details to follow.
If you run into GCC extensions which have not been included in any of these lists, please let us know (also including whether or not they work).
| Additional Information |
If you have any questions or comments about LLVM, please feel free to contact us via the mailing lists.


Identification of tumor antigens associated with PAAD prognosis. a) Potential tumor antigens (total 926) with high expression and mutation in PAAD, and significant association with OS and RFS (total 7 candidates). b- g Kaplan-Meier curves showing OS of PAAD patients stratified on the basis of ( b) ADAM9, ( c) EFNB2, ( d) MET, ( e) TMOD3, ( f) TPX2 and ( g) WNT7A expression levels


genes XTNX gene plant NBS-LRR land Plant different data TIR genes. species Shao clade expression {border-style NBS analysis genes, motifs conserved domain plants px;} #ffffff;} detected resistance TNL genome identified Arabidopsis IIa Supplementary disease duplication Table evolutionary motif Figure additional ancient occurred phylogenetic plants. revealed Click LINK clades file. lineages subclade Genes IIb divergence duplications evolution functional green resulted Liu Wang amino common genomes protein proteins sequence species, Biol. domains family loss recent truncated Science Sun Xue acid b). lost px; rounds suggesting tissues versus {font-family Evol. Mol. ancestor containing dicot diverged events example, families font-size function lineage pathogen polyploidization sequences suggests thaliana used Analysis China Clade However, Meyers Nandety Phylogenetic angiosperm angiosperms copy derived double; evolved genomes. maximum number observed present repeat studies study (clade Divergence Evolution FIGURE Furthermore, Hang IIb. Physiol. TABLE Van WGD/WGT Zhang Zhou algae alignment border-color border-width clades. collinearity conservative difference duplicated effector expansion frequent including involved lineage-specific motifs, nucleotide-binding origin originated pattern retained separation shows solid; species. total tree type undergone underwent using {font-style {font-weight ./pp.. Cell Collier Conserved Expression GRMZMG Gene Genome IIb, Motif Nishimura Peer Proc. Sci. TIR-NBS Zea analyzed ancestral annotated article background basal biological bold contrast, courier; defense distinct domains, early em; encoding event expressed functions genome. genomes, immunity independent indicated indicates intact intron length monocot nearly obtained online performed plants, presence prior pt;} result seven site-leucine-rich soon soybean, structure subclades suggest supported tandem


--- layout: post title: How to get NetBSD running on your Sega Dreamcast game console ---
Josh Tolbert <hemi at puresimplicity dot net> recently put together a lot of stuff related to the NetBSD/dreamcast port and created an easy to install NetBSD Dreamcast system along with a short introduction on how to setup your Dreamcast and what need to be done to increase the usuability of the NetBSD/dreamcast port (for now, focus on wscons(4) support for the Dreamcast framebuffer and getting POSIX threads to work). Josh's How-To and all stuff needed to get NetBSD working on your Dreamcast can found here.


GA account: {{.Account}}
Beacon Referrer: {{.Referer}}
Setup instructions: https://github.com/igrigorik/ga-beacon