Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun{CheckMap Map}
- local R P CheckRU CheckRUI CheckRUP CheckValue CheckPU CheckPUI CheckPUP CheckFormula in
- R= Map.ru
- P= Map.pu
- fun{CheckRU R}
- case R of nil then true
- [] H|T then {CheckRUI H} andthen {CheckRU T}
- else false
- end
- end
- fun{CheckRUI R}
- case R
- of primitive(kind:A) andthen {CheckRUP A}
- [] translate(dx:A dy:B 1:C) then {CheckValue A} andthen {CheckValue B} andthen {CheckRU C}
- else false
- end
- end
- fun{CheckRUP R}
- case R
- of road then true
- [] building then true
- []water then true
- else false
- end
- end
- fun{CheckValue R}
- case R
- of plus(A B) then {CheckValue A} andthen {CheckValue B}
- []minus(A B) then {CheckValue A} andthen {CheckValue B}
- []mult(A B) then {CheckValue A} andthen {CheckValue B}
- []'div'(A B) then {CheckValue A} andthen {CheckValue B}
- []cos(A) then {CheckValue A}
- []sin(A) then {CheckValue A}
- []tan(A) then {CheckValue A}
- [] {Float.is R} then true
- else false
- end
- end
- fun{CheckPU P}
- case P
- of nil then true
- []H|T then {CheckPUI H} andthen {CheckPU T}
- else false
- end
- end
- fun{CheckPUI P}
- case P
- of primitive(kind:A) then {CheckPUP A}
- [] translate(dx:A dy:B 1:C) then {CheckFormula A} andthen {CheckFormula B} andthen {CheckPU C}
- else false
- end
- end
- fun{CheckPUP P}
- case P
- of pokemon then true
- []pokestop then true
- [] arena then true
- else false
- end
- end
- fun{CheckFormula P}
- case P
- of time then true
- [] plus(A B) then {CheckFormula A} andthen {CheckFormula B}
- []minus(A B) then {CheckFormula A} andthen {CheckFormula B}
- []mult(A B) then {CheckFormula A} andthen {CheckFormula B}
- []'div'(A B) then {CheckFormula A} andthen {CheckFormula B}
- []cos(A) then {CheckFormula A}
- []sin(A) then {CheckFormula A}
- []tan(A) then {CheckFormula A}
- [] {Float.is P} then true
- else false
- end
- end
- if {CheckRU R} then {CheckPU P} else false end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement