Logic Language
Advertisement
So I went ahead and added those things. Pi takes ~0.09 seconds here so its between Tangent and Epoch... not that this is intended to be a real language heh. There is now a full multivalued lukasiewicz logic. Where 1 is true 0 is false and there is still mu. I have yet to add string and there is no boolean type. So the behaviour goes like: unbound variables default to mu. senseless operation result in mu. So for print 2 < true prints Mu.
There are types. floats can be used as normal numbers or as values in a logic if they are between 0 and 1 and when used with normal logic operators. For example print 5 => 6 is mu. but print 0.005 => 0.006 is 1.0. you can still do logic like
truthtable P => Q (for L3 logic). you can also do thing like if tautology p & p print p else print mu.
Anyways here is the source for pi:
There are types. floats can be used as normal numbers or as values in a logic if they are between 0 and 1 and when used with normal logic operators. For example print 5 => 6 is mu. but print 0.005 => 0.006 is 1.0. you can still do logic like
truthtable P => Q (for L3 logic). you can also do thing like if tautology p & p print p else print mu.
Anyways here is the source for pi:
isPlus := true;denominator := 1.0;val := 0.0;while denominator < 10000.0 do begin if isPlus then val := val + (4.0 / denominator) else val := val - (4.0 / denominator); isPlus := Not isPlus; denominator := denominator + 2.0 end;print val////////////////////////Began at: 07/08/2008 20:36:58: FalseTFloat 3.141392654Finished at: 07/08/2008 20:36:58 Interval: 00:00:00.1093750runBegan at: 07/08/2008 20:36:59: FalseTFloat 3.141392654Finished at: 07/08/2008 20:36:59 Interval: 00:00:00.0937500raining := 0.4;cloudy := 0.7;shining := 0.2;if raining Or shining => cloudy <=> 1.0 then print 200; print raining Or shining => cloudyBegan at: 07/08/2008 20:43:36TInteger 200 TFloat 1.0Finished at: 07/08/2008 20:43:36 Intervalprint true ^ 20; print 2 ^ 20;Error near line 0, character 30 Try one of: print ; quit; trycounter; tue | false; =>, ^, Or, Not, <=>TTriv FalseInput: print true ^ 20; print 2 ^ 20TTriv Mu TFloat 1048576.0Input: print 2 < trueTTriv MuAdvertisement
Advertisement
Advertisement
Discussion