mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
PB03-023: Fix adalog tests
Change-Id: Ifeb3ccb8042c6f327b67b5c74e0aa70e6d7515d1
This commit is contained in:
@@ -41,7 +41,7 @@ class Bind(AbstractExpression):
|
||||
Bind(A, B, property)
|
||||
"""
|
||||
|
||||
def __init__(self, from_expr, to_expr, conv_prop=None):
|
||||
def __init__(self, from_expr, to_expr, conv_prop=None, eq_prop=None):
|
||||
"""
|
||||
:param AbstractExpression from_expr: An expression resolving to a
|
||||
logical variable that is the source of the bind.
|
||||
|
||||
@@ -2,11 +2,12 @@ with Adalog.Abstract_Relation; use Adalog.Abstract_Relation;
|
||||
with Adalog.Main_Support; use Adalog.Main_Support;
|
||||
|
||||
package Support is
|
||||
function Eq (A, B : Integer) return Boolean is (A = B);
|
||||
type Dummy_Data is null record;
|
||||
D : Dummy_Data;
|
||||
No_Data : constant Dummy_Data := (null record);
|
||||
|
||||
function Transform (D : Dummy_Data; I : Integer) return Integer is (I ** 2);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, Transform);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, No_Data, Transform, Eq);
|
||||
function Square (X, Y : Eq_Int.Refs.Raw_Var) return Relation
|
||||
is (Bind.Create (X, Y, D));
|
||||
is (Bind.Create (X, Y, No_Data));
|
||||
end Support;
|
||||
|
||||
@@ -2,9 +2,11 @@ with Adalog.Main_Support; use Adalog.Main_Support;
|
||||
with Adalog.Predicates; use Adalog.Predicates;
|
||||
|
||||
package Support is
|
||||
function Eq (A, B : Integer) return Boolean is (A = B);
|
||||
type Dummy_Data is null record;
|
||||
No_Data : constant Dummy_Data := (null record);
|
||||
function Transform (D : Dummy_Data; I : Integer) return Integer is (I * 3);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, Transform);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, No_Data, Transform, Eq);
|
||||
|
||||
|
||||
type Pred is null record;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
with Adalog.Main_Support; use Adalog.Main_Support;
|
||||
|
||||
package Support is
|
||||
function Eq (A, B : Integer) return Boolean is (A = B);
|
||||
type Dummy_Data is null record;
|
||||
No_Data : constant Dummy_Data := (null record);
|
||||
function Transform (D : Dummy_Data; I : Integer) return Integer is (I * 3);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, Transform);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, No_Data, Transform, Eq);
|
||||
end Support;
|
||||
|
||||
@@ -2,9 +2,11 @@ with Adalog.Main_Support; use Adalog.Main_Support;
|
||||
with Adalog.Predicates; use Adalog.Predicates;
|
||||
|
||||
package Support is
|
||||
function Eq (A, B : Integer) return Boolean is (A = B);
|
||||
type Dummy_Data is null record;
|
||||
No_Data : constant Dummy_Data := (null record);
|
||||
function Transform (D : Dummy_Data; I : Integer) return Integer is (I * 3);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, Transform);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, No_Data, Transform, Eq);
|
||||
|
||||
type Pred is null record;
|
||||
function Call (Self : Pred; L, R : Integer) return Boolean is (L = R * 2);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
with Adalog.Main_Support; use Adalog.Main_Support;
|
||||
|
||||
package Support is
|
||||
function Eq (A, B : Integer) return Boolean is (A = B);
|
||||
type Dummy_Data is null record;
|
||||
No_Data : constant Dummy_Data := (null record);
|
||||
function Transform (D : Dummy_Data; I : Integer) return Integer is (I * 3);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, Transform);
|
||||
package Bind is new Eq_Int.Raw_Custom_Bind (Dummy_Data, No_Data, Transform, Eq);
|
||||
end Support;
|
||||
|
||||
Reference in New Issue
Block a user