Coder Social home page Coder Social logo

Comments (2)

Alizter avatar Alizter commented on September 2, 2024

I experimented with this a bit:

Tactic Notation "lhs" tactic3(tac) :=
  let R := match goal with |- ?R _ _ => constr:(R) end in 
  let pre_transitivity_proof_term_head := constr:(_ : Transitive R) in
  let transitivity_proof_term_head := (eval hnf in pre_transitivity_proof_term_head) in
  nrefine (pre_transitivity_proof_term_head _ _ _ ltac:(tac) _).

It didn't work out too well for the following reasons:

  1. Doing a typeclass search every time is a lot of wasted work.
  2. In some situations we implicitly assume that the goal will resolve to paths.
  3. The universe levels cause unification issues.
  4. The proof terms are a bit more complex.

My next suggestion would be to hard code the transitivity proofs for each kind of relation we want this to work on in order to solve (1) but then we get stuck on (2).

(3) is really tricky to understand when things go wrong.

(4) isn't great as Coq spends more and more time unfolding terms that it shouldn't need to.

We could instead introduce variants of lhs like lhsE for Equiv, lhsC` for wildcat etc. That way we wouldn't have issues 1-4, however then we would have even more tactics.

from coq-hott.

jdchristensen avatar jdchristensen commented on September 2, 2024

Can you explain more?

  1. I would assume that the typeclass search should be very fast, since in every case where we would use this, the instance should be obvious.
  2. I don't understand what you mean here.
  3. Can you give an example? Why are there universe issues with this?
  4. Can you give an example? It looks to me like it should give a very similar proof term.

from coq-hott.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.