Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,16 @@
declare
%% Given a set as a list, returns its powerset (again as a list)
fun {Powerset Set}
proc {Describe Root}
%% Describe sets by lower bound (nil) and upper bound (Set)
Root = {FS.var.bounds nil Set}
%% enumerate all possible sets
{FS.distribute naive [Root]}
end
AllSets = {SearchAll Describe}
in
%% convert to list representation
{Map AllSets FS.reflect.lowerBoundList}
end
in
{Inspect {Powerset [1 2 3 4]}}

View file

@ -0,0 +1,8 @@
fun {Powerset2 Set}
case Set of nil then [nil]
[] H|T thens
Acc = {Powerset2 T}
in
{Append Acc {Map Acc fun {$ A} H|A end}}
end
end