Open ice1000 opened 3 years ago
suc-suc-a
should be evaluated to suc (suc a)
and it corresponds to the pattern of the same form.
\pat fail (a, b : Nat) => addN b a
Stuck application should fail to be a pattern object, so the above code should fail.
Can we write \impossible in pattern functions? Will it be able to be used as an ordinary function then?
Can we write \impossible in pattern functions? Will it be able to be used as an ordinary function then?
Interesting question! I think we don't have to. Reason: if you want to synonym a single \impossible
, that just doesn't make sense -- it's not very long and doesn't need to be aliased. If you want to do x (y z \impossible) w
, you can have a synonym parameterized by the \impossible
part, and use \impossible
in the patterns. With this workaround provided I'd say it's unnecessary to do so.
We could start from 'pattern definitions':
Note that I want to use
\pat
definitions as both patterns and functions.Originally posted by @ice1000 in https://github.com/ice1000/aya-prover/issues/190#issuecomment-809092666