iensen / sparc Goto Github PK
View Code? Open in Web Editor NEWSorted A-Prolog with Consistency Restoring rules.
License: Other
Sorted A-Prolog with Consistency Restoring rules.
License: Other
The program with
does not compile..
The following program:
sorts
predicates
p(#s).
rules
1{p(X)}1 :- X<1.
Incorrectly classifies variable X as unrestricted.
The translation should be
1{p(X):s(X)}1 :- X<1,s(X).
Given a program with empty sorts, such as:
sorts
#booleans = {true, false}.
#garage = {r2}.
#john = {r1}.
#football = {r3}.
#activity = {}.
#carry = {}.
Running java -jar sparc.jar program.sparc
produces the following output and then terminates:
SPARC V2.56
sort activity defined at line 11 column 2 is empty
Currently, both default negation and classical negation are allowed before sort atoms:
For example, the following program is valid:
sorts
predicates
p(#s).
q(#s2).
r(#s2).
rules
q(X) :- -#s(X).
r(X) :- not #s(X).
However they do not have intuitive behavior (non of the literals q(d) and r(d) are implied).
Current proposal is to prohibit negations.
(Alternatively, we can alter the semantics to make not #s(X) mean "X is not in s" for any X in the domain of the program)
When I use -o together with -A option, the output is repeated twice.
E.g, the program
sorts
predicates
p(#s).
q(#s).
rules
p(a).
q(a).
Should only produce p(a) when run in sparc with an option -A.
SPARC performs badly when output answer sets are large. It works faster if output is taken from DLV run on the translated file.
When an unsupported version of clingo is used (<=5), Sparc should produce an error.
Some code needs to be added in ClingoSolver.java.
If a sparc program has many answer sets, they are all stored in a string buffer.
This can be avioided by streaming them directly to the terminal window (when the option -A) is used.
E.g, this program:
sorts
predicates
p(#s).
q(#s).
rules
p(a).
q(a).
When being run in SPARC with an option -A should only output p(a) in answer sets.
Allow to use arithmetic expressions in definitions of a new constant, e.g:
Allow anonimous sorts (e.g, a predicate definition of the form p({a,b,c}).
This program:
#maxint=20.
sorts
#s={f(5),6}.
predicates
p(#s).
q(#s).
rules
p(f(X+1)).
produced the following swi-prolog program:
:- use_module(library(clpfd)).
:- style_check(-singleton).
set_1(6).
set_1(f(5)).
p :- set_1(X_0),X_0 #= f(X+1),[X_0,X] ins 0..20,labeling([],[X_0,X]).
main :-(p -> writeln(yes) ; writeln(no)).
Which has illegal atom X_0 #= f(X+1).
Make CR-rules work when clingo solver is used.
Allow 'mod' to occur in program literals.
This program:
1{p(X):#s(X)}1 should work.
Given program
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Template for a SPARC file
%% Author:
%% Description:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
sorts
#people = {f(a,sara), f(b, sara), f(a, bob)}.
predicates
father(#people, #people).
rules
father(f(a,bob), f(a,sara)).
father(f(a, bob), f(b, sara)).
display
father(X, f(Z, sara)).
We have complaint for the statement in the display section:
SPARC V2.54
temp.sp: non-ground term "f(Z,sara)" occuring in program as 2 argument of predicate father/2
is not a program term
@iensen ๐
Below is a CR-Prolog program:
predicates
a(). b(). c().
rules
a.
-a :- not b, not c.
b :+. c :+.
b :- c.
c :- b.
Sparc+DLV gives:
SPARC V2.49
program translated
{a, b, c}
{a, b, c}
The answer set {a, b, c}
is duplicated, possibly because it has two abductive supports {b :+.}
and {c :+.}
.
| java -jar sparc.jar
does not work..
Hi I'm having trouble with the solveropts argument "pfilter" and "filter" with sparc 2.48 and DLV Dec 17 2012. Somehow the argument is not being passed from sparc to DLV. In the screenshot I compile using sparc and pass the compiled file and desired filter to DLV and it gives the expected output. Thanks.
:- #count{X1 : p(X1)} > 0, q(X1).
should produce an error or a warning
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.