Skip to content

Commit

Permalink
Adding example to demonstrate why determinism doesn't hold generally,…
Browse files Browse the repository at this point in the history
… and motivate our fix
  • Loading branch information
ivoysey committed Oct 13, 2016
1 parent 416e5d8 commit f0a13b3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions examples.agda
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,16 @@ module examples where
(ASubsume SNum TCRefl)) TCRefl))
(DoSynth (SAZipApAna MAArr (SVar refl) (AAMove EMApParent1))
( DoRefl))))))))


-- these motivates why actions aren't deterministic, and why it's
-- reasonable to ban the derivations that we do. the things that differ
-- in the term as a result of the appeal to subsumption in the second
-- derivation aren't needed -- the ascription is redundant because the
-- type is already pinned to num ==> num, so that's the only thing that
-- could fill the holes produced.
notdet1 : ∅ ⊢ ▹ ⦇⦈ ◃ ~ construct (lam 0) ~> ·λ 0 ▹ ⦇⦈ ◃ ⇐ (num ==> num)
notdet1 = AAConLam1 refl MAArr

notdet2 : ∅ ⊢ ▹ ⦇⦈ ◃ ~ construct (lam 0) ~> ·λ 0 ⦇⦈ ·:₂ (▹ ⦇⦈ ◃ ==>₁ ⦇⦈) ⇐ (num ==> num)
notdet2 = AASubsume EETop SEHole (SAConLam refl) (TCArr TCHole1 TCHole1)

0 comments on commit f0a13b3

Please sign in to comment.