- changed milestone to Later
Syntactische suiker
Sets - arrays - lists Binary quantifiers Type definitions (UNA) Renaming symbols and blocks Boolean equality Object-oriented flavour (object with fields) If-then-else
one = ?1 lone = ?<2 no = ~? algemene "implies" => ?x: P(x) | Q(x) = ?x: P(x) & Q(x) !x: P(x) | Q(x) = !x: P(x) => Q(x)
#{P} = 3 => het totaal aantal tupels dat aan P voldoet is drie
structure for 3 of all => alle types hebben drie elementen
Voorstel voor sets-arrays-lists: type elem type tuple<elem, elem> elemtuple type set<elemtuple> elemset type array<elemset> elemsetarray
P(elemsetarray)
zou gecompileerd kunnen worden naar
type elem
type int tuple partial first(tuple): elem partial second(tuple): elem
type int elemset type int essize contains(elemset, tuple) size(elemset): essize //size of set, nb of elements it contains
type int elemsetarray type int esaindex partial contains(elemsetarray, esaindex): elemset //array[index] -> elemset size(elemsetarray): esaindex //size of array (beyond is empty)
P(elemsetarray)
//Constraints constraint on the arraysize constraint on the set size
Comments (7)
-
-
Other requested syntactic sugar:
"and" -> "&"
"or" -> "|"
"not" -> ""
"implies" -> "=>"
"if" -> "<="
"iff" -> "<=>"
"forall" -> "!"
"exists" -> "?"
"in <predicate>" -> "[<predicate>]"
Also, it would be nice if variables could be separated by a comma in a quantifier expression. That is, allow
forall x in S, y in U:
as syntactic sugar for
!x[S] y[U]:
-
reporter Opemerking: Indien dit gefixed wordt, moet de Eclipse plugin ook aangepast worden!
-
Refs #29: Variables can now be comma separated.
→ Wiki macro error: Changeset df1e58fe25bf not found.
-
Refs #29: Variables can now be comma separated.
-
Allow ( ) around sets of variables. E.g. for queries it is quite natural to write { (x,y) : ... }
-
- removed milestone
Removing milestone: Later (automated comment)
- Log in to comment