Reading Prolog Code

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025
  • Prolog code can be read in different ways: declaratively, selectively, procedurally and informally. Selective reading is also called program slicing and is useful for generating explanations. Failure slicing is a special case of program slicing and lets us show reasons for nontermination of Prolog programs. More information: www.metalevel....

Комментарии • 4

  • @tomtomato4578
    @tomtomato4578 2 года назад +2

    This was very helpful! Thank you :)

  • @tariqrashid5932
    @tariqrashid5932 2 года назад +1

    At 17:00 the query list_length(Ls, 3) terminates. Why is this?
    It seems to be related to the addition of the constraint L #> 0 but I can't see why as L=3 is provided as input and L is always >0 so shouldn't effect termination.

    • @GianMarcoLeone
      @GianMarcoLeone Год назад

      list_length is evaluated recursively. So, for each iteration, the new L in the body is the L0 of the outer evaluation, that is L-1

  • @mwgkgk
    @mwgkgk 4 года назад

    Program slicing is debugging infinite loops with early returns