-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
83 lines (72 loc) · 1.89 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
==================================================================
Transitive Closure (by David J. Pearce 2013)
==================================================================
This example illustrates a very simple system for closing over
arithmetic inequalities. This system is interesting since it's about
the smallest system which requires an inference rule (compared with
e.g. the larger arithmetic example). Only strict inequalities between
variables and constants are permitted for simplicity.
An example session:
> Welcome!
>
> > x < y, y < z
> ------------------------------------
> And{
> LessThan[Var("x"),Var("y")],
> LessThan[Var("y"),Var("z")]
> }
>
> ==> (?? steps)
>
> And{
> LessThan[Var("x"),Var("y")],
> LessThan[Var("y"),Var("z")],
> LessThan[Var("x"),Var("z")]
> }
>
> > x < x
> ------------------------------------
> LessThan[Var("x"),Var("x")]
>
> ==> (?? steps)
>
> False
>
> x < y, y < x
> ------------------------------------
> And{
> LessThan[Var("x"),Var("y")],
> LessThan[Var("y"),Var("x")]
> }
>
> ==> (?? steps)
>
> False
>
> > 1 < x, x < 1
> ------------------------------------
> And{
> LessThan[Num(1),Var("x")],
> LessThan[Var("x"),Num(1)]
> }
> APPLIED: Closure$Reduction_2
> APPLIED: Closure$Reduction_1
> APPLIED: Closure$Inference_0
>
> ==> (?? steps)
>
> False
As we can see, you type in very simple inequalities involving
variables and/or integer constants and the algorithm performs a
transitive closure. In the case of an inconsistenty being found, it
returns false; otherwise, it returns the closed set.
==================================================================
Running
==================================================================
Firstly, you need to build WyRL using ant from the top-level
directory:
> ant
...
> cd examples/closure
Then, you can run the example as follows:
> java -cp .:../../lib/wybs-v0.3.34.jar:../../lib/wyrl-v0.3.34.jar Main