diff options
Diffstat (limited to 'consecutive-fibonacci-numbers-are-coprime.lisp')
-rw-r--r-- | consecutive-fibonacci-numbers-are-coprime.lisp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/consecutive-fibonacci-numbers-are-coprime.lisp b/consecutive-fibonacci-numbers-are-coprime.lisp index d80ce43..482eb65 100644 --- a/consecutive-fibonacci-numbers-are-coprime.lisp +++ b/consecutive-fibonacci-numbers-are-coprime.lisp @@ -5,6 +5,7 @@ ;; フィボナッチ関数の定義 (defun fibonacci (n) + (declare (xargs :guard (natp n))) (cond ((zp n) 0) ((equal n 1) 1) @@ -13,7 +14,9 @@ ;; ユークリッドの互除法による最大公約数の定義 (defun gcd$ (n m) - (declare (xargs :measure (+ (nfix m) (nfix n)))) + (declare (xargs :measure (+ (nfix m) (nfix n)) + :guard (and (posp n) + (posp m)))) (cond ((or (not (posp n)) (not (posp m)) |