diff --git a/src/AstArgument.h b/src/AstArgument.h index b069aa90433..54b248396b8 100644 --- a/src/AstArgument.h +++ b/src/AstArgument.h @@ -19,6 +19,7 @@ #pragma once #include "AstNode.h" +#include "AstType.h" #include "AstTypes.h" #include "FunctorOps.h" #include "SymbolTable.h" @@ -254,7 +255,7 @@ class AstNullConstant : public AstConstant { /** Print argument to the given output stream */ void print(std::ostream& os) const override { - os << '-'; + os << "nil"; } /** Creates a clone of this AST sub-structure */ @@ -484,11 +485,24 @@ class AstRecordInit : public AstArgument { /** The list of components to be aggregated into a record */ std::vector> args; + /** The type of record being construted */ + AstTypeIdentifier type; + public: AstRecordInit() = default; + AstRecordInit(const AstTypeIdentifier& type) : type(type) {} + ~AstRecordInit() override = default; + void setType(const AstTypeIdentifier& t) { + type = t; + } + + AstTypeIdentifier getType() const { + return type; + } + void add(std::unique_ptr arg) { args.push_back(std::move(arg)); } @@ -498,12 +512,12 @@ class AstRecordInit : public AstArgument { } void print(std::ostream& os) const override { - os << "[" << join(args, ",", print_deref>()) << "]"; + os << "*" << type << "[" << join(args, ",", print_deref>()) << "]"; } /** Creates a clone of this AST sub-structure */ AstRecordInit* clone() const override { - auto res = new AstRecordInit(); + auto res = new AstRecordInit(type); for (auto& cur : args) { res->args.push_back(std::unique_ptr(cur->clone())); } @@ -532,7 +546,7 @@ class AstRecordInit : public AstArgument { bool equal(const AstNode& node) const override { assert(nullptr != dynamic_cast(&node)); const auto& other = static_cast(node); - return equal_targets(args, other.args); + return equal_targets(args, other.args) && type == other.type; } }; diff --git a/src/ComponentModel.cpp b/src/ComponentModel.cpp index e17b00531a8..f2ffd827eec 100644 --- a/src/ComponentModel.cpp +++ b/src/ComponentModel.cpp @@ -407,6 +407,14 @@ ComponentContent getInstantiatedContent(const AstComponentInit& componentInit, } } }); + + // rename type information in record constructor + visitDepthFirst(node, [&](const AstRecordInit& record) { + auto pos = typeNameMapping.find(record.getType()); + if (pos != typeNameMapping.end()) { + const_cast(record).setType(pos->second); + } + }); }; // rename attribute type in headers and atoms in clauses of the relation diff --git a/src/parser.yy b/src/parser.yy index bdc3ebef859..3bf14ebb4d6 100644 --- a/src/parser.yy +++ b/src/parser.yy @@ -659,12 +659,13 @@ arg $$ = new AstIntrinsicFunctor(FunctorOp::LNOT, std::unique_ptr($2)); $$->setSrcLoc(@$); } - | LBRACKET RBRACKET { - $$ = new AstRecordInit(); + | STAR type_id LBRACKET RBRACKET { + $$ = new AstRecordInit(*$2); $$->setSrcLoc(@$); } - | LBRACKET recordlist RBRACKET { - $$ = $2; + | STAR type_id LBRACKET recordlist RBRACKET { + $4->setType(*$2); + $$ = $4; $$->setSrcLoc(@$); } | NIL { diff --git a/src/test/ast_utils_test.cpp b/src/test/ast_utils_test.cpp index 3de7dedcda1..63cc79146c6 100644 --- a/src/test/ast_utils_test.cpp +++ b/src/test/ast_utils_test.cpp @@ -110,7 +110,7 @@ TEST(AstUtils, GroundedRecords) { .decl r ( r : R ) .decl s ( r : N ) - s(x) :- r([x,y]). + s(x) :- r(*R [x,y]). )", sym, e, d); @@ -120,7 +120,7 @@ TEST(AstUtils, GroundedRecords) { auto clause = program.getRelation("s")->getClause(0); // check construction - EXPECT_EQ("s(x) :- \n r([x,y]).", toString(*clause)); + EXPECT_EQ("s(x) :- \n r(*R[x,y]).", toString(*clause)); // obtain groundness auto isGrounded = getGroundedTerms(*clause); @@ -339,8 +339,9 @@ TEST(AstUtils, GroundTermPropagation) { R"( .type D .decl p(a:D,b:D) + .type R = [ x : D, y : D ] - p(a,b) :- p(x,y), r = [x,y], s = r, s = [w,v], [w,v] = [a,b]. + p(a,b) :- p(x,y), r = *R [x,y], s = r, s = *R [w,v], *R [w,v] = *R [a,b]. )", sym, e, d); @@ -349,15 +350,15 @@ TEST(AstUtils, GroundTermPropagation) { // check types in clauses AstClause* a = program.getRelation("p")->getClause(0); - EXPECT_EQ("p(a,b) :- \n p(x,y),\n r = [x,y],\n s = r,\n s = [w,v],\n [w,v] = [a,b].", + EXPECT_EQ("p(a,b) :- \n p(x,y),\n r = *R[x,y],\n s = r,\n s = *R[w,v],\n *R[w,v] = *R[a,b].", toString(*a)); std::unique_ptr res = ResolveAliasesTransformer::resolveAliases(*a); std::unique_ptr cleaned = ResolveAliasesTransformer::removeTrivialEquality(*res); EXPECT_EQ( - "p(x,y) :- \n p(x,y),\n [x,y] = [x,y],\n [x,y] = [x,y],\n [x,y] = [x,y],\n [x,y] = " - "[x,y].", + "p(x,y) :- \n p(x,y),\n *R[x,y] = *R[x,y],\n *R[x,y] = *R[x,y],\n *R[x,y] = *R[x,y],\n " + "*R[x,y] = *R[x,y].", toString(*res)); EXPECT_EQ("p(x,y) :- \n p(x,y).", toString(*cleaned)); } @@ -399,14 +400,15 @@ TEST(AstUtils, ResolveGroundedAliases) { R"( .type D .decl p(a:D,b:D) + .type R = [ x : D, y : D ] - p(a,b) :- p(x,y), r = [x,y], s = r, s = [w,v], [w,v] = [a,b]. + p(a,b) :- p(x,y), r = *R [x,y], s = r, s = *R [w,v], *R [w,v] = *R [a,b]. )", sym, e, d); AstProgram& program = *tu->getProgram(); - EXPECT_EQ("p(a,b) :- \n p(x,y),\n r = [x,y],\n s = r,\n s = [w,v],\n [w,v] = [a,b].", + EXPECT_EQ("p(a,b) :- \n p(x,y),\n r = *R[x,y],\n s = r,\n s = *R[w,v],\n *R[w,v] = *R[a,b].", toString(*program.getRelation("p")->getClause(0))); std::make_unique()->apply(*tu); diff --git a/tests/evaluation/aliases/aliases.dl b/tests/evaluation/aliases/aliases.dl index 4db5fbe87e8..507665c962b 100644 --- a/tests/evaluation/aliases/aliases.dl +++ b/tests/evaluation/aliases/aliases.dl @@ -7,7 +7,7 @@ // tests the proper handling of aliases .number_type N - +.type R = [x : N, y : N] .decl n ( a : N ) @@ -30,5 +30,4 @@ a(3,2). .decl r ( a : N ) .output r () -r(z) :- a(x,y), r = [x,y], s = r, s = [v,w], w=z, z=v. - +r(z) :- a(x,y), r = *R[x,y], s = r, s = *R[v,w], w=z, z=v. diff --git a/tests/evaluation/components_generic/components_generic.dl b/tests/evaluation/components_generic/components_generic.dl index 1f85bc8789d..e63b86d7619 100644 --- a/tests/evaluation/components_generic/components_generic.dl +++ b/tests/evaluation/components_generic/components_generic.dl @@ -61,9 +61,9 @@ StreetMap.e("B","C"). .init SocialNet = Net -#define Homer ["Homer","Evergreen Terrace 742"] -#define Ned ["Ned","Evergreen Terrace 744"] -#define Edna ["Ned","Evergreen Terrace 82"] +#define Homer *Person["Homer","Evergreen Terrace 742"] +#define Ned *Person["Ned","Evergreen Terrace 744"] +#define Edna *Person["Ned","Evergreen Terrace 82"] SocialNet.e(Homer,Ned). SocialNet.e(Ned,Edna). @@ -75,7 +75,3 @@ SocialNet.e(Ned,Edna). .output result() result("Map Works") :- StreetMap.r("C","A"). result("Social Net Works") :- SocialNet.r(Edna,Homer). - - - - diff --git a/tests/evaluation/inline_nqueens/inline_nqueens.dl b/tests/evaluation/inline_nqueens/inline_nqueens.dl index ca7f000da7e..e244a19a0c3 100644 --- a/tests/evaluation/inline_nqueens/inline_nqueens.dl +++ b/tests/evaluation/inline_nqueens/inline_nqueens.dl @@ -31,7 +31,7 @@ up_to_size(x + 1) :- up_to_size(x), !size(x). // This relation holds the position of each square of the board. .decl on_board( p : Position ) inline -on_board([x, y]) :- up_to_size(x), up_to_size(y). +on_board(*Position[x, y]) :- up_to_size(x), up_to_size(y). // Mutually-non-attacking list of queen positions. @@ -40,16 +40,16 @@ on_board([x, y]) :- up_to_size(x), up_to_size(y). // Arguments are not on the same diagonal. .decl non_diagonals( p : Position, q : Position ) inline -non_diagonals([px, py], [qx, qy]) :- px - qx != py - qy, qx - px != py - qy, on_board([px, py]), on_board([qx, qy]). +non_diagonals(*Position[px, py], *Position[qx, qy]) :- px - qx != py - qy, qx - px != py - qy, on_board(*Position[px, py]), on_board(*Position[qx, qy]). // Holds if p and q do not attack each other. .decl sympathetic( p : Position, q : Position ) inline -sympathetic(p, q) :- non_diagonals(p, q), px != qx, py != qy, p=[px, py], q=[qx,qy]. +sympathetic(p, q) :- non_diagonals(p, q), px != qx, py != qy, p=*Position[px, py], q=*Position[qx,qy]. // Holds if the head of qs is mutually non-attacking with its tail, which should itself be compatible. // Generated column by column, left to right. .decl compatible( qs : QueenList, n : number ) -compatible([p, nil], 1) :- on_board(p). //, p = [1,y]. -compatible([p, [head, tail]], n+1) :- sympathetic(p, head), compatible([p, tail], n), compatible([head, tail], n), p = [px, py], head = [hx, hy], px > hx. +compatible(*QueenList[p, nil], 1) :- on_board(p). //, p = *Position[1,y]. +compatible(*QueenList[p, *QueenList[head, tail]], n+1) :- sympathetic(p, head), compatible(*QueenList[p, tail], n), compatible(*QueenList[head, tail], n), p = *Position[px, py], head = *Position[hx, hy], px > hx. diff --git a/tests/evaluation/inline_nqueens/inline_nqueens.err b/tests/evaluation/inline_nqueens/inline_nqueens.err index 1b88c7936a2..d25fd4e5b18 100644 --- a/tests/evaluation/inline_nqueens/inline_nqueens.err +++ b/tests/evaluation/inline_nqueens/inline_nqueens.err @@ -1,6 +1,6 @@ Warning: Variable py only occurs once in file inline_nqueens.dl at line 55 -compatible([p, [head, tail]], n+1) :- sympathetic(p, head), compatible([p, tail], n), compatible([head, tail], n), p = [px, py], head = [hx, hy], px > hx. -----------------------------------------------------------------------------------------------------------------------------^------------------------------ +compatible(*QueenList[p, *QueenList[head, tail]], n+1) :- sympathetic(p, head), compatible(*QueenList[p, tail], n), compatible(*QueenList[head, tail], n), p = *Position[px, py], head = *Position[hx, hy], px > hx. +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------^--------------------------------------- Warning: Variable hy only occurs once in file inline_nqueens.dl at line 55 -compatible([p, [head, tail]], n+1) :- sympathetic(p, head), compatible([p, tail], n), compatible([head, tail], n), p = [px, py], head = [hx, hy], px > hx. ----------------------------------------------------------------------------------------------------------------------------------------------^------------- +compatible(*QueenList[p, *QueenList[head, tail]], n+1) :- sympathetic(p, head), compatible(*QueenList[p, tail], n), compatible(*QueenList[head, tail], n), p = *Position[px, py], head = *Position[hx, hy], px > hx. +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^------------- diff --git a/tests/evaluation/inline_records/inline_records.dl b/tests/evaluation/inline_records/inline_records.dl index 9a22a8c2d36..3ba3077f128 100644 --- a/tests/evaluation/inline_records/inline_records.dl +++ b/tests/evaluation/inline_records/inline_records.dl @@ -14,17 +14,17 @@ ] .decl a(x:Conn, y:Conn) inline -a(["Hello", "Goodbye"], ["temporary", "value"]). -a(["temporary", "value"], ["NO", "NO"]). -a(["can", "do"], ["my", "value"]). +a(*Conn["Hello", "Goodbye"], *Conn["temporary", "value"]). +a(*Conn["temporary", "value"], *Conn["NO", "NO"]). +a(*Conn["can", "do"], *Conn["my", "value"]). .decl b(x:Conn, y:Conn) inline -b(["good job", "bad job"], ["can", "do"]). -b(x, y) :- a(x, y), x != ["temporary", "value"]. +b(*Conn["good job", "bad job"], *Conn["can", "do"]). +b(x, y) :- a(x, y), x != *Conn["temporary", "value"]. .decl c(x:Conn) inline c(x) :- a(z, y), b(x, z), x != y. .decl d(x:Thing) -d(x) :- c([x, _]). +d(x) :- c(*Conn[x, _]). .output d() diff --git a/tests/evaluation/magic_nqueens/magic_nqueens.dl b/tests/evaluation/magic_nqueens/magic_nqueens.dl index 5b58254ece0..16267db0365 100644 --- a/tests/evaluation/magic_nqueens/magic_nqueens.dl +++ b/tests/evaluation/magic_nqueens/magic_nqueens.dl @@ -33,7 +33,7 @@ up_to_size(x + 1) :- up_to_size(x), !size(x). // This relation holds the position of each square of the board. .decl on_board( p : Position ) -on_board([x, y]) :- up_to_size(x), up_to_size(y). +on_board(*Position[x, y]) :- up_to_size(x), up_to_size(y). // Mutually-non-attacking list of queen positions. @@ -42,16 +42,16 @@ on_board([x, y]) :- up_to_size(x), up_to_size(y). // Arguments are not on the same diagonal. .decl non_diagonals( p : Position, q : Position ) -non_diagonals([px, py], [qx, qy]) :- px - qx != py - qy, qx - px != py - qy, on_board([px, py]), on_board([qx, qy]). +non_diagonals(*Position[px, py], *Position[qx, qy]) :- px - qx != py - qy, qx - px != py - qy, on_board(*Position[px, py]), on_board(*Position[qx, qy]). // Holds if p and q do not attack each other. .decl sympathetic( p : Position, q : Position ) -sympathetic(p, q) :- non_diagonals(p, q), px != qx, py != qy, p=[px, py], q=[qx,qy]. +sympathetic(p, q) :- non_diagonals(p, q), px != qx, py != qy, p=*Position[px, py], q=*Position[qx,qy]. // Holds if the head of qs is mutually non-attacking with its tail, which should itself be compatible. // Generated column by column, left to right. .decl compatible( qs : QueenList, n : number ) -compatible([p, nil], 1) :- on_board(p). //, p = [1,y]. -compatible([p, [head, tail]], n+1) :- sympathetic(p, head), compatible([p, tail], n), compatible([head, tail], n), p = [px, py], head = [hx, hy], px > hx. +compatible(*QueenList[p, nil], 1) :- on_board(p). //, p = [1,y]. +compatible(*QueenList[p, *QueenList[head, tail]], n+1) :- sympathetic(p, head), compatible(*QueenList[p, tail], n), compatible(*QueenList[head, tail], n), p = *Position[px, py], head = *Position[hx, hy], px > hx. diff --git a/tests/evaluation/magic_nqueens/magic_nqueens.err b/tests/evaluation/magic_nqueens/magic_nqueens.err index 5b29efa04c6..4d64fc45bd0 100644 --- a/tests/evaluation/magic_nqueens/magic_nqueens.err +++ b/tests/evaluation/magic_nqueens/magic_nqueens.err @@ -1,6 +1,6 @@ Warning: Variable py only occurs once in file magic_nqueens.dl at line 57 -compatible([p, [head, tail]], n+1) :- sympathetic(p, head), compatible([p, tail], n), compatible([head, tail], n), p = [px, py], head = [hx, hy], px > hx. -----------------------------------------------------------------------------------------------------------------------------^------------------------------ +compatible(*QueenList[p, *QueenList[head, tail]], n+1) :- sympathetic(p, head), compatible(*QueenList[p, tail], n), compatible(*QueenList[head, tail], n), p = *Position[px, py], head = *Position[hx, hy], px > hx. +-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------^--------------------------------------- Warning: Variable hy only occurs once in file magic_nqueens.dl at line 57 -compatible([p, [head, tail]], n+1) :- sympathetic(p, head), compatible([p, tail], n), compatible([head, tail], n), p = [px, py], head = [hx, hy], px > hx. ----------------------------------------------------------------------------------------------------------------------------------------------^------------- +compatible(*QueenList[p, *QueenList[head, tail]], n+1) :- sympathetic(p, head), compatible(*QueenList[p, tail], n), compatible(*QueenList[head, tail], n), p = *Position[px, py], head = *Position[hx, hy], px > hx. +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------^------------- diff --git a/tests/evaluation/magic_records4/magic_records4.dl b/tests/evaluation/magic_records4/magic_records4.dl index b8f5f446e83..b288f8a1e71 100644 --- a/tests/evaluation/magic_records4/magic_records4.dl +++ b/tests/evaluation/magic_records4/magic_records4.dl @@ -18,8 +18,8 @@ m(6). .type pair = [ first : N, second : N ] .decl p ( p1 : pair, x: N, p2:pair, y:N ) -p([x,y], x*y, [x,y], y/x) :- n(x), m(y). +p(*pair[x,y], x*y, *pair[x,y], y/x) :- n(x), m(y). .decl r ( x1 : N, y1 : N, z1:N, x2 : N, y2 : N, z2:N ) .output r () -r(x1,y1,z1, x2, y2, z2) :- p([x1,y1], z1, [x2,y2], z2). +r(x1,y1,z1, x2, y2, z2) :- p(*pair[x1,y1], z1, *pair[x2,y2], z2). diff --git a/tests/evaluation/magic_string_substr/magic_string_substr.dl b/tests/evaluation/magic_string_substr/magic_string_substr.dl index 3ecbef6ba2b..5a38ea801e4 100644 --- a/tests/evaluation/magic_string_substr/magic_string_substr.dl +++ b/tests/evaluation/magic_string_substr/magic_string_substr.dl @@ -26,4 +26,4 @@ C(substr("12",22,12)) :- Nullary(). // TODO (lyndonhenry): The code following this comment is a hack to disable the `-e` option, which happens automatically when a program contains record types. The `substr` functor returns an empty string when called with an invalid index. As such, the invalid substring indices used on line 19 of this test will cause a tuple containing the empty string to occur in the relation of `C`, which is otherwise empty. Using the `-efile` and `-m*` options together causes the intermediate IDB file `C+_f.facts` to be written to `output-dir`, where this file contains a single blank line for the tuple with the empty string in `C`. When this same file is then read as intermediate EDB by successor strata, This is not a bug with either the `-efile` or `-m*` options, nor their use together, but rather something else. The issue is that when empty strings are derived as IDB they can be written as output, however empty strings cannot be read as input EDB. .type T = [ x:number ] .decl P(x:T) -P([0]). +P(*T[0]). diff --git a/tests/evaluation/rec_lists/rec_lists.dl b/tests/evaluation/rec_lists/rec_lists.dl index 0c051199827..3b7aa9c2c88 100644 --- a/tests/evaluation/rec_lists/rec_lists.dl +++ b/tests/evaluation/rec_lists/rec_lists.dl @@ -14,13 +14,12 @@ n(3). .decl len ( l : List, n : number ) s(nil). -s( [n,r] ) :- n(n), s(r), len(r,l), l < 5. +s( *List[n,r] ) :- n(n), s(r), len(r,l), l < 5. len(nil,0). -len( [n,r] , x+1 ) :- s([n,r]), len(r,x). +len( *List[n,r] , x+1 ) :- s(*List[n,r]), len(r,x). .decl fst ( l : number ) .output fst () -fst(x) :- s([x,_]). - +fst(x) :- s(*List[x,_]). diff --git a/tests/evaluation/rec_lists2/rec_lists2.dl b/tests/evaluation/rec_lists2/rec_lists2.dl index a53e841b8bc..15da620a260 100644 --- a/tests/evaluation/rec_lists2/rec_lists2.dl +++ b/tests/evaluation/rec_lists2/rec_lists2.dl @@ -3,9 +3,9 @@ .decl p ( x : list ) -p([1,[2,nil]]). -p([2,[3,nil]]). +p(*list[1,*list[2,nil]]). +p(*list[2,*list[3,nil]]). .decl r ( x : number ) .output r () -r(a+b) :- p ([a,[b,nil]]). +r(a+b) :- p (*list[a,*list[b,nil]]). diff --git a/tests/evaluation/subsumption/subsumption.dl b/tests/evaluation/subsumption/subsumption.dl index 92ace1067cd..77e39a7f96b 100644 --- a/tests/evaluation/subsumption/subsumption.dl +++ b/tests/evaluation/subsumption/subsumption.dl @@ -4,11 +4,11 @@ // - https://opensource.org/licenses/UPL // - /licenses/SOUFFLE-UPL.txt -// Subsumption of Interval Sets in Souffle +// Subsumption of Interval Sets in Souffle // Define a type for Interval and Interval List -.type Interval = [lower:number, upper:number] +.type Interval = [lower:number, upper:number] .type IntervalList = [head:Interval, tail:IntervalList] @@ -16,92 +16,92 @@ // set of unordered (overlapping) Intervals // ////////////////////////////////////////////// -.decl A(l:number, u:number) +.decl A(l:number, u:number) A(0,1000). A(1, 10). A(1, 99). A(100, 200). -A(200, 300). -A(1200, 1201). -A(1202, 1209). -A(1209, 1222). +A(200, 300). +A(1200, 1201). +A(1202, 1209). +A(1209, 1222). //////////////////////////// -// normalize Interval set // +// normalize Interval set // //////////////////////////// -// define a less relation among intervals -// using a lexicographical ordering, i.e., -// l1 < l2 \/ (l1 = l2 /\ u1 < u2) +// define a less relation among intervals +// using a lexicographical ordering, i.e., +// l1 < l2 \/ (l1 = l2 /\ u1 < u2) // for two intervals (l1,u1) and (l2,u2) -.decl less(x:Interval, y:Interval) -less([l1,u1],[l2,u2]) :- - A(l1,u1), +.decl less(x:Interval, y:Interval) +less(*Interval[l1,u1],*Interval[l2,u2]) :- + A(l1,u1), A(l2,u2), l1 < l2. -less([l1,u1],[l2,u2]) :- +less(*Interval[l1,u1],*Interval[l2,u2]) :- A(l1,u1), A(l2,u2), l1 = l2, - u1 < u2. + u1 < u2. // define simple transitivity between two intervals -.decl leg(x:Interval, y:Interval) -leg(x,z) :- +.decl leg(x:Interval, y:Interval) +leg(x,z) :- less(x,y), - less(y,z). + less(y,z). // define a linear order among the intervals .decl succ(x:Interval, y:Interval) -succ(x,y) :- - less(x,y), - !leg(x,y). +succ(x,y) :- + less(x,y), + !leg(x,y). // define first Interval in total order .decl first(x: Interval) -first([l,u]) :- - A(l,u), - !less(_,[l,u]). +first(*Interval[l,u]) :- + A(l,u), + !less(_,*Interval[l,u]). // define last Interval in total order .decl last(x: Interval) -last([l,u]) :- - A(l,u), - !less([l,u],_). +last(*Interval[l,u]) :- + A(l,u), + !less(*Interval[l,u],_). // construct normalized interval list -// assumption that that the tail is +// assumption that that the tail is // already normalized, and a new interval has -// a greater or equal lower bound than the previous -// interval in the list. +// a greater or equal lower bound than the previous +// interval in the list. .decl normalized(x:Interval, l:IntervalList) // base case -normalized(x,[x,nil]) :- +normalized(x,*IntervalList[x,nil]) :- first(x). // previous and current interval are disjoint, i.e. no overlap -normalized(y,[y,list]) :- +normalized(y,*IntervalList[y,list]) :- normalized(x,list), succ(x,y), - list = [i, tail], - i = [l1, u1], - y = [l2, u2], + list = *IntervalList[i, tail], + i = *Interval[l1, u1], + y = *Interval[l2, u2], u1 + 1 < l2. -// previous and current interval overlap -// but previous interval does not subsume +// previous and current interval overlap +// but previous interval does not subsume // the current one -normalized(y,[[l1,u2],tail]) :- +normalized(y,*IntervalList[*Interval[l1,u2],tail]) :- normalized(x,list), succ(x,y), - list = [i, tail], - i = [l1, u1], - y = [l2, u2], + list = *IntervalList[i, tail], + i = *Interval[l1, u1], + y = *Interval[l2, u2], u1 + 1 >= l2, l1 < l2. @@ -109,29 +109,29 @@ normalized(y,[[l1,u2],tail]) :- normalized(y,list) :- normalized(x,list), succ(x,y), - list = [i, tail], - i = [l1, u1], - y = [l2, u2], + list = *IntervalList[i, tail], + i = *Interval[l1, u1], + y = *Interval[l2, u2], u1 + 1 >= l2, l1 >= l2. -// unwind list & dump in a relation +// unwind list & dump in a relation -.decl B(l:number, u:number, list:IntervalList) +.decl B(l:number, u:number, list:IntervalList) B(l, u, list) :- last(x), normalized(x, list), - list = [i, tail], - i = [l, u]. + list = *IntervalList[i, tail], + i = *Interval[l, u]. B(l, u, tail) :- B(_, _, list), - list = [i, tail], - i = [l, u]. + list = *IntervalList[i, tail], + i = *Interval[l, u]. // projection of B -.decl C(l:number, u:number) -C(l,u) :- +.decl C(l:number, u:number) +C(l,u) :- B(l,u,_). // output diff --git a/tests/evaluation/subsumption/subsumption.err b/tests/evaluation/subsumption/subsumption.err index b52240fd13d..b24bc52fe07 100644 --- a/tests/evaluation/subsumption/subsumption.err +++ b/tests/evaluation/subsumption/subsumption.err @@ -1,18 +1,18 @@ Warning: Variable tail only occurs once in file subsumption.dl at line 91 - list = [i, tail], ---------------^------ + list = *IntervalList[i, tail], +---------------------------^------ Warning: Variable l1 only occurs once in file subsumption.dl at line 92 - i = [l1, u1], ---------^-------- + i = *Interval[l1, u1], +-----------------^-------- Warning: Variable u2 only occurs once in file subsumption.dl at line 93 - y = [l2, u2], -------------^---- + y = *Interval[l2, u2], +---------------------^---- Warning: Variable tail only occurs once in file subsumption.dl at line 112 - list = [i, tail], ---------------^------ + list = *IntervalList[i, tail], +---------------------------^------ Warning: Variable u2 only occurs once in file subsumption.dl at line 114 - y = [l2, u2], -------------^---- + y = *Interval[l2, u2], +---------------------^---- Warning: Variable tail only occurs once in file subsumption.dl at line 124 - list = [i, tail], ---------------^------ + list = *IntervalList[i, tail], +---------------------------^------ diff --git a/tests/evaluation/unpacking/unpacking.dl b/tests/evaluation/unpacking/unpacking.dl index 6fdceee3c21..c08743577fa 100644 --- a/tests/evaluation/unpacking/unpacking.dl +++ b/tests/evaluation/unpacking/unpacking.dl @@ -8,12 +8,9 @@ .decl b(x:N,y:N) .output b() -a([1,2]). -a([2,3]). - - -b(x,y) :- a([x,y]). -b(x,z) :- a([x,y]), b(y,z). - +a(*P[1,2]). +a(*P[2,3]). +b(x,y) :- a(*P[x,y]). +b(x,z) :- a(*P[x,y]), b(y,z). diff --git a/tests/semantic/comp_inner_types/comp_inner_types.dl b/tests/semantic/comp_inner_types/comp_inner_types.dl index 80cc3a5b6f7..73b3e9327c4 100644 --- a/tests/semantic/comp_inner_types/comp_inner_types.dl +++ b/tests/semantic/comp_inner_types/comp_inner_types.dl @@ -16,10 +16,10 @@ // declare a relation dependent on these inner types .decl inner_rel(record: InnerRecord, union: InnerUnion) - inner_rel(["x", 1], 1). + inner_rel(*InnerRecord["x", 1], 1). .decl out0(x: T1, y: T2, z: T3) - out0(x,y,z) :- inner_rel([x,y],z). + out0(x,y,z) :- inner_rel(*InnerRecord[x,y],z). .output out0() } @@ -35,9 +35,9 @@ // depends on the inner component types .decl outer_rel1(x: comp.InnerRecord) -outer_rel1(["x", 1]). +outer_rel1(*comp.InnerRecord["x", 1]). .decl out1(x: comp.T1, y: comp.T2) -out1(x,y) :- outer_rel1([x,y]). +out1(x,y) :- outer_rel1(*comp.InnerRecord[x,y]). .output out1() // depends on the inner component types @@ -49,9 +49,9 @@ out2(x) :- outer_rel2(x). // should be independent of the inner types in the component .decl outer_rel3(x: InnerRecord) -outer_rel3([0,1]). +outer_rel3(*InnerRecord[0,1]). .decl out3(x: T1, y: T1) -out3(x,y) :- outer_rel3([x,y]). +out3(x,y) :- outer_rel3(*InnerRecord[x,y]). .output out3() // should be independent of the inner types in the component diff --git a/tests/semantic/comp_types/comp_types.dl b/tests/semantic/comp_types/comp_types.dl index 6cb61f9af2c..21043626999 100644 --- a/tests/semantic/comp_types/comp_types.dl +++ b/tests/semantic/comp_types/comp_types.dl @@ -3,7 +3,7 @@ .comp A { .type inner = [ x : Param ] .decl rel ( a : inner ) - rel(["x"]). + rel(*inner["x"]). } // instantiate the component several times diff --git a/tests/semantic/not_copy/not_copy.dl b/tests/semantic/not_copy/not_copy.dl index fd355457e62..49430a564e8 100644 --- a/tests/semantic/not_copy/not_copy.dl +++ b/tests/semantic/not_copy/not_copy.dl @@ -12,7 +12,7 @@ // A .decl A(a:X) -A(["a"]). +A(*X["a"]). // B .decl B(b:X) @@ -21,10 +21,10 @@ A(["a"]). // `B(x) :- x = ["foo"], A(x).` is going to be transformed to // `B(["foo"]) :- A(["foo"]).` after constant propagation. -B(x) :- x = ["foo"], A(x). +B(x) :- x = *X["foo"], A(x). // C .decl C(c:symbol) .output C() -C(x) :- B([x]). +C(x) :- B(*X[x]). diff --git a/tests/semantic/record_null/record_null.dl b/tests/semantic/record_null/record_null.dl index 8f654f68ce3..6f04b9a1407 100644 --- a/tests/semantic/record_null/record_null.dl +++ b/tests/semantic/record_null/record_null.dl @@ -6,11 +6,10 @@ // this is ok a("N",nil,nil). -a("N",nil,["N",nil]). -a("N",nil,["N",["N",nil]]). +a("N",nil,*L["N",nil]). +a("N",nil,*L["N",*L["N",nil]]). // this is not a(nil,nil,nil). -a("N",nil,[nil,nil]). -a("N",nil,["N",[nil,nil]]). - +a("N",nil,*L[nil,nil]). +a("N",nil,*L["N",*L[nil,nil]]). diff --git a/tests/semantic/record_null/record_null.err b/tests/semantic/record_null/record_null.err index 01d382ea070..d8ddc072039 100644 --- a/tests/semantic/record_null/record_null.err +++ b/tests/semantic/record_null/record_null.err @@ -2,9 +2,9 @@ Error: Null constant used as a non-record in file record_null.dl at line 13 a(nil,nil,nil). --^------------- Error: Null constant used as a non-record in file record_null.dl at line 14 -a("N",nil,[nil,nil]). ------------^---------- +a("N",nil,*L[nil,nil]). +-------------^---------- Error: Null constant used as a non-record in file record_null.dl at line 15 -a("N",nil,["N",[nil,nil]]). -----------------^----------- +a("N",nil,*L["N",*L[nil,nil]]). +--------------------^----------- 3 errors generated, evaluation aborted diff --git a/tests/semantic/records/records.dl b/tests/semantic/records/records.dl index 9c34fdd7bd6..13e4cd17020 100644 --- a/tests/semantic/records/records.dl +++ b/tests/semantic/records/records.dl @@ -12,9 +12,8 @@ n(5). .type pair = [ first : N, second : N ] .decl p ( p : pair ) -p([x,x]) :- n(x). +p(*pair[x,x]) :- n(x). .decl r ( x : N, y : N ) .output r () -r(x,y) :- p([x,y]). - +r(x,y) :- p(*pair[x,y]). diff --git a/tests/semantic/records1/records1.dl b/tests/semantic/records1/records1.dl index 3a9db029362..6af5c84edda 100644 --- a/tests/semantic/records1/records1.dl +++ b/tests/semantic/records1/records1.dl @@ -15,8 +15,8 @@ m(6). .type pair = [ first : N, second : N ] .decl p ( p : pair, x: N ) -p([x,y], x+y) :- n(x), m(y). +p(*pair[x,y], x+y) :- n(x), m(y). .decl r ( x : N, y : N, z:N ) .output r () -r(x,y,z) :- p([x,y], z). +r(x,y,z) :- p(*pair[x,y], z). diff --git a/tests/semantic/records2/records2.dl b/tests/semantic/records2/records2.dl index 08acaa25f67..53ca0488348 100644 --- a/tests/semantic/records2/records2.dl +++ b/tests/semantic/records2/records2.dl @@ -15,16 +15,16 @@ m(6). .type pair = [ first : N, second : N ] .decl p ( p : pair, x: N ) -p([x,y], x+y) :- n(x), m(y). +p(*pair[x,y], x+y) :- n(x), m(y). .decl r1 ( x : N, y : N, z:N ) .output r1 () -r1(z-y,y,z) :- p([_,y], z). +r1(z-y,y,z) :- p(*pair[_,y], z). .decl r2 ( x : N, y : N, z:N ) .output r2 () -r2(z-x,x,z) :- p([x,_], z). +r2(z-x,x,z) :- p(*pair[x,_], z). .decl r3 ( z:N ) .output r3 () -r3(z) :- p([_,_], z). +r3(z) :- p(*pair[_,_], z). diff --git a/tests/semantic/records3/records3.dl b/tests/semantic/records3/records3.dl index e382680c17f..c0e7d6d77b5 100644 --- a/tests/semantic/records3/records3.dl +++ b/tests/semantic/records3/records3.dl @@ -15,8 +15,8 @@ m(6). .type pair = [ first : N, second : N ] .decl p ( p1 : pair, x: N, p2:pair, y:N ) -p([x,y], x+y, [x,y], x-y) :- n(x), m(y). +p(*pair[x,y], x+y, *pair[x,y], x-y) :- n(x), m(y). .decl r ( x1 : N, y1 : N, z1:N, x2 : N, y2 : N, z2:N ) .output r () -r(x1,y1,z1, x2, y2, z2) :- p([x1,y1], z1, [x2,y2], z2). +r(x1,y1,z1, x2, y2, z2) :- p(*pair[x1,y1], z1, *pair[x2,y2], z2). diff --git a/tests/semantic/records4/records4.dl b/tests/semantic/records4/records4.dl index efb02f5e4b6..6befe37d296 100644 --- a/tests/semantic/records4/records4.dl +++ b/tests/semantic/records4/records4.dl @@ -15,8 +15,8 @@ m(6). .type pair = [ first : N, second : N ] .decl p ( p1 : pair, x: N, p2:pair, y:N ) -p([x,y], x*y, [x,y], y/x) :- n(x), m(y). +p(*pair[x,y], x*y, *pair[x,y], y/x) :- n(x), m(y). .decl r ( x1 : N, y1 : N, z1:N, x2 : N, y2 : N, z2:N ) .output r () -r(x1,y1,z1, x2, y2, z2) :- p([x1,y1], z1, [x2,y2], z2). +r(x1,y1,z1, x2, y2, z2) :- p(*pair[x1,y1], z1, *pair[x2,y2], z2). diff --git a/tests/semantic/records5/records5.dl b/tests/semantic/records5/records5.dl index 3908160173a..c86cab69d60 100644 --- a/tests/semantic/records5/records5.dl +++ b/tests/semantic/records5/records5.dl @@ -4,19 +4,19 @@ .decl s ( p : pair ) -s([1,2]). -s([2,3]). -s([3,1]). +s(*pair[1,2]). +s(*pair[2,3]). +s(*pair[3,1]). .decl res ( s : symbol ) .output res () -res("11") :- s([1,1]). -res("12") :- s([1,2]). -res("13") :- s([1,3]). -res("21") :- s([2,1]). -res("22") :- s([2,2]). -res("23") :- s([2,3]). -res("31") :- s([3,1]). -res("32") :- s([3,2]). -res("33") :- s([3,3]). +res("11") :- s(*pair[1,1]). +res("12") :- s(*pair[1,2]). +res("13") :- s(*pair[1,3]). +res("21") :- s(*pair[2,1]). +res("22") :- s(*pair[2,2]). +res("23") :- s(*pair[2,3]). +res("31") :- s(*pair[3,1]). +res("32") :- s(*pair[3,2]). +res("33") :- s(*pair[3,3]). diff --git a/tests/semantic/records6/records6.dl b/tests/semantic/records6/records6.dl index 5e3a31bfc19..b9b267d1d4e 100644 --- a/tests/semantic/records6/records6.dl +++ b/tests/semantic/records6/records6.dl @@ -9,5 +9,5 @@ .output AccessPathShouldBeRebased2() AccessPathShouldBeRebased2(?newAp , ?from, ?to) :- - AccessPathShouldBeRebased2([ ?from, [ [ ?rest, ?nextFld ], ?lastFld ] ], ?from, ?to), - ?newAp = [ ?from, [ ?rest, ?nextFld ] ]. + AccessPathShouldBeRebased2(*AccessPath[ ?from, *AccessPathSuffix[ *AccessPathSuffix[ ?rest, ?nextFld ], ?lastFld ] ], ?from, ?to), + ?newAp = *AccessPath[ ?from, *AccessPathSuffix[ ?rest, ?nextFld ] ]. diff --git a/tests/semantic/records6/records6.err b/tests/semantic/records6/records6.err index c0db0584c87..e7a0433291d 100644 --- a/tests/semantic/records6/records6.err +++ b/tests/semantic/records6/records6.err @@ -2,5 +2,5 @@ Warning: Record types in output relations are not printed verbatim: attribute ?a .decl AccessPathShouldBeRebased2(?ap:AccessPath, ?from:Var, ?to:Var) -------------------------------------^------------------------------- Warning: Variable ?lastFld only occurs once in file records6.dl at line 12 - AccessPathShouldBeRebased2([ ?from, [ [ ?rest, ?nextFld ], ?lastFld ] ], ?from, ?to), ---------------------------------------------------------------^-------------------------- + AccessPathShouldBeRebased2(*AccessPath[ ?from, *AccessPathSuffix[ *AccessPathSuffix[ ?rest, ?nextFld ], ?lastFld ] ], ?from, ?to), +-----------------------------------------------------------------------------------------------------------^-------------------------- diff --git a/tests/semantic/type_system1/type_system1.dl b/tests/semantic/type_system1/type_system1.dl index fc4534222ff..d13fae95e5b 100644 --- a/tests/semantic/type_system1/type_system1.dl +++ b/tests/semantic/type_system1/type_system1.dl @@ -27,129 +27,129 @@ // Number Relation -NumberRelation(0). // no error -NumberRelation(1). // no error -NumberRelation(-1). // no error -NumberRelation(1+1). // no error -NumberRelation("1"). // error -NumberRelation(nil). // error +NumberRelation(0). // no error +NumberRelation(1). // no error +NumberRelation(-1). // no error +NumberRelation(1+1). // no error +NumberRelation("1"). // error +NumberRelation(nil). // error -NumberRelation([1]). // error -NumberRelation([-1]). // error -NumberRelation([1+1]). // error +NumberRelation(*single_number[1]). // error +NumberRelation(*single_number[-1]). // error +NumberRelation(*single_number[1+1]). // error -NumberRelation([1, 1]). // error -NumberRelation([-1, -1]). // error -NumberRelation([1+1, 1+1]). // error +NumberRelation(*double_number[1, 1]). // error +NumberRelation(*double_number[-1, -1]). // error +NumberRelation(*double_number[1+1, 1+1]). // error -NumberRelation([1, 1, 1]). // error -NumberRelation([-1, -1, -1]). // error -NumberRelation([1+1, 1+1, 1+1]). // error +NumberRelation(*triple_number[1, 1, 1]). // error +NumberRelation(*triple_number[-1, -1, -1]). // error +NumberRelation(*triple_number[1+1, 1+1, 1+1]). // error -NumberRelation(["1"]). // error -NumberRelation(["1", "1"]). // error -NumberRelation(["1", "1", "1"]). // error +NumberRelation(*single_symbol["1"]). // error +NumberRelation(*double_symbol["1", "1"]). // error +NumberRelation(*triple_symbol["1", "1", "1"]). // error // Symbol Relation -SymbolRelation(0). // error -SymbolRelation(1). // error -SymbolRelation(-1). // error -SymbolRelation(1+1). // error -SymbolRelation("1"). // no error -SymbolRelation(nil). // error +SymbolRelation(0). // error +SymbolRelation(1). // error +SymbolRelation(-1). // error +SymbolRelation(1+1). // error +SymbolRelation("1"). // no error +SymbolRelation(nil). // error -SymbolRelation([1]). // error -SymbolRelation([-1]). // error -SymbolRelation([1+1]). // error +SymbolRelation(*single_number[1]). // error +SymbolRelation(*single_number[-1]). // error +SymbolRelation(*single_number[1+1]). // error -SymbolRelation([1, 1]). // error -SymbolRelation([-1, -1]). // error -SymbolRelation([1+1, 1+1]). // error +SymbolRelation(*double_number[1, 1]). // error +SymbolRelation(*double_number[-1, -1]). // error +SymbolRelation(*double_number[1+1, 1+1]). // error -SymbolRelation([1, 1, 1]). // error -SymbolRelation([-1, -1, -1]). // error -SymbolRelation([1+1, 1+1, 1+1]). // error +SymbolRelation(*triple_number[1, 1, 1]). // error +SymbolRelation(*triple_number[-1, -1, -1]). // error +SymbolRelation(*triple_number[1+1, 1+1, 1+1]). // error -SymbolRelation(["1"]). // error -SymbolRelation(["1", "1"]). // error -SymbolRelation(["1", "1", "1"]). // error +SymbolRelation(*single_symbol["1"]). // error +SymbolRelation(*double_symbol["1", "1"]). // error +SymbolRelation(*triple_symbol["1", "1", "1"]). // error // Single Number Relation -SingleNumberRelation(0). // error -SingleNumberRelation(1). // error -SingleNumberRelation(-1). // error -SingleNumberRelation(1+1). // error -SingleNumberRelation("1"). // error -SingleNumberRelation(nil). // no error -SingleNumberRelation([1]). // no error -SingleNumberRelation([-1]). // no error -SingleNumberRelation([1+1]). // no error -SingleNumberRelation(["1"]). // error +SingleNumberRelation(0). // error +SingleNumberRelation(1). // error +SingleNumberRelation(-1). // error +SingleNumberRelation(1+1). // error +SingleNumberRelation("1"). // error +SingleNumberRelation(nil). // no error +SingleNumberRelation(*single_number[1]). // no error +SingleNumberRelation(*single_number[-1]). // no error +SingleNumberRelation(*single_number[1+1]). // no error +SingleNumberRelation(*single_number["1"]). // error // Double Number Relation -DoubleNumberRelation(0). // error -DoubleNumberRelation(1). // error -DoubleNumberRelation(-1). // error -DoubleNumberRelation(1+1). // error -DoubleNumberRelation("1"). // error -DoubleNumberRelation(nil). // no error -DoubleNumberRelation([1, 1]). // no error -DoubleNumberRelation([-1, -1]). // no error -DoubleNumberRelation([1+1, 1+1]). // no error -DoubleNumberRelation(["1", "1"]). // error +DoubleNumberRelation(0). // error +DoubleNumberRelation(1). // error +DoubleNumberRelation(-1). // error +DoubleNumberRelation(1+1). // error +DoubleNumberRelation("1"). // error +DoubleNumberRelation(nil). // no error +DoubleNumberRelation(*double_number[1, 1]). // no error +DoubleNumberRelation(*double_number[-1, -1]). // no error +DoubleNumberRelation(*double_number[1+1, 1+1]). // no error +DoubleNumberRelation(*double_number["1", "1"]). // error // Triple Number Relation -TripleNumberRelation(0). // error -TripleNumberRelation(1). // error -TripleNumberRelation(-1). // error -TripleNumberRelation(1+1). // error -TripleNumberRelation("1"). // error -TripleNumberRelation(nil). // no error -TripleNumberRelation([1, 1, 1]). // no error -TripleNumberRelation([-1, -1, -1]). // no error -TripleNumberRelation([1+1, 1+1, 1+1]). // no error -TripleNumberRelation(["1", "1", "1"]). // error +TripleNumberRelation(0). // error +TripleNumberRelation(1). // error +TripleNumberRelation(-1). // error +TripleNumberRelation(1+1). // error +TripleNumberRelation("1"). // error +TripleNumberRelation(nil). // no error +TripleNumberRelation(*triple_number[1, 1, 1]). // no error +TripleNumberRelation(*triple_number[-1, -1, -1]). // no error +TripleNumberRelation(*triple_number[1+1, 1+1, 1+1]). // no error +TripleNumberRelation(*triple_number["1", "1", "1"]). // error // Single Symbol Relation -SingleSymbolRelation(0). // error -SingleSymbolRelation(1). // error -SingleSymbolRelation(-1). // error -SingleSymbolRelation(1+1). // error -SingleSymbolRelation("1"). // error -SingleSymbolRelation(nil). // no error -SingleSymbolRelation([1]). // error -SingleSymbolRelation([-1]). // error -SingleSymbolRelation([1+1]). // error -SingleSymbolRelation(["1"]). // no error +SingleSymbolRelation(0). // error +SingleSymbolRelation(1). // error +SingleSymbolRelation(-1). // error +SingleSymbolRelation(1+1). // error +SingleSymbolRelation("1"). // error +SingleSymbolRelation(nil). // no error +SingleSymbolRelation(*single_symbol[1]). // error +SingleSymbolRelation(*single_symbol[-1]). // error +SingleSymbolRelation(*single_symbol[1+1]). // error +SingleSymbolRelation(*single_symbol["1"]). // no error // Double Symbol Relation -DoubleSymbolRelation(0). // error -DoubleSymbolRelation(1). // error -DoubleSymbolRelation(-1). // error -DoubleSymbolRelation(1+1). // error -DoubleSymbolRelation("1"). // error -DoubleSymbolRelation(nil). // no error -DoubleSymbolRelation([1, 1]). // error -DoubleSymbolRelation([-1, -1]). // error -DoubleSymbolRelation([1+1, 1+1]). // error -DoubleSymbolRelation(["1", "1"]). // no error +DoubleSymbolRelation(0). // error +DoubleSymbolRelation(1). // error +DoubleSymbolRelation(-1). // error +DoubleSymbolRelation(1+1). // error +DoubleSymbolRelation("1"). // error +DoubleSymbolRelation(nil). // no error +DoubleSymbolRelation(*double_symbol[1, 1]). // error +DoubleSymbolRelation(*double_symbol[-1, -1]). // error +DoubleSymbolRelation(*double_symbol[1+1, 1+1]). // error +DoubleSymbolRelation(*double_symbol["1", "1"]). // no error // Triple Symbol Relation -TripleSymbolRelation(0). // error -TripleSymbolRelation(1). // error -TripleSymbolRelation(-1). // error -TripleSymbolRelation(1+1). // error -TripleSymbolRelation("1"). // error -TripleSymbolRelation(nil). // no error -TripleSymbolRelation([1, 1, 1]). // error -TripleSymbolRelation([-1, -1, -1]). // error -TripleSymbolRelation([1+1, 1+1, 1+1]). // error -TripleSymbolRelation(["1", "1", "1"]). // no error +TripleSymbolRelation(0). // error +TripleSymbolRelation(1). // error +TripleSymbolRelation(-1). // error +TripleSymbolRelation(1+1). // error +TripleSymbolRelation("1"). // error +TripleSymbolRelation(nil). // no error +TripleSymbolRelation(*triple_symbol[1, 1, 1]). // error +TripleSymbolRelation(*triple_symbol[-1, -1, -1]). // error +TripleSymbolRelation(*triple_symbol[1+1, 1+1, 1+1]). // error +TripleSymbolRelation(*triple_symbol["1", "1", "1"]). // no error diff --git a/tests/semantic/type_system1/type_system1.err b/tests/semantic/type_system1/type_system1.err index d7d49fafc34..839e92a7e16 100644 --- a/tests/semantic/type_system1/type_system1.err +++ b/tests/semantic/type_system1/type_system1.err @@ -1,328 +1,328 @@ Error: Symbol constant (type mismatch) in file type_system1.dl at line 34 -NumberRelation("1"). // error ----------------^-------------------------------- +NumberRelation("1"). // error +---------------^------------------------------------------------- Error: Null constant used as a non-record in file type_system1.dl at line 35 -NumberRelation(nil). // error ----------------^-------------------------------- +NumberRelation(nil). // error +---------------^------------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 37 -NumberRelation([1]). // error -----------------^------------------------------- +NumberRelation(*single_number[1]). // error +------------------------------^---------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 38 -NumberRelation([-1]). // error ------------------^------------------------------ +NumberRelation(*single_number[-1]). // error +-------------------------------^--------------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 39 -NumberRelation([1+1]). // error -----------------^------------------------------- +NumberRelation(*single_number[1+1]). // error +------------------------------^---------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 41 -NumberRelation([1, 1]). // error -----------------^------------------------------- +NumberRelation(*double_number[1, 1]). // error +------------------------------^---------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 41 -NumberRelation([1, 1]). // error --------------------^---------------------------- +NumberRelation(*double_number[1, 1]). // error +---------------------------------^------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 42 -NumberRelation([-1, -1]). // error ------------------^------------------------------ +NumberRelation(*double_number[-1, -1]). // error +-------------------------------^--------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 42 -NumberRelation([-1, -1]). // error ----------------------^-------------------------- +NumberRelation(*double_number[-1, -1]). // error +-----------------------------------^----------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 43 -NumberRelation([1+1, 1+1]). // error -----------------^------------------------------- +NumberRelation(*double_number[1+1, 1+1]). // error +------------------------------^---------------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 43 -NumberRelation([1+1, 1+1]). // error ----------------------^-------------------------- +NumberRelation(*double_number[1+1, 1+1]). // error +-----------------------------------^----------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 45 -NumberRelation([1, 1, 1]). // error -----------------^------------------------------- +NumberRelation(*triple_number[1, 1, 1]). // error +------------------------------^---------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 45 -NumberRelation([1, 1, 1]). // error --------------------^---------------------------- +NumberRelation(*triple_number[1, 1, 1]). // error +---------------------------------^------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 45 -NumberRelation([1, 1, 1]). // error -----------------------^------------------------- +NumberRelation(*triple_number[1, 1, 1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 46 -NumberRelation([-1, -1, -1]). // error ------------------^------------------------------ +NumberRelation(*triple_number[-1, -1, -1]). // error +-------------------------------^--------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 46 -NumberRelation([-1, -1, -1]). // error ----------------------^-------------------------- +NumberRelation(*triple_number[-1, -1, -1]). // error +-----------------------------------^----------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 46 -NumberRelation([-1, -1, -1]). // error --------------------------^---------------------- +NumberRelation(*triple_number[-1, -1, -1]). // error +---------------------------------------^------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 47 -NumberRelation([1+1, 1+1, 1+1]). // error -----------------^------------------------------- +NumberRelation(*triple_number[1+1, 1+1, 1+1]). // error +------------------------------^---------------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 47 -NumberRelation([1+1, 1+1, 1+1]). // error ----------------------^-------------------------- +NumberRelation(*triple_number[1+1, 1+1, 1+1]). // error +-----------------------------------^----------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 47 -NumberRelation([1+1, 1+1, 1+1]). // error ---------------------------^--------------------- +NumberRelation(*triple_number[1+1, 1+1, 1+1]). // error +----------------------------------------^------------------------ Error: Symbol constant (type mismatch) in file type_system1.dl at line 49 -NumberRelation(["1"]). // error -----------------^------------------------------- +NumberRelation(*single_symbol["1"]). // error +------------------------------^---------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 50 -NumberRelation(["1", "1"]). // error -----------------^------------------------------- +NumberRelation(*double_symbol["1", "1"]). // error +------------------------------^---------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 50 -NumberRelation(["1", "1"]). // error ----------------------^-------------------------- +NumberRelation(*double_symbol["1", "1"]). // error +-----------------------------------^----------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 51 -NumberRelation(["1", "1", "1"]). // error -----------------^------------------------------- +NumberRelation(*triple_symbol["1", "1", "1"]). // error +------------------------------^---------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 51 -NumberRelation(["1", "1", "1"]). // error ----------------------^-------------------------- +NumberRelation(*triple_symbol["1", "1", "1"]). // error +-----------------------------------^----------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 51 -NumberRelation(["1", "1", "1"]). // error ---------------------------^--------------------- +NumberRelation(*triple_symbol["1", "1", "1"]). // error +----------------------------------------^------------------------ Error: Number constant (type mismatch) in file type_system1.dl at line 55 -SymbolRelation(0). // error ----------------^-------------------------------- +SymbolRelation(0). // error +---------------^------------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 56 -SymbolRelation(1). // error ----------------^-------------------------------- +SymbolRelation(1). // error +---------------^------------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 57 -SymbolRelation(-1). // error -----------------^------------------------------- +SymbolRelation(-1). // error +----------------^------------------------------------------------ Error: Non-numeric use for numeric functor in file type_system1.dl at line 58 -SymbolRelation(1+1). // error ----------------^-------------------------------- +SymbolRelation(1+1). // error +---------------^------------------------------------------------- Error: Null constant used as a non-record in file type_system1.dl at line 60 -SymbolRelation(nil). // error ----------------^-------------------------------- +SymbolRelation(nil). // error +---------------^------------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 62 -SymbolRelation([1]). // error -----------------^------------------------------- +SymbolRelation(*single_number[1]). // error +------------------------------^---------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 63 -SymbolRelation([-1]). // error ------------------^------------------------------ +SymbolRelation(*single_number[-1]). // error +-------------------------------^--------------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 64 -SymbolRelation([1+1]). // error -----------------^------------------------------- +SymbolRelation(*single_number[1+1]). // error +------------------------------^---------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 66 -SymbolRelation([1, 1]). // error -----------------^------------------------------- +SymbolRelation(*double_number[1, 1]). // error +------------------------------^---------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 66 -SymbolRelation([1, 1]). // error --------------------^---------------------------- +SymbolRelation(*double_number[1, 1]). // error +---------------------------------^------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 67 -SymbolRelation([-1, -1]). // error ------------------^------------------------------ +SymbolRelation(*double_number[-1, -1]). // error +-------------------------------^--------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 67 -SymbolRelation([-1, -1]). // error ----------------------^-------------------------- +SymbolRelation(*double_number[-1, -1]). // error +-----------------------------------^----------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 68 -SymbolRelation([1+1, 1+1]). // error -----------------^------------------------------- +SymbolRelation(*double_number[1+1, 1+1]). // error +------------------------------^---------------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 68 -SymbolRelation([1+1, 1+1]). // error ----------------------^-------------------------- +SymbolRelation(*double_number[1+1, 1+1]). // error +-----------------------------------^----------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 70 -SymbolRelation([1, 1, 1]). // error -----------------^------------------------------- +SymbolRelation(*triple_number[1, 1, 1]). // error +------------------------------^---------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 70 -SymbolRelation([1, 1, 1]). // error --------------------^---------------------------- +SymbolRelation(*triple_number[1, 1, 1]). // error +---------------------------------^------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 70 -SymbolRelation([1, 1, 1]). // error -----------------------^------------------------- +SymbolRelation(*triple_number[1, 1, 1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 71 -SymbolRelation([-1, -1, -1]). // error ------------------^------------------------------ +SymbolRelation(*triple_number[-1, -1, -1]). // error +-------------------------------^--------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 71 -SymbolRelation([-1, -1, -1]). // error ----------------------^-------------------------- +SymbolRelation(*triple_number[-1, -1, -1]). // error +-----------------------------------^----------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 71 -SymbolRelation([-1, -1, -1]). // error --------------------------^---------------------- +SymbolRelation(*triple_number[-1, -1, -1]). // error +---------------------------------------^------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 72 -SymbolRelation([1+1, 1+1, 1+1]). // error -----------------^------------------------------- +SymbolRelation(*triple_number[1+1, 1+1, 1+1]). // error +------------------------------^---------------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 72 -SymbolRelation([1+1, 1+1, 1+1]). // error ----------------------^-------------------------- +SymbolRelation(*triple_number[1+1, 1+1, 1+1]). // error +-----------------------------------^----------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 72 -SymbolRelation([1+1, 1+1, 1+1]). // error ---------------------------^--------------------- +SymbolRelation(*triple_number[1+1, 1+1, 1+1]). // error +----------------------------------------^------------------------ Error: Symbol constant (type mismatch) in file type_system1.dl at line 74 -SymbolRelation(["1"]). // error -----------------^------------------------------- +SymbolRelation(*single_symbol["1"]). // error +------------------------------^---------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 75 -SymbolRelation(["1", "1"]). // error -----------------^------------------------------- +SymbolRelation(*double_symbol["1", "1"]). // error +------------------------------^---------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 75 -SymbolRelation(["1", "1"]). // error ----------------------^-------------------------- +SymbolRelation(*double_symbol["1", "1"]). // error +-----------------------------------^----------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 76 -SymbolRelation(["1", "1", "1"]). // error -----------------^------------------------------- +SymbolRelation(*triple_symbol["1", "1", "1"]). // error +------------------------------^---------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 76 -SymbolRelation(["1", "1", "1"]). // error ----------------------^-------------------------- +SymbolRelation(*triple_symbol["1", "1", "1"]). // error +-----------------------------------^----------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 76 -SymbolRelation(["1", "1", "1"]). // error ---------------------------^--------------------- +SymbolRelation(*triple_symbol["1", "1", "1"]). // error +----------------------------------------^------------------------ Error: Number constant (type mismatch) in file type_system1.dl at line 80 -SingleNumberRelation(0). // error ----------------------^-------------------------- +SingleNumberRelation(0). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 81 -SingleNumberRelation(1). // error ----------------------^-------------------------- +SingleNumberRelation(1). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 82 -SingleNumberRelation(-1). // error -----------------------^------------------------- +SingleNumberRelation(-1). // error +----------------------^------------------------------------------ Error: Non-numeric use for numeric functor in file type_system1.dl at line 83 -SingleNumberRelation(1+1). // error ----------------------^-------------------------- +SingleNumberRelation(1+1). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 84 -SingleNumberRelation("1"). // error ----------------------^-------------------------- +SingleNumberRelation("1"). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 89 -SingleNumberRelation(["1"]). // error -----------------------^------------------------- +SingleNumberRelation(*single_number["1"]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 94 -DoubleNumberRelation(0). // error ----------------------^-------------------------- +DoubleNumberRelation(0). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 95 -DoubleNumberRelation(1). // error ----------------------^-------------------------- +DoubleNumberRelation(1). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 96 -DoubleNumberRelation(-1). // error -----------------------^------------------------- +DoubleNumberRelation(-1). // error +----------------------^------------------------------------------ Error: Non-numeric use for numeric functor in file type_system1.dl at line 97 -DoubleNumberRelation(1+1). // error ----------------------^-------------------------- +DoubleNumberRelation(1+1). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 98 -DoubleNumberRelation("1"). // error ----------------------^-------------------------- +DoubleNumberRelation("1"). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 103 -DoubleNumberRelation(["1", "1"]). // error -----------------------^------------------------- +DoubleNumberRelation(*double_number["1", "1"]). // error +------------------------------------^---------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 103 -DoubleNumberRelation(["1", "1"]). // error ----------------------------^-------------------- +DoubleNumberRelation(*double_number["1", "1"]). // error +-----------------------------------------^----------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 107 -TripleNumberRelation(0). // error ----------------------^-------------------------- +TripleNumberRelation(0). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 108 -TripleNumberRelation(1). // error ----------------------^-------------------------- +TripleNumberRelation(1). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 109 -TripleNumberRelation(-1). // error -----------------------^------------------------- +TripleNumberRelation(-1). // error +----------------------^------------------------------------------ Error: Non-numeric use for numeric functor in file type_system1.dl at line 110 -TripleNumberRelation(1+1). // error ----------------------^-------------------------- +TripleNumberRelation(1+1). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 111 -TripleNumberRelation("1"). // error ----------------------^-------------------------- +TripleNumberRelation("1"). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 116 -TripleNumberRelation(["1", "1", "1"]). // error -----------------------^------------------------- +TripleNumberRelation(*triple_number["1", "1", "1"]). // error +------------------------------------^---------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 116 -TripleNumberRelation(["1", "1", "1"]). // error ----------------------------^-------------------- +TripleNumberRelation(*triple_number["1", "1", "1"]). // error +-----------------------------------------^----------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 116 -TripleNumberRelation(["1", "1", "1"]). // error ---------------------------------^--------------- +TripleNumberRelation(*triple_number["1", "1", "1"]). // error +----------------------------------------------^------------------ Error: Number constant (type mismatch) in file type_system1.dl at line 120 -SingleSymbolRelation(0). // error ----------------------^-------------------------- +SingleSymbolRelation(0). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 121 -SingleSymbolRelation(1). // error ----------------------^-------------------------- +SingleSymbolRelation(1). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 122 -SingleSymbolRelation(-1). // error -----------------------^------------------------- +SingleSymbolRelation(-1). // error +----------------------^------------------------------------------ Error: Non-numeric use for numeric functor in file type_system1.dl at line 123 -SingleSymbolRelation(1+1). // error ----------------------^-------------------------- +SingleSymbolRelation(1+1). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 124 -SingleSymbolRelation("1"). // error ----------------------^-------------------------- +SingleSymbolRelation("1"). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 126 -SingleSymbolRelation([1]). // error -----------------------^------------------------- +SingleSymbolRelation(*single_symbol[1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 127 -SingleSymbolRelation([-1]). // error ------------------------^------------------------ +SingleSymbolRelation(*single_symbol[-1]). // error +-------------------------------------^--------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 128 -SingleSymbolRelation([1+1]). // error -----------------------^------------------------- +SingleSymbolRelation(*single_symbol[1+1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 133 -DoubleSymbolRelation(0). // error ----------------------^-------------------------- +DoubleSymbolRelation(0). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 134 -DoubleSymbolRelation(1). // error ----------------------^-------------------------- +DoubleSymbolRelation(1). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 135 -DoubleSymbolRelation(-1). // error -----------------------^------------------------- +DoubleSymbolRelation(-1). // error +----------------------^------------------------------------------ Error: Non-numeric use for numeric functor in file type_system1.dl at line 136 -DoubleSymbolRelation(1+1). // error ----------------------^-------------------------- +DoubleSymbolRelation(1+1). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 137 -DoubleSymbolRelation("1"). // error ----------------------^-------------------------- +DoubleSymbolRelation("1"). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 139 -DoubleSymbolRelation([1, 1]). // error -----------------------^------------------------- +DoubleSymbolRelation(*double_symbol[1, 1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 139 -DoubleSymbolRelation([1, 1]). // error --------------------------^---------------------- +DoubleSymbolRelation(*double_symbol[1, 1]). // error +---------------------------------------^------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 140 -DoubleSymbolRelation([-1, -1]). // error ------------------------^------------------------ +DoubleSymbolRelation(*double_symbol[-1, -1]). // error +-------------------------------------^--------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 140 -DoubleSymbolRelation([-1, -1]). // error ----------------------------^-------------------- +DoubleSymbolRelation(*double_symbol[-1, -1]). // error +-----------------------------------------^----------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 141 -DoubleSymbolRelation([1+1, 1+1]). // error -----------------------^------------------------- +DoubleSymbolRelation(*double_symbol[1+1, 1+1]). // error +------------------------------------^---------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 141 -DoubleSymbolRelation([1+1, 1+1]). // error ----------------------------^-------------------- +DoubleSymbolRelation(*double_symbol[1+1, 1+1]). // error +-----------------------------------------^----------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 146 -TripleSymbolRelation(0). // error ----------------------^-------------------------- +TripleSymbolRelation(0). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 147 -TripleSymbolRelation(1). // error ----------------------^-------------------------- +TripleSymbolRelation(1). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 148 -TripleSymbolRelation(-1). // error -----------------------^------------------------- +TripleSymbolRelation(-1). // error +----------------------^------------------------------------------ Error: Non-numeric use for numeric functor in file type_system1.dl at line 149 -TripleSymbolRelation(1+1). // error ----------------------^-------------------------- +TripleSymbolRelation(1+1). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system1.dl at line 150 -TripleSymbolRelation("1"). // error ----------------------^-------------------------- +TripleSymbolRelation("1"). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 152 -TripleSymbolRelation([1, 1, 1]). // error -----------------------^------------------------- +TripleSymbolRelation(*triple_symbol[1, 1, 1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 152 -TripleSymbolRelation([1, 1, 1]). // error --------------------------^---------------------- +TripleSymbolRelation(*triple_symbol[1, 1, 1]). // error +---------------------------------------^------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 152 -TripleSymbolRelation([1, 1, 1]). // error -----------------------------^------------------- +TripleSymbolRelation(*triple_symbol[1, 1, 1]). // error +------------------------------------------^---------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 153 -TripleSymbolRelation([-1, -1, -1]). // error ------------------------^------------------------ +TripleSymbolRelation(*triple_symbol[-1, -1, -1]). // error +-------------------------------------^--------------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 153 -TripleSymbolRelation([-1, -1, -1]). // error ----------------------------^-------------------- +TripleSymbolRelation(*triple_symbol[-1, -1, -1]). // error +-----------------------------------------^----------------------- Error: Number constant (type mismatch) in file type_system1.dl at line 153 -TripleSymbolRelation([-1, -1, -1]). // error --------------------------------^---------------- +TripleSymbolRelation(*triple_symbol[-1, -1, -1]). // error +---------------------------------------------^------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 154 -TripleSymbolRelation([1+1, 1+1, 1+1]). // error -----------------------^------------------------- +TripleSymbolRelation(*triple_symbol[1+1, 1+1, 1+1]). // error +------------------------------------^---------------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 154 -TripleSymbolRelation([1+1, 1+1, 1+1]). // error ----------------------------^-------------------- +TripleSymbolRelation(*triple_symbol[1+1, 1+1, 1+1]). // error +-----------------------------------------^----------------------- Error: Non-numeric use for numeric functor in file type_system1.dl at line 154 -TripleSymbolRelation([1+1, 1+1, 1+1]). // error ---------------------------------^--------------- +TripleSymbolRelation(*triple_symbol[1+1, 1+1, 1+1]). // error +----------------------------------------------^------------------ 109 errors generated, evaluation aborted diff --git a/tests/semantic/type_system2/type_system2.dl b/tests/semantic/type_system2/type_system2.dl index fe0598e23f5..fe9060073ca 100644 --- a/tests/semantic/type_system2/type_system2.dl +++ b/tests/semantic/type_system2/type_system2.dl @@ -24,36 +24,36 @@ // Single Number Relation -SingleNumberRelation([1]). // no error -SingleNumberRelation([1, 1]). // error -SingleNumberRelation([1, 1, 1]). // error +SingleNumberRelation(*single_number[1]). // no error +SingleNumberRelation(*single_number[1, 1]). // error +SingleNumberRelation(*single_number[1, 1, 1]). // error // Double Number Relation -DoubleNumberRelation([1]). // error -DoubleNumberRelation([1, 1]). // no error -DoubleNumberRelation([1, 1, 1]). // error +DoubleNumberRelation(*double_number[1]). // error +DoubleNumberRelation(*double_number[1, 1]). // no error +DoubleNumberRelation(*double_number[1, 1, 1]). // error // Triple Number Relation -TripleNumberRelation([1]). // error -TripleNumberRelation([1, 1]). // error -TripleNumberRelation([1, 1, 1]). // no error +TripleNumberRelation(*triple_number[1]). // error +TripleNumberRelation(*triple_number[1, 1]). // error +TripleNumberRelation(*triple_number[1, 1, 1]). // no error // Single Symbol Relation -SingleSymbolRelation(["1"]). // no error -SingleSymbolRelation(["1", "1"]). // error -SingleSymbolRelation(["1", "1", "1"]). // error +SingleSymbolRelation(*single_symbol["1"]). // no error +SingleSymbolRelation(*single_symbol["1", "1"]). // error +SingleSymbolRelation(*single_symbol["1", "1", "1"]). // error // Double Symbol Relation -DoubleSymbolRelation(["1"]). // error -DoubleSymbolRelation(["1", "1"]). // no error -DoubleSymbolRelation(["1", "1", "1"]). // error +DoubleSymbolRelation(*double_symbol["1"]). // error +DoubleSymbolRelation(*double_symbol["1", "1"]). // no error +DoubleSymbolRelation(*double_symbol["1", "1", "1"]). // error // Triple Symbol Relation -TripleSymbolRelation(["1"]). // error -TripleSymbolRelation(["1", "1"]). // error -TripleSymbolRelation(["1", "1", "1"]). // no error +TripleSymbolRelation(*triple_symbol["1"]). // error +TripleSymbolRelation(*triple_symbol["1", "1"]). // error +TripleSymbolRelation(*triple_symbol["1", "1", "1"]). // no error diff --git a/tests/semantic/type_system2/type_system2.err b/tests/semantic/type_system2/type_system2.err index 79054e44243..a00f177cf0b 100644 --- a/tests/semantic/type_system2/type_system2.err +++ b/tests/semantic/type_system2/type_system2.err @@ -1,67 +1,67 @@ Error: Number constant (type mismatch) in file type_system2.dl at line 28 -SingleNumberRelation([1, 1]). // error -----------------------^------------------------- +SingleNumberRelation(*single_number[1, 1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system2.dl at line 28 -SingleNumberRelation([1, 1]). // error --------------------------^---------------------- +SingleNumberRelation(*single_number[1, 1]). // error +---------------------------------------^------------------------- Error: Number constant (type mismatch) in file type_system2.dl at line 29 -SingleNumberRelation([1, 1, 1]). // error -----------------------^------------------------- +SingleNumberRelation(*single_number[1, 1, 1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system2.dl at line 29 -SingleNumberRelation([1, 1, 1]). // error --------------------------^---------------------- +SingleNumberRelation(*single_number[1, 1, 1]). // error +---------------------------------------^------------------------- Error: Number constant (type mismatch) in file type_system2.dl at line 29 -SingleNumberRelation([1, 1, 1]). // error -----------------------------^------------------- +SingleNumberRelation(*single_number[1, 1, 1]). // error +------------------------------------------^---------------------- Error: Wrong number of arguments given to record in file type_system2.dl at line 33 -DoubleNumberRelation([1]). // error ----------------------^-------------------------- +DoubleNumberRelation(*double_number[1]). // error +---------------------^------------------------------------------- Error: Number constant (type mismatch) in file type_system2.dl at line 35 -DoubleNumberRelation([1, 1, 1]). // error -----------------------^------------------------- +DoubleNumberRelation(*double_number[1, 1, 1]). // error +------------------------------------^---------------------------- Error: Number constant (type mismatch) in file type_system2.dl at line 35 -DoubleNumberRelation([1, 1, 1]). // error --------------------------^---------------------- +DoubleNumberRelation(*double_number[1, 1, 1]). // error +---------------------------------------^------------------------- Error: Number constant (type mismatch) in file type_system2.dl at line 35 -DoubleNumberRelation([1, 1, 1]). // error -----------------------------^------------------- +DoubleNumberRelation(*double_number[1, 1, 1]). // error +------------------------------------------^---------------------- Error: Wrong number of arguments given to record in file type_system2.dl at line 39 -TripleNumberRelation([1]). // error ----------------------^-------------------------- +TripleNumberRelation(*triple_number[1]). // error +---------------------^------------------------------------------- Error: Wrong number of arguments given to record in file type_system2.dl at line 40 -TripleNumberRelation([1, 1]). // error ----------------------^-------------------------- +TripleNumberRelation(*triple_number[1, 1]). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system2.dl at line 46 -SingleSymbolRelation(["1", "1"]). // error -----------------------^------------------------- +SingleSymbolRelation(*single_symbol["1", "1"]). // error +------------------------------------^---------------------------- Error: Symbol constant (type mismatch) in file type_system2.dl at line 46 -SingleSymbolRelation(["1", "1"]). // error ----------------------------^-------------------- +SingleSymbolRelation(*single_symbol["1", "1"]). // error +-----------------------------------------^----------------------- Error: Symbol constant (type mismatch) in file type_system2.dl at line 47 -SingleSymbolRelation(["1", "1", "1"]). // error -----------------------^------------------------- +SingleSymbolRelation(*single_symbol["1", "1", "1"]). // error +------------------------------------^---------------------------- Error: Symbol constant (type mismatch) in file type_system2.dl at line 47 -SingleSymbolRelation(["1", "1", "1"]). // error ----------------------------^-------------------- +SingleSymbolRelation(*single_symbol["1", "1", "1"]). // error +-----------------------------------------^----------------------- Error: Symbol constant (type mismatch) in file type_system2.dl at line 47 -SingleSymbolRelation(["1", "1", "1"]). // error ---------------------------------^--------------- +SingleSymbolRelation(*single_symbol["1", "1", "1"]). // error +----------------------------------------------^------------------ Error: Wrong number of arguments given to record in file type_system2.dl at line 51 -DoubleSymbolRelation(["1"]). // error ----------------------^-------------------------- +DoubleSymbolRelation(*double_symbol["1"]). // error +---------------------^------------------------------------------- Error: Symbol constant (type mismatch) in file type_system2.dl at line 53 -DoubleSymbolRelation(["1", "1", "1"]). // error -----------------------^------------------------- +DoubleSymbolRelation(*double_symbol["1", "1", "1"]). // error +------------------------------------^---------------------------- Error: Symbol constant (type mismatch) in file type_system2.dl at line 53 -DoubleSymbolRelation(["1", "1", "1"]). // error ----------------------------^-------------------- +DoubleSymbolRelation(*double_symbol["1", "1", "1"]). // error +-----------------------------------------^----------------------- Error: Symbol constant (type mismatch) in file type_system2.dl at line 53 -DoubleSymbolRelation(["1", "1", "1"]). // error ---------------------------------^--------------- +DoubleSymbolRelation(*double_symbol["1", "1", "1"]). // error +----------------------------------------------^------------------ Error: Wrong number of arguments given to record in file type_system2.dl at line 57 -TripleSymbolRelation(["1"]). // error ----------------------^-------------------------- +TripleSymbolRelation(*triple_symbol["1"]). // error +---------------------^------------------------------------------- Error: Wrong number of arguments given to record in file type_system2.dl at line 58 -TripleSymbolRelation(["1", "1"]). // error ----------------------^-------------------------- +TripleSymbolRelation(*triple_symbol["1", "1"]). // error +---------------------^------------------------------------------- 22 errors generated, evaluation aborted diff --git a/tests/syntactic/cpp_keywords/cpp_keywords.dl b/tests/syntactic/cpp_keywords/cpp_keywords.dl index bd365e3c265..359680f657d 100644 --- a/tests/syntactic/cpp_keywords/cpp_keywords.dl +++ b/tests/syntactic/cpp_keywords/cpp_keywords.dl @@ -216,8 +216,8 @@ pragma(1). _Pragma(1). .decl worked?(x:number) .output worked?() -worked?(X) :- workaround([X]). +worked?(X) :- workaround(*number_record[X]). // TODO (#467, #468): the following is a hack to disable stratification as over a hundred subprograms are produced for this test .type number_record = [ x:number ] .decl workaround(x:number_record) -workaround([X]) :- alignas(X), alignof(X), asm(X), atomic_cancel(X), atomic_commit(X), atomic_noexcept(X), auto(X), bool(X), break(X), case(X), catch(X), char(X), char16_t(X), char32_t(X), class(X), concept(X), const(X), constexpr(X), const_cast(X), continue(X), decltype(X), default(X), delete(X), do(X), double(X), dynamic_cast(X), enum(X), explicit(X), export(X), extern(X), float(X), for(X), friend(X), goto(X), int(X), import(X), long(X), module(X), mutable(X), namespace(X), new(X), noexcept(X), nullptr(X), operator(X), or(X), private(X), protected(X), public(X), register(X), reinterpret_cast(X), requires(X), return(X), short(X), signed(X), sizeof(X), static(X), static_assert(X), static_cast(X), struct(X), switch(X), synchronized(X), template(X), this(X), thread_local(X), throw(X), try(X), typedef(X), typeid(X), typename(X), union(X), unsigned(X), using(X), virtual(X), void(X), volatile(X), wchar_t(X), while(X), xor(X), compl(X), bitor(X), bitand(X), and_eq(X), or_eq(X), xor_eq(X), not(X), and(X), not_eq(X), override(X), final(X), transaction_safe(X), transaction_safe_dynamic(X), if(X), elif(X), else(X), endif(X), defined(X), ifdef(X), ifndef(X), define(X), undef(X), include(X), line(X), error(X), pragma(X), _Pragma(X). +workaround(*number_record[X]) :- alignas(X), alignof(X), asm(X), atomic_cancel(X), atomic_commit(X), atomic_noexcept(X), auto(X), bool(X), break(X), case(X), catch(X), char(X), char16_t(X), char32_t(X), class(X), concept(X), const(X), constexpr(X), const_cast(X), continue(X), decltype(X), default(X), delete(X), do(X), double(X), dynamic_cast(X), enum(X), explicit(X), export(X), extern(X), float(X), for(X), friend(X), goto(X), int(X), import(X), long(X), module(X), mutable(X), namespace(X), new(X), noexcept(X), nullptr(X), operator(X), or(X), private(X), protected(X), public(X), register(X), reinterpret_cast(X), requires(X), return(X), short(X), signed(X), sizeof(X), static(X), static_assert(X), static_cast(X), struct(X), switch(X), synchronized(X), template(X), this(X), thread_local(X), throw(X), try(X), typedef(X), typeid(X), typename(X), union(X), unsigned(X), using(X), virtual(X), void(X), volatile(X), wchar_t(X), while(X), xor(X), compl(X), bitor(X), bitand(X), and_eq(X), or_eq(X), xor_eq(X), not(X), and(X), not_eq(X), override(X), final(X), transaction_safe(X), transaction_safe_dynamic(X), if(X), elif(X), else(X), endif(X), defined(X), ifdef(X), ifndef(X), define(X), undef(X), include(X), line(X), error(X), pragma(X), _Pragma(X).