Giter Site home page Giter Site logo

Comments (7)

andreasabel avatar andreasabel commented on September 22, 2024 1

It seems we can get a cleaner implementation if we split out TacticAttribute from Attribute and then use Either Attribute TacticAttribute for the parsed attributes, which can then be handled after a partitionEithers by either applyAttr... or setTacticAttr.

-- | An attribute is a modifier for `ArgInfo`.
data Attribute
= RelevanceAttribute Relevance
| QuantityAttribute Quantity
| TacticAttribute (Ranged Expr)
| CohesionAttribute Cohesion
| LockAttribute Lock

TacticAttribute is in fact not a modifier of ArgInfo so it violates (see bedde3d, #3858) the dedication of Attribute given in its genesis (see 5f5efa7).

from agda.

jespercockx avatar jespercockx commented on September 22, 2024

It seems like the macro just doesn't get called for fails.

from agda.

andreasabel avatar andreasabel commented on September 22, 2024

@jespercockx Where in the code do we call these tactics? I failed to find it in Rules.Application or Rules.Term...

from agda.

andreasabel avatar andreasabel commented on September 22, 2024

Oh, it is here:

implicitNamedArgs n expand t0 = do
t0' <- reduce t0
reportSDoc "tc.term.args" 30 $ "implicitNamedArgs" <+> prettyTCM t0'
reportSDoc "tc.term.args" 80 $ "implicitNamedArgs" <+> text (show t0')
case unEl t0' of
Pi dom@Dom{domInfo = info, domTactic = tac, unDom = a} b
| let x = bareNameWithDefault "_" dom, expand (getHiding info) x -> do
info' <- if hidden info then return info else do
reportSDoc "tc.term.args.ifs" 15 $
"inserting instance meta for type" <+> prettyTCM a
reportSDoc "tc.term.args.ifs" 40 $ nest 2 $ vcat
[ "x = " <+> text (show x)
, "hiding = " <+> text (show $ getHiding info)
]
return $ makeInstance info
(_, v) <- newMetaArg info' x CmpLeq a
whenJust tac $ \ tac -> liftTCM $
applyModalityToContext info $ unquoteTactic tac v a

from agda.

andreasabel avatar andreasabel commented on September 22, 2024

Trace:

calling implicitNamedArgs
  sFun =  {_ : Set} → Set
  hx   =  Hidden
  mx   =  nothing
implicitNamedArgs {_ : Set} → Set
Checking named arg {_} : Set
implicitNamedArgs Set
checkApplication: checkHeadApplication returned
  v =  doTheThing
checkExpr doTheThing {_} : Set
  returns doTheThing

More detail:

implicitNamedArgs El 
  {_getSort = ..., unEl = Pi (Dom {domInfo = ArgInfo {...}}
  , domName = Nothing
  , domIsFinite = False
  , domTactic = Nothing
  , unDom = El {_getSort = ..., unEl = Sort (Univ UType (Max 0 []))}}) (NoAbs "_" El {_getSort = ..., unEl = Sort (Univ UType (Max 0 []))})}

Looks your tactic is dropped from the type of doTheThing : @(tactic auto) {Set} → Set and never makes it to the place of implicit argument insertion.

from agda.

andreasabel avatar andreasabel commented on September 22, 2024

I would guess the tactic is already dropped in the parser, since applyAttr... ignores tactics, and there is a special setTacticAttr which is only called in certain places. This looks like bad engineering. Tactics should also be handled by applyAttr....

| Attributes1 Application3 '->' Expr {% applyAttrs1 $1 (defaultArg $ rawApp $2) <&> \ dom ->
Fun (getRange ($1,$2,$3,$4)) dom $4 }

from agda.

jespercockx avatar jespercockx commented on September 22, 2024

@andreasabel Since work on this issue seems to have stalled, I am moving it to the later milestone. When the issue is resolved, please change it to the current milestone at the time of fixing.

from agda.

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.