Coder Social home page Coder Social logo

Comments (3)

JasonGross avatar JasonGross commented on July 28, 2024 1

Then various files in the library will fail to build, so you add necessary hints to fix those places. For example, Jason suggested:

#[export] Hint Mode IsTrunc ! ! : typeclass_instances. (* if the level and type both have some known structure, we can proceed *)
#[export] Hint Mode IsTrunc - + : typeclass_instances. (* if the type is fully known we can use tc to infer the level *)
#[export] Hint Mode IsEquiv - - + : typeclass_instances. (* only infer equivalence if the function is known; - - ! would also be fine if we want to infer IsEquiv id without needing the types to be known *)
#[export] Hint Mode Equiv + + : typeclass_instances. (* only infer Equiv if both types are fully known *)

But many others will be needed.

Ah, these suggestions are not to fix the problems caused by Hint Constants Opaque, but to further (and orthogonally) constrain typeclass search. Instead the problems caused by Hint Constants Opaque need to be fixed by Hint Transparent some_particular_constant : typeclass_instances.

from coq-hott.

jdchristensen avatar jdchristensen commented on July 28, 2024 1

Thanks for clarifying. So here's one approach:

Phase 1: add Hint Constants Opaque; see what breaks; add Hint Transparent as needed.

Phase 2: add Hint Mode to add additional constraints based on what makes sense for various typeclasses, and make sure things still build.

As you make changes, check the build time and make sure you haven't caused a slowdown.

I guess phase 2 can be done without doing phase 1, and might be less work.

from coq-hott.

jdchristensen avatar jdchristensen commented on July 28, 2024

More tips about phase 1 from @JasonGross:

Roughly the rule of thumb is that you need to mark transparent any definition whose truncatedness you want tc to infer, but for which no trunc instance is declared. (For example, if you want to use instances of IsTrunc _ { a : A & ... } interchangably with instances of IsTrunc _ (hfiber ...)). There are a couple of exceptions, though I expect them to be quite rare for IsTrunc. One example is that if you prove forall (A : Type) (ls : list A), IsHProp (nil = ls) and then want to automatically infer forall (A B : Type) (f : A -> B) (ls : list B), IsHProp (map f nil = ls), you'll need to declare map transparent. I wouldn't be all that surprised if none of the truncation instances broke.

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.