fact: Fixpoint constantOf {T} (t : Term var T) : option (onelevelG T) := match t in Term _ T return option (onelevelG T) with | RLiteralApp _ l af => match l with | RLC l' => match l' in RLiteralConstructor T return args_for (Term var) T -> args_for_onelevel T -> option (onelevel (range_of T)) with | Rpair _ _ => fun af _ => Some (ahd af, ahd (atl af)) | RS => fun af afr => option_map S (ahd afr) | RO => fun _ _ => Some O | Rnil _ => fun _ _ => Some nil | Rcons _ => fun af afr => option_map (cons (ahd af)) (ahd (atl afr)) | Rbool v | Rrchar_expr_ascii v | Rstring v | Rritem_ascii v => fun _ _ => Some v end | RLNC _ => fun _ _ => None end af (constantOfs (@constantOf) af) | _ => None end.
imports: Fiat.Parsers.Reflective.Syntax Fiat.Parsers.Reflective.Semantics Fiat.Parsers.Reflective.Syntactify Fiat.Common Fiat.Common.NatFacts Fiat.Common.List.Operations