Skip to content

Commit

Permalink
Program Fixpoint pflookup
Browse files Browse the repository at this point in the history
  • Loading branch information
h0nzZik committed Mar 14, 2024
1 parent 1c65363 commit 0196432
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions minuska/theories/minusl_compile_properties.v
Original file line number Diff line number Diff line change
Expand Up @@ -2233,6 +2233,31 @@ Next Obligation.
Defined.
Fail Next Obligation.

Program Fixpoint pflookup
{A : Type}
(l : list A)
(i : nat)
: option ({ x : A | x ∈ l})
:=
match l with
| [] => None
| x::xs =>
match i with
| 0 => Some (exist _ x _ )
| S i' =>
tmp ← pflookup xs i';
let x := proj1_sig tmp in
let pf := proj2_sig tmp in
Some (exist _ x _)
end
end.
Next Obligation.
left.
Defined.
Next Obligation.
right. exact H.
Defined.
Fail Next Obligation.

Lemma length_pfmap
{A B : Type}
Expand Down Expand Up @@ -2282,6 +2307,18 @@ Proof.
Qed.


Lemma pfmap_lookup_Some_1
{A B : Type}
(l : list A)
(f : forall (x : A), x ∈ l -> B)
(i : nat)
(y : B)
(pf : pfmap l f !! i = Some y)
:
Some y = (fun x => ) <$> (l !! i)



Fixpoint factor_by_subst
{Σ : StaticModel}
(sz : nat)
Expand Down

0 comments on commit 0196432

Please sign in to comment.