Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/AST/parameterizedtype.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,17 @@ func MkParameterizedType(name string, types []TypeApp) ParameterizedType {
}
if k != len(types) {
pMap.lock.Unlock()
Glob.PrintInfo("PRMTR_TYPE", fmt.Sprintf("Name of the type: %s, length of the args: %d", name, len(types)))
Glob.PrintError("PRMTR_TYPE", "Parameterized type can not be instanciated with this number of arguments.")
debug(
Lib.MkLazy(func() string {
return fmt.Sprintf("Name of the type: %s, length of the args: %d", name, len(types))
}))
Glob.Fatal("PRMTR_TYPE", "Parameterized type can not be instanciated with this number of arguments.")
return ParameterizedType{}
}
types = nextTypes
} else {
pMap.lock.Unlock()
Glob.PrintError("PRMTR_TYPE", "Parameterized type not found.")
Glob.Fatal("PRMTR_TYPE", "Parameterized type not found.")
return ParameterizedType{}
}
pMap.lock.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion src/AST/term.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func TypeAppToTerm(typeApp TypeApp) Term {
if nt.IsMeta() {
term = typeVarToMeta(nt)
} else {
Glob.PrintError("TERM", "A TypeVar should be only converted to terms if it has been instantiated.")
Glob.Fatal("TERM", "A TypeVar should be only converted to terms if it has been instantiated.")
term = nil
}
case TypeHint:
Expand Down
2 changes: 1 addition & 1 deletion src/Core/subst_and_form.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func MergeSubstAndForm(s1, s2 SubstAndForm) (error, SubstAndForm) {
new_subst, _ := Unif.MergeSubstitutions(s1.GetSubst().Copy(), s2.GetSubst().Copy())

if new_subst.Equals(Unif.Failure()) {
Glob.PrintError("MSAF", fmt.Sprintf("Error : MergeSubstitutions returns failure between : %v and %v \n", s1.ToString(), s2.ToString()))
Glob.Fatal("MSAF", fmt.Sprintf("Error : MergeSubstitutions returns failure between : %v and %v \n", s1.ToString(), s2.ToString()))
return errors.New("Couldn't merge two substitutions"), MakeEmptySubstAndForm()
}

Expand Down
2 changes: 1 addition & 1 deletion src/Core/substitutions_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func RemoveElementWithoutMM(subs Unif.Substitutions, mm Lib.Set[AST.Meta]) Unif.
)

if ms.Equals(Unif.Failure()) {
Glob.PrintError("REWM", "MergeSubstitutions returns failure")
Glob.Fatal("REWM", "MergeSubstitutions returns failure")
}

return ms
Expand Down
4 changes: 2 additions & 2 deletions src/Glob/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ func exitWithError(panicMsg string) {

func Anomaly(label, msg string) {
url := "https://github.com/GoelandProver/Goeland/issues"
PrintError("Anomaly", fmt.Sprintf("In %s: %s.\nPlease report at %s", label, msg, url))
printError("Anomaly", fmt.Sprintf("In %s: %s.\nPlease report at %s", label, msg, url))
exitWithError("Anomaly encountered.")
}

func Fatal(label, msg string) {
PrintError(label, msg)
printError(label, msg)
exitWithError("Fatal error encountered.")
}
2 changes: 1 addition & 1 deletion src/Glob/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func PrintInfo(function, message string) {
//
// Use when you want to warn that something is not happening as it should and it is important and must be corrected.
// The prefix for error messages is '[error]' in red.
func PrintError(function, message string) {
func printError(function, message string) {
printToLogger(logError, function, message)
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mods/assisted/assistant.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func InitAssisted() {
if typed, ok := Search.UsedSearch.(Search.BasicSearchAlgorithm); ok {
searchAlgo = typed
} else {
Glob.PrintError("ASS", "Search algorithm not supported by the Assisted plugin")
Glob.Fatal("ASS", "Search algorithm not supported by the Assisted plugin")
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mods/dmt/rewrite.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func addRewrittenFormulas(rewritten []Core.IntSubstAndForm, unif Unif.MatchingSu
useful_subst := Core.RemoveElementWithoutMM(unif.GetSubst(), atomic.GetMetas())
meta_search := atomic.GetMetas()
if !checkMetaAreFromSearch(meta_search, useful_subst) {
Glob.PrintError("DMT", fmt.Sprintf("There is at least one meta in final subst which is not from search : %v - %v - %v", useful_subst.ToString(), atomic.ToString(), unif.GetForm().ToString()))
Glob.Fatal("DMT", fmt.Sprintf("There is at least one meta in final subst which is not from search : %v - %v - %v", useful_subst.ToString(), atomic.ToString(), unif.GetForm().ToString()))
}
filteredUnif := Unif.MakeMatchingSubstitutions(
unif.GetForm(),
Expand Down
4 changes: 2 additions & 2 deletions src/Mods/equality/bse/constraints_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (c Constraint) toString() string {
case EQ:
return c.getTP().GetT1().ToString() + " ≃ " + c.getTP().GetT2().ToString()
default:
Glob.PrintError("CT", "Constraint type unknown")
Glob.Anomaly("CT", "Constraint type unknown")
return "Constraint type unknown"
}
}
Expand Down Expand Up @@ -114,7 +114,7 @@ func (c *Constraint) checkLPO() (bool, bool) {
case EQ:
return cs.order == 0, true
default:
Glob.PrintError("CT", "Constraint type not valid")
Glob.Anomaly("CT", "Constraint type not valid")
return false, true
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Mods/equality/bse/equality_problem.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (ep EqualityProblem) applySubstitution(s Unif.Substitutions) EqualityProble
new_equalities := ep.GetE()

if !ep.getC().isEmpty() {
Glob.PrintError("EQ-AS", fmt.Sprintf("Constraint not null in applySubstitution : %v", ep.getC().toString()))
Glob.Fatal("EQ-AS", fmt.Sprintf("Constraint not null in applySubstitution : %v", ep.getC().toString()))
}

for _, subst := range s {
Expand Down
4 changes: 2 additions & 2 deletions src/Mods/equality/bse/equality_rules_reasoning.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ func manageEqualityReasoningProblem(ep EqualityProblem, sl []Unif.Substitutions)
for _, subst_element := range s_subst {
merged_subst, same_key := Unif.MergeSubstitutions(s.Copy(), subst_element.Copy())
if same_key {
Glob.PrintError("ERPWAS", "Error in EqualityReasoningList : same key appears in merge")
Glob.Fatal("ERPWAS", "Error in EqualityReasoningList : same key appears in merge")
}
if merged_subst.Equals(Unif.Failure()) {
Glob.PrintError("ERPWAS", "Error in EqualityReasoningList : merge returns failure")
Glob.Fatal("ERPWAS", "Error in EqualityReasoningList : merge returns failure")
} else {
found = true
res_substs = append(res_substs, merged_subst)
Expand Down
10 changes: 5 additions & 5 deletions src/Mods/equality/bse/equality_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ func retrieveEqualities(dt Unif.DataStructure) Equalities {
ms_ordered := orderSubstForRetrieve(ms.GetSubst(), MetaEQ1, MetaEQ2)
eq1_term, ok_t1 := ms_ordered.Get(MetaEQ1)
if ok_t1 == -1 {
Glob.PrintError("RI", "Meta_eq_1 not found in map")
Glob.Anomaly("RI", "Meta_eq_1 not found in map")
}
eq2_term, ok_t2 := ms_ordered.Get(MetaEQ2)
if ok_t2 == -1 {
Glob.PrintError("RI", "Meta_eq_2 not found in map")
Glob.Anomaly("RI", "Meta_eq_2 not found in map")
}
res = append(res, eqStruct.MakeTermPair(eq1_term, eq2_term))
}
Expand Down Expand Up @@ -175,11 +175,11 @@ func retrieveInequalities(dt Unif.DataStructure) Inequalities {
ms_ordered := orderSubstForRetrieve(ms.GetSubst(), MetaNEQ1, MetaNEQ2)
neq1_term, ok_t1 := ms_ordered.Get(MetaNEQ1)
if ok_t1 == -1 {
Glob.PrintError("RI", "Meta_eq_1 not found in map")
Glob.Anomaly("RI", "Meta_eq_1 not found in map")
}
neq2_term, ok_t2 := ms_ordered.Get(MetaNEQ2)
if ok_t2 == -1 {
Glob.PrintError("RI", "Meta_eq_1 not found in map")
Glob.Anomaly("RI", "Meta_eq_1 not found in map")
}
res = append(res, eqStruct.MakeTermPair(neq1_term, neq2_term))
}
Expand All @@ -193,7 +193,7 @@ func orderSubstForRetrieve(s Unif.Substitutions, M1, M2 AST.Meta) Unif.Substitut
k, v := subst.Get()
if !k.Equals(M1) && !k.Equals(M2) {
if !v.IsMeta() {
Glob.PrintError("OSFR", "Meta EQ/NEQ not found")
Glob.Fatal("OSFR", "Meta EQ/NEQ not found")
} else {
new_subst.Set(v.ToMeta(), k)
}
Expand Down
10 changes: 5 additions & 5 deletions src/Mods/equality/bse/lpo.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func compareLPO(s, t AST.Term) compareStruct {
// function & meta : Occurences inside : f(x) < x, f(y) < x
return compareMetaFun(t_type, s_type, -1)
default:
Glob.PrintError("CPR", "Type of t unknown")
Glob.Anomaly("CPR", "Type of t unknown")
}
case AST.Meta:
debug(
Expand All @@ -108,10 +108,10 @@ func compareLPO(s, t AST.Term) compareStruct {
// Meta and meta
return compareMetaMeta(s_type, t_type)
default:
Glob.PrintError("CPR", "Type of t unknown")
Glob.Anomaly("CPR", "Type of t unknown")
}
default:
Glob.PrintError("CPR", "Type of s unknown")
Glob.Anomaly("CPR", "Type of s unknown")
}
return makeCompareStruct(0, false, s, t)
}
Expand Down Expand Up @@ -164,7 +164,7 @@ func compareMetaFunInside(m AST.Meta, f AST.Fun, return_code int) (bool, compare
res = cs.order
is_comparable = cs.is_comparable
default:
Glob.PrintError("CMFI", "Unexpected return_code in compare")
Glob.Anomaly("CMFI", "Unexpected return_code in compare")
}

if is_comparable {
Expand Down Expand Up @@ -240,7 +240,7 @@ func caseFEqualsG(s, t AST.Fun) (bool, compareStruct) {
Lib.MkLazy(func() string { return "Case F = G" }),
)
if s.GetArgs().Len() != t.GetArgs().Len() {
Glob.PrintError("F=G", fmt.Sprintf("Error : %v and %v don't have the same number of arguments", s.GetID().ToString(), t.GetID().ToString()))
Glob.Fatal("F=G", fmt.Sprintf("Error : %v and %v don't have the same number of arguments", s.GetID().ToString(), t.GetID().ToString()))
return true, makeCompareStruct(0, false, nil, nil)
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mods/gs3/dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func getTermAt(form AST.Form, occsArr occurrences) AST.Term {
t := getTermAux(form, occ)
if term != nil {
if !term.Equals(t) {
Glob.PrintError("GTA", "The same variable is instanciated as two different terms.")
Glob.Anomaly("GTA", "The same variable is instanciated as two different terms.")
}
} else {
term = t
Expand Down
2 changes: 1 addition & 1 deletion src/Mods/lambdapi/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var LambdapiOutputProofStruct = &Search.OutputProofStruct{ProofOutput: MakeLambd

func MakeLambdapiOutput(prf []Search.ProofStruct, meta Lib.List[AST.Meta]) string {
if len(prf) == 0 {
Glob.PrintError("LambdaPi", "Nothing to output")
Glob.Fatal("LambdaPi", "Nothing to output")
return ""
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mods/lambdapi/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func makeProofStep(proof *gs3.GS3Sequent) string {

// Weakening rule
case gs3.W:
Glob.PrintError("LP", "Trying to do a weakening rule but it's not implemented yet")
Glob.Fatal("LP", "Trying to do a weakening rule but it's not implemented yet")
}

return "//" + toCorrectString(proof.GetTargetForm()) + "\n" + resultingString
Expand Down
2 changes: 1 addition & 1 deletion src/Mods/rocq/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ var RocqOutputProofStruct = &Search.OutputProofStruct{ProofOutput: MakeRocqOutpu

func MakeRocqOutput(prf []Search.ProofStruct, meta Lib.List[AST.Meta]) string {
if len(prf) == 0 {
Glob.PrintError("Rocq", "Nothing to output")
Glob.Fatal("Rocq", "Nothing to output")
return ""
}

Expand Down
2 changes: 1 addition & 1 deletion src/Mods/tptp/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var TptpOutputProofStruct = &Search.OutputProofStruct{ProofOutput: MakeTptpOutpu

func MakeTptpOutput(prf []Search.ProofStruct, meta Lib.List[AST.Meta]) string {
if len(prf) == 0 {
Glob.PrintError("TPTP", "Nothing to output")
Glob.Fatal("TPTP", "Nothing to output")
return ""
}

Expand Down
2 changes: 1 addition & 1 deletion src/Search/child_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ func (ds *destructiveSearch) passSubstToParent(args wcdArgs, proofChildren [][]P
err, merged := Core.MergeSubstAndForm(subst, args.st.GetAppliedSubst())

if err != nil {
Glob.PrintError("WC", "Error when merging the children substitution's with the applied one.")
Glob.Fatal("WC", "Error when merging the children substitution's with the applied one.")
return err
}

Expand Down
10 changes: 5 additions & 5 deletions src/Search/destructive.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func (ds *destructiveSearch) waitChildren(args wcdArgs) {
}

if err != nil {
Glob.PrintError("WC", "Error when waiting for children. It should be an error when merging substitutions. What to do?")
Glob.Fatal("WC", "Error when waiting for children: "+err.Error())
}
}
}
Expand Down Expand Up @@ -873,7 +873,7 @@ func (ds *destructiveSearch) selectChildren(father Communication, children *[]Co
err, new_subst := Core.MergeSubstAndForm(s.Copy(), new_current_subst.Copy())

if err != nil {
Glob.PrintError("SLC", "Error when merging substitutions. What to do?")
Glob.Fatal("SLC", "Error when merging substitutions.")
}

new_result_subst = append(new_result_subst, new_subst)
Expand Down Expand Up @@ -943,7 +943,7 @@ func (ds *destructiveSearch) manageRewriteRules(fatherId uint64, state State, c
return
}
} else {
Glob.PrintError("DMT", err.Error())
Glob.Fatal("DMT", err.Error())
}
}
}
Expand Down Expand Up @@ -1112,7 +1112,7 @@ func (ds *destructiveSearch) ManageClosureRule(father_id uint64, st *State, c Co
for _, subst_for_father := range substs_with_mm {
// Check if subst_for_father is failure
if subst_for_father.Equals(Unif.Failure()) {
Glob.PrintError("MCR", fmt.Sprintf("Error : SubstForFather is failure between : %v and %v \n", subst_for_father.ToString(), st.GetAppliedSubst().ToString()))
Glob.Fatal("MCR", fmt.Sprintf("Error : SubstForFather is failure between : %v and %v \n", subst_for_father.ToString(), st.GetAppliedSubst().ToString()))
}
debug(
Lib.MkLazy(func() string { return fmt.Sprintf("Formula = : %v", f.ToString()) }),
Expand All @@ -1133,7 +1133,7 @@ func (ds *destructiveSearch) ManageClosureRule(father_id uint64, st *State, c Co
err, subst_and_form_for_father := Core.MergeSubstAndForm(subst_and_form_for_father.Copy(), st.GetAppliedSubst())

if err != nil {
Glob.PrintError("MCR", "Contradiction found between applied subst and child subst. What to do?")
Glob.Fatal("MCR", "Contradiction found between applied subst and child subst.")
} else {

st.SetSubstsFound(Core.AppendIfNotContainsSubstAndForm(st.GetSubstsFound(), subst_and_form_for_father))
Expand Down
4 changes: 2 additions & 2 deletions src/Search/incremental/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ func makeCorrectRule(formula AST.Form, terms Lib.List[AST.Term]) Rule {
any.FullString = []string{"GAMMA", "NOT", "EXISTS"}
return &GammaNotExists{AnyRule: any}
default:
Glob.PrintError("RULES", "Could not find the type of the formula")
Glob.Anomaly("RULES", "Could not find the type of the formula")
return nil
}
default:
Glob.PrintError("RULES", "Could not find the type of the formula")
Glob.Anomaly("RULES", "Could not find the type of the formula")
return nil
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Search/incremental/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ func (is *incrementalSearch) handleSearchResults() bool {
}

func (is *incrementalSearch) SetApplyRules(func(uint64, Search.State, Search.Communication, Core.FormAndTermsList, int, int, []int)) {
Glob.PrintError("NDS", "Incremental search not compatible with the assisted plugin for now.")
Glob.Fatal("NDS", "Incremental search not compatible with the assisted plugin for now.")
}

// ManageClosureRule implements Search.SearchAlgorithm.
func (is *incrementalSearch) ManageClosureRule(uint64, *Search.State, Search.Communication, []Unif.Substitutions, Core.FormAndTerms, int, int) (bool, []Core.SubstAndForm) {
Glob.PrintError("NDS", "Incremental search not compatible with the equality plugin for now.")
Glob.Fatal("NDS", "Incremental search not compatible with the equality plugin for now.")
return false, []Core.SubstAndForm{}
}
14 changes: 7 additions & 7 deletions src/Search/nonDestructiveSearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,20 @@ type nonDestructiveSearch struct {
func NewNonDestructiveSearch() BasicSearchAlgorithm {
nds := &nonDestructiveSearch{}
_ = nds
Glob.PrintError("NDS", "Non-destructive search not in working order for now.")
Glob.Fatal("NDS", "Non-destructive search not in working order for now.")
return nil
}

func (nds *nonDestructiveSearch) setApplyRules(function func(uint64, State, Communication, Core.FormAndTermsList, int, int, []int)) {
Glob.PrintError("NDS", "Non-destructive search not compatible with the assisted plugin for now.")
Glob.Fatal("NDS", "Non-destructive search not compatible with the assisted plugin for now.")
}

func (nds *nonDestructiveSearch) doEndManageBeta(fatherId uint64, state State, c Communication, channels []Communication, currentNodeId int, originalNodeId int, childIds []int, metaToReintroduce []int) {
debug(Lib.MkLazy(func() string { return "Die" }))
}

func (nds *nonDestructiveSearch) manageRewriteRules(fatherId uint64, state State, c Communication, newAtomics Core.FormAndTermsList, currentNodeId int, originalNodeId int, metaToReintroduce []int) {
Glob.PrintError("NDS", "Non-destructive search not compatible with the DMT plugin for now.")
Glob.Fatal("NDS", "Non-destructive search not compatible with the DMT plugin for now.")
}

/* Choose substitution - whitout meta in lastAppliedSubst */
Expand Down Expand Up @@ -216,14 +216,14 @@ func (nds *nonDestructiveSearch) instantiate(fatherId uint64, state *State, c Co
Glob.PrintInfo("PS", "Same key in S2 and S1")
}
if new_subst.Equals(Unif.Failure()) {
Glob.PrintError("PS", "MergeSubstitutions return failure")
Glob.Fatal("PS", "MergeSubstitutions return failure")
}
new_subst, same_key = Unif.MergeSubstitutions(new_subst, s.GetSubst())
if same_key {
Glob.PrintInfo("PS", "Same key in S2 and S1")
}
if new_subst.Equals(Unif.Failure()) {
Glob.PrintError("PS", "MergeSubstitutions return failure")
Glob.Fatal("PS", "MergeSubstitutions return failure")
}

// Then associate with the substitution (if possible)
Expand Down Expand Up @@ -260,10 +260,10 @@ func (nds *nonDestructiveSearch) instantiate(fatherId uint64, state *State, c Co

ms, same_key := Unif.MergeSubstitutions(state.GetAppliedSubst().GetSubst(), new_subst)
if same_key {
Glob.PrintError("PS", "Same key in S2 and S1")
Glob.Fatal("PS", "Same key in S2 and S1")
}
if ms.Equals(Unif.Failure()) {
Glob.PrintError("PS", "MergeSubstitutions return failure")
Glob.Fatal("PS", "MergeSubstitutions return failure")
}
state.SetAppliedSubst(Core.MakeSubstAndForm(ms, s.GetForm()))
state.SetLastAppliedSubst(s)
Expand Down
2 changes: 1 addition & 1 deletion src/Search/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ func ApplyGammaRules(fnt Core.FormAndTerms, index int, state *State) (Core.FormA
setStateRules(state, "GAMMA", "FORALL")

case AST.AllType:
Glob.PrintError("search", "Typed search not handled yet")
Glob.PrintInfo("search", "Typed search not handled yet")
os.Exit(3)
}

Expand Down
Loading