Picat 0.7
Version of implementation Picat of programming language PicatChanges from the previous version Picat 0.6:
-
In
insert_ordered(L,T):Lmust be a proper list. - The two-product encoding is used in sat for the at-most-one constraint.
-
More efficient translation of
X #=> Yinsat. -
The function
len(Term)is added, which is equivalent tolength(Term). -
The attribute
lenis added as an alias oflength(e.g.,[1,2].len = L) -
Change the default labeling strategy for
max/minback tomaxof/minof(in Picat 0.6, it wasmaxof_inc/minof_inc). -
The objective expression in
minof/maxof/minof_inc/maxof_inccannot contain dot or index notations. - An improvement in the debugger.
-
A bug fix in
read_file_lines(File)for reading UTF-8 characters. -
Standardize the behaviors of
mod/2 anddiv/2 forcp,sat,mip, andbasic.
Links:
Examples:
Hello, World! - Picat (491):
main =>
print("Hello, World!\n").
Hello, World! - Picat (492):
main =>
println("Hello, World!").
Factorial - Picat (493):
This example implements recursive factorial definition using a predicate.
factorial(0, F) => F = 1.
factorial(N, F), N > 0 => factorial(N - 1, F1), F = N * F1.
main =>
foreach (I in 0 .. 16)
factorial(I, F),
writef("%w! = %w\n", I, F)
end.
Factorial - Picat (494):
This example implements recursive factorial definition using a function.
factorial(0) = 1.
factorial(N) = F, N > 0 => F = N * factorial(N - 1).
main =>
foreach (I in 0 .. 16)
writef("%w! = %w\n", I, factorial(I))
end.
Comments
]]>blog comments powered by Disqus
]]>