文章目录
1. Overview
- References
• Stanford CS103, https://web.stanford.edu/class/cs103
• NYU G22.2390-001, https://cvc4.cs.stanford.edu/logic/ • CMU CDM http://www.cs.cmu.edu/~cdm/
• UB CS70 http://inst.eecs.berkeley.edu/~cs70/fa16/
• CMU-CS122 https://www.cs.cmu.edu/~iliano/courses/17F-CMU-CS122/
• Stanford CS103, https://web.stanford.edu/class/cs103
• CMU 15-453 https://www.cs.cmu.edu/~fp/courses/flac/
• Columbia, COMS W3261, http://www.cs.columbia.edu/~aho/cs3261/ • IITJodhpur,CS222,http://krchowdhary.com/toc/cs222.html
• 南京大学离散数学课程
- To Be Distinguished, You Need To
Take
-
✓ Lectures
-
✓ Recitation (Optional)
Do
-
✓ 3 Labs
-
✓ Preliminary Questions
-
✓ Homework
Pass
✓ Quiz✓ Finalexam
Grading Breakdown
- Others 20%
- Lab 20%
- Quiz 20%
- Final 40%
Faculty Information
网站
Website:
http://ipads.se.sjtu.edu.cn/courses/cdm
Canvas:
https://oc.sjtu.edu.cn/courses/24410
形式化验证网站:
https://rise4fun.com/Dafny/tutorial
Three Parts of CDM(*)
Part I. Reasoning. (8 ~ 9 Weeks)
How to prove the correctness?
Part II. Computability. (~ 6 Weeks)
Is the problem computable (solvable)?
Part III. Probability. (~1 Weeks)
How does computer solve continuous problem? (Underneath the ML)
Textbooks
《数理逻辑与集合论》第2版 • 石纯一 著,清华大学出版社
John E. Hopcroft, Rajeev Motwani and Jeffrey D. Ullman, Introduction to Automata Theory, Languages, and Computation, Pearson, 2001
移位运算符
左移(<<)
i = i << n ; 相当于 i = i * (2 ^ n )
右移(>>)
i = i >> n ; 相当于 i = i / ( 2 ^ n )
位运算符 与(&)运算符 异或^
&
位操作中的与操作运算符。也就是常说的and操作,双目运算符。
计算的时候按位计算,&两边操作数对应位上全为1时,结果的该位值为1。否则该位值为0
比如0x12&0x23 转为二进制为:B00010010&B00100011,按位计算结果为B00000010,
即结果为0x02
^
两个二进制操作数对应位相同为0,不同为1;
异或交换取值
void swap(int a, int b)
{
a ^= b;
b ^= a;
a ^= b;
}
参考:
https://blog.youkuaiyun.com/mofeigege/article/details/106304076?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522159995841819725222400123%2522%252C%2522scm%2522%253A%252220140713.130102334…%2522%257D&request_id=159995841819725222400123&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2alltop_click~default-1-106304076.first_rank_ecpm_v3_pc_rank_v2&utm_term=位运算符&spm=1018.2118.3001.4187
https://jingyan.baidu.com/article/a3f121e4919494fc9052bb0f.html
question
Three Parts of CDM CDM:computer Discrete Mathematics? Yes
(Underneath the ML):Machine Learning? Yes
形式化验证举例:
method clone(n: nat) returns (b : nat)
ensures b == n
{
var i := 0;
while i < n
invariant 0 <= i && i <= n
{
i := i + 1;
}
return i; }
本课词汇
1.Propositional 命题
2.semantic 语义的