newground.newground module

Main module. Contains the Newground class, which is used for the tranformations.

class newground.newground.Newground(no_show=False, ground_guess=False, output_printer=None, aggregate_mode=AggregateMode.RA, cyclic_strategy=CyclicStrategy.ASSUME_TIGHT, grounding_mode=GroundingModes.REWRITE_AGGREGATES_GROUND_PARTLY)

Bases: object

Main module. Contains the Newground class, which is used for the tranformations.

compute_scc_data_structures(term_transformer)

Important for non-tight ASP. This method computes the strongly-connected-components, and then prepares the necessary data-structures.

global_main_transformations(program_builder, transformer, term_transformer)

Global main transformations, like adding ‘’:- not sat.’’, and similar.

handle_strongly_connected_component(term_transformer, strongly_connected_comps_counter, predicates_strongly_connected_comps, rule_strongly_connected_comps, rule_head_strongly_connected_comps, scc_rule_functions_scc_lookup, strongly_connected_comp)

Handle a single strongly-connected-component.

scc_extract_relevant_bodies(term_transformer, strongly_connected_comps_counter, predicates_strongly_connected_comps, rule_strongly_connected_comps, scc_rule_functions_scc_lookup, strongly_connected_comp, node)

Necessary method for SCC for extracting bodies.

scc_extract_relevant_heads(term_transformer, strongly_connected_comps_counter, rule_head_strongly_connected_comps, scc_rule_functions_scc_lookup, strongly_connected_comp, node)

Necessary method for SCCs for extracting relevant heads.

start(contents)

Start method of the Newground. Call this method to start the rewriting procedure.

start_aggregate_transformer(contents, domain)

Starts the aggregate transformer.

start_domain_inference(combined_inputs)

Starts the domain inference in general. It calls the term- and domain-transformers. It is the first general procedure which is called.

start_main_transformation(aggregate_transformer_output_program, domain, safe_variables, term_transformer, rule_strongly_connected_comps, predicates_strongly_connected_comps, rule_strongly_connected_comps_heads, scc_rule_functions_scc_lookup)

Wrapper for calling the main transformer.