Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[VRG]

- added support for multiple goals in vrg-run.pl. all
  tests are t/senior.t are now *really* passing and
  no tests skipped.


git-svn-id: http://svn.berlios.de/svnroot/repos/unisimu/VRG@852 625e195c-0704-0410-94f2-f261ee9f2fe7
  • Loading branch information...
commit a3ec19567aa69c42acefce4a2ad85b6d39e452a8 1 parent ae03660
agent authored
Showing with 38 additions and 24 deletions.
  1. +1 −0  lib/Clips/GraphViz.pm
  2. +25 −11 script/vrg-run.pl
  3. +12 −13 t/senior.t
1  lib/Clips/GraphViz.pm
View
@@ -140,6 +140,7 @@ sub draw($$$) {
sub get_facts ($$$$) {
my ($self, $goal, $res_facts, $res_fires) = @_;
my @facts = @{ $self->{facts} };
+ return if !$goal;
$res_facts->[$goal] = $facts[$goal];
my @fires = @{ $self->{fires} };
36 script/vrg-run.pl
View
@@ -86,21 +86,35 @@
#warn "GOAL!!! $goal_res\n";
-my $goal;
+my @goal;
if (($anti_init_facts . $anti_vec_facts) =~ /\(contradiction (\S+) (\S+)\)/) {
print "Contradiction detected. (Check the relationships between $1 and $2.)\n";
-} elsif ($anti_vec_facts =~ /\(goal ([^\)]+)\)/) {
- $goal = "($1)";
- #warn "goal: $1\n";
- my $pat = quotemeta($goal);
- if ($anti_vec_facts =~ /\s+$pat\s*\n/s) {
- print "Yes.\n";
+} else {
+ while ($anti_vec_facts =~ /\(goal ([^\)]+)\)/g) {
+ push @goal, "($1)";
+ }
+ if (@goal == 0) {
+ warn "no goal found.\n";
} else {
- print "No.\n";
+ my @missed;
+ for my $goal (@goal) {
+ my $pat = quotemeta($goal);
+ if ($anti_vec_facts !~ /\s+$pat\s*\n/s) {
+ push @missed, $goal;
+ }
+ }
+ if (@missed) {
+ if (@goal == 1) {
+ print "No.\n";
+ } else {
+ print "No. (pending: ",
+ (join ', ', map { format_fact($_) } @missed), ")\n";
+ }
+ } else {
+ print "Yes.\n";
+ }
}
-} else {
- warn "no goal found.\n";
}
if ($opts{t}) {
@@ -156,7 +170,7 @@
outfile => $fname,
fact_filter => \&format_fact,
trim => 1,
- goal => $goal,
+ goal => \@goal,
);
warn "generating $fname...\n";
}
25 t/senior.t
View
@@ -1,6 +1,6 @@
use t::VRG;
-plan tests => 144;
+plan tests => 149;
run_tests();
@@ -348,11 +348,11 @@ line m, n;
alpha T beta, n on alpha, m on beta, m T n => n T beta, m T alpha;
--- ans
-No.
+No. (pending: n [T] beta, m [T] alpha)
-=== TEST 15:
+=== TEST 16:
若平面 alpha T 平面 beta, 直线 n 在 alpha 上,直线 m 在 beta 上,
m T n, 则 n T beta 和 m T alpha 当中至少有一个成立,对吗?
@@ -364,11 +364,11 @@ line m, n;
alpha T beta, n on alpha, m on beta, m T n => n ~T beta, m ~T alpha;
--- ans
-No.
+No. (pending: n [~T] beta, m [~T] alpha)
-=== TEST 16: multiple goals
+=== TEST 17: multiple goals
--- vrg
plane alpha, beta;
@@ -381,7 +381,7 @@ Yes.
-=== TEST 17: multiple goals
+=== TEST 18: multiple goals
multiple goals is yet not (really) supported.
--- vrg
@@ -391,12 +391,11 @@ line m, n;
alpha T beta, n on alpha, m on beta, m T n => beta T alpha, m // n
--- ans
-No.
---- SKIP
+No. (pending: m [//] n)
-=== TEST 18: (常规方法中,处理面面垂直问题多半是要作出交线的垂线的。)
+=== TEST 19: (常规方法中,处理面面垂直问题多半是要作出交线的垂线的。)
已知平面 alpha, beta 都垂直于面 gama, 交线分别为 a, b,
若 a // b, 求证:alpha // beta.
@@ -426,7 +425,7 @@ Yes.
-=== TEST 19:
+=== TEST 20:
已知 a, b, c 是直线,alpha、beta 是平面,
则由 a T b, a T c, b 在 alpha 上,
c 在 alpha 上能否得出直线 a T 平面 alpha?
@@ -442,7 +441,7 @@ No.
-=== TEST 20:
+=== TEST 21:
已知 a, b, c 是直线,alpha、beta 是平面,
则由 a T b, b // alpha 能否得出直线 a T 平面 alpha?
--- vrg
@@ -456,7 +455,7 @@ No.
-=== TEST 21:
+=== TEST 22:
已知 a, b, c 是直线,alpha、beta 是平面,则
由 alpha T beta, b // beta 能否得出直线 a T 平面 alpha?
@@ -471,7 +470,7 @@ No.
-=== TEST 22:
+=== TEST 23:
已知 a, b, c 是直线,alpha、beta 是平面,
则由 a // b, b T alpha 能否得出直线 a T 平面 alpha?
Please sign in to comment.
Something went wrong with that request. Please try again.