Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#begin_lua function min(a,b) return math.min(a,b) end #end_lua. | |
%% Adam's minimal event calculus formalism: | |
%% - only true holds/happens are tracked | |
%% - all fluents are always inertial | |
%% - time is a totally ordered contiguous integer sequence | |
%% - events and fluents are self-contained terms | |
%% - T variables always come first for easy sorting | |
initiated(T,F) :- happens(T,E), initiates(T,E,F). |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#begin_lua | |
function collect(pred,arity) | |
local t = {} | |
Assignment.begin(pred,arity) | |
while Assignment.next() do | |
if Assignment.isTrue() then | |
table.insert(t,Assignment.args()) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#begin_lua | |
function args(t) | |
if Val.type(t) == Val.FUNC then | |
local res = t:args() | |
res.n = nil | |
return res | |
else | |
return {} | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node(1..100). | |
1 { arc(A,B):node(A):node(B) }. | |
%arc(A,C) :- arc(A,B), arc(B,C). | |
%% intent: forall( nodes(a,b,c), implies( and(arc(a,b), arc(b,c)), arc(a,c) ) ). | |
var(a;b;c). | |
bind(V,N):node(N) :- var(V). | |
bot :- bind(a,A), bind(b,B), not arc(A,B). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Sample script to make an HTTP request with query parameters | |
local response = http.request { | |
url = 'http://www.random.org/integers/', | |
params = { | |
num=1, min=0, max=1, format='plain', | |
rnd='new', col=1, base=10 | |
} | |
} | |
if tonumber(response.content) == 0 then | |
return 'heads' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is a snippet from RSAudioDemoActivity#run | |
Process.setThreadPriority(Process.THREAD_PRIORITY_AUDIO); | |
short samples[] = new short[BLOCK_FRAMES]; | |
Allocation out = Allocation.createSized(renderScript, Element.I16(renderScript), samples.length, Allocation.USAGE_SCRIPT); | |
synth.set_block_frames(BLOCK_FRAMES); | |
synth.bind_block_out(out); | |
synth.set_sample_rate(SAMPLE_RATE_IN_HZ); |