readpfds_6.3.2

  • 630 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
630
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
0
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. * reverseはmonotonicな関数* reverseの実行には|r|ステップかかる* |r|ステップ = 借金* 最も外側にあるreverse suspは|f|回のtailの後にforce* |r| =~ |f| の時reverseして、* オペレーション毎に借金を1つ返済するなら、* reverseをforceするまでにその借金を返済すれば良い
  • 2. let q0 = (m, f, m, r)let q1 = tail q0 # <= f ++ reverse r -- |r|借金let q2 = tail q1let q3 = tail q2...let qm = tail qm-1 # <= force (reverse r) -- 返済期限ここの時任意のkで分岐が発生したとするとqkからqmまで分岐先でも二重に実行されることになる。
  • 3. let q0 = (m, f, m, r)let q0 = q0let q1 = tail q0 # <= f ++ reverse r -- |r|借金...let qm = tail qm-1 # <= force (reverse r) -- 返済期限let q1 = tail q0 # <= f ++ reverse r -- |r|借金...let qm = tail qm-1 # <= force (reverse r) -- 返済期限
  • 4. d(i) = fのi番目の要素における借金D(i) = 0からiまでのd(j)を足しこんだものさらに↓を不変条件とするD(i) <= min(2i, |f| - |r|)