clean test
This commit is contained in:
parent
2ced2e784e
commit
37570c6a40
@ -24,25 +24,6 @@ function for_sum (var n : nat) : int is block {
|
|||||||
end
|
end
|
||||||
} with acc
|
} with acc
|
||||||
|
|
||||||
|
|
||||||
function lamby (var accu : (record st : string ; acc : int end) ; var i : int )
|
|
||||||
: (record st : string ; acc : int end) is block {
|
|
||||||
accu.acc := accu.acc + i ;
|
|
||||||
accu.st := accu.st ^ "to" ;
|
|
||||||
} with accu
|
|
||||||
|
|
||||||
function for_collection_ (var nee : unit; var nuu : unit) : (int * string) is block {
|
|
||||||
var acc : int := 0 ;
|
|
||||||
var st : string := "to" ;
|
|
||||||
var mylist : list(int) := list 1 ; 1 ; 1 end ;
|
|
||||||
var init_record : (record st : string; acc : int end ) :=
|
|
||||||
record st = st; acc = acc; end;
|
|
||||||
var folded_record : (record st : string; acc : int end ) :=
|
|
||||||
list_fold(mylist , init_record , lamby) ;
|
|
||||||
st := folded_record.st ;
|
|
||||||
acc := folded_record.acc ;
|
|
||||||
} with (folded_record.acc , folded_record.st)
|
|
||||||
|
|
||||||
function for_collection_list (var nee : unit) : (int * string) is block {
|
function for_collection_list (var nee : unit) : (int * string) is block {
|
||||||
var acc : int := 0 ;
|
var acc : int := 0 ;
|
||||||
var st : string := "to" ;
|
var st : string := "to" ;
|
||||||
|
Loading…
Reference in New Issue
Block a user