2つの自然な引数をとり、それらの等価性の証明の多分を返す関数を書いてみたいと思います。Idris - 2つの数値の等価性を証明する
私は
equal : (a: Nat) -> (b: Nat) -> Maybe ((a == b) = True)
equal a b = case (a == b) of
True => Just Refl
False => Nothing
にしようとしているが、私はこれを行うには正しい方法で、次のエラー
When checking argument x to constructor Prelude.Maybe.Just:
Type mismatch between
True = True (Type of Refl)
and
Prelude.Nat.Nat implementation of Prelude.Interfaces.Eq, method == a
b =
True (Expected type)
Specifically:
Type mismatch between
True
and
Prelude.Nat.Nat implementation of Prelude.Interfaces.Eq, method == a
b
を取得しますか?
また、ボーナス質問として、私がしなければ
equal : (a: Nat) -> (b: Nat) -> Maybe ((a == b) = True)
equal a b = case (a == b) of
True => proof search
False => Nothing
私は
INTERNAL ERROR: Proof done, nothing to run tactic on: Solve
pat {a_504} : Prelude.Nat.Nat. pat {b_505} : Prelude.Nat.Nat. Prelude.Maybe.Nothing (= Prelude.Bool.Bool Prelude.Bool.Bool (Prelude.Interfaces.Prelude.Nat.Nat implementation of Prelude.Interfaces.Eq, method == {a_504} {b_505}) Prelude.Bool.True)
This is probably a bug, or a missing error message.
Please consider reporting at https://github.com/idris-lang/Idris-dev/issues
は、それが既知の問題であり得るか、私はそれを報告しなければなりませんか?
問題を報告する決定を下す一方、戦術ベースの証明はIdrisでは廃止されていることに注意してください。 –
'decEq'の使用を検討してください。 – 2426021684