\n", $errors, "", br, "The maintainers have been notified."; }); delete_files("/tmp/input-xml.$$"); exit; } pop @status; push @status, "$validate1_message $done"; ############################################################################## push @status, "$inference_message $processing"; write_status_page(-status=>[@status]); if($query->param("Rank") =~ /\d/) { $untainted_rank = $&; } else { pop @status; push @status, "$inference_message $error"; write_report_page(-status => [@status], -reportsub => sub { my $FILE = shift(@_); print $FILE "You somehow managed to send us an invalid rank, perhaps even intentionally. Naughty Naughty. Try again.", br;}); # Do something better here } # Peform the actual typing inference $errors = infer_typing(-input=>"/tmp/input-xml.$$", -output=>"/tmp/output-xml.$$", -rank=>$untainted_rank, -implementation=>$query->param("Implementation")); # Two possible types of errors: inference failed or inference timed out. # If the inference engine chokes for other reasons # we have no way of knowing about it at present pop @status; if($errors == 1) { $inference_result = "(Done - inference failed)"; } elsif($errors == 2) { push @status, "$inference_message $error"; write_report_page(-status=>[@status], -reportsub => sub { my $FILE = shift(@_); print $FILE br, "", "Type inference timed out. This may mean that the term you requested requires more time to process than we allow.", ""; }); delete_files("/tmp/input-xml.$$"); exit; } else { $inference_result = "(Done - inference succeed)"; } push @status, "$inference_message $inference_result"; delete_files("/tmp/input-xml.$$"); ############################################################################## push @status, "$validate2_message $processing"; write_status_page(-status=>[@status]); # Validate the XML output from typing inference as a sanity check $errors = validate_xml(-input=>"/tmp/output-xml.$$", -schema=>$systemi_schema); # If there were errors, tell the user and maintainers if($errors) { pop @status; push @status, "$validate2_message $error"; send_error_report($errors); write_report_page(-status=>[@status], -reportsub => sub { my $FILE = shift(@_); print $FILE "Internal Consistency Error:", br, "
\n", $errors, "", br, "The maintainers have been notified."; }); delete_files("/tmp/output-xml.$$"); exit; } pop @status; push @status, "$validate2_message $done"; ############################################################################## push @status, "$style_message $processing"; write_status_page(-status=>[@status]); # Figure out what options apply if($query->param("UnifyOptions") eq "Tracing") { $options = [$query->param("GeneralStyleOptions"), $query->param("TracingStyleOptions")]; } else { $options = [$query->param("GeneralStyleOptions"), $query->param("StandardStyleOptions")]; } if($query->param("EPathEnvironment") eq "on") { $options = [@{$options}, 'E-path Environment']; } if($query->param("IncludeLegend") eq "on") { $options = [@{$options}, 'Legend']; } # Apply a stylesheet to the output from typing inference %output = style_xml(-input=>"/tmp/output-xml.$$", -output_prefix=>$session, -style=>$query->param("OutputStyle"), -options=>$options); delete_files("/tmp/output-xml.$$"); if($output{'errors'}) { pop @status; push @status, "$style_message $error"; send_error_report($output{'errors'}); write_report_page(-status=>[@status], -reportsub => sub { my $FILE = shift(@_); print $FILE "Internal Consistency Error:", br, "
\n", $output{'errors'}, "", br, "The maintainers have been notified."; }); delete_files($output{'file'}); exit; } pop @status; push @status, "$style_message $done"; ############################################################################## # Done, redirect the user to the output file write_report_page(-status=>[@status], -refresh=>$output{'file'}, -reportsub=> sub { my $FILE = shift(@_); print $FILE br, "
";
print "System I Experimentation Tool"; print "Welcome user@".$query->remote_host()."! "; print <Unfortunately, this tool does not presently work with web browsers, such as , which do not support the use of <meta http-equiv="refresh">. Direct bug reports and questions to: (fn [user, host] => user ^ "@" ^ host) ["compositional-web-bugs", "types.bu.edu"]; |
|
END
$body = $body.$query->textarea(-name=>'Term',
-rows=>4,
-cols=>50);
$body = $body.< |
END
$body = $body."File: ".$query->filefield(-name=>'Upload',-size=>40,-maxlength=>32768);
$body = $body.< |
In some examples the types may become very large making the skeletons
and derivation difficult to read. One may opt to only apply expansion
variable substitutions to the skeletons and derivations
displayed in the output, which may make those examples easier to read.
END
$body = $body.$query->checkbox(-name=>'ExpandOnly',
-checked=>'on',
-label=>'Apply Expansions Only');
$body = $body.<
The Alan-Washburn implementation computes composed substitutions using safe composition,
while the Yates-Schwartz implementation computes chains of small substitutions.
The Carlier implementation works with chains internally, but has an
option to compose them (using an algorithm different from safe composition).
END
$body = $body.$query->checkbox(-name=>'ComposeSubstitutions',
-checked=>'on',
-label=>'Compose Substitutions');
$body = $body.<
In the Alan-Washburn implementation, E-path Environments are generated and may optionally be included in the output.
END
$body = $body.$query->checkbox(-name=>'EPathEnvironment',
-value=>'on',
-label=>'Include E-path Environment');
if(!$valid_epath) {
$body = $body." (cannot include E-Path Environment when using the Java implementation)";
}
$body = $body.<
The output from our inference engines can be rendered using
into several different file formats, which would you like?
END
@radio = $query->radio_group(
-name=>'OutputStyle',
-values=>['Raw XML', 'PDF', 'Gzipped PostScript', 'PostScript','XHTML', 'ASCII Text'],
-default=>'PDF');
$xml_radio = shift @radio;
$body = $body."
For these formats, you can choose among the following items to be included in your output: END $body = $body.$query->checkbox_group(-name=>"GeneralStyleOptions", -values=>$general_style_params, -defaults=>$general_style_params, -rows=>2); $body = $body."
"; $body = $body.<
Additional options relevant for standard unification output:
END
$body = $body.$query->checkbox_group(-name=>"StandardStyleOptions",
-values=>$standard_style_params,
-defaults=>$standard_style_params,
-rows=>2);
$body = $body.<
Additional options relevant for tracing unification output: END $body = $body.$query->checkbox_group(-name=>"TracingStyleOptions", -values=>$tracing_style_params, -defaults=>$tracing_style_params, -rows=>2); $body = $body."
For XML output, the following options are relevant for tracing unification output: END $body = $body.$query->checkbox_group(-name=>"XMLTracingStyleOptions", -values=>$xml_tracing_style_params, -defaults=>$xml_tracing_style_params, -rows=>1); $body = $body."
$title |
$content |
@_ |