Julia Kulczycka
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Lista 4 E ogólnie to, co już zaczęłam, to sobie pisałam w plikach na moim dysku, więc jak wam pasuje taka forma, a gdzieś będą błędy, to możecie poprawić tutaj i wkleić nowego screena zamiast pisać od 0 u siebie nie: https://uniwroc-my.sharepoint.com/:f:/g/personal/322282_uwr_edu_pl/EhaGVtAQwqNAoYEqRR1Zr28BVKZskC4IBiofowiawTvS8w?e=Z3HPcl ## Zadanie 1 :::success Zrobione ::: ### Flow through assignments and tests ![image](https://hackmd.io/_uploads/HJPJBM70T.png) ### Flow along the control ![image](https://hackmd.io/_uploads/r1XVBfXA6.png) ### Sprawdzenie ![image](https://hackmd.io/_uploads/Hy8W8MmR6.png) ## Zadanie 2 :::success Raczej zrobione ::: *Wykład - koło 45 minuty* Algorytm działa tak, że dopóki w jakimś równaniu lewa i prawa strona nie spełniają zależności między sobą, to aktualizujemy równanie, aż do momentu gdy nie mamy takiej nierówności. Może nie jest to super intuicyjne, ale tutaj rozwiązaniami równań są zbiory (np. {(x, ?), (y, 1)}), a zamiennymi są nazwy/oznaczenia (np. $RD\circ(1)$). **Algorytm wylicza najmniejszy punkt stały.** ### Układ równań ![image](https://hackmd.io/_uploads/Sk1k1QmC6.png) ### Algorytm Każde równanie jest postaci $RD_j = F_j(RD_1, RD_2, ..., RD_{18})$ ![image](https://hackmd.io/_uploads/SyGiJQ7Rp.png) ### Rozwiązanie Algorytm zaczynamy od podstawienia wartości, którą znamy. Używam skróconego zapisu $xk = (x, l)$, żeby było czytelnie no i wycofałam się z tych oznaczeń bez kółeczek w sensie RD1, RD2, ... RD18, bo to kompletnie nieprzejrzyste dla mnie było. ![image](https://hackmd.io/_uploads/SyszmV7Ap.png) **Porównując roziwązanie d ozadania 6** ## Zadanie 3 ### Definicje, których nie rozumiem $Kill$ (wykład koło 1:40-45) - usunięcie wszyztkich wyrażeń zawierajacych x w celu uzyskania faktów prawdziwych na wejściu do zbioru prawdziwych faktów. Czyli np. wyliczyliśmy gdzieś wcześniej x + 5, którego mogliśmy gdzieś użyć, ale potem przypisujemy do x nową wartość, więc wcześniejsza wartość x + 5 jest już nieaktualna. $Gen$ (też coś koło tego) - gdy np. x = p + y + z, to wszystkie podwyrażenia p + y, p + z, p + y + z (to jakoś dziwnie się robi i te wartości mogą być gdzieś zapamiętywane) stają się dostępne, i ta funkcja generująca je wylicza. ### Przykład z wykładu Czemu zabijamy pary, które już są na pewno martwe, np. y? w 4 i x? w 5? Nie wiem, ale będę robić analogicznie (a jak dojdziemy do wniosku, że tak nie ma być, to poprawimy). **Bo ogólnie zabijamy wszystkie wyrażenia związane z tymi zmiennymi, żebyśmy nie mogli użyć jakichś przestarzałych informacji(tak jak opisałem wyżej z tymi podwyrażeniami).** ![image](https://hackmd.io/_uploads/BkMtMNXR6.png) ### Wystąpienia funkcji kill() i gen() ![image](https://hackmd.io/_uploads/r1xT44QRa.png) **w równaniach chyba tak?** ![image](https://hackmd.io/_uploads/rk1QRLX0p.png) ### Definicje gen(read) i kill(read) ![image](https://hackmd.io/_uploads/Hyj3mN7Ap.png) **Nasze definicje:** $gen([read(x)]^l) = \{(x,l)\}$ $kill([read(x)]^l) = \{(x,?)\} \cup \{(x, l') | B^{l'}\}$ ### Algorytm wyliczania tych wartości ![image](https://hackmd.io/_uploads/HkdyQvQAT.png) ## Zadanie 4 Idę jak burza, a wy co, RPiS robicie frajerzy? spierdalaj ![431014573_652256033669646_4125482114538093054_n](https://hackmd.io/_uploads/HkgbNrQC6.png) ### $RD_{exit}$ (zamalowane kropki) ![image](https://hackmd.io/_uploads/BJMkOVmCT.png) ### $RD_{entry}$ (puste kropki) ![image](https://hackmd.io/_uploads/rkz7uVmAp.png) ### Rozwiązanie układu Ogólnie nie czaję clue tego zadania, chyba, że wg slides1/28 nie mogę zrobić takiej podwójnej sumy z dwóch przypadków. **możesz możesz :>>>** *:3* **Równania** ![image](https://hackmd.io/_uploads/S1V0FNQRp.png) **Rozwiązanie według algorytmu** ![image](https://hackmd.io/_uploads/HyJXTNX06.png) **W rzeczywistości jednak zauważamy, że x zawsze będzie większe od 0, więc w ostatecznym wyniku nie będzie (y,4).** ## Zadanie 5 :::success jest git? chuj wie XD czekaj zgubilem mózg Tu Maciek z przyszłości i akceptuje to rozwiązanie. ::: Podręcznik z odnośnikiem do tego zadania, jak komuś się nie chce szukać: https://faculty.sist.shanghaitech.edu.cn/faculty/songfu/cav/PPA.pdf strona 75 w dokumencie. ### Analiza zmiennych żywych Teraz będziemy analizować programy pod trochę innym kątem - wcześniej interesowało nas, w którym miejscu programu była *ostatni raz* przypisywana wartość do danej zmiennej. Teraz będziemy *patrzeć w przód* - analizować, które przypisania zmiennych faktycznie mają wpływ na działanie programu. Czyli generalnie chcemy przeanalizować, w których miejscach programu moglibyśmy spotkać takie ostrzeżenie: ![image](https://hackmd.io/_uploads/HJLuu4NRa.png) #### **Idea i definicja** Zmienną uważamy za **żywą**, jeśli jeszcze gdzieś jej *może* użyjemy (np. do wyliczenia innej zmiennej), zanim ją zredefiniujemy (przypiszemy jej nową wartość). *Może* w tym przypadku oznacza, że np. zostanie użyta w jakiejś gałęzi instrukcji warunkowej. ![image](https://hackmd.io/_uploads/r11w2vQ06.png) **Przykład** ![image](https://hackmd.io/_uploads/rkgrUVNCp.png) Ma sens - pierwsze przypisanie ```x := 2``` jest zbędne, bo przecież w 3 instrukcji redefiniujemy wartość ```x := 1```, a w 2 jej nie używamy. Po wyjściu z 3 obydwie zmienne są żywe, bo używamy ich do porównania w 4. #### **Definicja *kill* i *gen* w analizie zmiennych żywych** $FV(a)$ - zbiór wszystkich zmiennych występujących w wyrażeniu $a$ ![image](https://hackmd.io/_uploads/SkOnwP7RT.png) W sumie ma sens, jak popatrzymy na przykład. Robiąc przypisanie, "zabijamy" zmienną do której przypisujemy w tym sensie, że jej poprzednia wartość nas już nie obchodzi (czyli, jeżeli od poprzedniego przypisania nie była używana, to znaczy, że była martwa). Za to nasze przypisanie może używać innych zmiennych, które z kolei w tamtym momencie stają się żywe, bo ich używamy. Tzn. ```x := y + 1 ``` "zabija" starą wartość ```x```, ale sprawia, że wartość ```y``` jest "żywa", no bo właśnie w tym miejscu jej używamy. **Przykład** ![image](https://hackmd.io/_uploads/rkO1uvmR6.png) ### Analiza programu #### Przykład z wykładu Zwróćmy uwagę, że tutaj równania odnoszą się do tego, co jest *przed nimi* tzn. równanie opisujące wejście do instrukcji 1, odwołuje się do równania opisującego wyjście z niej, a to opisujące wyjście z instrukcji 1 odwołuje się do wejścia do instrukcji 2. To jest ta intuicja, że do analizy zmiennych żywych czytamy program *od końca*. Dlatego też "punkt startowy" (w którym nie ma żadnej zmiennej żywej) to wyjście z ostatniej instrukcji programu. Program: ![image](https://hackmd.io/_uploads/By7c2V4RT.png) Układ równań: ![image](https://hackmd.io/_uploads/Hybz2NVCp.png) Rozwiązanie: ![image](https://hackmd.io/_uploads/BJGN3V4AT.png) #### Analiza programu z zadania 1 Program: ![image](https://hackmd.io/_uploads/HJt1GH4A6.png) Układ równań: ![image](https://hackmd.io/_uploads/HyKKNSEAp.png) Rozwiązanie: ![image](https://hackmd.io/_uploads/ryesVSN0p.png) Wydaje mi się poprawne - $z$ jest żywe aż do 4, gdzie je wykorzystujemy jedyny raz w programie, $x$ też jest żywe do wyjścia z 5 itd.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully