aboutsummaryrefslogtreecommitdiff
path: root/src/Reflection
diff options
context:
space:
mode:
authorGravatar Jason Gross <jgross@mit.edu>2016-12-02 20:18:47 -0500
committerGravatar Jason Gross <jgross@mit.edu>2016-12-02 20:18:47 -0500
commit215150526079dad408dde1d0744cb0f88765a6ac (patch)
treef5c750d2ec19fbfb32db90cb681bc12f11c39f68 /src/Reflection
parent428c255e87f4b3e4503148cd000dd274f06bac39 (diff)
Add invert_Pair
Diffstat (limited to 'src/Reflection')
-rw-r--r--src/Reflection/Syntax.v8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Reflection/Syntax.v b/src/Reflection/Syntax.v
index fd4a4dfa0..a88fac743 100644
--- a/src/Reflection/Syntax.v
+++ b/src/Reflection/Syntax.v
@@ -370,6 +370,14 @@ Section language.
| Const _ v => Some v
| _ => None
end.
+ Definition invert_Pair {var A B} (e : @exprf var (Prod A B)) : option (exprf A * exprf B)
+ := match e in @exprf _ t return option match t with
+ | Prod _ _ => _
+ | _ => unit
+ end with
+ | Pair _ x _ y => Some (x, y)%core
+ | _ => None
+ end.
End misc.
Section wf.