Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun{CheckMap Map}
- fun{CheckVal Val}
- if {Float.is Val} then true
- else
- case Val
- of plus(A B) then ({CheckVal A} andthen {CheckVal B})
- [] minus(A B) then ({CheckVal A} andthen {CheckVal B})
- [] mult(A B) then ({CheckVal A} andthen {CheckVal B})
- [] 'div'(A B) then ({CheckVal A} andthen {CheckVal B})
- [] cos(A) then {CheckVal A}
- [] sin(A) then {CheckVal A}
- [] tan(A) then {CheckVal A}
- [] exp(A) then {CheckVal A}
- [] log(A) then {CheckVal A}
- [] neg(A) then {CheckVal A}
- else false
- end
- end
- end
- fun{CheckForm Form}
- if {Float.is Form} then true
- else
- case Form
- of plus(A B) then ({CheckForm A} andthen {CheckForm B})
- [] minus(A B) then ({CheckForm A} andthen {CheckForm B})
- [] mult(A B) then ({CheckForm A} andthen {CheckForm B})
- [] 'div'(A B) then ({CheckForm A} andthen {CheckForm B})
- [] cos(A) then {CheckForm A}
- [] sin(A) then {CheckForm A}
- [] tan(A) then {CheckForm A}
- [] exp(A) then {CheckForm A}
- [] log(A) then {CheckForm A}
- [] neg(A) then {CheckForm A}
- [] ite(A B C) then ({CheckForm A} andthen {CheckForm B} andthen {CheckForm B})
- [] eq(A B) then ({CheckForm A} andthen {CheckForm B})
- [] ne(A B) then ({CheckForm A} andthen {CheckForm B})
- [] lt(A B) then ({CheckForm A} andthen {CheckForm B})
- [] le(A B) then ({CheckForm A} andthen {CheckForm B})
- [] gt(A B) then ({CheckForm A} andthen {CheckForm B})
- [] ge(A B) then ({CheckForm A} andthen {CheckForm B})
- else false
- end
- end
- end
- fun{CheckPrim Prim}
- case Prim
- of primitive(kind: RuP) then case RuP
- of road then true
- [] building then true
- [] water then true
- else false
- end
- else false
- end
- end
- fun{CheckPrimPok Prim}
- case Prim
- of primitive(kind: PuP) then case PuP
- of pokemon then true
- [] arena then true
- [] pokestop then true
- else false
- end
- else false
- end
- end
- fun{CheckTrans Trans}
- case Trans of translate(dx:Dx dy:Dy 1:Ru)
- then ({CheckVal Dx} andthen {CheckVal Dy} andthen {CheckR Ru})
- else false
- end
- end
- fun{CheckTransPok Trans}
- case Trans of translate(dx:Dx dy:Dy 1:Pu)
- then ({CheckForm Dx} andthen {CheckForm Dy} andthen {CheckP Pu})
- else false
- end
- end
- fun{CheckRot Rot}
- case Rot of rotate(angle:Angle 1:Ru)
- then ({CheckVal Angle} andthen {CheckR Ru})
- else false
- end
- end
- fun{CheckScale Scale}
- case Scale of scale(rx:Rx ry:Ry 1:Ru)
- then ({CheckVal Rx} andthen {CheckVal Ry} andthen {CheckR Ru})
- else false
- end
- end
- fun{CheckSpa Spa}
- case Spa of spawn(tmin:Tmin tmax:Tmax 1:Pu)
- then ({CheckForm Tmin} andthen {CheckForm Tmax} andthen {CheckP Pu})
- else false
- end
- end
- fun{CheckR Ru}
- case Ru
- of H|T then
- case H
- of primitive(kind:A) then ({CheckPrim H} andthen {CheckR T})
- [] translate(dx:Dx dy:Dy 1:Ru) then ({CheckTrans H} andthen {CheckR T})
- [] rotate(angle:Angle 1:Ru) then ({CheckRot H} andthen {CheckR T})
- [] scale(rx:Rx ry:Ry 1:Ru) then ({CheckScale H} andthen {CheckR T})
- else false
- end
- [] nil then true
- else false
- end
- end
- fun{CheckP Pu}
- case Pu
- of H|T then
- case H
- of primitive(kind:A) then ({CheckPrimPok H} andthen {CheckP Pu})
- [] translate(dx:Dx dy:Dy 1:Pu) then ({CheckTransPok H} andthen {CheckP Pu})
- [] spawn(tmin:Tmin tmax:Tmax 1:Pu) then ({CheckSpa H} andthen {CheckP Pu})
- else false
- end
- [] nil then true
- else false
- end
- end
- in
- case Map
- of map(ru:Ru pu:Pu) then
- if ({CheckR Ru} andthen {CheckP Pu})
- then true
- else false
- end
- else false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement