Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d912a890 authored by PECHOUX Romain's avatar PECHOUX Romain
Browse files

examples revised

parent ae7e0575
No related branches found
No related tags found
No related merge requests found
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Point { class Point {
int x; int x;
int y; int y;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Exe { class Exe {
int f(int a, int b) { int f(int a, int b) {
int res = a; int res = a;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class BList { class BList {
boolean value; boolean value;
BList tail; BList tail;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Point1D { class Point1D {
int x; int x;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class List { class List {
int data; int data;
List next; List next;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class List { class List {
int data; int data;
List next; List next;
...@@ -45,9 +47,6 @@ class UList extends List { ...@@ -45,9 +47,6 @@ class UList extends List {
return res; return res;
} }
//public List getNext() {
// return new List(0, null);
//}
} }
class UselessList extends List { class UselessList extends List {
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class List { class List {
int data; int data;
List next; List next;
...@@ -73,7 +75,8 @@ class Exe { ...@@ -73,7 +75,8 @@ class Exe {
if(l.getData() > 0) { if(l.getData() > 0) {
while (true) {} while (true) {}
} }
//the sum block types in 1, and it's result is 0 thus it cannot be used inside a conditional //the sum block types in 1, and it's result is 0 thus it cannot be used inside a conditional.
//This would break the control flow discipline.
if(l.sum() > 0) {} if(l.sum() > 0) {}
} }
} }
\ No newline at end of file
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Exe { class Exe {
void add(int a, int b) throws Exception { void add(int a, int b) throws Exception {
a = a + b; a = a + b;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Node { class Node {
Node left; Node left;
Node right; Node right;
......
...@@ -11,7 +11,9 @@ class Exe { ...@@ -11,7 +11,9 @@ class Exe {
x = x - 1; x = x - 1;
y = y + 1; y = y + 1;
} }
//The #declass tag implements declassification mechanism.
//Below a variable y of tier 0 is declassified to tier 1
//Hence it can be used in a while loop again.
#declass #declass
y; y;
x; x;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Point { class Point {
int x; int x;
int y; int y;
...@@ -13,8 +15,6 @@ class Point { ...@@ -13,8 +15,6 @@ class Point {
public Point(int x, int y) { public Point(int x, int y) {
this.x = x; this.x = x;
this.y = y; this.y = y;
// this.getX();
} }
} }
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Exe { class Exe {
int max(int a, int b) { int max(int a, int b) {
int<0> res = b; int<0> res = b;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Exe { class Exe {
int x; int x;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Exe { class Exe {
int sum(int i) { int sum(int i) {
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Exe { class Exe {
int max(int a, int b) { int max(int a, int b) {
int<0> res = b; int<0> res = b;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Ring { class Ring {
boolean data; boolean data;
Ring next; Ring next;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class BList { class BList {
boolean value; boolean value;
BList tail; BList tail;
......
//Tiers can be forced by the programmer using the syntax "type<tier> var;", e.g. "int<0> x;".
class Exe { class Exe {
int sum(int i) { int sum(int i) {
int res = i; int res = i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment