type __->?__ : -Type -> +Type -> Type
%% nested pairs are different from n-tupels (n > 2)
type __*__ : +Type -> +Type -> Type
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% "pred p args = e" abbreviates "op p args :? unit = e"
%% CASL requires "<=>" for pred-defn and disallows "()" as result
%% def is also total (identical to tt)
%% tt is total "op tt(x: s): unit = ()"
type __->__ : -Type -> +Type -> Type
op __res__(x : s; y : t) : s = x;
op fst(x : s; y : t) : s = x;
program snd (x : s, y : t) : t = y;
%% trivial because its the strict function property
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
. (\ x : s . eq (x, x)) = tt
. (\ (x, y : s) . x res eq (x, y))
= \ (x, y : s) . y res eq (x, y);
%% notation "\ ." abbreviates "\bla:unit."
%% where "bla" is never used, but only "()" instead
%% an implicit cast from s to ?s of a term "e" yields the term "\ . e"
%% the cast from ?s to s is still done manually here (for the strict "und")
%% use "And" instead of "und" to avoid cast from "?unit" to "unit"
%% the type instance for the first "eq" should be "?t"
%% this is explicitely enforced by "\ .f(x)"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Recursion (requires "free type nat ::= 0 | Suc(nat)" and "+"
pred isChain : forall c : Cpo . nat -> c
pred isBound : forall c : Cpo . c * (nat -> c)
op sup : (nat -> c) ->? c
program __ <<=[f] __ = eq;
type instance __*__ : +Cpo -> +Cpo -> Cpo
vars x1, x2 : c; y1, y2 : d
type instance __*__ : +Pcpo -> +Pcpo -> Pcpo
type instance __-->?__ : -Cpo -> +Cpo -> Pcpo
type instance __-->__ : -Cpo -> +Cpo -> Cpo
program f <<= g = f <<=[c -->? d] g;
type instance __-->__ : -Cpo -> +Pcpo -> Pcpo
Y ((\ x' : c --> p . x') as (c --> p) --> c --> p);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
free type bool ::= true | false
__*__ : +Pcpo -> +Pcpo -> Pcpo;
__-->__ : -Cpo -> +Pcpo -> Pcpo;
__-->?__ : -Cpo -> +Cpo -> Pcpo;
op Y : forall p : Pcpo . (p --> p) --> p %(fun)%
op __<<=__ : forall c : Cpo . c * c ->? Unit %(pred)%
op def : forall s : Type . Pred s %(op)%
op eq : forall s : Type . s * s ->? Unit %(pred)%
op fst : forall s : Type; t : Type . s * t -> s
%[op= \ ((var x : s), (var y : t)) .! (var x : s)]%
op isBound : forall c : Cpo . c * (nat -> c) ->? Unit %(pred)%
op isChain : forall c : Cpo . (nat -> c) ->? Unit %(pred)%
op not : Unit ->? Unit %(pred)%
op snd : s * t ->? t %(op)%
op sup : forall c : Cpo . (nat -> c) ->? c %(op)%
op tt : forall s : Type . Pred s %(op)%
op undefined : forall p : Pcpo; c : Cpo . c --> p
(fun Y : forall p : Pcpo . (p --> p) --> p)
((\ x' : c --> p . (var x' : c --> p)) as (c --> p) --> c --> p)
program def = \ x : s . () %(pe_def)%
program tt = \ x : s . () %(pe_tt)%
forall x : s; y : t . x res y = (x as s)
forall x : s; y : t . fst (x, y) = (x as s)
program (var snd : s * t ->? t) (x, y : t) : t = y %(pe_snd)%
forall s : Type . (\ x : s . eq (x, x)) = tt
. (\ (x : s, y : s) . x res eq (x, y))
= \ (x : s, y : s) . y res eq (x, y)
program __ <<=[f] __ = eq %(pe___<<=__)%
program f <<= g = f <<= g %(pe___<<=__)%
forall p : Pcpo; f : p --> p . f (Y f) = Y f
forall p : Pcpo; f : p --> p; x : p . f x = x => Y f <<= x
= (Y ((\ x' : c --> p . x') as (c --> p) --> c --> p) as c --> p)
free type bool ::= false | true %(ga_bool)%
### Warning 4.7, void universe class declaration 'Type'
### Hint 6.5, is type variable 's'
### Hint 6.7, is type variable 't'
### Hint 11.6, redeclared type 'Unit'
*** Error 14.11, illegal type pattern argument '__'
*** Error 15.8, illegal type pattern argument '__'
ignoring declaration for builtin identifier 'true'
ignoring declaration for builtin identifier 'false'
ignoring declaration for builtin identifier '__/\__'
ignoring declaration for builtin identifier '__\/__'
ignoring declaration for builtin identifier '__=>__'
ignoring declaration for builtin identifier '__if__'
ignoring declaration for builtin identifier '__<=>__'
ignoring declaration for builtin identifier '__=__'
### Hint 27.8, redeclared type '__->?__'
### Hint 30.8, redeclared type '__*__'
*** Error 31.6-31.12, illegal type pattern '__ * __ * __'
### Hint 40.7, not a class 's'
### Hint 42.16, rebound variable 'x'
repeated declaration of 'def' with type 'Pred s'
### Hint 44.15, rebound variable 'x'
repeated declaration of 'tt' with type 'Pred s'
*** Error 46.11, unexpected mixfix token: und
### Hint 50.8, redeclared type '__->__'
### Hint 52.8, redeclared type '__->__'
### Hint 52.18, repeated supertype '__->?__'
*** Error 54.6, unexpected mixfix token: :
### Hint 58.13, rebound variable 'x'
ignoring declaration for builtin identifier '__res__'
### Hint 59.9, rebound variable 'x'
### Hint 60.14, rebound variable 'x'
### Hint 60.14, rebound variable 'x'
'(var snd : s * t ->? t) ((var x : s), (var y : t)) : t'
### Hint 65.7, rebound variable 'x'
*** Error 65.18-65.30, unexpected term 'def (x res y)'
### Hint 65.40, rebound variable 'x'
*** Error 65.51-65.69, unexpected term '(def y) und (def x)'
### Hint 65.7, rebound variable 'x'
*** Error 65.18-65.30, unexpected term 'def (x res y)'
### Hint 65.40, rebound variable 'x'
*** Error 65.51-65.69, unexpected term '(def y) und (def x)'
1. (\ ((var x : s), (var y : t)) . def (x res y))
= \ ((var x : s), (var y : t)) . (def y) und (def x)
2. (\ ((var x : s), (var y : t)) . def (x res y))
= \ ((var x : s), (var y : t)) . (def y) und (def x)
### Hint 74.5, rebound variable 'x'
### Hint 74.5, rebound variable 'x'
### Hint 75.6, rebound variable 'x'
### Hint 75.35, rebound variable 'x'
### Hint 75.35, rebound variable 'x'
### Hint 75.6, rebound variable 'x'
### Hint 75.35, rebound variable 'x'
### Hint 75.35, rebound variable 'x'
### Warning 85.6, new type shadows type variable 's'
*** Error 85.11, illegal type variable as supertype 's'
in type of '(pred eq : forall s : Type . s * s)'
is not unifiable with type 'Unit ->? Unit' (87.33)
untypeable term (with type: _v371 ->? Pred Unit) 'eq'
no typing for 'program all (p : Pred s) : Pred Unit = eq (p, tt)'
### Hint 90.14, rebound variable 'x'
### Hint 90.45, no type found for 't1'
### Hint 90.45, no type found for 't1'
untypeable term (with type: ? (_v390 ->? _v389 ->? Unit ->? Pred Unit))
untypeable term (with type: _v390 ->? _v389 ->? Unit ->? Pred Unit)
untypeable term (with type: _v389 ->? Unit ->? Pred Unit)
### Hint 90.45, no type found for 't1'
### Hint 90.45, no type found for 't1'
untypeable term (with type: ? (_v392 ->? _v391 ->? ? Pred Unit))
untypeable term (with type: _v392 ->? _v391 ->? ? Pred Unit)
untypeable term (with type: _v391 ->? ? Pred Unit) 't1 () und'
untypeable term (with type: ? Pred Unit) 't1 () und t2'
'program And (x, y : Pred Unit) : Pred Unit = t1 () und t2 ()'
*** Error 93.11, unexpected mixfix token: impl
*** Error 95.11, unexpected mixfix token: or
### Hint 98.39, no type found for 'all'
untypeable term (with type: _v409 ->? Pred Unit) 'all'
'program ex (p : Pred s) : Pred Unit
= all \ r : Pred Unit . (all \ x : s . p x impl r) impl r'
### Hint 101.29, no type found for 'all'
untypeable term (with type: _v420 ->? Pred Unit) 'all'
### Hint 101.9, rebound variable 'ff'
### Hint 101.29, no type found for 'all'
untypeable term (with type: _v421 ->? Pred Unit) 'all'
'program ff () : Pred Unit = all \ r : Pred Unit . r ()'
in type of '(var r : Unit ->? Unit)'
is not unifiable with type '_v436 ->? Pred Unit' (103.49)
untypeable term (with type: _v437 ->? _v436 ->? Pred Unit) 'r'
untypeable term (with type: _v436 ->? Pred Unit) 'r impl'
no typing for 'program neg (r : Pred Unit) : Pred Unit = r impl ff'
### Hint 108.3, no type found for 'all'
### Hint 108.3, untypeable term (with type: _v440 ->? Unit) 'all'
. all \ x : s . eq (\ . f x, g x) impl eq (f, g)'
### Warning 115.7, unchanged class 'Cpo'
### Hint 117.5, is type variable 'c'
### Hint 121.3, no type found for 'all'
### Hint 121.3, untypeable term (with type: _v442 ->? Unit) 'all'
*** Error 121.3-121.16, no typing for 'all \ x : c . x <<= x'
### Hint 122.3, no type found for 'all'
### Hint 122.3, untypeable term (with type: _v445 ->? Unit) 'all'
'all \ (x, y, z : c) . (x <<= y) und (y <<= z) impl x <<= z'
### Hint 123.3, no type found for 'all'
### Hint 123.3, untypeable term (with type: _v448 ->? Unit) 'all'
'all \ (x, y, z : c) . (x <<= y) und (y <<= x) impl eq (x, y)'
### Hint 125.32, no type found for 'all'
### Hint 125.32, untypeable term (with type: _v451 ->? _v452) 'all'
no typing for '(all \ n : nat . s n <<= s (Suc n)) as Unit'
### Hint 126.15, rebound variable 'x'
### Hint 126.38, no type found for 'all'
### Hint 126.38, untypeable term (with type: _v455 ->? _v456) 'all'
no typing for '(all \ n : nat . s n <<= x) as Unit'
((((isBound (sup s, s)) und) all)
(\ x : c . ((((isBound (x, s)) impl) sup) s) <<= x)))
((((isBound (sup s, s)) und) all)
(\ x : c . ((((isBound (x, s)) impl) sup) s) <<= x))
### Hint 130.3, no type found for 'all'
### Hint 130.3, untypeable term (with type: _v458 ->? Unit) 'all'
(isBound (sup s, s) und all
(\ x : c . isBound (x, s) impl sup (s) <<= x))'
### Hint 134.3, no type found for 'all'
### Hint 134.3, untypeable term (with type: _v460 ->? Unit) 'all'
no typing for 'all \ s : nat -> c . isChain s impl def (sup s)'
### Hint 139.5, is type variable 'p'
ignoring declaration for builtin identifier 'bottom'
### Hint 143.3, no type found for 'all'
### Hint 143.3, untypeable term (with type: _v462 ->? Unit) 'all'
*** Error 143.3-143.22, no typing for 'all \ x : p . bottom <<= x'
### Hint 148.6, is type variable 'f'
### Hint 150.15-150.17, is type list '[f]'
repeated declaration of '__<<=__' with type 'c * c ->? Unit'
### Hint 153.5, is type variable 'c'
### Hint 153.5, rebound type variable 'c'
### Hint 153.8, is type variable 'd'
### Hint 155.17, redeclared type '__*__'
### Hint 157.7, not a class 'c'
### Hint 157.11, not a class 'c'
### Hint 157.18, not a class 'd'
### Hint 157.23, not a class 'd'
### Hint 159.10, rebound variable 'x1'
### Hint 159.14, rebound variable 'y1'
### Hint 159.23, rebound variable 'x2'
### Hint 159.27, rebound variable 'y2'
in type of '(pred __<<=__ : forall c : Cpo . c * c)'
is not unifiable with type '_v477 ->? _v476 ->? Unit' (159.53)
untypeable term (with type: _v478 ->? _v477 ->? _v476 ->? Unit)
untypeable term (with type: _v477 ->? _v476 ->? Unit) 'x1 <<= x2'
untypeable term (with type: _v476 ->? Unit) '(x1 <<= x2) und'
'program (x1, y1) <<= (x2, y2) = (x1 <<= x2) und (y1 <<= y2)'
### Hint 169.9, redeclared type '__-->?__'
### Hint 169.20, repeated supertype '__->?__'
(def (((f x) und) x)) <<= y
(((def (f x)) und) x) <<= y
*** Error 174.45, unexpected mixfix token: +
def ((((f (s m)) und) eq)
(sup (\ n : nat .! f (s (n + m))), f (sup s)))
((((def f) (s m)) und) eq)
(sup (\ n : nat .! f (s (n + m))), f (sup s))
*** Error 170.7, unexpected mixfix token: :
### Hint 176.16-176.25, is type list '[c -->? d]'
(def ((((f x) impl) f) x)) <<= (g x)
((((def (f x)) impl) f) x) <<= (g x)
### Warning 176.11, variable also known as type variable 'f'
### Hint 176.31, no type found for 'all'
### Hint 176.31, untypeable term (with type: _v502 ->? Unit) 'all'
'program f <<=[c -->? d] g
= all \ x : c . def (f x) impl f (x) <<= g (x)'
### Hint 179.17, redeclared type '__-->__'
### Warning 181.17-181.23, non-unique kind for '__ -->? __'
### Hint 181.9, redeclared type '__-->__'
### Hint 181.19, repeated supertype '__-->?__'
*** Error 182.7, unexpected mixfix token: :
### Hint 184.7, not a kind 'c --> d'
### Warning 184.6, variable also known as type variable 'f'
### Hint 184.11, not a kind 'c --> d'
### Hint 186.25-186.34, is type list '[c -->? d]'
### Hint 186.10, rebound variable 'f'
### Warning 186.10, variable also known as type variable 'f'
### Hint 186.16, rebound variable 'g'
### Hint 186.10, rebound variable 'f'
### Warning 186.10, variable also known as type variable 'f'
### Hint 186.16, rebound variable 'g'
repeated declaration of '__<<=__' with type 'c * c ->? Unit'
### Hint 192.3, no type found for 'all'
### Hint 192.3, untypeable term (with type: _v521 ->? Unit) 'all'
. eq (f (Y f), Y f) und all \ x : p . eq (f x, x) impl Y f <<= x'
### Hint 195.7, not a kind 'p --> p'
### Hint 195.5, rebound variable 'f'
### Warning 195.5, variable also known as type variable 'f'
### Hint 195.20, not a class 'p'
### Hint 195.18, rebound variable 'x'
no kind found for 'c --> p'
ignoring declaration for builtin identifier 'true'
ignoring declaration for builtin identifier 'false'