module While7

	use int.Int
	use ref.Ref

	exception Myexc int
	let b[@infer](_:int) : int
	ensures { result = 102 }
	=
		let i = ref 0 in
		while !i < 100 do
		variant { 100 - !i }
		i := !i + 1;
		if !i >= 100 then
		i := 102;
		done;
		!i

	let b2[@infer:oct](_:int) : int
	ensures { result = 102 }
	=
		let i = ref 0 in
		while !i < 100 do
		variant { 100 - !i }
		i := !i + 1;
		if !i >= 100 then
		i := 102;
		done;
		!i

	let b3[@infer:box](_:int) : int
	ensures { result = 102 }
	=
		let i = ref 0 in
		while !i < 100 do
		variant { 100 - !i }
		i := !i + 1;
		if !i >= 100 then
		i := 102;
		done;
		!i

end
