diff options
author | Jason Gross <jgross@mit.edu> | 2016-12-02 20:18:47 -0500 |
---|---|---|
committer | Jason Gross <jgross@mit.edu> | 2016-12-02 20:18:47 -0500 |
commit | 215150526079dad408dde1d0744cb0f88765a6ac (patch) | |
tree | f5c750d2ec19fbfb32db90cb681bc12f11c39f68 /src/Reflection | |
parent | 428c255e87f4b3e4503148cd000dd274f06bac39 (diff) |
Add invert_Pair
Diffstat (limited to 'src/Reflection')
-rw-r--r-- | src/Reflection/Syntax.v | 8 |
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. |