kuis-isle3sw / ioplmaterials Goto Github PK
View Code? Open in Web Editor NEWMaterials for the class "Implementation of Programming Languages" in Kyoto University.
License: Other
Materials for the class "Implementation of Programming Languages" in Kyoto University.
License: Other
Obsolete.
「プログラミング言語処理系」教科書16ページ注釈3の
プログラムはこのリポジトリのminiMLInterp ディレクトリに格納されている.
は,正しくは
プログラムはこのリポジトリのsrc ディレクトリに格納されている.
ではないでしょうか.
IoPLTextbook.pdfの5ページにあるExercise 1.0.1には
OCamlインタプリタに以下の入力を与えたところ,
# let rec f x = if x = 0 then x else false;;
という応答が返ってきた.この応答の意味するところを,下線部のが何を指すかを明らかにしつつ,説明せよ.
と書かれていますが、応答およびその下線部が抜けているように思います。おそらくpdfにする際に抜け落ちてしまったのではないでしょうか。
As far as MySet usage follows the instruction text, this does not cause problem since elements of the set is tyvar
and physical equality and structural equality are luckily consistent for integers.
However, It should be implemented List.mem to avoid trouble, and of course, from the viewpoint of correct implementation.
教科書P58 3行目の文字が右にはみ出てしまっています.
中間試験の勉強のために予習クイズの解答をいただきたいのですが、可能でしょうか?
The fib
function in p.39 uses a binary operator -
, but it is not defined in the parser.
Every year, some students try this example in their interpreter and get confused with a strange error.
Please rewrite n - 1
to n + -1
.
This might not be the best place to file issues regarding the github education environment but the Travis CI build seems to be failing recently due to bash not being able to find dune in the docker environment.
Here is a link to the build, but you might need permissions to view it. (This is mainly directed to @ksuenaga since he is probably the only other person who can see the build).
https://travis-ci.com/github/kuis-isle3sw/isle3sw-2020-interpreter-sp4ghet/builds/172534948
*** censored ***
It might be more useful if we can clarify the procedures expected by this README description, especially for the sake of those who are not too familiar with OCaml toolings:
落ちてきたソースコード中の textbook/interpreter/ ディレクトリの中にインタプリタのソースコードが入っているので,duneコマンドでビルドしましょう.
What the exact command is expected by this description?
I gave several commands a try, but didn't succeed in the build.
from
IoPLMaterials/
~/IoPLMaterials master*
❯ dune build
Error: I cannot find the root of the current workspace/project.
If you would like to create a new dune project, you can type:
dune init project NAME
Otherwise, please make sure to run dune inside an existing project or
workspace. For more information about how dune identifies the root of the
current workspace/project, please refer to
https://dune.readthedocs.io/en/stable/usage.html#finding-the-root
~/IoPLMaterials master*
❯ dune init project textbook/interpreter/
# generates some files that seem to be unexpected?
(manual clean up)
~/IoPLMaterials master*
❯ cd textbook/interpreter
~/IoPLMaterials/textbook/interpreter master*
❯ dune build
Entering directory '/Users/aviatesk/IoPLMaterials/textbook'
File "interpreter/miniml.opam", line 1, characters 0-0:
Error: This opam file doesn't have a corresponding (package ...) stanza in
the dune-project_file. Since you have at least one other (package ...) stanza
in your dune-project file, you must a (package ...) stanza for each opam
package in your project.
bundle exec jekyll s
returns the following. Maybe my fix is not working. I'll take care of this later.
Liquid Exception: Invalid syntax for include tag. File contains invalid characters or sequences: ../miniml-interpreter/lib/syntax.ml Valid syntax: {% include_relative file.ext param='value' param2='value' %} in textbook/chap03-2.md
jekyll 3.9.0 | Error: Invalid syntax for include tag. File contains invalid characters or sequences:
../miniml-interpreter/lib/syntax.ml
Valid syntax:
{% include_relative file.ext param='value' param2='value' %}
/Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/tags/include.rb:67:in `validate_file_name': Invalid syntax for include tag. File contains invalid characters or sequences: (ArgumentError)
../miniml-interpreter/lib/syntax.ml
Valid syntax:
{% include_relative file.ext param='value' param2='value' %}
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/tags/include.rb:128:in `render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:91:in `render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/block.rb:17:in `render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/tags/highlight.rb:34:in `render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-commonmark-ghpages-0.1.6/lib/jekyll-commonmark-ghpages.rb:100:in `render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:82:in `render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:30:in `block (2 levels) in render!'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:42:in `measure_bytes'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:29:in `block in render!'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:49:in `measure_time'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/liquid_renderer/file.rb:28:in `render!'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:126:in `render_liquid'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:79:in `render_document'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/renderer.rb:62:in `run'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:479:in `render_regenerated'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:472:in `block in render_pages'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:471:in `each'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:471:in `render_pages'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:192:in `render'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/site.rb:71:in `process'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/command.rb:28:in `process_site'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:65:in `build'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/build.rb:36:in `process'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `block in start'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `each'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:93:in `start'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/lib/jekyll/commands/serve.rb:75:in `block (2 levels) in init_with_program'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/gems/jekyll-3.9.0/exe/jekyll:15:in `<top (required)>'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/bin/jekyll:23:in `load'
from /Users/ksuenaga/work/IoPL/IoPLMaterials/vendor/bundle/ruby/3.0.0/bin/jekyll:23:in `<top (required)>'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `load'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/cli/exec.rb:63:in `kernel_load'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/cli/exec.rb:28:in `run'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/cli.rb:497:in `exec'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/cli.rb:30:in `dispatch'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/cli.rb:24:in `start'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/libexec/bundle:49:in `block in <top (required)>'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/3.0.0/bundler/friendly_errors.rb:130:in `with_friendly_errors'
from /Users/ksuenaga/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bundler-2.2.3/libexec/bundle:37:in `<top (required)>'
from /Users/ksuenaga/.rbenv/versions/3.0.0/bin/bundle:23:in `load'
from /Users/ksuenaga/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>'
IoPLTextbook.pdfのページ8にて「例えば,〜は文法的に正しいC言語のプログラムであるが,」という部分がありますが、波線部分に挿入されていたであろうプログラムが抜け落ちているのではないかと思います。
https://github.com/ksuenaga/IoPLMaterials/blob/master/textbook/camlNyumon.ml#L9
の円周率は、
3.141592653589793238642643383279 じゃなくて
3.141592653589793238462643383279 ではないでしょうか
The directory src
was renamed for interpreter
in commit d275115.
However, directory name in .gitignore is still src
.
So, these src
should be changed to interpreter
.
このプロジェクトへの GitHub Sponsors, PayPal や 暗号通貨での寄付は受け付けていますか(or 受付予定はありますか)
Does/Will this project accept donation via GitHub Sponsors, Paypal or crypto currency?
IoPLTextbook.pdfの5ページにあるExercise 1.0.2 (3)にあるmapTree
の型ですが、bt -> int -> int -> bt
よりもbt -> (int -> int) -> bt
の方が正確ではないでしょうか。また、List.map : ('a -> 'b) -> 'a list -> 'b list
のように(int -> int) -> bt -> bt
型にしていないのには何か理由がございますか……?
Under which license is this repo published?
From the GitHub page on Licensing a repository:
Without a license, the default copyright laws apply, meaning that you retain all rights to your source code and no one may reproduce, distribute, or create derivative works from your work.
string_of_ty
の実装に依存しているが、変更例として示されている部分に string_of_ty
の変更があげられていない。syntax.ml への変更
(* MiniML の型を表す OCaml の値の型 *)
type ty =
TyInt
| TyBool(* ty 型の値のための pretty printer *)
let pp_ty typ =
match typ with
TyInt -> print_srtring "int"
| TyBool -> print_string "bool"
pp_ty
を実装することになっているが、ソースコード上は string_of_ty
を実装することになっているpp_ty と freevar_ty を完成させよ.freevar_ty は,与えられた型中の型変数の集合を返す関数で,型は ty -> tyvar MySet.t とする.型 'a MySet.t は mySet.mli で定義されている型 'a の値を要素とする集合を表す値の型である.
let string_of_ty _ =
assert false (* Exercise 4.3.1 *)
したがって、教科書を順番に読んで、4.2.1を実装しただけではテストが通らない。
4.2.1の時点でML2のための string_of_ty
と pp_ty
を実装させ、4.3.1でそれらをML3向けに拡張しろ、とした方が良いと考えています。
For example, Fig 4.1 in textbook/chap04-1.pdf shows the changes in main.ml
but the actual needed changes is in cui.ml
and main.ml
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.