需要帮助将数字转换为AGDA中的字符串

发布于 2025-01-24 07:17:49 字数 2294 浏览 3 评论 0原文

Agda的新手。我想要一种从代码中获取一些输出的方法,因此我正在寻找一种打印数字的方法。在标准

Unsolved metas at the following locations:
  /home/user/agda-stdlib-1.7/src/Data/List/Relation/Unary/Any/Properties.agda:100,17-18
  /home/user/agda-stdlib-1.7/src/Data/List/Relation/Unary/Any/Properties.agda:105,16-17
  /home/user/agda-stdlib-1.7/src/Data/List/Relation/Unary/Any/Properties.agda:105,28-29
when scope checking the declaration
  open import Data.List.Relation.Unary.Any.Properties

Failed to solve the following constraints:
  Check definition of to∘from : {P.A.a : Level} {P.A : Set P.A.a}
                                {P.p : Level} {P = P₁ : Pred P.A P.p} {Q.A.a : Level}
                                {Q.A : Set Q.A.a} {Q.p : Level} {Q = Q₁ : Pred Q.A Q.p}
                                {xs = xs₁ : List P.A} {ys = ys₁ : List Q.A}
                                (pq
                                 : Any (λ x → Any (λ y → Prod.Σ (P₁ x) (λ x₁ → Q₁ y)) ys₁) xs₁) →
                                Any-×⁺ (Any-×⁻ pq) ≡ pq
    stuck because
      /home/user/agda-stdlib-1.7/src/Data/List/Relation/Unary/Any/Properties.agda:266,3-34
      I'm not sure if there should be a case for the constructor refl,
      because I get stuck when trying to solve the following unification
      problems (inferred index ≟ expected index):
        lhs ≟ Any.map
              (λ x →
                 Any.map (λ q → P.subst P x p , q)
                 (Any.map
                  (λ x₁ →
                     P.subst Q x₁
                     (_5474 (x = x₂) (pq′ = pq′) (y = y) (y∈ys = y∈ys) (p = p) (q = q)
                      (lem₂ = lem₂) (pq = pq) (x∈xs = x∈xs) (lem₁ = lem₁)
                      (p = (P.subst P x p))))
                  y∈ys))
              x∈xs
      when checking that the pattern refl has type
      lhs ≡.map(λ x →
         Any.map (λ q → P.subst P x p , q)
         (Any.map
          (λ x₁ →
             P.subst Q x₁
             (_5474 (x = x₂) (pq′ = pq′) (y = y) (y∈ys = y∈ys) (p = p) (q = q)
              (lem₂ = lem₂) (pq = pq) (x∈xs = x∈xs) (lem₁ = lem₁)
              (p = (P.subst P x p))))
          y∈ys))
      x∈xs
    (blocked on any(_Q.p_474, _P.p_475))
when scope checking the declaration
  open import Data.List.Relation.Unary.Any.Properties

Any help? :)

New to Agda. I want a way to obtain some output from the code, so I am looking for a way to print numbers. Found a function in the standard library but I am unable to import it. I get the following:

Unsolved metas at the following locations:
  /home/user/agda-stdlib-1.7/src/Data/List/Relation/Unary/Any/Properties.agda:100,17-18
  /home/user/agda-stdlib-1.7/src/Data/List/Relation/Unary/Any/Properties.agda:105,16-17
  /home/user/agda-stdlib-1.7/src/Data/List/Relation/Unary/Any/Properties.agda:105,28-29
when scope checking the declaration
  open import Data.List.Relation.Unary.Any.Properties

Failed to solve the following constraints:
  Check definition of to∘from : {P.A.a : Level} {P.A : Set P.A.a}
                                {P.p : Level} {P = P₁ : Pred P.A P.p} {Q.A.a : Level}
                                {Q.A : Set Q.A.a} {Q.p : Level} {Q = Q₁ : Pred Q.A Q.p}
                                {xs = xs₁ : List P.A} {ys = ys₁ : List Q.A}
                                (pq
                                 : Any (λ x → Any (λ y → Prod.Σ (P₁ x) (λ x₁ → Q₁ y)) ys₁) xs₁) →
                                Any-×⁺ (Any-×⁻ pq) ≡ pq
    stuck because
      /home/user/agda-stdlib-1.7/src/Data/List/Relation/Unary/Any/Properties.agda:266,3-34
      I'm not sure if there should be a case for the constructor refl,
      because I get stuck when trying to solve the following unification
      problems (inferred index ≟ expected index):
        lhs ≟ Any.map
              (λ x →
                 Any.map (λ q → P.subst P x p , q)
                 (Any.map
                  (λ x₁ →
                     P.subst Q x₁
                     (_5474 (x = x₂) (pq′ = pq′) (y = y) (y∈ys = y∈ys) (p = p) (q = q)
                      (lem₂ = lem₂) (pq = pq) (x∈xs = x∈xs) (lem₁ = lem₁)
                      (p = (P.subst P x p))))
                  y∈ys))
              x∈xs
      when checking that the pattern refl has type
      lhs ≡.map(λ x →
         Any.map (λ q → P.subst P x p , q)
         (Any.map
          (λ x₁ →
             P.subst Q x₁
             (_5474 (x = x₂) (pq′ = pq′) (y = y) (y∈ys = y∈ys) (p = p) (q = q)
              (lem₂ = lem₂) (pq = pq) (x∈xs = x∈xs) (lem₁ = lem₁)
              (p = (P.subst P x p))))
          y∈ys))
      x∈xs
    (blocked on any(_Q.p_474, _P.p_475))
when scope checking the declaration
  open import Data.List.Relation.Unary.Any.Properties

Any help? :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗弃M 2025-01-31 07:17:49

问题说该文件中有一个未填充的孔,

Data/List/Relation/Unary/Any/Properties.agda

这是标准库中的文件,因此有两个可能的原因:

  • 您以某种方式修改了此文件,似乎不太可能
  • 克隆agda--的开发版本。 stdlib存储库,并且没有结帐一个发行标签

,假设这是第二个选项,则需要进入agda-stdlib文件夹并发出以下命令:

git fetch --all --tags
git checkout tags/v1.7.1

一旦完成:能够导入data.nat.show,并使用该模块内的功能,如其他任何模块。

The issue says that there is an unfilled hole in the file

Data/List/Relation/Unary/Any/Properties.agda

This is a file from the standard library, so there are two possible reasons for that:

  • You somehow modified this file, which seems unlikely
  • You cloned the development version of agda-stdlib repository and did not checkout a release tag

Assuming this is the second option, you need to go into your agda-stdlib folder and issue the following commands:

git fetch --all --tags
git checkout tags/v1.7.1

Once this is done, you should be able to import Data.Nat.Show and use the functions inside that module, as from any other module.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文