module Try1

	use int.Int
	use ref.Ref

	exception Myexc int
	let b [@bddinfer] [@infer](_:int) : int
	ensures { result = 12 }
	=
		let i = ref 0 in
		i := 0;
		while !i < 10 do
			variant { 10 - !i  }
			try
			i := !i + 1;
			raise (Myexc (!i + 5))
			with
			| Myexc(a) -> i := a
			end
		done;
		!i

	let b2 [@bddinfer] [@infer:oct](_:int) : int
	ensures { result = 12 }
	=
		let i = ref 0 in
		i := 0;
		while !i < 10 do
			variant { 10 - !i  }
			try
			i := !i + 1;
			raise (Myexc (!i + 5))
			with
			| Myexc(a) -> i := a
			end
		done;
		!i

end
