File tree Expand file tree Collapse file tree 6 files changed +63
-0
lines changed Expand file tree Collapse file tree 6 files changed +63
-0
lines changed Original file line number Diff line number Diff line change
1
+ -- Check that the solver correctly handles an equation that involve a cycle in
2
+ -- variable definitions, when that cycle can be resolved anyway.
3
+
4
+ with Langkit_Support.Adalog.Main_Support ;
5
+ use Langkit_Support.Adalog.Main_Support;
6
+
7
+ procedure Main is
8
+ use T_Solver, Refs, Solver_Ifc;
9
+
10
+ X : constant Refs.Logic_Var := Create (" X" );
11
+ Y : constant Refs.Logic_Var := Create (" Y" );
12
+ R : constant Relation :=
13
+ R_All ((Propagate (X, Y),
14
+ Propagate (Y, X),
15
+ Assign (X, 1 )));
16
+ begin
17
+ Solve_All (R);
18
+ end Main ;
Original file line number Diff line number Diff line change
1
+ Solving relation:
2
+ All:
3
+ %Y <- %X
4
+ %X <- %Y
5
+ %X <- 1
6
+
7
+ ... without optimizations:
8
+ Solution: [%Y = 1, %X = 1]
9
+
10
+ ... with all optimizations:
11
+ Solution: [%Y = 1, %X = 1]
12
+
13
+ Done.
Original file line number Diff line number Diff line change
1
+ driver : adalog
Original file line number Diff line number Diff line change
1
+ -- Check that the solver correctly handles an equation that involve a cycle in
2
+ -- variable definitions, when that cycle cannot be resolved.
3
+
4
+ with Langkit_Support.Adalog.Main_Support ;
5
+ use Langkit_Support.Adalog.Main_Support;
6
+
7
+ procedure Main is
8
+ use T_Solver, Refs, Solver_Ifc;
9
+
10
+ X : constant Refs.Logic_Var := Create (" X" );
11
+ Y : constant Refs.Logic_Var := Create (" Y" );
12
+ Z : constant Refs.Logic_Var := Create (" Z" );
13
+ R : constant Relation :=
14
+ R_All ((Propagate (X, Y),
15
+ Propagate (Y, Z),
16
+ Propagate (Z, X)));
17
+ begin
18
+ Solve_All (R);
19
+ end Main ;
Original file line number Diff line number Diff line change
1
+ Solving relation:
2
+ All:
3
+ %Y <- %X
4
+ %Z <- %Y
5
+ %X <- %Z
6
+
7
+ ... without optimizations:
8
+
9
+ ... with all optimizations:
10
+
11
+ Done.
Original file line number Diff line number Diff line change
1
+ driver : adalog
You can’t perform that action at this time.
0 commit comments